Solarus Forum

Solarus => Bugs & Feature requests => Topic started by: Satoh on November 23, 2017, 11:49:51 pm

Title: hero:set_size
Post by: Satoh on November 23, 2017, 11:49:51 pm
This one just keeps being a problem every time I have an idea to use solarus for.

LTTP is a sot of odd game in that its the only free movement game I've ever played where the hero actually takes up a full 16x16 collision rectangle.

Every other game I can think of from Chrono Trigger to Seiken Densetsu, to almost every 2D Zelda game has allowed the bounding box to be smaller than a full map tile and also allowed the player's sprite to clip into the wall a little bit.

For example, I know that Link's sprite in both Oracle games and Link's Awakening ( and LADX ) is 16x16, but his collision area is only 8x10, focused at the bottom center of his feet. He doesn't clip into the wall from the bottom, but he has a little room to walk around inside a 1x1 tile (16x16px) box, and a bit of space to gently kiss the walls.

In Minish Cap, Link's bounding box is 11x8 while his sprite is 18x24.

In The Legend of Zelda (NES) Link is 16x16px in sprite size, but his bounding box is only 16x8.

This is a feature that is extremely important to me for both accuracy and game-feel, as well as aesthetics.

I tried adding the set_size function to the hero entity list and recompiling solarus, but with all the library dependencies and compiler quirks, I couldn't get the thing to compile. After 8 hours (no I'm not exaggerating) I gave up.

Could you be so kind as to consider making the player's size alterable. The engine seems to be coded well enough that it shouldn't break anything, since it doesn't cause any problems for other entities.

I notice now that this has been recently discussed partially in another thread.
I'm leaving this here for emphasis and potential discussion of why it would be useful.
Title: Re: hero:set_size
Post by: Christopho on November 24, 2017, 09:42:20 am
There is already an issue for that:
It won't be very easy to do it yourself because unfortunately, the size of 16x16 is hardcoded in a lot of places of the source code.
Title: Re: hero:set_size
Post by: santiago_itzcoatl on March 04, 2018, 12:50:24 pm

┬┐does that mean I cannot work with bigger sprites?
Title: Re: hero:set_size
Post by: Diarandor on March 04, 2018, 03:08:07 pm
Sprites do not have a restriction in size. It is the bounding box which has restrictions. I think it is possible to code from scratch in Lua a smaller or bigger hero, but it is complicated and a lot of work. Someone with nice skills in programming could code it. However, it would be simpler to wait until the engine allows it, and work on different things at present.
Title: Re: hero:set_size
Post by: santiago_itzcoatl on March 08, 2018, 01:31:04 am
thank you.
Title: Re: hero:set_size
Post by: MetalZelda on March 18, 2018, 06:18:02 pm
There is a workaround where, you can make a custom entity that define the hero's collision size and make all collision detections through that entity