Micro Mayhem - New Map & Rewrite 🎉

Same old game, fun new updates!

Recording Studio

The new Recording Studio map is now live on Micro Mayhem! G Kaf and Jammie worked together to make this wonderful map, so please check it out when you get a chance!
image.png 2.79 MB

Code Rewrite

I spent lots of time going through the entire Micro Mayhem codebase and re-writing it from scratch. There are still some loose ends, but overall, the entire game loop has been rewritten from scratch to allow us quicker iteration going forward.
image.png 28.72 KB

Going forward, networking bugs should be fewer and further between. Adding new features means sifting through much less spaghetti. This means adding new features should be much faster.

Finally, we want to add more gamemodes other than the classic Race mode which the core game was built around. Now that the game loop has been overhauled, this is a much simpler task.

Logging

One thing that not enough s&box games are doing is leaving clean logs in the codebase. We were guilty of this too - we would ask someone for their log file, only to find absolutely zero context for why an error might have occurred. We are making use of better log messages, and setting the Logger name for each class, which makes it easier to discern where the log came from.
image.png 47.63 KB
You can name your logger by defining it within your class:
private static readonly Logger Log = new( "LobbyMode" );
Then, just use your Log functions as normal.

Exceptions

There are some areas in Micro Mayhem we were receiving really strange exceptions and behaviours. It was hard to understand why they were happening, since they were only occurring in 0.01% of sessions, so I decided to try to get ahead of them.

Many of the issues we were running into were networking bugs. Most of these have been cleaned up now, but we are no strangers to regressions, so I have defined custom exceptions which I only throw in situations where I know something 100% should never happen:
protected override void OnPlayerJoined( DashPlayer player )
{
    if ( !PawnPrefab.IsValid() )
       throw new InvalidMemberException( "PawnPrefab Property is invalid" );
Now, if we see an InvalidMemberException, we know it was an issue with the resource system, or we somehow uploaded a version of our game with a property missing that should have existed.