Elsewhere there are things that we all miss, yet it takes just one to notice...

Godot 4 Terrain Generator – progress

I’ve just uploading another video to youtube about the current progress of my work on 3d terrain generation.

Here I am mixing two noise values, a main noise for the actual terrain and the other which is only added at 10% strength adds extra terrain detail patches.

There’s still a lot of ideas yet I want to add to this and I am getting through them bit by bit.

Audio issues are still ongoing and hopefully will be resolved in future videos.

Until next time… Carl out…

Godot 3D terrain testing

Just using GDScripts SurfaceTool, here’s a quick glimpse of what I’ve been fiddling around with.

For some strange reason Godot keeps calling me back, and each time I play with something else. This is the latest.

Think of now using a threaded solution to generate meshes using 3D noise and maybe even stretch it a little and animate it with 4D noise as a constant time dimension added.

I dunno…

I was thinking just then, “hey, you do know that adding 6Tb storage to your PC is a big deal?” Well, that’s when it struck me, actually, yes it is!

They’ve been sat in the NAS case for almost a year now since I cut Windows on all my PC’s at home. And I never got round to setting it up for Linux. It kinda got that way, I had a 2Tb SSD to shove all my stuff on.

So a week later and Aliexpress delivers my HD caddies. Straight away, unboxed, 2 x 3Tb drives straight into them, and all setup. And voila! They all work and now I’m sat here with a tiny Mini PC, with about 10.5Tb of storage in total connected to it.

So, yeah… It’s a big deal.

… Now on to organising it all. (That’s the bummer…)

Portable monitors are awesome! … ?

Straight up, yes they are. I have two, an 11 inch standard HD and a 15 inch 4K. Both power over USB, both have extra USB C ports on them and both have USB C video input and HDMI.

They are also thin, very light and come with a magnetic cover which acts as a stand. The brightness and colours are perfect to me.

But, …

When it comes to the resolution and the size of the monitor itself, especially the 4K monitor, ‘size matters’.

I do a lot of programming and screen real estate is essential for displaying code. The more code you can see on the screen, the better. And here’s were the 4K monitor falters.

At that resolution, you know 4 times the space of a HD screen. Well, in resolution anyway. You’d think, or at least I did, silly me. You’d think that opening 4 browser windows in each corner or the monitor. Oh yeah, that is cool.

Nope. It’s a 15 inch screen. Splitting it up into 4, 7 inch screens doesn’t work. Simple as. You strain your eyes reading tiny, tiny text.

For programming they are superb. But to split the screen up smaller, nope.

Oh, I’ve also got a 28 inch 4k monitor and I can confirm it doesn’t look too bad splitting 4 browser windows.

Microsoft and Chrome

I’ve not long got a new PC and my first Windows 11. As usual, I set it up the way I like it.

Then, I boot up to find Edge has opened all my Chrome tabs.

The weeks go by and I see reports of the same thing on YouTube.

And now today, I’m getting emails from Microsoft asking me to recover my Google account through them.

Hmm

2024 Updates

So it is time for me to setup a new development folder. This time around, unlike the many years in the past, all the test projects will be dumped into a testing folder before they are allowed to join any main stream projects that I am working on.

Now with a PC upgrade I am capable of working a lot faster (8 cores/16 threads helps here), especially with running local AI’s and also working in Linux and MacOS. Most of this will be all on the same machine.

Current projects:

  1. Media server and device management software/server.
    • Video playback
    • Image viewer
    • Devices manual updates by client
    • plus many other features…
  2. Godot Game
    • Terrain generator and texture painting
    • Fauna splatting
    • Various generators to add objects in a scene
    • Miscellaneous player controls (ie. sliding down slopes and climbing walls)
  3. Home AI chat on the go.
    • Home AI that runs on a server that allows me to chat over the internet using my phone
    • Text or speech input.
    • Optional text to speech output
    • Selection of local LLM’s (ie Llama chat, or Mistral Instruct)

With WSL in windows it does make it easier to develop and test Linux software, however it is not that good because it doesn’t give raw access to hardware. This is not a problem for development and testing.

There will be a lot more to come over the months as things start to get organised and time is given to these projects.

Catch you all soon…

Carl

Testing before an interview

It’s extremely important if you are taking a laptop to an interview to showcase a project that you’ve been working on to thoroughly test it before going. I found this out recently.

It was a Node JS project I had been working on for about six months, it loaded up, built and ran fine the night before and even on the morning of the interview. Doubts that anything could go wrong just didn’t exist. This project was working.

But that wasn’t the case in the end.

