tsoding / nothing

A simple platformer about nothing
MIT License
295 stars 76 forks source link

Unsupported level format message is confusing #1188

Closed rexim closed 4 years ago

rexim commented 4 years ago

Introduced in #1166

Steps to reproduce

  1. Start the game
  2. Press N
  3. Press TAB
  4. Press S
  5. Give a filename
  6. Press Enter
  7. Quit the game
  8. Open the newly create level file
  9. Remove the line with version
  10. Start the game

Observed

The new level does not appear in the menu. The game printed in the logs:

[INFO] Level `fffda5` with unsupported version New Level rejected, expected 1

Expected:

A less confusing message telling us that we are using an unsupported level format.

rexim commented 4 years ago

It looks confusing probably because of the Level fffda5 part, because as a user of the program I don't have level fffda5 and I have no idea what it is talking about.

zhiayang commented 4 years ago

the issue comes from the fact that the level file is supposed to start with the version number. if there's no version number, then the error message treats the first line as the version -- which is the level name, hence "unsupported version New Level". then the next line, which is supposed to be the level name but is actually the rect data, is read as the name. sorry for writing a fairytale

as i said in ~issue tracker~ chat, this is kinda weird because there's only 2 levels right now, and all future levels will have the version on the first line, which would make this messsage non-confusing.

rexim commented 4 years ago

Resolved in #1192