Page 1 of 1

Does newly created amoeba kill firefly in same scan?

Posted: Thu Sep 05, 2024 12:03 am
by artsoft
(Not sure what's the best place for this question, so I put it here.)

This is a question regarding behavior of the original game engine on the C64 or Atari (to implement it correctly in a BD remake engine) which is a bit hard to test due to randomness, but I'm sure a few people here might know how it should work right:

Imagine the following part of a cave (just two rows, three columns each), before the next scan starts:

Code: Select all

D D A
F S D
S == space
D == dirt
A == amoeba
F == firefly, moving right

Assume that during scanning of the first row, the amoeba grows to the left, giving the following:

Code: Select all

D A A
F S D
Now the next row is scanned, and the firefly moves right:

Code: Select all

D A A
S F D
Now the question: Does the firefly explode or not (during this scan)?

As far as I can tell, the old (2010) version of the GDash implementation lets the firefly explode, because even though the newly created amoeba tile (to the left of the already existing amoeba tile) is marked as "scanned", it still gets the property "can blow up files" (causing the firefly to explode immediately in that same scan cycle).

In contrast to this, the current (2024) version of the GDash engine decides that a "scanned amoeba" does not have that property, and does not cause the firefly to explode (in this same scan cycle).

Which one is right here? I assume the newer (current) GDash version, but others might know for sure! :)

Re: Does newly created amoeba kill firefly in same scan?

Posted: Thu Sep 26, 2024 1:23 pm
by artsoft
Still thinking about this, and how to correctly implement this in the upcoming new R'n'D with GDash engine.

@LogicDeLuxe: Maybe you know what should be the correct engine behavior? I would be happy to follow your advice here. :)

Re: Does newly created amoeba kill firefly in same scan?

Posted: Thu Sep 26, 2024 11:50 pm
by LogicDeLuxe
I would have to take a look at the engines code. Unlike modern engines, the original engines don't have a scanned flag. The scanned property is a separate element which gets reset to the regular element according to the effect table. The effect table is also used for explosion sequences. Elements with no directional properties are usually compared against a single value, which would be the amoeba without the scanned property in this case. Directional elements like fireflies can be compared against a range, thus including the scanned ones requires no extra code. I never really looked it up, since given the random nature of amoeba, the difference in question is not that timing critical.
For reference, the element id's on several c64 engines: https://www.gratissaugen.de/erbsen/BD-Inside-FAQ.html
The scanned elements have "delayed" in their name, as in "delayed until the next scan".