Author Topic: [Suggestion] Jumping movement type  (Read 4937 times)

Offline Finnik

  • Colonel
  • ****
  • Posts: 492
  • Finnik#0257
    • View Profile
[Suggestion] Jumping movement type
« on: July 04, 2020, 01:54:18 pm »
I noticed that among the modders from time to time the theme about the balance of flying armor and suggestions for new types of movement pops up. In my opinion, the possibility of free-floating for the player has too much influence on the balance of some mods, which places a strong focus on melee combat (for example, missions with monsters in XCF).
I would like to discuss the possibility of adding a third type of movement to the game along with walking and flying - jumping. For most gameplay moments, this type will be considered as walking (for example, when we select the node for unit spawning, jumping unit should spawn on walking nodes).
Essentially, this type can be something in between the two existing movement types, I would imagine playing for a unit with the jumping armor this way. When we select a point to move, we cannot select a tile that has no floor (just like the walking type). So we can't finish the movement by jumping in a floating state. However, the route can pass through a tile without a floor, as it does if the unit can fly. At the same time, the unit cannot stop in the middle of the movement, being in a floating state. For example, a unit will not stop if it spotted a new threat (as it does sprint). If the unit is forced to stop (for example, a player presses the stop button - RMB, or we encounter other circumstances when the unit can't continue with the planned movement - it falls down because it can't stay floating (like walking type does it). And you can't make a jump if the unit doesn't have enough TU to finish the jump and finish it on a tile that has a floor. Maybe we would ask the player to hold some buttons like Ctrl or Alt to make sure he or she wants to define jumping trajectory, to handle most cases where the game would perform pathfinding not right.
It would also be good to take the cost of traveling in the jump to the armor properties so that you can set the cost of resources for each tile passed in the jump - for example, that it would require more TU, and would not consume energy; or that the jump also uses mana, and so on.
I understand that this is a pretty ambitious project, and I haven't covered all of the problematic cases that can arise, and it's also a noticeable complication of the current solution. But in my opinion, it would significantly expand the gameplay and could be in demand in many mods, so I would like to discuss it. Maybe somebody has already considered this idea or even considered its implementation in code, I would be very interested to know about it.
« Last Edit: February 14, 2023, 11:15:14 am by Meridian »

Offline efrenespartano

  • Commander
  • *****
  • Posts: 748
  • I know a lot about the law and other lawyerings.
    • View Profile
Re: Jumping movement type
« Reply #1 on: July 04, 2020, 04:15:36 pm »
I totally like this feature. It would be a daring project, but would add another form of gameplay! Me, as a modder and player, would like to use it in many situations, these a the main onee:

1.- As a powerful Recon armor, able to jump walls and other obstacles and behind the enemy, also with the ability to get away as quickly as possible from an incoming Chryssalid!

2.- If it is possible a limit for "jump range" or something, to create armors that move on environments of low gravity.

3.- If it is possible to give the jumping behavior to the IA, then I'd like to make a jumping Chryssalid to hunt down the guy in the 1.- idea  ;D

Anyway, I look forward for this idea, I hope it's doable and possible.

Offline Nord

  • Commander
  • *****
  • Posts: 1637
  • The Gate is open.
    • View Profile
Re: Jumping movement type
« Reply #2 on: July 04, 2020, 06:03:39 pm »
I think this is partially doable via script. Like putting down to ground any unit with the tag "jumping" in the end of a turn.

Offline Yankes

  • Commander
  • *****
  • Posts: 3207
    • View Profile
Re: Jumping movement type
« Reply #3 on: July 04, 2020, 06:20:15 pm »
Script are not capable right now to move units in any way, I have some plans for functionality like that but never have enough time to fully flesh out how it should work exactly.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1931
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: Jumping movement type
« Reply #4 on: July 04, 2020, 06:36:06 pm »
I have some old WIP code that allows unit movement by targeting an attack. The idea for this being it could be generalized to jumping, teleporting, using a grappling hook, etc. Tying it to an action means not having to edit the pathfinding code much, but would take more work "teaching" the AI to use it.

Offline Finnik

  • Colonel
  • ****
  • Posts: 492
  • Finnik#0257
    • View Profile
Re: Jumping movement type
« Reply #5 on: July 04, 2020, 08:54:09 pm »
Yeah, AI is the worst part in my plan, I never tried to do something about it before. As for action - I can't see how it can be used to have jumping armor with jumping (maybe built-in weapon, but I'd like to see it as movement mod, not tied to a weapon)...

wcho035

  • Guest
Re: Jumping movement type
« Reply #6 on: July 05, 2020, 08:07:39 pm »
The bottomless pit..
« Last Edit: July 05, 2020, 08:09:34 pm by Precentor Apollyon »

Offline Cynus_X

  • Sergeant
  • **
  • Posts: 24
    • View Profile
Re: Jumping movement type
« Reply #7 on: July 06, 2020, 05:19:37 pm »
It would also be good to take the cost of traveling in the jump to the armor properties so that you can set the cost of resources for each tile passed in the jump - for example, that it would require more TU, and would not consume energy; or that the jump also uses mana, and so on.