During the interview I booted up, loaded the project in as I had been doing, no changes to the system or project. Then I ran the project and opened up the page in a web browser.

Garbage! That’s what I got on the screen. Just garbage!

According to the output log from the project it was all going fine, but that’s not what was on the screen in the browser. I could see some of the text and icons but they were all squashed up on the screen. Argh! I thought. How could this happen?

I had to resort to just explaining the project and apologising for the failure for it to work properly.

Interview over and headed back home on the train. Furious at myself for this to happen.

Whilst on the train, I opened up my laptop to write a thank you email for the interview which I had to connect to my phones hot spot. Email sent, I decided to open up the project to quickly see why it all went wrong. The project ran, I opened it up in the browser… And it just worked!

After a very short investigation I found what the problem was. A CSS file was being requested from a CDN (content delivery network) which when connected to the internet could get access to and use in the project. During the interview, I did not connect to the internet and the CSS file was not loaded into the page. No layout information, colours, nothing…

So that was it. No internet. Project cannot access that single CSS file.

Of course now I’ve added the CSS file directly to the project and it does work completely offline.

Lesson learned.

ChatGPT vs Google Bard: AI programming in C++

Bard fails miserably at recursive programming where ChatGPT gave an almost finished result.

I asked both to write a C++ program given a folder to monitor its contents and recurs down through all sub folders and monitor those files too.

At the moment, Bard hasn’t got a grip on recursive programming. ChatGPT came out the clear winner. Although I did have to coax it to get it to include the right header files.

The final result definitely wouldn’t be production worthy but a good start to show how to work on this particular task type.

#include <iostream>
#include <sys/inotify.h>
#include <unistd.h>
#include <cstring>
#include <vector>
#include <dirent.h>

#define EVENT_SIZE (sizeof(struct inotify_event))
#define EVENT_BUF_LEN (1024 * (EVENT_SIZE + 16))

void monitorDirectory(const char* directory, int fd, std::vector<int>& watchDescriptors) {
    // Add a watch for the specified directory
    int wd = inotify_add_watch(fd, directory, IN_MODIFY | IN_CREATE | IN_DELETE | IN_MOVED_FROM | IN_MOVED_TO);
    if (wd < 0) {
        std::cerr << "Failed to add watch for directory: " << directory << std::endl;
        return;
    }

    watchDescriptors.push_back(wd);

    // Scan subdirectories
    DIR* dir = opendir(directory);
    if (!dir) {
        std::cerr << "Failed to open directory: " << directory << std::endl;
        return;
    }

    struct dirent* entry;
    while ((entry = readdir(dir)) != nullptr) {
        if (entry->d_type == DT_DIR) {
            if (std::strcmp(entry->d_name, ".") != 0 && std::strcmp(entry->d_name, "..") != 0) {
                std::string subdirectory = std::string(directory) + "/" + entry->d_name;
                monitorDirectory(subdirectory.c_str(), fd, watchDescriptors);
            }
        }
    }

    closedir(dir);
}

int main() {
    int fd = inotify_init();
    if (fd < 0) {
        std::cerr << "Failed to initialize inotify" << std::endl;
        return 1;
    }

    const char* directory = "/home/wlgfx/Downloads";
    std::vector<int> watchDescriptors;
    monitorDirectory(directory, fd, watchDescriptors);

    std::cout << "Monitoring changes in directory: " << directory << std::endl;

    char buffer[EVENT_BUF_LEN];
    while (true) {
        int length = read(fd, buffer, EVENT_BUF_LEN);
        if (length < 0) {
            std::cerr << "Failed to read events" << std::endl;
            break;
        }

        int i = 0;
        while (i < length) {
            struct inotify_event* event = (struct inotify_event*)&buffer[i];
            if (event->len) {
                if (event->mask & IN_CREATE)
                    std::cout << "File created: " << event->name << std::endl;
                else if (event->mask & IN_DELETE)
                    std::cout << "File deleted: " << event->name << std::endl;
                else if (event->mask & IN_MODIFY)
                    std::cout << "File modified: " << event->name << std::endl;
                else if (event->mask & IN_MOVED_FROM)
                    std::cout << "File/Folder moved from: " << event->name << std::endl;
                else if (event->mask & IN_MOVED_TO)
                    std::cout << "File/Folder moved to: " << event->name << std::endl;
            }
            i += EVENT_SIZE + event->len;
        }
    }

    // Cleanup
    for (int wd : watchDescriptors)
        inotify_rm_watch(fd, wd);

    close(fd);

    return 0;
}

Posts navigation

1 2 3 4 11 12 13
Scroll to top