Aller au contenu

Photo

"Markshire" jumping


  • Veuillez vous connecter pour répondre
12 réponses à ce sujet

#1
kamal_

kamal_
  • Members
  • 5 258 messages
I've converted the Markshire climbing system http://nwvault.ign.c...s.detail&id=103 into a jumping system, with options for jumping to a target, and directional jump based on the direction the pc is facing.

Directional jumping, pc jumps in the direction they are facing, distance based on dice roll. Shows the jump animation.
www.youtube.com/watch

Jumping towards a target, the other side of the ditch in this instance.
www.youtube.com/watch

Demo module.
dl.dropbox.com/u/3879894/test_jumping.7z

There's a bug I'd like some help with. If the jump lands the pc in a
non-walkable location, and CalcSafeLocation doesn't find one in range,
the pc "jumps" in place. I tried to use a while loop to expand the
radius of CalcSafeLocation, but I wrote myself into an infinite loop (so
I removed it).  What I want to do is expand the radius and recalculate,
until a safe location is found.

Modifié par kamal_, 19 octobre 2012 - 01:32 .


#2
kamal_

kamal_
  • Members
  • 5 258 messages
Ok, the basic system is working. You can jump over pits, and if you fail you wind up at a distance based on your roll. DC for the jump is done automatically. Falling damage is calculated how far you fall on the z axis (in other words, it reads the actual map and determines the height. You automatically travel in the direction of the jump target, a distance based on your roll. If that jump happens to wind up short, you fall to the local ground, so multiple ground levels in an open pit are handled automatically and damage calculated appropriately. (obviously, there's no animation, you just appear at the result of your jump)

For builders: One script on a placeable, and a local variable on the placeable with the target waypoint. The rest is handled automatically.

Demo vid: the tester fails every jump, but that's actually of more interest, you can see him go different distances, and wind up on the ground at the end of the failed jump. Falling damage is turned off in the vid.
www.youtube.com/watch

Modifié par kamal_, 17 octobre 2012 - 01:57 .


#3
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
I figured some of that stuff out for my tactical AI, you could poke around in there for ideas, or post some code here. I just remember that CalcSafeLocation is important.

I assume you're just jumping the PC x meters forward on success, and y meters forward on failure?

Come to think of it, a 'displacement' feat that jumps you left or right a few meters when physically attacked might be neat.

#4
kamal_

kamal_
  • Members
  • 5 258 messages
You simultaneously posted with my update to my post. I got it working. Demo vid uploading.

And yes, I abused CalcSafeLocation to make it do something unexpected, determine where to place the falling pc.

The jump function determines the path between the jump point and target waypoint, and lays out a vector between them, so you can jump in any arbitrary direction, just move the target waypoint in any direction you want, the pc automatically jumps towards it.

Modifié par kamal_, 17 octobre 2012 - 01:45 .


#5
kamal_

kamal_
  • Members
  • 5 258 messages
There's a bug I'd like some help with. If the jump lands the pc in a non-walkable location, and CalcSafeLocation doesn't find one in range, the pc "jumps" in place. I tried to use a while loop to expand the radius of CalcSafeLocation, but I wrote myself into an infinite loop (so I removed it).  What I want to do is expand the radius and recalculate, until a safe location is found.

Note for builders: Only the script on the placeable, and the one variable are necessary. The rest is calculated automatically, including the direction of the jump, the DC of the jump (move the target waypoint and the direction and DC automatically recalculate for you), the fall distance (calculated from the map itself), and damage. The jump distance is based on the dice roll for the jump, low rolls mean you don't jump as far.

DC based on http://www.d20srd.or...skills/jump.htm , and adds penalties based on armor weight, and weaponry equipped (it's hard to jump with a sword in hand). Jumping up/down/hopping on things not yet included. If you're not in combat, the roll is take 10 minimum, so you can't roll less than 10 outside combat.

Modifié par kamal_, 19 octobre 2012 - 01:33 .


#6
kamal_

kamal_
  • Members
  • 5 258 messages
Right now it jumps towards the target waypoint. It shouldn't be tremendously difficult to make the jump direction based on the pc facing instead of towards the waypoint. It would eliminate the DC and make it entirely based on topography of the actual map.

Add a custom jump feat and you'd have a basic jumping system.

#7
Dann-J

Dann-J
  • Members
  • 3 161 messages
X0_i0_position should have some functions you can raid, if you're not using it already.

#8
Tchos

Tchos
  • Members
  • 5 072 messages
This is interesting to me, too.  I've seen demos and tests of jumping, but never before anything actually released in a form we could get our hands on.  This person, for instance, made an attempt at a jumping animation to accompany the action, but that was almost 2 years ago.

#9
kamal_

kamal_
  • Members
  • 5 258 messages
Properly handling actual jumping would be quite tricky, since you'd have to do things like determine if anything in the way and if you could clear it. If you could detect placeables in the path, I'd try looking at whether they were walkable. Walkable = you could jump over it. For environmental objects, it would get a lot trickier. Assuming you could detect whether you were jumping over a walkmesh cutter, I'd probably just end the jump at the cutter as a compromise. I can't think of a way to easily tell if environmental objects would otherwise be walkable (and thus jumpable).

I never saw that video before Tchos, but it looks like he's doing jumping as I described above with jumping based on pc facing. A proper jump animation would need to be able to move the pc over unwalkable terrain, or fake that somehow, and I'm not sure that's possible.

#10
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

kamal_ wrote...

Properly handling actual jumping would be quite tricky, since you'd have to do things like determine if anything in the way and if you could clear it. If you could detect placeables in the path, I'd try looking at whether they were walkable. Walkable = you could jump over it. For environmental objects, it would get a lot trickier. Assuming you could detect whether you were jumping over a walkmesh cutter, I'd probably just end the jump at the cutter as a compromise. I can't think of a way to easily tell if environmental objects would otherwise be walkable (and thus jumpable).

I never saw that video before Tchos, but it looks like he's doing jumping as I described above with jumping based on pc facing. A proper jump animation would need to be able to move the pc over unwalkable terrain, or fake that somehow, and I'm not sure that's possible.


Hi Kamal,

You may be able to use things like "Line of Sight" to help determine if you can jump to a place.

You make be able to "fake" the destination (over a non walkable) simply by determining if the location is a valid one.

I have tried contacting Kaeldorn, as that system does look very well done, and it may be worth looking at the code they have alreay written. In the meanwhile, all the best with this Kamal!

Lance.

#11
kamal_

kamal_
  • Members
  • 5 258 messages
Added directional jumping, suitable for adding to a custom feat. Jump direction is based on the pc facing. There is no DC for directional jumps, you jump based purely on a roll to determine distance.

Added a jumping animation. It turns out there is a stock jump animation called "jumpback". The jumper will now play this animation in reverse, effectively making it a "jumpforward" animation. I should have a youtube video of directional jumping and the jump animation up in 20 minutes or so.

If someone wanted to develop this into a feat, I would suggest allowing the player to click a target for the jump and setting a DC based on that. For instance most adventurers would be able to successfully jump to a target 3 feet away all the time (except for that clumsy mage), while accurate jumps farther away would be higher DC. The code for assigning DC automatically is in the stock jump script. Since out of combat jumps the pc can take 10. Any targetted jump under 10 feet should be auto success.

There is no code for an intentionally jump down, something that is handled by pnp rules. If your landing spot is more than 10 feet below the jumper, the jumper takes damage. Theoretically, if this was a feat where the pc selected the target of their jump, this could be added, but the difference is only 1d6. (If you succeed on a jump down check, you take falling damage as if you had dropped 10 fewer feet than you actually did. )

Next step would be to add some sort of detection of obstructions that would stop a jump.

Modifié par kamal_, 19 octobre 2012 - 01:35 .


#12
kamal_

kamal_
  • Members
  • 5 258 messages

Lance Botelle wrote...
Hi Kamal,

You may be able to use things like "Line of Sight" to help determine if you can jump to a place.

Just tested this. There is a function called LineOfSightVector that determines if there is los between two vectors (the positions of the jumper, and the destination of the jump). The los isn't very accurate though, a high stack of crates, taller than the pc, allow los. Technically it does work though, I was able to stop jumping through a Crossroads Keep wall. Environmental objects don't block los though, when I set the wall to environmental and used a walkmesh cutter, I jumped right through.

So theoretically it could work, but it would be annoying because the area would have to be built with it in mind, and bad for performance (lots of placeables). I'll look at other ways.

#13
Lance Botelle

Lance Botelle
  • Members
  • 1 480 messages

kamal_ wrote...

Lance Botelle wrote...
Hi Kamal,

You may be able to use things like "Line of Sight" to help determine if you can jump to a place.

Just tested this. There is a function called LineOfSightVector that determines if there is los between two vectors (the positions of the jumper, and the destination of the jump). The los isn't very accurate though, a high stack of crates, taller than the pc, allow los. Technically it does work though, I was able to stop jumping through a Crossroads Keep wall. Environmental objects don't block los though, when I set the wall to environmental and used a walkmesh cutter, I jumped right through.

So theoretically it could work, but it would be annoying because the area would have to be built with it in mind, and bad for performance (lots of placeables). I'll look at other ways.


Hi Kamal,

I see you have released your jumping system. :) I will take a look in a minute.

What about the second idea about checking for valid locations? I would have thought even environmental objects (with a walkmesh) would return a LOCATION_INVALID to stop any jumping?

EDIT: Don't worry, I think you must have done this, as I read on the Vault: "... and won't jump if there's too many invalid locations in between, or if the jumper's line of sight is blocked (there are included messages for each). "

Lance.

Modifié par Lance Botelle, 22 octobre 2012 - 03:13 .