[PLAYER][DISCUSSION] Fencer Physics

Started by namida, February 09, 2017, 04:10:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

namida

I'd like to discuss whether any changes need to be made to the Fencer physics, before (a) I release an editor version that allows putting Fencers into a level, (b) make a public release of Lemmings Plus Omega II, or (c) release the next NeoLemmix update, which has some other things that make break physics too (even though both are extremely minor cases that will affect few if any replays, let alone levels).

The biggest concern I have at the moment is the possibility for a setup like shown in this test level. The obvious solution would be to require some amount of upwards motion in order to continue; though I would also like to exclude at least the first cycle or two from this requirement so that the Fencer doesn't have to be assigned right up against a wall. (There is already a requirement that, if the Fencer would move downwards by even one pixel, he reverts to a walker, or faller if more appropriate.)

My other concern would be whether the terrain check in general needs some improvement. Currently, IIRC, it uses a terrain check identical to the basher.

Any other input?
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

ccexplore

Haven't look at the level but have an idea what the setup may be based on the description alone.  Kind of wondering now how a similar setup would behave in Lemmings 2, will have to test it out later when I have time to.  I suspect it would stop as soon as it sees a lack of ground somewhere in front (ie. up to N pixels ahead, likely the same distance a single fence stroke covers) to eventually step up onto, even if there are plenty of higher terrain pixels to fence away.  So if it's truly a wall, then it will probably move horizontally for a while until it actually reaches the wall and can start going upwards, whereas if there's an air gap right above floor level, it will just stop after one stroke.

namida

#2
What's happened is if there's a tunnel that isnt' very tall - say, about 4px tall - the Fencer can essentially act like a basher while moving forwards along this tunnel. At the start of where he's fencing, this can happen with a tunnel up to 5px tall, I think. Harder to achieve, but he can perform this with one he encounters during fencing; I'm pretty sure this can't be more than 1px tall at the point where he first enters it, but it can be taller further along.

Here's an image of the level. The behaviour can be noticed by assigning the fencer just before the lemming walks into the tunnel at the bottom; second screenshot shows the result (achieved with a single Fencer assignment).

(The candy background / minimap color but space tiles is just because I was lazy when putting together this test level.)
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

ccexplore

Yes, your pictures confirm I have the correct idea of what your setup is.  And as I said, my guess is that in Lemmings 2 it won't even let you do more than one stroke in such a setup, even if the tunnel is only 1px tall.  The floor probably needs to slope up at some point within N pixels ahead of current position to allow the fencer to continue, even if there are plenty of higher terrain pixels to be fenced away.  But that's just a guess and I'll have to check it later to see if I'm right or not.

Now, if the tiny tunnel is also sloping upwards at the same slope of the fencer tunnel, that I expect the fencer to be able to follow through--it'll be the fencer equivalent of a similar but fully horizontal setup for the basher.

namida

#4
Yes, that would be allowed.

Current behaviour in source code is that on the frame during which the terrain check is performed, a check is also performed (using a simulated lemming) of whether or not the lemming will move upwards during the movement that cycle. If it will not, the lemming stops fencing. This does not apply on the first cycle after being assigned a fencer, but does apply to every cycle after this.

One issue is that this relies on a simulation, and currently, "simulation inside a simulation" apparently has problems (haven't actually tested this, just going off what Nepster has said). This means that shadows are inaccurate for situations that would otherwise trigger this.

This also does still feel a bit strict. The possible workarounds are either "check the next two cycles for upwards movement" (which would require either simulation-within-simulation, or combining the two current simulations used during Fencer stop tests to be merged into one), or "apply this check only from the 3rd cycle onwards".
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

namida

I've applied the former, "check the next two cycles", in the just-released experimental version.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

ccexplore

Quote from: ccexplore on February 09, 2017, 08:24:21 AMmy guess is that in Lemmings 2 it won't even let you do more than one stroke in such a setup

Turns out my guess is wrong.  [DOS] Lemmings 2's fencer will in fact continue fencing horizontally like a basher in namida's setup.  I verified it using the Medieval practice level using a digger, stacker, platformer and finally the fencer.

To be somewhat fair, maybe it's not too wrong.  After all, in Lemmings 1 (and maybe 2 as well) the basher has some tolerance for small steps downwards, so on a gently downward sloping tunnel the basher will continue through it.   (Indeed, it could be rather steep actually, perhaps too much so, since IIRC it's like up to 3 pixels downward step per pixel forward.)  That situation feels to me is like the basher's analog of the setup being discussed here for the fencer.

