Author Topic: [PLAYER][DISCUSSION] Fencer Physics  (Read 5105 times)

0 Members and 1 Guest are viewing this topic.

Offline namida

  • Administrator
  • Posts: 12414
    • View Profile
    • NeoLemmix Website
[PLAYER][DISCUSSION] Fencer Physics
« on: February 09, 2017, 04:10:44 AM »
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?
« Last Edit: February 09, 2017, 04:20:18 AM by namida »
My Lemmings 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)

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: [PLAYER][DISCUSSION] Fencer Physics
« Reply #1 on: February 09, 2017, 07:55:39 AM »
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.

Offline namida

  • Administrator
  • Posts: 12414
    • View Profile
    • NeoLemmix Website
Re: [PLAYER][DISCUSSION] Fencer Physics
« Reply #2 on: February 09, 2017, 08:06:28 AM »
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.)
« Last Edit: February 09, 2017, 08:18:43 AM by namida »
My Lemmings 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)

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: [PLAYER][DISCUSSION] Fencer Physics
« Reply #3 on: February 09, 2017, 08:24:21 AM »
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.

Offline namida

  • Administrator
  • Posts: 12414
    • View Profile
    • NeoLemmix Website
Re: [PLAYER][DISCUSSION] Fencer Physics
« Reply #4 on: February 09, 2017, 09:10:34 AM »
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".
« Last Edit: February 09, 2017, 09:55:40 AM by namida »
My Lemmings 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)

Offline namida

  • Administrator
  • Posts: 12414
    • View Profile
    • NeoLemmix Website
Re: [PLAYER][DISCUSSION] Fencer Physics
« Reply #5 on: February 09, 2017, 10:55:37 AM »
I've applied the former, "check the next two cycles", in the just-released experimental version.
My Lemmings 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)

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: [PLAYER][DISCUSSION] Fencer Physics
« Reply #6 on: February 09, 2017, 11:02:57 AM »
my 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?

Offline namida

  • Administrator
  • Posts: 12414
    • View Profile
    • NeoLemmix Website
Re: [PLAYER][DISCUSSION] Fencer Physics
« Reply #7 on: February 09, 2017, 11:11:06 AM »
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 Lemmings 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)

Offline IchoTolot

  • Global Moderator
  • Posts: 3616
    • View Profile
Re: [PLAYER][DISCUSSION] Fencer Physics
« Reply #8 on: February 09, 2017, 09:06:03 PM »
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.

Offline namida

  • Administrator
  • Posts: 12414
    • View Profile
    • NeoLemmix Website
Re: [PLAYER][DISCUSSION] Fencer Physics
« Reply #9 on: February 14, 2017, 09:20:42 AM »
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.

Quote
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.

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 Lemmings 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)

Offline Simon

  • Administrator
  • Posts: 3899
    • View Profile
    • Lix
Re: [PLAYER][DISCUSSION] Fencer Physics
« Reply #10 on: February 14, 2017, 05:49:45 PM »
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

Offline Gronkling

  • Posts: 483
    • View Profile
Re: [PLAYER][DISCUSSION] Fencer Physics
« Reply #11 on: February 14, 2017, 06:07:59 PM »
if the tunnel is narrow enough it can interact with the basher interestingly

Offline Simon

  • Administrator
  • Posts: 3899
    • View Profile
    • Lix
Re: [PLAYER][DISCUSSION] Fencer Physics
« Reply #12 on: February 14, 2017, 06:21:41 PM »
if the tunnel is narrow enough it can interact with the basher interestingly

Sounds good, too!

-- Simon

Offline Dullstar

  • Posts: 2094
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Re: [PLAYER][DISCUSSION] Fencer Physics
« Reply #13 on: February 18, 2017, 03:50:11 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?

Online Proxima

  • Posts: 4572
    • View Profile
Re: [PLAYER][DISCUSSION] Fencer Physics
« Reply #14 on: March 06, 2017, 06:05:42 PM »
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".

Offline namida

  • Administrator
  • Posts: 12414
    • View Profile
    • NeoLemmix Website
Re: [PLAYER][DISCUSSION] Fencer Physics
« Reply #15 on: March 07, 2017, 02:55:25 AM »
The upwards movement check is relaxed for the first stop; it's the downwards movement check (any downwards movement = cancel) that isn't. But perhaps this too should be relaxed for the first stroke.
My Lemmings 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)

Offline namida

  • Administrator
  • Posts: 12414
    • View Profile
    • NeoLemmix Website
Re: [PLAYER][DISCUSSION] Fencer Physics
« Reply #16 on: March 09, 2017, 10:22:00 AM »
Is there any objection to allowing a limited amount of downwards movement (perhaps maximum 2 pixels) during the first stroke? If not, I will make this change.
My Lemmings 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)