I pretty sure this is a bug:
In the DECORATE lump, there is a flag called SpawnFloat, which is supposed to make a decoration "spawn at a random height between the floor and ceiling".
I put the decorations in my level in a room that had a floor height of 0 and ceiling height of 384, but the decorations only seemed to spawn at most 128 units above the floor. I tried giving them an initial height but that seemed to do nothing.
The only flags I had set were NoGravity and SpawnFloatin the DECORATE lump.
Here comes the strange part:
I made the ceiling 512 instead of the 256 and the maximum height of the decorations semed to jump to about 144 units above the floor. I raised it to 4096 and it seemed to jump to 192 or so. A ceiling with a 64 unit height made the decorations sit flat on the floor.
Is there something messed up with calculating the heights of decorations using SpawnFloat? It seems as if the differences are exponential.
[Fixed] DECORATE: SpawnFloat
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
-
- Lead GZDoom+Raze Developer
- Posts: 49188
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
That's the calculations that are done:
They perfectly match your results and they are exactly the same in Hexen and Heretic where this flag comes from.
Code: Select all
else if (iz == FLOATRANDZ)
{
fixed_t space = actor->ceilingz - actor->height - actor->floorz;
if (space > 48*FRACUNIT)
{
space -= 40*FRACUNIT;
actor->z = ((space * rng())>>8) + actor->floorz + 40*FRACUNIT;
}
else
{
actor->z = actor->floorz;
}
}
-
- Posts: 24
- Joined: Sat Jan 24, 2004 8:04 pm
Well, then this page should be changed to reflect what it truely does:
http://www.zdoom.org/wiki/wiki.phtml?title=DECORATE
The part where is states: "spawn at a random height between the floor and ceiling" is misleading.
http://www.zdoom.org/wiki/wiki.phtml?title=DECORATE
The part where is states: "spawn at a random height between the floor and ceiling" is misleading.
-
- Posts: 3463
- Joined: Sat Jul 19, 2003 8:39 am
-
- Site Admin
- Posts: 7749
- Joined: Wed Jul 09, 2003 10:30 pm
Except you got the wiki entry wrong. The correct behavior is:
Simple to fix:
- Is the space at least 48 units tall?
- No, then spawn it on the floor.
- Yes, then spawn it at least 40 units above the floor.
Code: Select all
(space * rng())>>8
Code: Select all
MulScale8 (space, rng())
-
- Lead GZDoom+Raze Developer
- Posts: 49188
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany