[DISCUSSION] Conventions for trigger areas?

Started by namida, October 07, 2016, 11:58:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

namida

Note: This post is mostly just observations from existing sets. See this reply for current proposed conventions.

I'd like to discuss whether certain conventions should be adopted for object trigger areas, at least for certain types. So, I'll list all (relevant) objects, and my initial thoughts - for much of this, this will be based off what existing objects already have done for a long time. Exceptions will be listed, along with the reason if there is one for why that particular object might not follow the guidelines.

I'll only look at the default NeoLemmix sets here (ie: Orig, OhNo, LPII ~ LPIV, Xmas, Sega, Horror), but feel free to give input from other sets. And feel free to suggest something other than what's already been done in a set, if you think it would fit better.

Exits (Including locked exits)
Convention seems to be that these stick 1 pixel into the ground, and usually aren't more than 6px in height (official styles vary from 4px to 6px in height, no obvious reason in most cases; 4px is most common). Width varies depending on the exit design. The trigger area should, of course, be in the same place (from a graphical point of view) on both the unlocked and locked variants of an exit where applicable.
Exceptions:
Sega's exit's trigger area is 8px tall.
Sky's exit's trigger area does not even reach the ground, let alone go 1px into it. This is because it's designed to be used in midair, even though some levels do have it on the ground.

The Sky exit's case is a unique case, and I don't think standard rules could be effectively applied to it. In all other cases, should we perhaps define a standard height for them? I don't think a standard width is appropriate, due to the potential variety in designs.


One-Way Arrows
This is simple enough. Convention is that the trigger area covers the same area the graphic does, which is almost always the full size of the object. Changing this would be misleading.


One-Way Fields
This must be discussed in relation to the graphic. The most common graphic is a vertical "bar" of a fixed width that animates in some way; the Psychedelic set poses a special case where the graphic is a thinner bar between two (presumably inert) "orbs" at each end. This can be thought of as a regular animation, with some extras (the extras being ignored for the purpose of trigger area selection). LPIV_Space is another special case as the width varies between frames of animation; for this, the width for this purpose, the average width across all frames can be used.

One consistent factor is that the trigger area remains the same for both directions if the objects are identical. The X position and trigger width can also be described with a single, consistent rule:
X, Width: Without exception, set such that the trigger area is (a) a minimum of 2 pixels in width, and (b) if possible without breaking A, leaves two pixels to the edge of the "bar" part of the graphic on each side.

The Y and height are not so consistent:
Y: This is most commonly 1 pixel below the top of the bar (so in most graphics, at Y = 1), but in some sets a different value is used.
Height: This is almost always exactly the height of the bar; there is one exception.

The trigger area for a matching pair of left and right one-way-fields will always match each other. The X position and width of the trigger area are always such that the trigger area covers the width of the bar, except for the outer two pixels on each side. The height of the trigger area is almost always the same as the height of the bar; there is one exception. The Y position, however, is very inconsistent between one-way-field objects.

Trigger area setups:
Horror: Y = 1.
Metal: Y = 2.
Lab: Y = 5. This is an extreme outlier, as platformers could actually pass through the top of this bar even with terrain overhead.
LPIV_Space: Y = 1.
Psychedelic: Y = 3. This one would also allow a platformer to pass through, though more precision would be needed than on Lab. Additionally, this set is the exception to the height rule; the height is one pixel more than the rule would suggest.
Sky: Y = 0.

Y = 1 is the only value that appears more than once. It's arguably also the most consistent with what someone may expect. Should the standard rule be set to Y = 1?


Triggered objects with a direct effect on the lemming (Traps, teleporters, potentially any future objects of this kind)
There is pretty much no consensus on the trigger areas for these. For what it's worth, I think the base point (to which the trigger area would be relative) should be where the lemming graphic appears in the animation, for obvious reasons. The questions that arise - how high above this should they rise? How about below them - 1px into the ground, as with exits? What about the width; should there be a standard rule on this (since a lemming's size doesn't vary in the same way an exit's might)? Of course special cases could still arise - the spike traps in the Pillar set come to mind - remember that these are conventions or guidelines, and not rules that are going to be enforced by NeoLemmix's physics.

