Summary of last weeks
Nearly a full month has passed since my last blog post. Much has happened... I'll try to sum it up. But first, here's the current project state:
You may notice that there are no air planes any more. Instead, this is a clone (or the beginning of a clone) of the battle navigation puzzle from the game Puzzle Pirates.
How come?!
A friend of mine is working for the Solana Foundation and he's been trying to convince me for a while to try making a game that uses Solana in some way. About a year ago, I told him that I believe that the battle navigation game of Puzzle Pirates would be a good fit for a on-chain game: it's turn based, is pvp, and has a lot of strategy involved. So I thought, maybe I could give it a try to make such a game and see to what extend I can make it work on Solana. First I'd need to make the game of course.
Meanwhile, I don't want to drop my work on the engine. Instead I want to utilize it to improve it. There were now a lot of changes. Here's a list of it:
- Until then, my development happened on the repository of the engine. The plane game was part of the engine. I am now changing this and instead a the engine can now be run with a project directory as argument.
- The engine runs the make command to compile the code of the project directory - which makes setting up a project pretty lightweight.
- There's now a resource manager that loads resources from the project directory or the engine's asset folder.
- I've reworked the way how data can be retained between hot code reloads - for example, the resource manager retains the loaded resources, removing the loading time of assets in case they aren't changed.
- The compilation mix of engine and project folder is based on keeping the same structure of files and the compilation process looks up files that belong to the project folder at compile time using include paths. This way, the editor (part of the engine) can draw the project's serializable structs using the components residing in the project folder.
- I started moving the editor code I begun with the plane project into a dedicated directory. It's now concepted in a way that displaying the editor parts as part of the game code. The example running above shows this: You can open the hierarchy and inspector using the buttons and pause and step the game while observing the changes in the inspector.
- I had to adapt the build system to be able to compile the engine for desktop and web at the same time - quite a mess, but it works at the moment.
Next steps
I want to make the battle navigation work:
- I need enemy ships and some obstacles the ship can drive into
- The ships need stats for damage
- A win condition when all enemy ships are defeated
- Multiplayer code to play against other players online
The first three points are pretty straight forward while for the last part, I'll have to come up with a way how to handle this. If I had Solana integration, moving this bit to the chain would make most sense, but I don't have this yet. I guess it's easier to use sockets for communication and setting up a relay server that handles the messaging between the players.
Regarding the engine development, this is right now secondary, though I have some immediate points I want to tackle more sooner than later:
- Full value editing
- Right now, the float values can be edited through dragging the value, but a full text editor would be better
- Integers are currently not editable - same code needed as for float values
- Adding / removing components / game objects
- This wouldn't have an immediate purpose, but it might be useful for debugging
- Supporting asset types
- Currently, mesh references are not serialized and are thus invisible to the editor. I need to extend the resource manager to allow loading of meshes and textures
- Serialization
- This is a big one; if I could serialize the scene graph to a JSON file and loading it at runtime as prefabs, it would be a big step forward. I could set up more complex objects in the editor and save them to disk.
- With serialization working, the component / game object editing would be much actually useful
Hopefully I'll have a bit more of a game to show next time. I'll try to keep the blog posts more frequent as well.