If anything, jumping (skipping) a tile saves TU's, since you need momentum to cross that distances. So it would be more logical if it consume tons of Energy like it would in RL, maybe even cause a little stun. Would be even better if the amount of energy it cost is related to the amount of weight of equipment that is being carried so it would become an incentive to not pack your soldiers to the max they can carry. It would also be even more realistic if you needed to run at least 1 or 2 tiles prior to the jump.

On that note, I would also be interested in Climbing. Don't know how many times i've wished that was possible to mount a sniper on a ridge. For example, you would need 90% Tu's & Energy to move from tile "A1-lvl1" to "B1-lvl2", and you would need both hands free.

Offline Finnik

  • Colonel
  • ****
  • Posts: 492
  • Finnik#0257
    • View Profile
Re: Jumping movement type
« Reply #8 on: July 07, 2020, 11:31:04 am »
If anything, jumping (skipping) a tile saves TU's, since you need momentum to cross that distances. So it would be more logical if it consume tons of Energy like it would in RL, maybe even cause a little stun. Would be even better if the amount of energy it cost is related to the amount of weight of equipment that is being carried so it would become an incentive to not pack your soldiers to the max they can carry. It would also be even more realistic if you needed to run at least 1 or 2 tiles prior to the jump.

On that note, I would also be interested in Climbing. Don't know how many times i've wished that was possible to mount a sniper on a ridge. For example, you would need 90% Tu's & Energy to move from tile "A1-lvl1" to "B1-lvl2", and you would need both hands free.

Well, a general coding solution about jumping should e considered, and what resources would be consumed should be a modding problem. I imagine this like special abilities - rocket jumping armor with backpack (my initial idea, as I do not want to give floating powers to a player in my mod), super agile creatures jumping from standing (a chryssalid jumping on a roof where you want to hide) and stuff like that. I would guess that regular human jumping using momentum is way off the scope of this project, and I am not sure if it is even required much, compare to implementation difficulty. So I think of smaller steps first (they are already very huge in terms of work that needs to be done, though).
As for climbing - I don't know, actually. We can make maps with vertical stairs that works like a grav lift (pretty meh IMO, as you can perform shooting, as usual, kneel, etc, that looks not immersive). For grappling hook ideas - jumping system as I see it would fit your sniper's needs, but implementing climbing could be another big project, as there would be needed a lot of new stuff.

Offline Finnik

  • Colonel
  • ****
  • Posts: 492
  • Finnik#0257
    • View Profile
Re: Jumping movement type
« Reply #9 on: July 07, 2020, 05:04:27 pm »
Script are not capable right now to move units in any way, I have some plans for functionality like that but never have enough time to fully flesh out how it should work exactly.

I do not know how y-scripts work in code (I've tried to read it, but it's far beyond my comprehension), so I am trusting you here for sure. But is it hard to do that in code? like pulling down everybody if the unit has specific armor mod property and there is no ground in the tile it using (until it would be in such a tile)? Handling 2x2 units needed, though)

Offline Yankes

  • Commander
  • *****
  • Posts: 3207
    • View Profile
Re: Jumping movement type
« Reply #10 on: July 07, 2020, 08:08:08 pm »
Putting this to code is simple, hard is make it work smooth with rest of game logic. Problem is figuring out all possible corner cases and prevent them.

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 678
    • View Profile
Re: Jumping movement type
« Reply #11 on: July 07, 2020, 09:15:12 pm »
Cant you just put an script that alter movement type from 2 to 1 and end of turn and reset 1 to 2 at beginning. And make a force nudge so they unit fall at end turn :p

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11452
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Jumping movement type
« Reply #12 on: July 07, 2020, 09:24:13 pm »
Cant you just put an script that alter movement type from 2 to 1 and end of turn and reset 1 to 2 at beginning. And make a force nudge so they unit fall at end turn :p

Code: [Select]
drunkFloaterMovement: true

Offline Yankes

  • Commander
  • *****
  • Posts: 3207
    • View Profile
Re: Jumping movement type
« Reply #13 on: July 07, 2020, 09:28:56 pm »
Yes, limiting change to turn transition is one of possible solution. It bit limited for my taste but if there was not better solution then I would implemented it.
There is possible other way, and hole problem with this is figure out all possible solutions and analyze with give best functionality and best fit current game logic.

Offline Finnik

  • Colonel
  • ****
  • Posts: 492
  • Finnik#0257
    • View Profile
Re: Jumping movement type
« Reply #14 on: July 08, 2020, 12:29:43 am »
That is a very dirty hack to the code that could more or less demonstrate what I want to achieve. I can perform pathfinding like I'm flying, but I can't stay in a floating state, forced to end movement on the ground. This is not ending solution OFC, as I just changed one line in void Pathfinding::calculate

Code: [Select]
126           while (canFallDown(destinationTile, _unit->getArmor()->getSize()) ) //&& _movementType != MT_FLY


As it is working on the demo is more like what I personally want for my mod, as don't want the player to cheat melee enemies too much, and it would not fit general solution as is, as for most cases people would like to see jumping it should not allow such a complex trajectory. But this is what I meant for defining the endpoint of a jump.
There is much more work needed here, as even in the demo it was shown that if I have not enough TU I will still stay floating, this case as many others need to be handled, I can understand that.
« Last Edit: July 08, 2020, 12:59:20 am by Finnik »