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

Better settings loading #314

Merged
merged 2 commits into from
Sep 1, 2022
Merged

Better settings loading #314

merged 2 commits into from
Sep 1, 2022

Conversation

mateusz-lichota
Copy link
Contributor

@mateusz-lichota mateusz-lichota commented Aug 28, 2022

Add abilities to load settings.json from

  • the same folder the game binary is in,
  • the current working directory from which the binary is launched
  • a path specified by the -settings "<absolute path to a settings.json file>" command line argument
  • directly from the value of the -settings "<URL encoded string>" command line argument, as a URL encoded json string

Closes #309

@mateusz-lichota mateusz-lichota added the enhancement New feature or request label Aug 28, 2022
@wouter-heerwegh
Copy link
Member

I was trying this out with a newly built binary. Moved my settings from my Formula-Student-Driverless-Simulator folder to the folder of the executable and it used default settings instead. For instance, changing the car did not affect a change in the simulator. After moving the file back, the car did change.

@mateusz-lichota
Copy link
Contributor Author

Did you move the settings.json file to the folder where the Blocks.sh script is located, or the folder FSOnline/Binaries// ? I forgot to implement loading from current working dir (will do that now), but loading from the FSOnline/Binaries/<system>/ folder should work.

@wouter-heerwegh
Copy link
Member

I indeed put it in the same directory as the executable. This was not the FSOnline/Binaries folder.

@mateusz-lichota mateusz-lichota self-assigned this Sep 1, 2022
@mateusz-lichota
Copy link
Contributor Author

mateusz-lichota commented Sep 1, 2022

I've added loading settings from current working dir, and made the docs more precise. For completeness, when launching the simulator it will look for settings.json in the following places (in that order):

  1. in the command line argument (-settings "<path>") or (-settings "<URL encoded json document>")
  2. in the directory the simulator was launched from
  3. in the same folder as the Blocks.exe file (<folder with Blocks.sh or Blocks.bat>/FSOnline/Binaries/<your OS>/)
  4. in the ~/Formula-Student-Driverless-Simulator/ folder

@wouter-heerwegh wouter-heerwegh merged commit f89f1fe into FS-Driverless:master Sep 1, 2022
@mateusz-lichota mateusz-lichota deleted the better-settings-loading branch September 1, 2022 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve loading of the settings.json file
2 participants