• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Predicting Movement of Physics Objects

Aaron Craig

Member
I'm looking to replicate the Unicorn's power from Peggle in GameMaker using the physics engine. I'd like to be able to click on a marble, pull back and see where it's going to, but math isn't my strong suit. I assume I need some trig or calculus formulas to predict where it's going and to account for linear damping, friction, etc..
I couldn't find any games or plugins in the GMS marketplace, and nothing useful in my google searches. Is this something I can do with GameMaker physics?
I tried a bit myself, but I don't know how exactly linear damping and the other forces really interact with my marble. Does a 0.1 damping equate to -1 pixels downward or something specific like that, or is it more complex?
Any help would be appreciated.
 

Yal

šŸ§ *penguin noises*
GMC Elder
One problem with a lot of physics engines is that they aren't fully predictable, so your prediction will diverge from the actual simulation eventually (even running the same simulation with the same initial state and parameters will give different results far enough into the future). So you basically need to do the movement yourself if you want 100% predictability. On the plus side, you can probably just wing it for short predictions - it's not like being more thorough guarantees more correctness.
 
Top