Thinkofname's blog

UniverCity - Change log

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.

Gameplay

Grades

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.

Student UI additions

The new tabs on the student UI

The student information page now has tabs to split up some of the information about the student. The tabs are:

Internal

Saving improvements

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.

MMap’d asset loading

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 fs::File is 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.

Rendering pipeline improvements

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.

Minor things

Twitch

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.

Subreddit

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

Post a comment here