In the case of receivers, their trigger area should match that of the teleporter.


Water (Including "acid"*)
Horizontally, the trigger area should cover the entire object exactly. Vertically, the start position varies (understandably), but the trigger area always extends to exactly one pixel below the bottom of the graphic. I don't see any need to change this, and don't know if there's much point in making a guideline for the start Y coordinate.

"Acid" is not an actual object type, but rather, it refers to an object that has a graphical appearance similar to water, but is in fact a fire object. An example would be in the Lab graphic set.


Fire
Due to the large variety of designs, a single universal rule cannot really be applied. Here are some common guidelines seen in existing objects:
"Flamethrower" type objects: The trigger area should always extend one pixel behind the object (into the wall it's mounted on), so that it will affect climbers.
On-ground objects: The trigger area should extend one pixel into the ground. Anything beyond this is really impossible to set a rule on due to variety of objects.


Pickup Skills
This is currently completely consistent (as far as I know) across all graphic sets, as are the graphics of these themself (indeed, in the future I plan to change pickup skills to a game element rather than an object type). The trigger area is always at 4, 9 and is 4x7 in size. (Any that might not match that is an error in the set in question.) This does not mean that the size / position can't be changed, just that all current pickup skills follow this.


Unlock Buttons
There's a few appearances, and similar to exits, the width of the trigger area will probably vary with the button, but the horizontal position is always central. The vertical position and height are a bit less consistent; in some cases resulting in the buttons needing very precise positioning in a level. Some guidelines on vertical positioning and size are probably needed.


Radiation, Slowfreeze
There are two common graphics for radiation - yellow sparkles, or an arch with a blue orb that "fires" blue waves towards the ground. Between the same graphic, the trigger area is generally consistent- 4x9 at 10, 18 for the arch graphic; 6x25 at 1, 3 for the sparkle graphic. Whether these values are optimal is another question, but at least they're generally consistent.

Slowfreeze has two similar animations - blue sparkles, or an arch which the interior of pulsates a light blue color. The trigger areas are the same as the corresponding radiation objects.

One unique case is the radiation object in lpiv_wasteland. This has a completely different graphic of a glowing blue orb. Thus, its trigger area is also different.


Updraft
Currently, updraft graphics are all very similar, and are *x16 in size, where * is usually either 16 or 32. The trigger area generally leaves one pixel on either side out but otherwise spans the whole width, and starts at Y = 5 and is 16 pixels tall. Previous discussions have lead to a preference to change the trigger area to span the entire object; while this guideline is generally followed in new graphic sets, existing ones have often not been altered to meet it (including the offical ones). This new guideline makes sense and should probably be used, including adjusting existing sets to it.


Splitter
The graphic usually resembles some kind of arch, with an arrow in some form above it. The trigger area is usually central, 2px wide, and sticks 1px or 2px into the ground; usually with a height of 4px (with the position accounting for the distance into the ground). Proposed behaviour: always 2x4, central horizontally, sticking 1px into the ground; this is consistent with most other objects sticking 1px into the ground too.


Entrance
On an entrance using the standard graphic, the trigger point is at 24, 13. Obviously it varies on non-standard graphics, but the X position should always be in the middle of the graphic; if rounding is needed, round towards the right. There is little reason to change this rule.


Triggered Animation
This would really vary with the nature of the animation. Additionally, no official graphic sets have any examples of this kind of object. There is netiher much need nor much ability to define a standard for this.


Splatpad, Anti-splatpad
The only standard graphic set that contains these is lpiv_wasteland. In these, the animation is a red or green (depending on type of object) wire between two nails. The trigger area spans the area between the edges of the nails' heads, and reaches from the height of the widest point of the nails to the bottom of the object (but not 1px below it). It's been questioned whether a taller trigger area is nessecary, to better suit uneven terrain.
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)

Minim

The areas I'm most concerned about are those of the exits and One-way fields. For the exits, I prefer sticking to 4px wide per graphic set (Or for some graphic sets where they have a wider exit, such as the brick set, they use 8px). About a month ago I discovered that one of my old Lemmix levels is now impossible under the new NeoLemmix mechanics because of a somewhat narrowed trigger area. (Find minimac94Levelpacks.zip from this link and play Step 1 - Level 4. It's called 'Six Helpful Lemmings')

The area of the One-way field, especially the one in the Space Graphic set, is totally misleading. ??? I tried creating a level with it, and when I tested it I was suprised to see how much space the lemmings could walk into that OWF before turning back. As soon as I turned the trigger areas on, I soon discovered that the strip is only 1/3 wide to what it should be.

To sum up the OWF; Like the One-way arrows, the trigger area of all One-way fields should really be covering the whole area of the object. I must also agree that the standard rule be set to Y = 1, and thus referring to the point above, X = 0.
Level Solving Contest creator. Anybody bored and looking for a different challenge? Try these levels!

Neolemmix: #1 #4 #5 #6
Lix: #2  #7
Both Engines: #3

namida

QuoteAbout a month ago I discovered that one of my old Lemmix levels is now impossible under the new NeoLemmix mechanics because of a somewhat narrowed trigger area.

This alone is not reason to change anything. NeoLemmix has never made any guarantee that content converted directly from other engines will be 100% functional without adjustments. Even that it'll load at all in the game is not a permanent guarantee; only the editor guarantees being able to load content from certain other engines.

QuoteTo sum up the OWF; Like the One-way arrows, the trigger area of all One-way fields should really be covering the whole area of the object. I must also agree that the standard rule be set to Y = 1, and thus referring to the point above, X = 0.

Which width, though? The LPIV_Space graphic set's one way field varies in width between frames of its animation.
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)

Minim

Quote from: namida on October 12, 2016, 02:33:32 AM
QuoteTo sum up the OWF; Like the One-way arrows, the trigger area of all One-way fields should really be covering the whole area of the object. I must also agree that the standard rule be set to Y = 1, and thus referring to the point above, X = 0.

Which width, though? The LPIV_Space graphic set's one way field varies in width between frames of its animation.

The width of the object's background shown in the first frame, in this case I think it's 16 pixels. I'll double check.
Level Solving Contest creator. Anybody bored and looking for a different challenge? Try these levels!

Neolemmix: #1 #4 #5 #6
Lix: #2  #7
Both Engines: #3

namida

Yeah; if compared against the first frame, the field is kind of narrow. If compared against the narrowest frame on the other hand, the field is kind of wide. The middle ground - using the average width - made the most sense here.

Perhaps a graphic that changes width between frames wasn't the best choice for this kind of object in the first place...
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)

Dullstar

Exits (Including locked exits)
Size: maybe. The smaller ones are probably better so as to make it possible to build over the exit without too much trouble.

One-Way Fields
For most cases, I'd say that the one-way field's trigger area should include all of the pixels that appear to be part of it (basically anything that doesn't look like it's intended to be a border/frame or something like that). I may be overlooking something that would make this undesirable.

Wasn't there at least one set that repurposed these objects to make conveyor belts?

Triggered objects with a direct effect on the lemming (Traps, teleporters, potentially any future objects of this kind)
There's probably too much variability in designs here with most things. For most triggered traps it may be a good idea to have a sizing guideline and a suggestion as to how many of the trigger area pixels should be in the ground.

Water (Including "acid")
Is there a reason for extending 1 pixel below the object any?

Pickup Skills
I have noticed that many sets recolor the pickup skill background color, and if alternative lemming designs are allowed (can't remember if they're supported or not), e.g. Santa lemmings, then there may be reason to redraw the pickup skills for these sets. Allowing sets to have their own background color for pickup skills would be nice if the pickup skills are changed in the proposed manner.

Updraft
Agree that the newer guideline of covering the entire horizontal width of the object makes more sense, as it avoids the possibility of having small gaps in what visually appears to be a continuous updraft. I will probably change these in future versions of the Genesis sets if there's a chance they may be changed in the official sets.

