Post news Report RSS Saving/Loading Optimization, and procedural interior generation!

A major improvement in how the game handles data, and the first (early!) look inside a generated religious building.

Posted by on

This week I’ve been working on two things – improving saving and loading, and beginning work on the technical aspects of handling interiors, keys, doors, multiple floors, and a million other things intricately related to interiors and handling all the appropriate amounts of data. Firstly I’ve made a major change to how the game is saved. Until now each work was stored in a single huge file – “World1?, “World2?, etc – which meant that each time a particular chunk had to be saved or loaded, that huge file had to be opened, examined, and shut. So, rather than a single massive monolithic save file which gets larger and larger with each area you explore, and therefore the computational load of opening and closing that file each game gets larger and larger, I instead present you with a new data folder:

Each file is for the coordinates shown (obviously) and contains both the outside map grid, and any buildings that have been generated within that grid. Therefore, that is all that needs loading and saving each time you move between grids, rather than adding something to the massive older file. This has made the initial loading times for the game low, but as more and more areas are generated, it never gets slower! There’s also a code in each of these files to ensure it relates to the correct game instance, to ensure no crafty people switch around the save files to advantage themselves…

This is the first of three stages to the game’s optimization. The second stage involves changing how each individual tile is stored. Currently, every tile has its full set of colours – dawn, dusk, night, in player’s sight, out of player’s sight, etc – stored in every instance. This is horrifyingly inefficient. Instead, it needs changing to numbers that refers to where in the colour database the appropriate colours are found, and which doesn’t save/load them every time. In turn, the third stage is to adapt the rendering code to reflect this. I’ll probably be working on that in the next week alongside more general interior work. As with this first optimization, I expect this to take some time, but if we’re lucky it’ll be just as simple as the file/folder change was! And should hack the size of each save file down by… 40%? Maybe more? We’ll see.

SECONDLY, I’ve started work on interiors. Naturally I want interiors to be as complex and as varied as the external world; you should have to walk around for a long time before you see things “repeating”, and the interiors should be heavily dependent upon civilizations, religions, factions, geography, etc. I decided to start with religious buildings. Just as each one is distinct on the outside and the layout is procedurally generated… so too (as I’m sure you’ve come to expect from me by now) is the inside. The inside is naturally broadly consistent across all religious buildings from a certain religion, but each interior across religions is highly distinct. Some may contain statues, some may not; they’ll have different layouts of things like tables and chairs, *very* different altars (see next week’s update, maybe?), different places for offerings, naturally different NPCs, and also different secrets (if any). So, a religious building from the outside:

And on the inside (early days, don’t be too judgemental!) with some chairs (the backwards ‘t’), tables (the tall ‘pi’ symbols), doors within the building and leading outside, statues (in each of the ‘wings’), an altar (purple in this casee) and a staircase leading to the second floor…

…where we find a corridor running around the outside of the building, and two more stairs leading up to the top floor… but we’ll have to keep that one secret for now.

My intention for the remainder of this week is to finish off all possible variations of religious building interiors, which should yield something in the high tens of thousands of possible interior layouts! I’m also having to plan ahead to think about what kinds of secrets should be potentially spawning in these buildings, and how they should be accessed if so, so that’s also influencing the development process. I might also try to finish off all the altar graphics this week; the variation I have so far is amazing, and I think you guys will love them when I unveil them (either next week, or the week after). And that’s all for now. In the mean time, you can keep up to date on my devlog, Facebook page, or Twitter. See you then!

Post comment Comments
Da-Fort
Da-Fort - - 265 comments

My favorite, reduced loading times.

Reply Good karma Bad karma+1 vote
UltimaRatioRegum Author
UltimaRatioRegum - - 307 comments

Glorious, aren't they?

Reply Good karma+1 vote
Vladiskov
Vladiskov - - 384 comments

nice~

Reply Good karma Bad karma+2 votes
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: