Skip to main content

Side Projects V2.0

I've been working on a number of side projects recently, so no actual work on Treasures of the Deep Dwellers.

However all but one of those side projects have been aimed at testing some ideas with a view to restructuring the project or developing key components which were missing.

When I finished working on the most recent version, it felt like I was nearly ready to put out a demo... but after trying it out for a while I wasn't satisfied. Movement calculation was too slow, the characters and AI were too complicated and not well designed. Adding to them was becoming too much of a chore. And there was something wrong with the pathfinding...

I took part in a game jam and had the opportunity to work on an FSM (Finite State Machine) for character management. The version I designed for the competition was a little limited because I didn't use classes, I had to define all properties for all states at initialization of the game. The result was pretty messy, but it worked much better than the simple Boolean if/else models I'd been using up til now.

I took that idea and used it with a platformer demo which later morphed in to a point and click adventure game... This time I took the time to investigate using classes as part of an FSM.

After some experimentation and some tips from a fellow programmer I had something that really worked. The result was much tidier, much more comfortable to use and expand, used less code much more efficiently... all round it made my previous character code look like junk.

So it seemed it was time to start over.

But before returning to TOTDD I also took some time to develop a multiple choice dialog system, for handling NPC conversations. It includes an editor which allows me to build conversations using a nice object based interface.


There's also support there for semi-random and procedurally generated dialogs...

Back on the project I started by taking some old code and updating it. I was surprised to find a huge error in my A-star pah-finding code, namely that I had left out the "f" value completely because of a typo. I was using only "h" to plot the best course. Sometimes taking a break from a project allows you to go back and fix things you didn't even know were broken. In this case the algorithm was still finding a route, but it certainly wasn't the fastest one. My path smoothing code was covering that up however, so I didn't notice.

I did some work on blocking objects too, reducing the drain previously caused by checking for a blocked route from every node to its neighbor. I found a quick way to check for blocking by only comparing each node to a bounding box of the blocking object.

As well as all that I started using objects (classes) to represent the walk mesh nodes and neighbor links, this allowed me to write an update() function which quickly resets all the g and f values in the graph each time the graph is reused.

The resulting code is much cleaner, faster, and calculates a better path.


The remaining side project is sadly likely to further reduce the time spent on this project, little Henry, my second son was born just three weeks ago.


Right now things are crazy busy at home and I get maybe an hour a night for coding and other things after everyone has gone to bed. That doesn't mean I'm going to stop working on the project, without some kind of creative outlet I'm sure I'd go crazy! But family comes first so expect slower but more focused development of the project for the future.

Comments

Popular posts from this blog

Automating Level imports from Blender to Godot

  Recently I've been making some levels in Blender an importing them into Godot. There are only about 7 or 8 shaders for each level, not counting dynamic objects which will be added later. But to improve rendering performance, it can be a good idea to split the meshes up into sections. At that point you might be faced with a list like this: Or it might be even more chaotic, if you didn't use simple names for the objects in your level. So it can take a long time to sort out all the meshes, make them unique and add textures and so on. Blender imports with simple Blender textures, or with placeholder materials. This is sometimes OK, but if your Godot shaders are very different to those used by Blender, it means applying new materials to every mesh object in the level when you import the scene. I found that during the design process, I was importing and readying a level several times before I was happy with the final layout. So at first I was wasting a lot of time. In Blender, I us

Dynamic terrain in GODOT

Long time no posts. I haven't been keeping up with the projects I started. At first it seems fun and exciting, but I always run in to limitations in the setup, plus the grind of just making stuff without any real challenges... It ends up being something that I don't want to commit to. So right now I'm just messing around with some ideas and see what comes out. No commitment to a bigger project, just some time to try new things. This week I've been working on procedurally generated terrain.  In the past, there were some big limitations on how I approached this, because the game world had to have the whole map, from the micro to the macro. I had to choose a scale somewhere between, which meant I couldn't have really large maps, or really small details. I think I've found a way around that. Below you can see two types of map data coexisting on top of each other. The wireframe is the collision data, used for physics and for clicking on the map, to move characters ar

Make your game models POP with fake rim lighting.

I was watching one of my son's cartoons today and I noticed they models were using serious amounts of simulated rim lighting . Even though it wasn't a dark scene where you'd usually see such an effect, the result was actually quite effective. The white edge highlighting and ambient occluded creases give a kind of high contrast that is similar to, but different from traditional comic book ink work. I'll be honest, I don't know if there's a specific term for this effect in 3d design, since my major at university was in traditional art. I learned it as part of photography. You can find plenty of tutorials on "what is rim lighting" for photography. It basically means putting your main sources of light behind your subject so that they are lit around the edges. It can produce very arresting photographs, either with an obvious effect when used on a dark subject ... ..,or as part of a fully lit scene to add some subtle highlights. See ho