Author Topic: Objects' trigger area  (Read 4687 times)

0 Members and 1 Guest are viewing this topic.

Offline LJLPM

  • Posts: 402
    • View Profile
Objects' trigger area
« on: July 29, 2014, 06:08:39 PM »
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)???

Thank you for your help on the subject :D

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: Objects' trigger area
« Reply #1 on: July 29, 2014, 08:13:41 PM »
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 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 exit

  • Posts: 197
    • View Profile
Re: Objects' trigger area
« Reply #2 on: July 29, 2014, 08:26:33 PM »
While I was typing my reply, namida posted. :XD:

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.

Offline LJLPM

  • Posts: 402
    • View Profile
Re: Objects' trigger area
« Reply #3 on: July 29, 2014, 08:50:54 PM »
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)

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: Objects' trigger area
« Reply #4 on: July 30, 2014, 02:17:13 AM »
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 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 LJLPM

  • Posts: 402
    • View Profile
Re: Objects' trigger area
« Reply #5 on: July 30, 2014, 06:34:45 PM »
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! :thumbsup:).

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: Objects' trigger area
« Reply #6 on: July 31, 2014, 12:00:03 AM »
Feel free to use any Lemmings Plus content, except (for now) the LPIII levels (graphic sets are fine).
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 LJLPM

  • Posts: 402
    • View Profile
Re: Objects' trigger area
« Reply #7 on: July 31, 2014, 07:06:51 AM »
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).

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: Objects' trigger area
« Reply #8 on: July 31, 2014, 08:19:52 AM »
Those two aren't really new anyway; they're taken from Lemmings 3 and PS3 Lemmings respectively. :P Even the updraft was inspired by a somewhat similar object in Cheapo. Only the locked exits were anywhere close to my own idea. :P
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 LJLPM

  • Posts: 402
    • View Profile
Re: Objects' trigger area
« Reply #9 on: August 15, 2014, 12:10:41 PM »
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 :D (but I'm still interested in having the actual values from the original Lemmings)

Offline exit

  • Posts: 197
    • View Profile
Re: Objects' trigger area
« Reply #10 on: August 15, 2014, 10:26:09 PM »
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.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: Objects' trigger area
« Reply #11 on: August 15, 2014, 11:24:04 PM »
The groundXo files are not compressed and their format is documented here, from there it should be easy enough to get the information you need with a program or just a hex editor.

Offline LJLPM

  • Posts: 402
    • View Profile
Re: Objects' trigger area
« Reply #12 on: August 16, 2014, 11:57:37 AM »
Thank you for your answers. I'll check this out!
(atm, for my very first tests, I use my own custom values: http://www.lemmingsforums.com/index.php?topic=963.msg21835#msg21835)