Commit 9f4d073
committed
Fix behavioural difference from original game (cell overload++)
It is possible when resolving chain reactions that a cell will have atoms
added to it by multiple neighbouring explosions before its own explosion is
resolved. This means that a central cell could have more than 4 atoms in it
(potentially up to 7!), a side cell could have more than 3 (up to 5), and a
corner cell more than 2 (up to 3).
Our implementation originally discarded any atoms over the explosion
threshold, essentially causing us to lose matter. It was determined through
use of the debug mode and comparing with the original game that the original
does not do this.
The fix here is to allow a cell to be overloaded further, and when resolving
an explosion in a super-overloaded cell, leave behind any excess atoms in the
exploding cell.
Interestingly this reveals a display bug in the original game. Viewing the
game state at ?debug=84 and comparing to https://youtu.be/kEDjZyG2g-g?t=1m47s
the original game is failing to display the green atom present at (9, 4) after
that cell has exploded. This is however resolved by the next turn when 1 red
atom gets added to the cell, turning it into a 2-atom red cell (showing that
it is a display bug rather than a lost atom).
This would indicate the the original programmer also struggled somewhat with
these edge cases. :)1 parent 1aeb7d0 commit 9f4d073
1 file changed
+34
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
273 | 265 | | |
274 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
275 | 273 | | |
276 | 274 | | |
277 | 275 | | |
| |||
292 | 290 | | |
293 | 291 | | |
294 | 292 | | |
295 | | - | |
| 293 | + | |
| 294 | + | |
296 | 295 | | |
297 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
298 | 306 | | |
299 | 307 | | |
300 | 308 | | |
| |||
352 | 360 | | |
353 | 361 | | |
354 | 362 | | |
355 | | - | |
| 363 | + | |
356 | 364 | | |
357 | 365 | | |
358 | 366 | | |
| |||
363 | 371 | | |
364 | 372 | | |
365 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
366 | 383 | | |
367 | 384 | | |
368 | 385 | | |
| |||
0 commit comments