-----------------

Back to NL, while conceptually it's good to do a simulation for the check, if that's problematic to implement maybe you can just do the equivalent checks directly based on walker behavior?  There may be some risks of unexpected behaviors in corner cases due to not doing a fuller simulation, but seems like should be otherwise okay in most cases?

namida

It turned out to not be too problematic. Integrating the two simulations into a single one (which would also improve processing speed) was actually quite a straightforward task.

Meanwhile, simulation inside a simulation isn't actually such a huge problem - the main concern was an "infinite simulation loop", which was easy enough to avoid. There was one other relatively minor issue resulting from such, which was also an easy fix. So now, simulation-within-simulation is now possible, and while not nessecary for fixing the Fencer, it did allow for further improvements to Basher and Fencer shadows. :)
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

IchoTolot

After testing the skill a bit, I feel the tunnel can be 1-2 pixels higher.

Mostly because currently it is impossible to place a builder in the tunnel, because he is hitting his head. I smell bigger combination value between the skills if this is possible and I think a change will be worthwhile.
It will also be more comfortable connecting 2 crossing acending fencer tunnels via a builder.

namida

The latest editor experimental now allows anyone to use Fencers in their levels.

Please note that the Fencer physics, even in the latest experimental, should not be considered finalized. Do not create serious levels with them if you aren't prepared to make a few tweaks later if need be.

If you're using V10.12.XX of the game and you find a bug, please confirm it still happens in the V10.13.XX experimentals before reporting it.

QuoteMostly because currently it is impossible to place a builder in the tunnel, because he is hitting his head. I smell bigger combination value between the skills if this is possible and I think a change will be worthwhile.
It will also be more comfortable connecting 2 crossing acending fencer tunnels via a builder.

One reason for the narrow tunnel was to further distinguish it from the other destructive skills, particularly the miner. (In fact, originally (prior to V10.12.XX's release) the tunnel was even narrower again.)
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

Simon

Quote from: namida on February 14, 2017, 09:20:42 AM
One reason for the narrow tunnel was to further distinguish it from the other destructive skills, particularly the miner.

If you want a distinguished skill, the fencer is a poor choice. The fencer is a continuous ground remover with the lemming at the tip of the tunnel in progress. A 4th variation of what the game has 3 already.

You want flexible swiss army knifes, not narrowly-applicable keys.

-- Simon

Gronkling

if the tunnel is narrow enough it can interact with the basher interestingly

Simon

Quote from: Gronkling on February 14, 2017, 06:07:59 PM
if the tunnel is narrow enough it can interact with the basher interestingly

Sounds good, too!

-- Simon

Dullstar

Quote from: namida on February 14, 2017, 09:20:42 AM
One reason for the narrow tunnel was to further distinguish it from the other destructive skills, particularly the miner. (In fact, originally (prior to V10.12.XX's release) the tunnel was even narrower again.)

I'd question if such a distinction is necessary. If the skill is essentially a miner that goes upwards, why not have its tunnel be the same size?

Proxima

One thing that stands out after a quick play with the fencer: it's oversensitive to bumpy terrain. Consider the green pipe near the end of Fluffy 3: a single pixel is missing from the ground just before the pipe. Because of this, you have to assign the fencer when the lemming has already descended into that singel pixel; if you assign it earlier, the descent makes the fencer stop.

I know there is an analogous miner stop with a missing terrain pixel (a la Crazy 8), but that required a very particular terrain setup, whereas this could affect any level with bumpy terrain -- or indeed with slightly rounded blocks.

I'd go along with the suggestion, earlier in the topic, that the upwards movement check be relaxed for the first stroke, to make the skill feel "cleaner".