Triggered Animation
I didn't know these objects existed, to be honest. I assume it's similar to a trap, but instead of killing the lemming it simply plays an animation, leaving the lemming unaffected: if so, these could benefit from the ability to have their trigger area independent from the object, to allow an animation to occur whenever lemmings pass a certain part of the level. Could also benefit from single use varieties if they don't already exist.

namida

QuoteWasn't there at least one set that repurposed [one-way fields] to make conveyor belts?

This would come under the case of non-standard graphics, similar to LPIV_Wasteland's radiation object. The rules can't always cover these kind of edge cases, I'm more concerned about standard cases here.
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

Bumping this topic because I want to look at making any needed adjustments to the default sets before the next update.
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

Some recent thoughts.

As a general rule, in the absence of a reason to do otherwise, the standard height for any triggered objects, as well as exits, should be 4px. This seems to be the most common value anyway, so it would be a good one to make the standard. 5px might also work. In all cases, the position should be such that, on a flat surface, a properly-placed object's trigger area would extend exactly one pixel into the ground.

For fire objects, with "pit-type" ones, the trigger area should extend exactly to the edges of the fire area.

Updrafts, for consistency with one-way-fields, should have a trigger area that matches their height exactly, but is positioned one pixel below the top of the object.
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

Quote from: namida on March 06, 2017, 03:06:18 PM
Some recent thoughts.

As a general rule, in the absence of a reason to do otherwise, the standard height for any triggered objects, as well as exits, should be 4px. This seems to be the most common value anyway, so it would be a good one to make the standard. 5px might also work. In all cases, the position should be such that, on a flat surface, a properly-placed object's trigger area would extend exactly one pixel into the ground.

For fire objects, with "pit-type" ones, the trigger area should extend exactly to the edges of the fire area.

Updrafts, for consistency with one-way-fields, should have a trigger area that matches their height exactly, but is positioned one pixel below the top of the object.

It still depends a lot on the object's design.

For a little button 4 pixels height and a narrow width is enough, but other things 5 or even 6 pixels height and a wider action radius might be more appropriate.

Example: The cavelem eyes, medieval dragon and l2 space robot trap triggers are a big bigger, because a machine gun has a bit of a fire arc and a creature's reaction radius is bigger than a little button's in my opinion.
But they are still not overly large just a bit wider + slightly higher.

Only thing to always remember is that the trigger area needs to be 1 pixel below (in rare design cases a point for even 2 could be made).

As long as the trigger area makes ~ sense in the object's design and it's not extremly large, tiny or out of place it should be alright.

Clear physics mode is always there to clarify your current in game situation!

By the way: I think for the next update I need to adjust the flamers in the Lemmini converted castle tileset as they don't reach 1 pixel behind the object (this should not break a ton of stuff I imagine as the case would be VERY specific :P).

namida

#10
Here's my first second attempt at making a conventions list:

Please note that this is just a proposal and is NOT official yet.

Special Note
Some unconventional designs for objects may call for trigger areas that differ from these guidelines. Be very careful doing this, but feel free to do so if there is a very good reason.

1. Entrances
The trigger point should horizontally be central to the window itself (if rounding is needed, round towards the right) and vertically placed such that there is a 1px gap between the bottom part of the window's "frame" and the trigger point.

2. Pickup skills
Assuming you're using the default graphic (and using anything else is not recommended), the trigger area should be located at 4,9 and be 4x7 in size.

3. Fire
Most fire objects should be possible to cover with the guidelines in the "other single, discrete objects" and "other continuous objects" sections. The one special case is flamethrowers.
Flamethrowers (such as those in the Fire and Snow) sets should have trigger areas that roughly cover the area of the flamethrower device itself, as well as the flame while it appears (visually) to still be "intact". Most importantly, these trigger areas should extend one pixel further into the wall than the flamethrower device itself does.

4. Receivers
A receiver's trigger area should be 1x1 in size (future versions of GSTool will enforce this), and be placed at the exact pixel where the lemming should appear when exiting the receiver.

