Author Topic: Hitboxes in Lemmings and NeoLemmix  (Read 3327 times)

0 Members and 1 Guest are viewing this topic.

Offline LJLPM

  • Posts: 402
    • View Profile
Hitboxes in Lemmings and NeoLemmix
« on: January 17, 2021, 10:00:27 AM »
Hi,

Yesterday, I got back to work on my Lemmings-like game for Android :)
The work has been on hold for 2 years :( and, unfortunately, I won't be able to work regularly on the game, but I'll try to work on it the more I can!!
The good news is the game still works like a charm on my newer smartphone (nothing broke between different devices and different Android versions)
Another good news is playing the game after this long pause allowed me to see things I want to improve :)
One of those things could be to simplify the code which deals with Lemmings' hitboxes...

In Lemmings/SuperLemmini and/or NeoLemmix, where are -(at 'pixel' level)- :
- 1) the hitboxes which trigger a fall from a wall's edge, from stairs, etc... ? (if pixel at Lemming's back foot (see "scheme.nxmi") is empty?)
- 2) the hitboxes which trigger a fall when hitting a roof ? (at Lemming's head?)
- 3) the hitboxes which trigger a turn around when hitting a wall or a Blocker ? (at Lemming's back foot? head? body?)
- 4) any other hitbox(es) I may miss?

Thank you for your help!

Offline LJLPM

  • Posts: 402
    • View Profile
Re: Hitboxes in Lemmings and NeoLemmix
« Reply #1 on: January 18, 2021, 11:32:35 PM »
In NeoLemmix's spritesheets, why has the empty margin (from the png's left/right side to the actual left/right sprite) not the same width for left and right Lemmings sprites, please ?
(the left margin for left sprites is always wider than the right margin for right sprites)

In .png images, I would have thought left and right sprites would use a full symetrical approach, sliding right sprites 1 px more to the left.

Thank you for the explanation!

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: Hitboxes in Lemmings and NeoLemmix
« Reply #2 on: January 18, 2021, 11:43:10 PM »
In NeoLemmix's spritesheets, why has the empty margin (from the png's left/right side to the actual left/right sprite) not the same width for left and right Lemmings sprites, please ?
(the left margin for left sprites is always wider than the right margin for right sprites)

In .png images, I would have thought left and right sprites would use a full symetrical approach, sliding right sprites 1 px more to the left.

Thank you for the explanation!

For the most part: Because that's how they were in DOS, where the graphics were ripped from.

Regarding the hitboxes - they're constant offsets from the foot position, but I don't know them off-hand. Not always the same for all states either. The "fallback" (or really, "invalid") foot position if not specified in the scheme file, is 0,0.
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: Hitboxes in Lemmings and NeoLemmix
« Reply #3 on: January 18, 2021, 11:59:10 PM »
OK, thank you for the pieces of info!

About the hitboxes in NeoLemmix, they always consist of a single pixel, or not necessary? (for example, hitting a roof depends on a single pixel only ?)

I'm thinking about some serious changes in the Android game (double sprites' scale, simplify the handling of hitboxes, ...), and I'm weighing the pros and cons (hence my questions), because it's not an easy decision...

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: Hitboxes in Lemmings and NeoLemmix
« Reply #4 on: January 19, 2021, 12:08:20 AM »
The check for "is a lemming standing on terrain?" is always just one pixel, but other checks may not always be.

In the case of developing a game from scratch, I would go with a more-realistic hitbox. By the time NeoLemmix decided to be completely independent of DOS, the DOS-like single pixel hitboxes were already too ingrained, and the impact on existing content was a concern for making any change to it - a new game does not have existing content to worry about.
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)