Tallowmere 2
Work in progress. Subject to change. More fun than you can shake a kitten at.
Tallowmere 2

Lady Tallowmere has begun expanding her empire.

Tallowmere 2 is an upcoming 2D dungeon platformer game, currently in its early stages, being developed by Chris McFarland in Auckland, New Zealand.

Delve Further
Blog Post

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.

Title screen

Here's the title screen at the moment:


I'm on the fence about what to have the second part of the title be, so I've blurred it for now.

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.

Menus

Onto the real menu system:


The icons are placeholders, and some of the subtext isn't proper, but you get the idea. All the text is localised in an English JSON file, so is ready for other languages down the line.

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

  • I like simplicity. Throw too much on the screen at once and I find myself less inclined to be bothered wanting to read every little detail all at once. I get quite overwhelmed; seeing a lot of stuff all at once can spike quite a learning curve to learn the ins and outs of what's available. Not necessarily a bad thing, but there's a point when things can feel like things are too complex, even if it's just displaying data.

  • Mobile phone sizes are small. I mean, with desktop, you can have small font sizes and display a lot on the screen at once since you're typically sitting close to your screen, which covers a large visual area in front of you. Whereas on a phone, the dimensions are typically quite small, so relative font sizes need to be larger so that you don't have to squint. I don't want things to be too small on the desktop screen, but not too large either...

  • Font sizes. I find when playing Tallowmere on my desktop fullscreen in a smaller resolution (like between 600p-720p), it feels nice having a larger font than the smaller font size that is used with the 1080p resolution.

  • Clicking and dragging. Will it be a thing? I do not plan on letting the player use the mouse for aiming, but am happy to let menus be clicked on this time around (in the original Tallowmere, there was no mouse cursor support). But will there be item slots on an action bar? Will you drag a skill to a slot using your mouse or finger? Or perhaps a pop-up menu will let you choose a slot if you're using a keyboard or controller? Or if you're using a controller, could you hold a button and move the thumbstick like a slow-drag-mouse emulator?

  • Item comparisons. In a traditional desktop action RPG, your current inventory and bag slots take up half the screen, but you have to use your mouse to hover over each item's icon to see what it is. Is this feasible when using a keyboard, controller, or touch screen? Having to navigate in an up/down/left/right to inspect your gear? On mobile, having to move your finger and tap every item? One thing I like about the original Tallowmere was the ease of just pressing Up or Down to navigate (even on mobile, just two arrows up and down), and one button to confirm or go forward, and one button to go back. Items are on the left, and info is on the right. I'm envisioning this time around to have a command to show item comparison info.

  • Pop-ups. Like when you hover over an item to see extra info about it. I tried this to start with, having half a menu on the left side of the screen, and info popping out to the right. But you basically might as well have the UI area be filled and ready to display whatever info needs to be shown. And what about touch screen buttons to confirm or go back? Having a dynamically-sized pop-up info box just ended up feeling distracting. I feel that keeping things consistently sized makes for a more pleasant experience.

  • Style. When dealing with a piece of UI that is interactible, such as a main menu, I find it nice to make the UI look like it's a tangible object, a bit of fancy pizzazz that feels elegant. Of course, you don't want to overdo do it. Needs to be not dead simple, yet make it look like you've put some effort into making it feel appealing.

  • Full-screen or not? I tried for a time making the UI take up all the screen real estate, but I felt it detracted from the game that the menu is covering. No longer was a case of "Here's a menu on top of the game world"; instead it became a case of "Here, your game is a menu now".

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.

Multiplayer networking

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:


This is using Unity's UNet networking system, which was added in Unity 5.1 I believe. I was very tempted to try out Photon, but reading that you have to have a license just to host your own local "on premise" servers, doesn't really sit right with me. I want players to be able to host their own LAN parties and play with their friends and family without having to rely on online connectivity stuff if desired. I also don't want to have to pay lots of money towards licensing costs if my game happens to take off!

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.

‒ Chris