5. Other objects that are usually used as single, discrete objects
(Exits, Traps, some Fire, Teleporters, Unlock Buttons, Splitter, some Radiation / Slowfreeze)
If the lemming graphic appears as part of the animation when triggered (such as a trap or teleporter), the trigger area should be placed such that the lemming graphic would be in the center of the trigger area, and the trigger area should be no more than 4px wide. Height-wise, the trigger area should be 4px tall in most cases, with the bottom line being 1px below the lemmings' feet.
If the lemming graphic does not appear as part of the animation when triggered (such as an exit or unlock button), the trigger area should be placed central to the object itself, or to what would appear to be the "functional" part of it (for example, on an exit this would be the "door" area). Width may be variable depending on the object's design, but in the case of exits, there should be at least 1px of gap between the trigger region and the edges of the "doorway".
This guideline applies to the "archway" type Radiation / Slowfreeze objects (eg. those in the Purple and Lab tilesets). The radiation waves, not the arch, is considered the "functional" part; even on archway slowfreeze objects, the trigger area is set as if it was an archway radiation object. The trigger area on these should begin about half way down the radiation waves, and extend 1px into the ground.

6. Other objects that are often used as continuous objects
(Water, some Fire, One-way Arrows, One-way Fields, some Radiation / Slowfreeze, Updrafts)
In any direction the object should be able to "loop", the trigger area's size should be equal to the size of the object itself (excluding parts that would visually appear to be non-functional). In such cases, the trigger area is always horizontally positioned at 0 horizontally, and 1 vertically; except in the case of one-way arrows where it is placed at 0,0, and updrafts where it is placed at (0,5). In the other direction, the positioning / size varies between objects:
Water - Vertically should begin at the highest pixel which is not transparent on any frame (excluding bubble / splash type effects), and extend 1px into the ground.
Fire - Should cover the area between the closest-to-edge pixel on each side which is not transparent on any frame. If the fire goes all the way to the other side, it should extend exactly to the object's edge. In any case, move it downwards by one pixel if this is the vertical axis.
One-Way Fields - Should leave a 2px border at the edge of the field's visual area, unless this would make the trigger area less than 2px wide.

Should (anti-)splatpads also be placed in this category?
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'm also thinking that for all existing sets (but not any newly-made ones), we should keep the existing trigger areas until there's another major upgrade anyway - most likely the upgrade to new formats. (The upcoming V10.13 upgrade has very few physics changes - a couple of very minor fixes to some graphic sets, and a few minor tweaks to the Fencer skill which hasn't been very widely used yet anyway.)
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

Quote1. Objects that actively interact with lemmings, or respond to their presence
(Exits)
trigger area should be 4px tall

4 pixels height is good. L1 put too high a trigger area on some exits. Lems jumped through the roof.

Why is exit listed in category 1, but not water? How does exit's behavior change when it eats lemmings?

QuoteA receiver's trigger area should always be 100% identical to that of the corresponding teleporter.

I expected receivers to work like a hatch, with a spawn point instead of an entire area. Can receivers output at several different coordinates?

-- Simon

namida

QuoteI expected receivers to work like a hatch, with a spawn point instead of an entire area. Can receivers output at several different coordinates?
Say for example, a teleporter has a 4x4 trigger area. If the lemming enters at (1, 3) of this area, it will come out at (1, 3) of the receiver's trigger area.
I don't remember exactly how this is implemented, so I'm not sure how it will function if the sizes aren't matched. IIRC, it's relative to the position and ignores the size, except for the size being used to calculate what position to use if the object is flipped / inverted.

QuoteWhy is exit listed in category 1, how does exit's behavior change when it eats lemmings?
It behaves in a somewhat similar fashion - a lemming animation is shown, which should be positioned to have a proper appearance with regard to the object's appearance itself. In this case, the animation is part of the lemming, whereas in other cases it's part of the object, but visually the effect is much the same, as are (arguably) the expectations of where the effect would occur on the object.
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

Updated the suggested conventions list above. It's also far more generalized now.
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)