aliens

Author Topic: [DONE][Suggestion] Ladders / climbing  (Read 5246 times)

Offline Finnik

  • Commander
  • *****
  • Posts: 508
  • Finnik#0257
    • View Profile
[DONE][Suggestion] Ladders / climbing
« on: March 21, 2023, 01:04:59 pm »
[Suggestion] Gravlift not only for floor tiles
----------------

While creating a level design for my craft, I faced with a code vs. design problem - I wanted to make a side ladder to deploy troops from the hatch of the craft, but in order to make a ladder I actually must define it not in object (ladder), but only for the floor tile type.
I know, currently modders live with that, but I don't think it is very good:
1) If the ladder tile was destroyed, but floor tile is ok - gravlift will still "magically" (for the player) works.
2) As a modder, I need to define floor image, as craft map will replace floor tile of the landing zone's floor tile, which is not very good - I want my craft ladder even don't touch the ground with keeping original landing zone tile as is.

I looked at the code, but was a bit confused - it looks like a simple check in gravlift code for working only with floors. I altered it, but it turns to be not working. Also, this tile engine part is still very scare to me to touch, and I have no idea why this restriction was originally placed.
You might want this change in OXCE, as such gravlift ladders appear in different mods, but if you don't - an advise for implementation of such a feature would be also super appreciated.
« Last Edit: April 22, 2023, 10:13:31 pm by Meridian »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [Suggestion] Ladders / climbing
« Reply #1 on: March 21, 2023, 01:26:45 pm »
Ah, ladders. A constant pain in the ass, as you need to make a special ground tile just for them (and often another, invisible one for a mid-point), wasting precious tile space.

I wholeheartedly support the idea of enabling the lift functionality on objects.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [Suggestion] Ladders / climbing
« Reply #2 on: March 21, 2023, 01:29:43 pm »
This could need more work to do, as currently GravLift is interacting with two floors, one beneath you and another on top of you.
I do not remember exactly this part of code but it could need more spacial cases to work correctly.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [Suggestion] Ladders / climbing
« Reply #3 on: March 21, 2023, 01:43:02 pm »
Ah, ladders. A constant pain in the ass, as you need to make a special ground tile just for them (and often another, invisible one for a mid-point), wasting precious tile space.

I wholeheartedly support the idea of enabling the lift functionality on objects.
Biggest question is: should engine allow you standing on top of ladder? :>
This mean:
Code: [Select]
S
L
L
L
where `L` is ladder and `S` is soldier

I consider if ladder should be on level where you want climb too. If someone would shoot part next to you, you will fall one level down.
Simply standing on top of ladder (that is on lower level) will look bit bizarre.

[ps]
I think this could be more a "Climbing wall" than "Gravity Lift", that you could move sideway if two are in row.

[ps2]
Even more fun if we combine it with custom move costs, like you can climb some walls but you need special gear to do it.
« Last Edit: March 21, 2023, 02:05:49 pm by Yankes »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [Suggestion] Ladders / climbing
« Reply #4 on: March 21, 2023, 03:52:34 pm »
Biggest question is: should engine allow you standing on top of ladder? :>

I don't think it's really necessary. Like you said, it would look weird.

I generally make ladders in one of 2 ways - see the attachment for the relevant one (the other one being just a floor tile with a hole).

I think this could be more a "Climbing wall" than "Gravity Lift", that you could move sideway if two are in row.

[ps2]
Even more fun if we combine it with custom move costs, like you can climb some walls but you need special gear to do it.

These are good points too. :)

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [Suggestion] Ladders / climbing
« Reply #5 on: March 21, 2023, 05:56:28 pm »
Ok, I will make ladder like on your screenshot "canonical" version.
I first try finish refactor of vapor and I could check to see if would be easy to implement some thing like this.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [Suggestion] Ladders / climbing
« Reply #6 on: March 25, 2023, 09:04:51 pm »
First hack to make it work. It need lot more work to finish all details but basic logic is available.

WIP branch: https://github.com/Yankes/OpenXcom/tree/stash/climb

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [Suggestion] Ladders / climbing
« Reply #7 on: March 26, 2023, 12:46:45 pm »
Incredible. I'm drooling with anticipation. :)

Offline Finnik

  • Commander
  • *****
  • Posts: 508
  • Finnik#0257
    • View Profile
Re: [Suggestion] Ladders / climbing
« Reply #8 on: March 29, 2023, 09:24:11 am »
Thank you! Looking forward to seeing it in a release version!

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: [DONE][Suggestion] Ladders / climbing
« Reply #9 on: April 29, 2023, 03:41:03 pm »
Also some new attributes for changing tile move cost per armor have been added in OXCE v7.9:

Code: [Select]
armors:
  - type: STR_POWER_SUIT_UC
    moveCost:
      baseClimbPercent: [100, 100]

      climbUpPercent: [100, 50]
      climbDownPercent: [100, 50]

See also this post for the full list: https://openxcom.org/forum/index.php/topic,11239.0.html

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
Re: [DONE][Suggestion] Ladders / climbing
« Reply #10 on: May 06, 2023, 09:03:49 pm »
So..
If I add those attributes to the stats of an alien armor, say the Chryssalid armor, the alien will be able to climb walls?
« Last Edit: May 06, 2023, 09:05:47 pm by robin »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9098
    • View Profile
Re: [DONE][Suggestion] Ladders / climbing
« Reply #11 on: May 06, 2023, 09:07:44 pm »
No, those attributes are already present on all armors, they are the default values.

To climb walls, you need to mark tile parts as such (with grav lift flag I believe)... more info @Solarius and @Yankes... I didn't pay too much attention.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11728
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: [DONE][Suggestion] Ladders / climbing
« Reply #12 on: May 06, 2023, 11:52:38 pm »
Sorry, I haven't played with armours. All I've implemented is climbable walls (well, actually ladders).

Attached a screenshot showing an example with all relevant values circled.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: [DONE][Suggestion] Ladders / climbing
« Reply #13 on: May 07, 2023, 06:07:05 pm »
So..
If I add those attributes to the stats of an alien armor, say the Chryssalid armor, the alien will be able to climb walls?

Video show was more a hack where I put flag `GravLift` on every tile to test this logic.
In theory we could add option for climbing any wall but this require refractor as it now would conflict with other move options.
Currently you can disable armor that will not climb on any ladder, or when setting `TU_Slide` or `TU_Walk` to 255 you can disable
climb for all armors that have specific move type.

Offline howareyou32ny

  • Captain
  • ***
  • Posts: 65
  • Work hard and play hard lol
    • View Profile
Re: [Suggestion] Ladders / climbing
« Reply #14 on: June 17, 2023, 05:54:57 pm »
First hack to make it work. It need lot more work to finish all details but basic logic is available.

WIP branch: https://github.com/Yankes/OpenXcom/tree/stash/climb

wow. can not wait. keep up the good work guys.