Gamelift and game state management?

Hi!

I’ve been (re)directed to this topic with one of my question from here Strategy game design

My question was about game state management. The idea is a multiplayer, small hexgrid based strategy game. So i have to store current game state somewhere(units, their stats, their interrelation, etc for both players). And since im very new to game design and AWS game tech too, i wonder how to design this.
The game is mainly multiplayer, but i want to have single-player option as well. In single-player mode im not sure if server side state management is necessary and also how to integrate multi- and single player state management(maybe it is not practical to integrate them?).

So is Gamelift really the place to put this state storage, management? If yes, how would you implement such thing?

Thanks,
lc

1 Like

I can answer part of your question which is how to ‘store’ things when running on GameLift.

GameLift offers a fleet instance role. Basically this role can be assumed in your code to call other AWS services including data stores like DynamoDB, S3 etc.

You would need both an STS client and then access to whatever other clients you need ie

As for your other points:

  • single player mode - most likely you are going to use some local state storage for this. Its almost not worth using the ‘cloud’ here unless you want to offer networked features that require this ie:
    • Leaderboards that reflect other players scores
    • Allowing players to start/stop and play across devices ie I can start on my phone, get home, change to my PC.
    • Daily challenges etc.

If theres nothing where people can ‘compete’ against others, then theres less incentive to cheat and so you can avoid a lot of the complexity/cost in your single player mode development path.

For mutliplayer, typically you don’t trust the client, they make requests to the server and it maintains state and decides if it should ‘honor’ the request. For storing the state a lot depends on what the state should be and what needs to persist beyond your ‘session’; think about what the worst outcome of that session failing to complete could be.

Theres are often written as two modes, but you could model your state manager as something that can be replaced dynamically ie in single player mode the state manager runs locally, in networked version it just a proxy that makes request <-> server, has local caches etc.

Hopefully though you’ll get more answers than that :wink:

1 Like

I never developed a server, have some understanding of REST APIs. So many things to think about and work out, but i think i got the grip on it with your answers. So thank you for that!

Yeah, i want to have a unified solution for this. So for sure i’ll need local storage in both cases, but in case of multiplayer match the server will be the single source of truth for state update.

Of course i’ve got more questions after reading a bit more about Gamelift, but i think it’s better if i ask them in separate threads.

Hi,
For this demand, GameLift can help you. It is important to keep in mind with the settings so that the costs are not high during the use and consumption of the tool. Take into account the scenario of having multiple players connected to justify using the right tool. Success in your project!