Hash of parameters, two-way?

Hi

I’m designing a game where setup of the game (or simply the game parameters) play a big part. I want to allow players to be able to share a specific ‘setup’ with one another, allowing players to share game setups.

Example: Player A sets up the parameters and gets a hash value X. He thinks the game is really enjoyable at these settings, so he sends an email to friend B. Player B is now able to ‘load’ parameters from the given hash value X, and can try to beat player A’s score.

Does this make sense?

I’d like to avoid having all possible hashes saved, but that’s what my research tells me. I hope im wrong.

Edit: I also would like to have parameters input in an unbound range - if that makes it harder :slight_smile:

Kind regards,
Asser Fahrenholz

jmonkey has this sort of thing build in: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:save_and_load

Assuming both players have the same versions of the game, i dont see why they couldnt send that file back and forth to eachother. And you could probably even give it a better extension for your purposes (eg instead of .j3o you could give it the extension .gamesettings)

The classic way to do that would be to use a seed into a random number generator for your procedural world.

Take a look at Gentrieve 2 by Phroot for an example using jME3 that does this.

<cite>@icamefromspace said:</cite> jmonkey has this sort of thing build in: https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:save_and_load

Assuming both players have the same versions of the game, i dont see why they couldnt send that file back and forth to eachother. And you could probably even give it a better extension for your purposes (eg instead of .j3o you could give it the extension .gamesettings)

Makes sense that I could make a savefile only including the game-settings. Thanks for the hint.

Assuming you want something that can be easily shared without complicated file attachments … just copy and paste into the game for example… maybe even from a tweet, forum post, or text message… I would do the following:

  1. Output (serialize) your game settings to a JSON or XML string… JSON would be smaller.
  2. Compress the serialized string using LZW (I think it’s built into Java).
  3. Take the compressed string and Uuencode it to make it copy and pasteable in e-mails, texts, tweets… or whatever…

When importing… just reverse the process.

Build out of your options a string, eg assuming

10-abc-543

Could be like world size 10, name abc and enemy level 543, if you dont have hundrets of parameters that could easyli work and would be possible without any additional complications.

<cite>@Empire Phoenix said:</cite> Build out of your options a string, eg assuming

10-abc-543

Could be like world size 10, name abc and enemy level 543, if you dont have hundrets of parameters that could easyli work and would be possible without any additional complications.

I might well end up with hundreds of parameters (not noob-friendly I know, but its by design).

<cite>@aaronperkins said:</cite> Assuming you want something that can be easily shared without complicated file attachments ... just copy and paste into the game for example.. maybe even from a tweet, forum post, or text message... I would do the following:
  1. Output (serialize) your game settings to a JSON or XML string… JSON would be smaller.
  2. Compress the serialized string using LZW (I think it’s built into Java).
  3. Take the compressed string and Uuencode it to make it copy and pasteable in e-mails, texts, tweets… or whatever…

When importing… just reverse the process.

Would this be prone to clashes?

No, all of those steps are bidirectional so there won’t be clashes. The resulting string could well be very long though.

<cite>@zarch said:</cite> No, all of those steps are bidirectional so there won't be clashes. The resulting string could well be very long though.

Thanks. I’ll have to think about what seems most userfriendly, a file to load or a long string that uniquely identifies the parameter-values.