This update marks the end of development for now and adds in some basic workshop support.
To go along with this release the source code has been released here: https://github.com/Thinkofname/UniverCity
The license is GPL-3 and the code is the same as the version released on Steam (the Steam version is built with the 'steam' feature enabled). Due to the GPL licensing the steamworks support is disabled by default which breaks things like the 'modding' menu and multiplayer. The assets are not included with the release and will have to be copied from the game on Steam.
The workshop support is basic currently, a 'modding' menu item will be visible to upload mods if a folder other than 'base' exists in the assets folder. Subscribed mods should be available when launching the game.
Update 0.5.0
This update fixes a few minor issues.
Whats been going on?
To cut a long story short I've got a job which is taking up most of my time currently and will be for the foreseeable future. As you can imagine the game didn't sell well enough to support it and I budgeted enough time to work on the game for a year which is now up. I'm sorry about this and wish I had a way around this.
So the plan with the game is this currently: Fix a few usability issues, try and add in workshop support so some modding is supported and then leave early access with what exists currently.
Assuming I can manage it license-wise I also want to release the game's code (not assets) as open source so that those who wish to do more with the game can.
Changes
Redesigned notifications. They now much easier to notice and read.
Fixed a bug showing tutorial save files in the free build save list when using steam cloud.
Asset packs can now be loaded by modifying the config allowing for modding. No UI for this currently.
To go along with the previous change assets are no longer packed for easy access
The reason a room can't be removed is now displayed on a tooltip when hovering over the disabled remove button
Update 0.4.4
Changes
Reworked the model for plants. This greatly improves the look of flowers
Added a special variant of flowers without the pots for gardens
Added new music to the game.
In-game now uses a separate playlist from the main-menu
Implemented support for Steam Cloud saves. Old saves will be moved to steam cloud the first time they are saved after this update.
Update 0.4.3
Small update to improve on some minor points.
32 bit builds for Windows are no longer updated. They are currently pinned at the previous version and may be removed later.
Changes
Hovering over staff/students now displays the button needed to inspect them.
Hovering over objects in edit mode now displays the buttons needed to move or remove the object.
Fixed room tooltips appearing during edit mode.
Placement errors are now displayed on a tool-tip instead of at the top of the screen.
Update 0.4.2
Quick update to fix a few minor issues plus a slight improvement
Changes
You can now block the autofill from certain periods by right clicking on them.
Fixes on forcing the main GPU on dual GPU laptops
Internal Changes
Large number of internal changes to the ecs which should improve the safety of using it.
Added a missing license file. Fixes a crash on visiting the credits.
Update 0.4.0
0.4.1: Pushed an update to fix a crash due to a typo in two of the lesson configs.
Sorry for the delay on this update, reworking the way students picked lessons ended up taking quite a while.
Breaking
The 32 bit builds of the game don't seem to seeing any use and they are not the easiest to maintain. I plan to make this update the last one that supports 32 bit and will remove them next version. If this causes any issues for you please let me know.
Also due to the number of changes old save files will no longer load.
Changes
Scheduling
Rewrote the lesson system to allow players to have more control over what happens. Previously students would built lesson plans automatically from the rooms that were built. This was random so students wouldn't be grouped together with anyone.
You can see courses from the new "Courses" button on the action bar. Creating a new course from this screen should place you into an editor. From this editor you can name the course, set a price to join the course and select the subject for the course.
Clicking on any of the blank timetable slots will bring you to a screen where you can select the lesson for the period, "Free period" being students doing whatever they want. Once a lesson is selected you'll be able to add rooms and assign staff to them. The dropdown boxes will only let you select rooms that work for the lesson are unused. Same for staff. If you add multiple rooms students will use the second if the first is full helping to increase the capacity of the course.
Once you've finished setting up lessons saving will place the course into the list and allow students to sign up to it. You may edit the course at any time but students already signed up will not see the timetable changes if you decide to move things around and may end up missing lessons.
This requires managing your staff to not over work them as they no longer automatically stop working when tired but their teaching gets worse.
There is still more to come on this system in future updates.
Other
Added a little animation to buttons when hovering over them to smooth the transistion.
Chat messages in multiplayer have been disabled.
Staff will now idle in the staff room when not teaching instead of just standing around getting tired.
The settings screen no longer lets you set when staff rest as they now do it when idle.
Internal Changes
The FPS limiter is now more accurate and shouldn't end up around 59.4 fps vs 60 fps on certain systems.
The `studentspls` cheat now uses the normal spawning system instead of having its own special one.
Fixed some entity ghosting issues causing duplicates that would just stand around.
The 64 bit builds for Windows are now compiled on Linux using clang/lld instead of msvc. This makes producing the builds faster and the resulting build seems equal (if not better) in performance to the previous system.
Open Source Parts
Recently I open sourced two small crates used in the game and put them on a Github org here: https://github.com/ThinkLibs
Hopefully I can open source more in the future.
Update 0.3.4
This update was focused on rewriting the user interface backend to be more performant which ended up taking a while. My next focus is going to be working on the scheduling system for lessons.
Changes
Rewrote the user interface backend to be perform better and be more flexible. This system is open source and used to be called "stylish" but has been renamed to FunGUI and can be found here
Fixed inner walls disappearing when you placed paths inside them
Fixed being able to stack paths
Fixed an internal issue with negative numbers in the choice system.
Update 0.3.2
Update 0.3.3: Disabled fullscreen mode due to being generally buggy.
Changes
Walls are now lowered when placing rooms/buildings.
It ended up being pretty hard to place a building behind another building as you could only see where the wall was and not the border. This should hopefully solve that issue.
Added another type of trash to make things look a bit more interesting.
Trash now fades into the floor instead of just disappearing when cleaned up
Fixed students missing lessons when loading a save file
This would happen if you saved whilst a student was walking to a lesson, the game wouldn't save the fact they were walking and when it loaded the game again the student would assume it couldn't reach the room.
Added basic command support support on the server console.
Currently only "quit" and "save" for now.
Redo the female student models. No longer a copy/paste job from the male model.
Smooth shadow rendering, shows more on lower settings.
Changed the rendering of shadows on water.
This occurred due to an optimization on shadow rendering breaking the hack used for water shadows.
Fixed some holes in a few models
Modified the textures of doors and added a few new colors.
Slowed down the snack stop's serving time and fixed a few issues with its script
Internal Changes
Cleaned up some unused code/data from the old idle system
Optimized shadow rendering slightly by doing it at a later rendering stage
Animated model rendering improvements which should allow for slight differences in body shapes when sharing animations.
Reduced the amount of VRAM required slightly by changing the types used for some framebuffers.
Optimized the ECS used internally to save some memory
Optimized some memory allocations in a few hotspots.
Update 0.3.0
0.3.1: Small update pushed to fix a few issues
Fixed some rooms not warning about missing staff. Also expanded this to cover extra staff as well.
Fix placing the incorrect staff member in a room breaking it sometimes
Some improvements to the eating idle task's code
0.3.0:
This took longer than it should have, sorry about that. The focus of this update was to improve how idling worked to allow for more interesting things to happen as well as fixing the issues with the previous system. This ended up being a bit more as I ended up tiding up a few other things along the way. From git:
Reworked how idling is handled internally. Now works on a smarter system which should solve the issues like students repeatedly using a toilet or snack stop.
Allowed students to drop trash after getting something to eat, janitors can clean this up.
Fixed mishandling entities during saving rooms causing data to transfer from one entity to another on load, all previous data on entities in rooms has been lost as a result.
Greatly optimized loading and saving. Save format now streams to a file and uses CBOR instead of JSON. Also fixed some unneeded pathfinding work happening on load. Load times (in some tests) when from 2 seconds to 200 milliseconds. This requires a conversion of old save files which should happen automatically when trying to load it.
Crash reports now try to merge multiple crashes into one file. Turns out crashing whilst crashing was common when threads get involved.
Removed the "double tile rule" that prevented you from placing a tile onto a tile of the same type, this was left over from an issue back during development.
Validate seats before trying to continue to sit on them. Should cause students to leave a seat faster once it is removed
Set "SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS" to false
I always assumed this was something done by my window manager not SDL2 and it bugged me. Saw a thread on reddit pointing this out and thought I should change the default. If you liked the previous default you can set the enviroment variable "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=1".
Students now avoid walking on the grass outside your building area and now prefer using the paths.
Updated to Rust 1.29.0
Known issues:
DevBlog: Idling and Random Events
Instead of quietly working on this I thought I'd post what I have done currently and what is left to do.
What started out as trying to work out a system for "Student random events" (e.g. simple things like dropping trash to larger events) ended up becoming a redesign on the way students idle (which is what they do when not in a lesson). As some may have noticed the previous system ended up with some silly issues popping up e.g. students staying in the toilets and just switching stalls or repeatedly queuing for the snack stop.
The previous system
The previous system worked by every 20-55 seconds the student that was not in a lesson would leave their current room and select a new room to go to. Select the task was done by building a list of every room marked with a "can_idle" flag and that had space. It then computed a "bias score" for every room, this was based on the stats of the student and used to weight students towards certain tasks.
The list of rooms was then sorted based on the bias score and in the cases where two rooms had the same score their distance from the player was used instead. And then a task was selected from the list semi-randomly, looking at this code now it somewhat undid a lot of the previous work in the cases of small universities.
Once inside a room that rooms script took over until the next time a task was to be selected. Buildings and Gardens for example would try and find a seat and if not they would randomly pick a free spot to stand on.
The planned system
The new system is planned to work more globally than the previous system. Instead of selecting a random room instead an action would be selected instead e.g. sitting, chatting or getting something to eat. Each task can be ordered by priority and given a random chance of being selected, they can also have a list of rules that decide when it is valid to select this task.
To make this work (And what took up a bit of time) I needed some way to evaluate these rules quickly (they'll be run often) and store these variables efficiently in memory. I ended up writing a small parser (using the rust library combine) that compiled down to a simple set of instructions that could quickly be run to return a boolean. For the variables I ended up creating a new component type for the ECS I was using that could be variable sized and then creating a list of variables based on the ones referenced in the rules. As part of this I moved all stats (like hunger) into this variable system and updated all the code around that. The whole compiler/bytecode thing may have been overkill but it was fun to write at least.
Once that was hooked up it was then a matter of making it so the scripts could actually run and control entities. This has taken a lot of work due to pretty much everything assuming that a student is always in a room (be it for a lesson or idling) which needed to change. A lot of that involved splitting the `RoomOwned` component into a "Controlled" component that allowed entities to be released from both rooms and idling, the other part was fixing entity methods that assumed that the entity was in a room (mainly the "release" methods).
Next up was making these scripts able to control the client-side of things (multiplayer and singleplayer as they both use a server). This required having the client know which script to call, instead of sending the name of the script which could waste a lot of network bandwidth I went with sending a 16 bit value that points to an offset in the list of choices, assuming both sides have the same mods loaded (in the same order) this should always be fine (And I don't think we would need more than 65536 idle options anyway).
The last thing to implement is saving (which whilst writing this I realized even the saving for rooms is flawed), again the saving system assumes a lot about rooms and needs a bit of a rethink.
Once that is done I should be able to start re-implementing the previous idle tasks with this new system and throw in some new ones (and improvements to the old ones). As for random events I'm still undecided whether they should just be low chance idle tasks or a separate system that interrupts whatever the student is currently doing.
This is taking some time as its only me working on this and I'm not the fastest programmer out there. Sorry about that but I'm hoping this wont take much longer so I can move on to the next thing.