Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in Argument Parsing with options seed #37

Merged
merged 9 commits into from
Jun 23, 2020

Conversation

Sheikah45
Copy link
Member

This looks to attempt to solve #35 with including a random seed and an options seed in the map name. Both seeds are encoded as base64 strings to try to keep the length of the map names reasonable.

Currently each argument is a single byte which is then translated into an appropriate value in the parse options method. The original command line argument parser is adapted and left intact to minimize the changes necessary to the client to send over arguments as well as to try and increase compatibility between map generator versions. Default values are defined in case the options string is not passed and an encoding function for the map name is included for generation of the map name solely inside of the map generator if needed.

Additionally other argument parsing methods have been added so that developers do not have to have an encoded string for testing however a valid map name is generated and used to save the map with all argument parsing options. For all argument parsing the map name will override any other options that are set.

The base64 encoding is changed slightly when saving the map by replacing the '' character with a '-' character. When parsing the map the '-' character is replaced with a '' character to ensure a base64 compliant string in the case that the slightly modified version is given to the generator.

Sheikh45 added 2 commits June 18, 2020 22:58
…epresented as base64 strings. Included encoding and decoding of string. Added additional argument parsing to enable debugging without needing to encode strings. Also added in more randomness to the number of mexes and hydros generated based on number of spawns.
…e you want 0.1.6 made seed argument optional.
@Sheikah45
Copy link
Member Author

Sheikah45 commented Jun 19, 2020

This also deals with FAForever/downlords-faf-client#1781

@Sheikah45
Copy link
Member Author

As we discussed this should also move the version up to 1.0.0

@1-alex98 1-alex98 merged commit 70077fe into FAForever:develop Jun 23, 2020
@Sheikah45 Sheikah45 deleted the ArgumentParsing branch August 1, 2020 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Long term argument handling / client integration Make spawn number configurable
2 participants