N*sync

I’ve managed to get some basic networking going, and have started on the logic around movement.
But with every step forward I’m seeing more and more steps appear in front of me… Making a multiplayer game is no small feat!

I want to have point and click movement, rather than incremental movement via input, but this is pretty complicated to work out. At least I’m finding it to be.
Every time I think I’ve worked out a solution, I realise there’s a case where it won’t work. For example, just now I’ve made it so the server is updating the player’s position on an interval according to their speed. The client is doing the same, so they should both end up in the same place. However, if the player clicks somewhere else during this move, then the previous move needs to stop, but I need some way to stop the loop on the server… I guess I could add a variable to the user that’s checked on each loop, and breaks out if it’s set, something like CanMove”. But I’d need to save that to the DB, make sure the running loop sees it and stops, then change it again to allow the next move.
There must be a better way…

I’ll sleep on it and see what comes to mind.

November 7, 2020

Auth

Just a little bit of fun today… Auth is mostly done (i.e. sign up, log in), but there are still the annoying things like forgot password, sending emails etc. I’ll save those for last.

I want to allow people to get in and play around without having to fill out a sign up form and verify their account. However, it’s not the sort of game that you’ll want to start over each time you play. The idea is to explore, collect, level up etc, so you’ll be able to properly sign up and log in to an account as well. There will also be a way to retrieve an account with a code.
I’ll have a job running to delete accounts that are several days old and haven’t been verified yet.
The good new is, now that this boring stuff is out of the way, I can get onto networking and then the battle system.

I can’t believe it’s been almost a week already… I watched a video of some games from another, 48 hour, game jam, and they looked amazing. I’m not sure how some of them were done in only two days, unless they used a ton of off the shelf assets, or had a team. Although, I shouldn’t underestimate the simple efficiencies of not having external responsibilities that can slow you down (e.g. job, family).

Even if I don’t make it within the month, I’ll have made more progress than I had before. In fact, I made more progress in a day than I had up until that day! That’s the beauty of a challenge.

November 6, 2020

Battles

Again, not much time spent on the game today unfortunately. What little time I did spend on it was setting up the concept of Turns, i.e. two players submitting a few cards each and then the logic being done to determine the outcome of the turn and return a result.

I’m not sure of the best way to approach it, but how I’ve done it is that when a player submits their actions for the turn it checks for an outstanding Turn and creates a new one if one doesn’t exist. When the last player submits their action it’ll run the logic.
I thought it would be cool to store the turns so you could replay a battle, or at least see what happened.

I’m approaching the point where I’ll need to create Player accounts and get multiplayer going so I can test some battles in real time between two separate browsers. That’ll be a milestone!
For multiplayer I’ll use SignalR. I tested it out once a while back and it was pretty straight forward.

November 5, 2020

Data

No great progress today, but I did get a basic API working; sending card data to the client. Basic stuff, but necessary.
I’m not really sure what to do next. I think maybe I can start on the battle system. I’m kind of rehashing what I said last night. It’s been a long day…

For the battles, all the work will need to be done on the server to avoid cheating. It’ll probably flow something like this:

  • Player selects action
  • Server checks that the action is allowed
  • If so, action is applied
  • Result is returned to client

The other big thing I’m concerned about is the construction of the overworld, and movement around it, but I’ll try to nail the core mechanics first.

I’m tossing up whether or not to build a UI for creating cards, or to just do it directly in the DB. It’d be nice to have a UI, but I think it’d be a waste of time at the moment.

November 4, 2020

Progress!

I decided to focus on getting the back end set up first, rather than focusing on the UI. Visuals always have a habit of eating up a lot of time if you get carried away, and that’s something I can’t afford to do. I also don’t want to do the UI for the UIs sake - I’d rather do it with the actual game data so I can test the game at the same time.

I’ve set up a number of classes that represent the player account, player characters, map tiles, map objects, the different cards and battles.
Gameplay is centered around cards, but I wouldn’t consider it to be a card game. It’s just a different way to represent an inventory.
The current card types are:

  • Weapon - Used for combat
  • Ammunition - Required by most weapons
  • Equipment - Clothing and armour
  • Effect - Inflict or heal damage
  • Thing - Parts that can be combined to create objects (e.g. structures or vehicles)

Cards have a value and a probability of being found, allowing for a trading mechanic to be introduced, and motivating players to explore and battle to find more cards.
One thing I’m going to struggle with is balancing all the different cards, e.g. making sure a particular weapon isn’t too strong, or completely useless.

The next step is setting up the controllers to send Cards to the front end, with a basic UI to display them. I’ll then need to set up the battle system.
Like Pokemon, the overworld will be in real time, and the battles will be turn based.

Lots to do.

(For the front end I think I’ll go with pixi.js after all)

November 3, 2020

Game Off 2020

I stumbled across the GitHub Game Off challenge the other day and thought it looked like a bit of fun.
Life hasn’t become any simpler, and I’ve got less time on my hands than at any point in the year, but I’m determined to make something.

Fortunately my effort on Arid has been pretty poor, bordering on non-existent, so I’ll be able to build something inspired by the same idea, if not a bit simpler than what I had in mind for the original vision of the game.
The theme of the game jam is Moonshot… The moon is arid, so it can still work. I’ll just need to tweak the concept a bit. I’m thinking 80s, Cold War era lunar conflict.

I should be able to update this blog more often now with development progress. My first steps (which would need to be finished within a day, or two at the most) are basically the same as before:

  1. Show a sprite on the screen
  2. Control the movement of a sprite around the screen
  3. Sync a sprite moving across two sessions at once
  4. Have two sprites interact
  5. Finish the rest of the game…

I’m still not sure about going with DIY or a framework, but I need to figure it out ASAP because a month really isn’t a lot of time. I’m thinking it should be broken down like this:

  • First two weeks for development
  • The next week for art
  • The final week for everything else

I don’t expect it to be 100% by the end of this, but there’ll hopefully be enough there to get people interested in seeing it get finished.

More information about Game Off 2020 can be found here.

November 2, 2020