GameProperty in the UpdateGameSession()?

0

Hello,

I saw that during the CreateGameSession, we can enter some GameProperties. But after that, we cannot update them in the UpdateGameSession. Is there an alternative to this or a solution to update the GameProperties?

Thank you

asked 3 years ago194 views
4 Answers
0

Can you describe your use case for updating the game session properties while the game session is active?

Another user had a requirement to adjust game properties to avoid players joining once the session left the lobby: https://forums.awsgametech.com/t/how-to-go-about-creating-updating-game-session-properties-for-a-lobby-system/6746

AFAIK these are immutable during the session (as you can see UpdateGameSession doesn't allow them to be changed).

Why not start a new match search/new game session with your new properties? Or are you managing some state here?

I'll ping the GameLift service team to see if they have any updates/advice for you as I see you also posted on https://forums.awsgametech.com/t/can-gamesessionproperties-be-updated-with-a-call-to-updategamesession/4586/4

answered 3 years ago
0

Hi, It's for a lobby system. The plan was to store the map id, the game rules, etc. And I would like them to be in the Game Properties so that we can know these properties without having to join. The admin of a game can change these properties.

answered 3 years ago
0

Hello Eloujah! As Pip mentioned and you have figured out, game session properties are immutable and can only be set on CreateGameSession right now. I've asked the team to reconsider prioritization for this request since it has come up a few times over the years.

Looking at other alternatives that you could take advantage of today:

  1. As Pip suggested, if your create a new GameSession at the start of every match, then you can update the mapId, rules, and other GameSession properties in CreateGameSession. The only limitation with this approach is that you can't change the map/rules in the middle of a match. Any changes made by an admin of your game would take place at the start of the next match.

  2. If the above idea doesn't work with your game model, you could also look at utilizing the Name field of the GameSession to store/parse out information that can be updated. As an example, "lobby-MyGameName_mapId-dedust_rule1-abc123_rule2-def456" could be easily assembled and parsed by your game client. The main limitation here is a 1024 character limit, which would result in an Exception from GameLift if you tried to use more characters than that.

Hope those ideas help and I'll let you know if I hear anything on prioritizing updating GameSession properties!

answered 3 years ago
0

Thank you,

I think I'll go for the Name for the moment. I was thinking about that but I wasn't sure if it is a good way to store data. I'll try with JSON and custom parsing and see which one is the best. With the custom parsing, I'll need to add some security so that the players can't inject properties.

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions