Hexworks / zircon

Zircon is an extensible and user-friendly, multiplatform tile engine.
https://hexworks.org/projects/zircon/
Apache License 2.0
755 stars 138 forks source link

Windows 10 Coroutine `ConcurrentModificationException` and White Screen Flickering #423

Open fancyplants opened 1 year ago

fancyplants commented 1 year ago

Describe the bug A ConcurrentModificationException from the ArrayList data structure when running. (Also, the screen is 90% of the time completely white when I try running the project on Windows, but fine and doesn't run into any of these issues on my Mac).

To Reproduce I'm following the Caves of Zircon tutorial right now, and I'm about halfway through Part 11, so:

  1. Clone my progress at https://github.com/fancyplants/zircon-tut
  2. Run the game as usual (there's also a bigger issue that the window most of the time is completely white in both PlayView and StartView.
  3. Press movement keys and see this exception get thrown in a coroutine.
  4. Note: the game still continues running after this point (but it is hard to tell, since the screen is white most of the time as well).
checkForComodification:1013, ArrayList$Itr (java.util)
next:967, ArrayList$Itr (java.util)
filterTo:805, TurnBasedEngine$executeTurn$1 (org.hexworks.amethyst.internal)
filter:714, TurnBasedEngine$executeTurn$1 (org.hexworks.amethyst.internal)
invokeSuspend:22, TurnBasedEngine$executeTurn$1 (org.hexworks.amethyst.internal)
lambda 'with' in 'resumeWith':33, BaseContinuationImpl (kotlin.coroutines.jvm.internal)
resumeWith:29, BaseContinuationImpl (kotlin.coroutines.jvm.internal)
lambda 'withCoroutineContext' in 'run':56, DispatchedTask (kotlinx.coroutines)
withCoroutineContext:45, DispatchedTask (kotlinx.coroutines)
run:42, DispatchedTask (kotlinx.coroutines)
runSafely:571, CoroutineScheduler (kotlinx.coroutines.scheduling)
executeTask:738, CoroutineScheduler$Worker (kotlinx.coroutines.scheduling)
runWorker:678, CoroutineScheduler$Worker (kotlinx.coroutines.scheduling)
run:665, CoroutineScheduler$Worker (kotlinx.coroutines.scheduling)

Expected behavior I expect it to run nominally on Windows the same way it runs on Mac (no screen flickering, no exceptions), but it does not.

Screenshots What the game looks like most of the time: image

I try to take a screenshot of the game nominally, but as soon as I get a good frame for a few seconds it reverts back to a white screen.

Desktop (please complete the following information):

Additional context Let me know if there's any other way I can help (more info, a live debug session, or even guidance on how I can fix this myself and submit the fix to the repository), since I've tried a bunch of different ways to make roguelikes and this is the one I wanna build my first game idea on!