Quick development update because it’s been so long since I’ve posted one, the primary reason for that isn’t that I haven’t been working on Alaska, it’s that working on Alaska, Family stuff and other issues I’ve got going on right now have left me WAY too busy to blog! Not to mention my annual Dota 2 International & Steam Summer Sale distractions that slow development down every summer and give me the R&R I need to go at a breakneck pace the rest of the year.
That stuff is all largely sorted though and I have got things to post about from my plan in the last development update I got almost all of it finished the only part I’m still not happy with is the notification system which is still too easy to ignore and the tutorials, which I’m currently thinking would serve the player better if they were in the world beside the objects they refer to. It’d mean they were easier to ignore when you’re not interacting with that object and harder to ignore when you are, people have a tendency to filter the HUD entirely when they are focusing on a task and I’ve found that had prevented people from reading the tutorials, I’m hoping this system helps point people in the right direction.
I’m also working on the notifications, adding the most recent text to the HUD until you dismiss it, currently by going into the notes section of the UI although I can foresee issues with that approach and might do a timed dismiss or add an easier way to dismiss them.
The final thing I’ll be adding is final map sections for the players ship, there is a bedroom and lab on the ship which haven’t currently been implemented and a basketball court on the station which also hasn’t been implemented, also I haven’t added any toilets at all and being an immersive sim tradition (along with the basketball court) It feels wrong to not include them.
Implementing the font system actually required a lot more work on the renderer than I anticipated, the previous font system was stateless, a major weakness, in that you couldn’t use shaders to manipulate it which has a lot of ramifications, including not using the same object space as all the other geometry, it had to be in a 2D plane on the screen. Rectifying that however introduced a problem, everywhere a font was used in the code with the new system would flip GPU states and cause the renderer to barely function after it was switched on and I went about introducing the fix.
The first pass on the fix was to swap all the state change code for state pushing and popping code and use a state stack. State stacks are common in graphics programming because there’s a lot of driver overhead in switching states and a stack can be used to help minimize that. The first pass on the state stack just set a state as it was pushed and set the previous state when one was popped, simple and SLOW! I couldn’t really live with making the engine even less efficient so I wrote some code to manage the states better it involved setting the state based on a comparison between the current state and the one on the top of the stack at draw time, meaning a push and pop without a draw between cost nothing in GPU terms.
After that I noticed I was currently creating the states as I was pushing them, even if an identical state already existed, which is also a source of a lot of slow down. I implemented a system where a state would be created once and reference counted between all duplicate pushes and common states where created once at start up, minimising both the number of states being used at once and the number of times a state was created, the system works well and is a good balance between not having to worry too much about the GPU state in game code and optimising the state switching. I still need to implement a depth peeling system to deal with transparency which will allow me to bucket the states better and reduce switching further, but that will affect the game code quite a bit so is less clear cut for wins/work.
I plan to have something to show in the next update after quite a long series of dry updates, it’d be nice to have a new animated gif or two so I’ll hopefully get a chance to focus on something visual over the next couple of weeks.