Post Jam refactoring


Refactoring the world generation logic

There are always some rushed features when it comes to creating game jam games. "The Legends of Rahnok" was no exception. Once the game jam was over I set to work trying to clean up the project a bit. It became apparent that one of the main things I needed to do was to separate the world generation logic from adding the world to the scene tree. This would allow generating the world and loading the game to happen separately and in a more optimized way. The world is now generated and stored in a dictionary and when it comes to runtime we simply have to add the objects to the world without having to do any random generation. This has led to the following benefits.

Much larger worlds

It is possible to create much larger worlds with this new system. The original game was 6000*6000. In testing, I managed to get it up to 26000*26000 with no performance drop. The new version is set at 16000*16000. There is still too little content in the game to justify this big a world but that will soon change ;)

Loading world chunks on the fly

With the data saved in a dictionary, it is now possible to render chunks during runtime. Generating and displaying chunks in one step led to substantial freezes as new chunks loaded in. Rendering only the chunks around the player utilizing the pre-generated data means a better framerate in bigger worlds.

Other generation improvements

While working on refactoring the terrain and world generation I also experimented with the following features.

Cities and towns

The original version suffered from having far too many towns generated near each other giving the world a cluttered and repetitive feel. Large towns or cities now only spawn on the far reaches of the map and towns must be at least 2 chunks apart. This gives a much more natural population density to the world.

Kingdoms

While this feature is not complete yet work has begun on different regions or kingdoms on the map. These regions use the Veronoi algorithm and allow each region to have its own biome.

Dungeons

Dungeons can now be found in towns as well as the wilderness. If you have the unfortunate luck to get a world where the starting city is on an island you can still participate in some dungeon delving, even though bridges and boats have not been implemented.

The way dungeons are placed in the world has also seen some improvement. They now place themselves on demand when the player interacts with a door. Yet another benefit of separating generation from scene loading!


General improvements and bug fixes

Health and health regen

A health bar has been added and the player can now regenerate health over time.

Drowning

Walking on the ocean floor to the edge of the map is no longer possible! Water now results in instant death until a proper swimming mechanic has been introduced.

Textures and collisions

The ghost rocks that littered the landscape are no more! Rocks now have collisions and texture applied.

So what's next for the Legends of Rahnok?

The next step in the roadmap is to add some proper combat mechanics and flesh out the RPG aspects of the game a bit further. So stay tuned for future updates!

Files

legends-of-rahnok-web.zip 42 MB
Version 0.1.2 Jul 25, 2023
legends-of-rahnok-windows.zip 69 MB
Version 0.1.2 Jul 25, 2023
legends-of-rahnok-linux.zip 56 MB
Version 0.1.2 Jul 25, 2023

Get Legends of Rahnok

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.