0 Favourites

Predicting player jump path accurately

  • Hi everyone

    I was looking at this post where R0J0hound posted a sample capx of predicting the player jump path. I've been using it as a basis for my game but noticed that while it's great for a general idea of where the player will go, it's not too accurate.

    For example, the lines below in pink are from where the player actually jumped and the one in blue is predicted in code:

    <img src="http://i.imgur.com/r1lUK.png" border="0">

    My modded sample capx

    As you can see it is a bit off.

    I've been trying to come up with a way of making this more accurate all week and have nothing but tired eyes. If I want an accurate path as possible for where the jump path will go, should I be looking at a completely different solution? Are there any tweaks I can make to the code by R0J0hound to make it more accurate?

    Times like this I realize I'm a web developer, not a game developer <img src="smileys/smiley9.gif" border="0" align="middle">

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Set the deceleration of the player sprite to zero, and add an event to set the "platform vector X" to 0 when the player lands. That should make it more accurate.

    I divided by 60 in the expressions assuming a constant 60fps. In reality the framerate varies so the exact path can't be found.

  • You know how sometimes you think "I should just post this question...no..NO I'll figure it out!" and then spend days and days on wrestling a problem to the ground? All which could be solved by just asking for help?

    This is one of those times. The acceleration was indeed the problem. It makes sense too - The player has the platformer behaviour which applies acceleration/deceleration while moving, but the generated jump nodes have no idea of what that is. I added in a little condition that simply says while the player is jumping turn off acceleration.

    You are a king amongst men R0J0hound :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
[plugin] Youtube player
175 20,536
rexrainbow's avatar
rexrainbow
Unread hot topic
0 Favourites
Path Movement Behavior
98 52,469
R0J0hound's avatar
R0J0hound
Unread hot topic
0 Favourites
Follow path behavior
37 15,875
nemezes's avatar
nemezes