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

Don't call error when no tutorials are found #2309

Open
byorgey opened this issue Feb 6, 2025 · 2 comments
Open

Don't call error when no tutorials are found #2309

byorgey opened this issue Feb 6, 2025 · 2 comments
Labels
Bug The observed behaviour is incorrect or unexpected. T-Tutorial Involves the tutorial experience for new players. Z-User Experience This issue seeks to make the game more enjoyable to play.

Comments

@byorgey
Copy link
Member

byorgey commented Feb 6, 2025

If no tutorials are found, we currently simply crash with a call to error. I don't know how to reproduce, but one of my students somehow got Swarm installed and running but in such a way that it apparently could not find the data files, so it crashed with a message saying "No first tutorial found!".

We should instead somehow generate a nice error message explaining the problem.

See also #1494 .

@byorgey byorgey added Bug The observed behaviour is incorrect or unexpected. T-Tutorial Involves the tutorial experience for new players. Z-User Experience This issue seeks to make the game more enjoyable to play. labels Feb 6, 2025
@xsebek
Copy link
Member

xsebek commented Feb 8, 2025

I don't know how to reproduce

Maybe they copied the data files but not the inner folders? 🤔 Something like:

mkdir -p ~/.local/share/swarm/data/scenarios; cp data/scenarios/* ~/.local/share/swarm/data/scenarios/
# cp: data/scenarios/Tutorials is a directory (not copied).

We should instead somehow generate a nice error message explaining the problem.

What if, in addition to adding the warning message to Messages, we made the Tutorials menu red and, when selected, opened a dialog popup explaining that the data files are missing?

It would be extra work, but we could reuse that for New Game when all data files are missing.

@byorgey
Copy link
Member Author

byorgey commented Feb 8, 2025

Maybe they copied the data files but not the inner folders?

The student in question was definitely not that sophisticated in their use of the command line. They just cloned the repo and ran cabal run -O0 swarm:exe:swarm. This failed at first, e.g. because we had to install a few missing distro packages, but eventually it succeeded... but with no data files. We did various combinations of cabal clean, cabal build, cabal install but none of them fixed the issue. Eventually we just abandoned the repo and did cabal install swarm to download and build it from Hackage, which succeeded. Seems like ultimately some sort of bug in cabal but I wouldn't have the faintest idea how to go about reproducing, much less diagnosing, it.

Anyway, the ultimate point is that this can happen, so we should handle it gracefully.

What if, in addition to adding the warning message to Messages, we made the Tutorials menu red and, when selected, opened a dialog popup explaining that the data files are missing?

It would be extra work, but we could reuse that for New Game when all data files are missing.

That sounds like a nice idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug The observed behaviour is incorrect or unexpected. T-Tutorial Involves the tutorial experience for new players. Z-User Experience This issue seeks to make the game more enjoyable to play.
Projects
None yet
Development

No branches or pull requests

2 participants