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

Advice needed on tilesets...

I need some advice on which is the best way to handle building the dungeon. Right now I'm using prefabs for my dungeon, they have a north south east and west section for each "room": The basic tileset. This has several advantages, and also several disadvantages. Firstly I can have curved rooms, I can have tunnels and other interesting shapes. The tilesets can look quite nice with a little work. On the other hand I can't easily get the navigation data before building the map and once the map has been built I can't make changes to the layout, like having active pit traps or believable secret doors. Although the rooms are interesting, they are quite repetitive, and it takes a lot of effort to make even a few different variations. Also rooms are constrained to one size. A newer version of the tileset with a lot of variant parts for making more interesting rooms. To create a tile set is a real headache too. Planning how to lay out the UVs, trying to cra...

Upstairs / Downstairs.

I've decided to make my prefabs multilevel. Later this should allow me to add pit traps and other great stuff. It also makes it easier to line up stairs so that you can exit them on the same co-ordinates where you entered them. The prefab editor is pretty much finished, it just needs some code for loading up prefabs from a saved dictionary, so that they can be checked or edited. The entries will need to be forwards compatible, so I'll be loading each tile and then translating the indexes to a new array, that way if I add extra indexes or extra info (like traps or puzzles) I'll be able to update existing prefabs to work with the new standard. Click for a video.

Video Diary 8

Things are moving along well, there's been a lot of progress on the action manager side of things. Actions have finally moved to the UI, so you can initiate actions by clicking the appropriate button. I've set up some dummy actions to show what happens visually when actions are taken, but the actual dice rolls and such are yet to be integrated. The UI objects are also being added, though some are non functional or empty at the moment. Click on the image to see this week's development video. Every time I add something big I also add about a dozen small things. Like the selection box visualization. Previously this was using render.drawline, and old fashioned Blender function which can be impossible to see at certain resolutions, or at certain frequencies. I replaced it with a function that adds planes of the right size and scale in the right location. I also made all characters a little bigger. I still need to do some work with vectors and final target locations t...