• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] A little physique engine

Status
Not open for further replies.
Level 6
Joined
Jun 4, 2009
Messages
91
Here is a little physique engine for WC3 wrote in vjass.

It include a little escape demo wich you play with arrow keys

It does a computation of dynamics with some parameters you can specify like
-gravity
-air density (used in air friction, but I didn't really tested it)
-refresh period


this works by a structure that you can extends as shown in the "How To Use" trigger and the escape demo

While updating it does call two stub functions.
-in the first, you may return the sum of your forces
(weight and ground reflection will be computed by the engine then, so don't compute them yourself)
you can also add misc stuff

-the second is called once the destination is computed, but the units isn't yet moved, so you can perform collision detection (not yet provided in, sorry)
move the camera, and so on



Hope it'll help you making good maps. Please report me bugs and/or code correction if you do. Also report me if I did a mistake in the code.
 
Last edited:
Level 6
Joined
Oct 4, 2008
Messages
263
firstly post stuff like this in the JASS resources submission forum.

secondly, some feedback:
i like the system. however, there is a bug. if you stand between two small 'tops', you will be caught there and unable to move.
 
Level 6
Joined
Jun 4, 2009
Messages
91
yes, because of gravity. And there aren't as small as they looks if you change your camera, you'll see how hudge they're. To solve, you can change the bound factor to 1.0

or you can unpause the unit when his speeds get slow (but you shall check it isn't jumping)
but then the question is when to pause it again ?

But maybe smoothing curves will be an efficient solution
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
  1. Do not overuse color commands, maybe use a subtle color for the title, but don't use color codes for the rest, it hurts my eyes.
  2. This doesn't belong in this section, post in in the spells-section as a system.
  3. Create a function that if the unit is stuck, you can use the jump-spell again, otherwise it's pretty useless since I got stuck all the time.
 
Status
Not open for further replies.
Top