UniverCity is a university management game being programmed in the Rust programming language. Lots of internal work this week plus work on implementing grading for students.
Students (finally) have grades given to them when completing lessons. The system is still in the works but currently grades are affected by the stats of the teacher of the lesson and not the student (to be fixed later). The teachers skill plays the largest role in grades followed by their control stat. If the teacher has too many students all students in the class will suffer as a result, the game will notify the player if this happens.
The student information page now has tabs to split up some of the information about the student. The tabs are:
Due to the design of the game internally single-player works by connecting to a server with some optimizations (channels instead of sockets, etc). This works well but introduced an issue where exiting the game would cause the server to shutdown and begin saving the game but the player could exit before this finished. To fix this the client will now disconnect from the server and then wait for it to fully shutdown before returning to the main menu.
For release versions of the game the assets are packed into a single file. Previously the asset loader would seek to the asset location and read it into a vector (without locking which could have caused issues I hadn’t noticed previously, not sure why
Sync). I decided to try and use mmapping via the
memmap crate to improve the loading. Using this I was able to remove the vector allocation and instead just return a slice to the mmap’d memory region. This did involve a bit of unsafe code to do but the end result is nicer and slightly faster in some cases.
The pipeline system talked about in a previous post got a improvement where it will reused framebuffer textures in future render passes when they are no longer used (within a single frame). This removes 2 (or 3 depending on rendering settings) large textures saving a bit of VRAM.
panic="abort"for release builds. I couldn’t do this previously because luajit required the unwinding information to work with but the fix to handle rust changes with panics actually allowed this to work as well.
ok_orbeing used instead of
ok_or_elseallocating a string everytime a lua function called a rust method, whoops.
Arc<String>to save a bit of memory.
ResourceKeys to be less costly on cloning.
I haven’t been streaming my work on twitch here lately but sometimes I will pop up and stream for a bit. Feel free to stop by and watch if I’m streaming.
I’ve opened a subreddit for the game as per someones suggestion. It’s mostly empty currently but hopefully that’ll change once I get some time to put some work into it. Here