simon987 / Much-Assembly-Required

Assembly programming game
https://muchassemblyrequired.com
GNU General Public License v3.0
925 stars 87 forks source link

Trap flag / Debugger #232

Closed simon987 closed 4 years ago

simon987 commented 4 years ago

(Brainstorm, wip, open to ideas)

Is it a problem that the player code could potentially be executing through a "tick boundary", e.g. while World states are updating or worse, during save(), asynchronous from the main game loop? How to calculate execution time (in miliseconds) if a player is continuously stopping/resuming execution? What happens at the beginning of a tick if a player's CPU is currently executing code (or is paused) ?

Possible solutions:

kevinramharak commented 4 years ago
  1. I would agree to move towards limiting the instruction count instead of time.
  2. What about only allowing 1 step each tick? It would depend on the tick length if this becomes tedious or not, but it would constrain all execution inside ticks right?
  3. Hm, im not sure how it is handled now? As far as i know each tick is 100% synchronous right? I don't think you would want to introduce asynchronous execution into your game loop. It sounds cool, but it would introduce issues that would be really hard to debug right?