Human sacrifice, clients and servers living together... mass hysteria!


Despite actually looking slightly worse (the whole 'walls' thing on dynamically generated maps hasn't been a priority yet), I've made a significant amount of progress.

The client now asks permission for movement! The server will check whether the player is where they say they are, whether the place they're trying to go is passable and unoccupied, and respond appropriately. The client starts the walk animation immediately but will revert to its original position if the server says no.

The gif starts off janky but kind of smooths out. Gotta get that looked at.

No, it's not good practice to have your credentials in the logs, no, that's not my online banking password, and yes, this is all set up for SSL.

While the map is obviously super simple right now, it is being passed to the client on successful authentication, so I'm pleased with that.

Aside from crashing and hanging left and right (seriously, it's constant), Unity has a by-design behavior that I can understand but still caused a bit of an issue: It refuses to run any of its own functions outside of the main thread. Well, I've got threads flying around everywhere; in particular, aside from the normal don't-hang-the-UI coroutines, I'm getting messages via websocket from the server that are handled in parallel.

Thing is, those threads can't use any Unity functions, and now that I'm wanting to render a map in response to a message, that means I have a problem. Fortunately, I found a really great little tool someone put together to queue requests for the main thread to run, and it works like a charm. :)

My Clojure code got cleaned up quite a bit, then got randomized again. So I do have some more namespace cleanup to do, but the actual quality is pretty good -- both client and server -- compared to what I've hacked together on these attempts in the past, which is encouraging.

So that actually clears up my original To-Do list. I think I might take a break (kinda) from sprites and work on some UI. I expect menus to be the largest interaction point in the game, so I really want to get that right.

Leave a comment

Log in with itch.io to leave a comment.