Built UniverCities can finally be saved and loaded at a later date. I may make breaking changes to the format whilst i’m working on this but it will be stable by the time the game releases.
For rooms this just saves the placement instructions in order and replays the placement of the room/objects on load. The only downside is if the rules of valid placements change loading can fail.
For entities this just serializes the type and a select number of components (the ones that can’t be recreated from scratch). This seems to work well so far.
Currently the format is json, I was originally going to use msgpack but the serde library failed to decode the files after saving them. I may try it again later if save file size becomes an issue.
Previously this was only possible when editing rooms/placing buildings but wouldn’t work if the building/room contained another room. This now works and also lowers the walls of all rooms within as well.
Limited mode is where you edit a room/building containing another building, this doesn’t disable the room and prevents fully removing it but allows adding/removing objects.
Previously this was just a flat texture with a hole. The texture resolution was increased and the handle got a model instead of being flat.
This still isn’t the greatest looking door but its much better than before. At some point I plan to add multiple door types to give players a option to select from.
The game has an in game menu that pauses in single player. From this menu the game can be saved and the options menu can be accessed. Currently all settings can be changed whilst in game.
Implemented a basic chat system. In multiplayer the names will be what the player entered on the connection screen but single player is currently hardcoded to ‘Local Player’. This also gives me a way to implement some cheats to make testing things easier. Currently I only have two cheats implemented:
/prebuild– Rebuilds the rendering pipeline. Useful for testing shaders
/moneypls– Gives the player extra money
Added a credits screen. This lists the sources for the music and sound i’ve used in my game as well as listing every crate and library used.
Crates and their licenses are extracted by a simple shell script that the CI runs every build although some (webrender/stylish) are hardcoded due to being git only. The links to the crates are also clickable.
Added a graphics menu that lets you control the quality of shadows (up to a resolution of 8096x8096) and SSAO (number of samples). I also implemented a FXAA shader to smooth out the rough edges. The effect is small but noticable.
The graphics menu lets you disable shadows, ssao and fxaa which greatly improves the performance on low end machines.
Floors can now be customized. Make a nice or ugly pattern how ever you like. #gamedev #indiedev pic.twitter.com/NShjYn7uY2— Thinkofname (@thinkofdeath) September 22, 2017
Previously to map the id to a tile it invoked the asset loader which requires a lock plus a few hashmap lookups. Instead of doing this on
set_tile now does it and caches the result in a faster
IntMap. This helped pref quite a bit in a few cases.
Previously the texture of the wall would be decided based on what tiles it was touching. This made having multiple floor options per a room hard as changing the floor would change the walls at the same time.
Now walls are decided by the room (but connectivity rules are still on the tiles).
Some scripts used the exact name of tiles to work out what to do or if a placement was valid. This has been changed to either looking at the tile’s properties or checking the tiles room instead.
I’ve been streaming my work on twitch here most days. Feel free to stop by and watch if i’m streaming.