Objects' trigger area

Started by LJLPM, July 29, 2014, 06:08:39 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

LJLPM

Hello,

I have a question about Object's trigger areas in Lemmings 1.
To determine if Lemmings trigger a trap, does the game:
- 1) for each Lemming, loop through a list of interactive objects to see if the current Lemming is inside an interactive area?
- 2) test Lemmings' position against some kind of colored mask (as with testing Lemmings' feet against solid terrain or empty room)?
- 3) neither 1) nor 2)http://www.lemmingsforums.com/Smileys/lemmings/huh.gif" alt="???" title="Huh?" class="smiley" />

Thank you for your help on the subject http://www.lemmingsforums.com/Smileys/lemmings/laugh.gif" alt=":D" title="Laugh" class="smiley" />

namida

An array is used that divides the map into 4px x 4px sections and contains info on which trigger area type each one contains (in the case of triggered traps, it contains the object's index instead of the "triggered trap" type marker). I'm not sure if DOS does the same, but Lemmix differentiates trap index IDs from trigger area types by adding 128 to the latter. These are just checked for in the normal course of updating lemmings each frame.
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)

exit

While I was typing my reply, namida posted. http://www.lemmingsforums.com/Smileys/lemmings/XD.gif" alt=":XD:" title="XD" class="smiley" />

Since Lemmix was built from DOS code, I'm pretty sure it would work the same.
I don't think you answered his question fully. This might help:
The game(as namida stated) cycles through each lemming to check if it is in the trigger area. This means(on DOS at least) that the lemming's "coordinates" are in the trigger area. Those coordinates are the ninth pixel under the lemming's feet(3x9 on a graph). If those coordinates are in the trigger area, the lemming gets killed/goes into the exit. So for traps and exits the answer is number 3.
For one-way arrow walls the game uses the same pixel that it uses to check for steel to check if a one-way arrow wall trigger area is there.

LJLPM

Thank you for your answers: they are very helpful!
I'm working on a Lemmings-like game for Android, and, since handling traps is the next big thing on my "TODO" list, I was wondering what was the Lemmings way of doing it.
For steel, 1-way walls & exit door, I have used colored masks.
(game-dev topic: http://www.lemmingsforums.com/index.php?topic=963.0;all)

namida

I would reccomend handle all objects the way traps are - just use the object index and check against the object's data. This will make it easier to add new ones, I think. I'm planning to change NeoLemmix to this method at some stage.

If you want to allow multiple objects overlapping, you may want to use a bitwise system instead of just an ID.
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)

LJLPM

Yes, I'll handle all interactive objects the way traps are: it seems convenient (by the way, if it's ok for you, I'll probably add "pre-located" Lemmings and "skill" items, just as you did in Lemmings Plus III: they are very good ideas, indeed, to refresh the gameplay! http://www.lemmingsforums.com/Smileys/lemmings/thumbsup.gif" alt=":thumbsup:" title="Thumbs Up" class="smiley" />).

namida

Feel free to use any Lemmings Plus content, except (for now) the LPIII levels (graphic sets are fine).
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)

LJLPM

Ok ; thank you! Actually, I was talking about the new gameplay ideas, neither about the levels, nor the graphics (as I'm aiming at making a game with its own new custom graphics).

namida

Those two aren't really new anyway; they're taken from Lemmings 3 and PS3 Lemmings respectively. http://www.lemmingsforums.com/Smileys/lemmings/tongue.gif" alt=":P" title="Tongue" class="smiley" /> Even the updraft was inspired by a somewhat similar object in Cheapo. Only the locked exits were anywhere close to my own idea. http://www.lemmingsforums.com/Smileys/lemmings/tongue.gif" alt=":P" title="Tongue" class="smiley" />
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)

LJLPM

About the objects' trigger areas, I would like to perform some tests for my Android game using Lemmings1's traps.
Where could I find the decompressed(readable) data from groundXo.dat, please? Because I would like to know the following values, for each object in the tilesets:
- trigger_left
- trigger_top
- trigger_width
- trigger_height
Thanks!

edit: I've started to perform some tests with estimated values for the trigger areas, and it works nicely in the Android game http://www.lemmingsforums.com/Smileys/lemmings/laugh.gif" alt=":D" title="Laugh" class="smiley" /> (but I'm still interested in having the actual values from the original Lemmings)

exit

I don't know the coordinates for the trigger areas, but I'll tell you the sizes.
Dirt: 4x8
Marble: 4x8
Fire: 4x8
Pillar: 4x8
Crystal: 4x8
Brick: 8x4
Snow: 4x4
Bubble: 4x4
Rock: 4x4

There you go.

ccexplore

The groundXo files are not compressed and their format is documented http://www.camanis.net/lemmings/files/docs/lemmings_vgagrx_dat_groundxo_dat_file_format.txt" class="bbc_link" target="_blank">here, from there it should be easy enough to get the information you need with a program or just a hex editor.