Quick Question

All about creating levels and level sets, custom elements and custom artwork.

Moderators: Flumminator, Zomis

Post Reply
Yoshi348
Posts: 132
Joined: Fri Jun 18, 2004 8:27 pm
Location: My own little world (California)

Quick Question

Post by Yoshi348 »

What specifically does amoeba speed mean? I mean, how exactly is the number value used?
User avatar
Holger
Site Admin
Posts: 4081
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

It's used to calculate the delay for a new amoeba tile, as follows:

MovDelay[ax][ay] = RND(FRAMES_PER_SECOND * 25 / (1 + level.amoeba_speed));

Yes, it looks weird...
Zomis
Posts: 1502
Joined: Mon Jun 21, 2004 1:27 pm
Location: Sweden
Contact:

Post by Zomis »

Holger wrote:MovDelay[ax][ay] = RND(FRAMES_PER_SECOND * 25 / (1 + level.amoeba_speed));
Which translated into english means (I think):
The amount of frames it takes for the amoeba to grow is =
Randomise(50 * 25 / (1 + amoeba_speed))
The randomise(x) function chooses a random number from 0 to x-1.
So with an amoeba speed of 10 (as I think the default is), the randomised value is between 0 and 113.

I'm not sure that this is correct, but I think it is...
Yoshi348
Posts: 132
Joined: Fri Jun 18, 2004 8:27 pm
Location: My own little world (California)

Post by Yoshi348 »

I see. And to find out the length in seconds, I would omit the FPS multiplier, no?

That still doesn't explain why setting it to 0 makes dead amoeba, but there's probably a line beforehand which checks for that special case.
Zomis
Posts: 1502
Joined: Mon Jun 21, 2004 1:27 pm
Location: Sweden
Contact:

Post by Zomis »

Yoshi348 wrote:I see. And to find out the length in seconds, I would omit the FPS multiplier, no?

That still doesn't explain why setting it to 0 makes dead amoeba, but there's probably a line beforehand which checks for that special case.
1. Maybe so yes...or simply divide the result from the calculation with 50, then you'll get the approx time in game seconds. (Note that in the game, a game second may take more than 50 real-time frames...uuh, one real-time second I meant ;). This due to variations in calculation of CEs and stuff, it's mostly the CEs that takes time, except from the amount of active elements on map/on screen)

2.
A few lines over the code Holger wrote, also taken from game.c:

Code: Select all

   if (!level.amoeba_speed)
  {
    Feld[ax][ay] = EL_AMOEBA_DEAD;
    DrawLevelField(ax, ay);
    return;
  }
Post Reply