Lady Tallowmere has begun expanding her empire.
Menu systems and multiplayer networking
15 March 2016 • Chris McFarland
Been awhile since my last post. Been busy reinvigorating myself to get out of a depressive slump. Been working on Tallowmere's console ports, and doing up some shrines for Tallowmere that are long overdue (did the sprites months ago but never got around to coding the mechanics... until a few days ago!). Also been helping take care of my new baby daughter who's about 1-month-old now!
But in terms of Tallowmere 2, I've made good progress with the menu system and multiplayer networking.
Here's the title screen at the moment:
I'm also on the fence about whether to write the title as Tallowmere II or Tallowmere 2. "2" is easier to type. "II" looks kinda bad for the current title's sans-serif font, whereas "II" looks cool in a serif font.
Onto the real menu system:
I spent a few days trying various menu/window configurations. Ended up settling for basically an improved version of Tallowmere's menu system.
Mouse cursor support is in, as is keyboard navigation and controller navigation. Touch support will come later.
UI design considerations
So that's my thoughts on menu sytems for now.
To do (and I've been toying with this a bit), is needing to display info while you're running about, such as current room info, your health, any buffs you have, and possibly action bar slots. Having UI elements be flush with screen edges looks nice, but there's the chance the UI might end up covering up an enemy slightly that you really need to see, which would be a bad thing. Make the HUD too big and it covers too much area; too small and boring and it looks lame. Lots to consider.
In any case, the main menu above took about a month to create. Menu development is hard.
Also hard, is making multiplayer networking happen. Handling the player connection logic, latency, ensuring every creature position is synced, and writing all the code for every action in the game... Oh boy. And since Tallowmere 2 is real-time, each client expects instant input feedback to make the controls feel smooth. And having to build the game to a separate EXE every time I need to test! Joy.
But here, some progress! A client and server running side-by-side:
UNet allows you to run your game as a host out of the box, and I like that. Down the line, perhaps I will make use of matchmaking and lobbies, but for now I will focus on the ability to just connect to a player via IP address.
UNet also has a network latency simulator, which will help me a lot with testing. (for what it's worth, don't enable the simulator on the server; will just cause the client to disconnect for no reason!)
Next up, I will need to code in weapon usage and shield usage. Also need to sync player positions better. Unity's built-in offering of network transform and rigidbody interpolation just feels wrong, so I will probably write my own snapping code. Having your foot position be slightly off isn't a big deal, but if your character looks like it's falling on someone else's screen when you're actually just standing still near the edge of a ledge, that needs to be addressed.
Really though, I want PvE network co-op to feel as responsive for every client as possible, so I will most likely be giving the client the benefit of the doubt, and make hits and physics contacts and collisions be processed on the client, despite whatever lag might be present; there needs to be a bit of fudge room. When it comes to PvP though, I wouldn't be surprised if the host has full control over who hit who. Will be interesting to try and code it.
I'm also not in a position to be worried about cheating, because I don't plan on having ranked PvP and stuff. I will first and foremost focus on a multiplayer PvE co-op mode, but PvP later on will be fun too, because why not. But as I'm just one person making all this, I don't see myself managing servers and data accuracy and server-side-authority checks and whatnot. Think it would be out of my scope.
But there you go. Until next time.
Tallowmere 2 © Chris McFarland 2016