Posted: 21st Jun 2007 18:42
I'm messing about with Newton and I have developed a couple of different methods of controlling the character, but the movement never seems entirely natural.

I'm using TreeCollision for the floor model and I've basically had to turn off all friction between the player and floor models because the player gets "wobbly" and is thrown completely off course when it apparently "sticks" to the floor at almost random times. Doing so has given me the appearance of sliding collision, which is what I want, but now I'm running into something else that I can't quite compensate for.

The movement now seems to very slowly get off track and any attempts to compensate immediately (i.e., making a sharp turn) makes my player model spin around or roll over in the extreme case, or just wander way off track in the more common case.

My question is this, is there some sort of function in Newton that I am missing which will move the player on a directly linear path, much like the controls in DBPro? I'd like to be able to use the up and down keys to move forward and backward, while the left and right arrow keys would be used to strafe. Ideally, I'd like to use the mouse to point the heading for the character so that one is always walking in the direction in which the user is looking.

Additionally, I'm not liking how my current code using Newton seems to gradually apply the force at first, which creates a delay between the pressing (and holding) of the movement key and the actual movement, and how releasing the movement key does not bring the player model to an immediate rest, nor does applying an opposing force by using the opposite movement key.

The fact is, Newton is absolutely amazing and my experience as described above leads me to believe that I'm using Newton incorrectly for movement of my player model. I've been through Walaber's HTML documentation packaged with the wrapper, and while extremely helpful, I haven't found the solution in the documentation. All of the demos seem to use the above method for movement, unless I'm missing something.

Any suggestions from anyone who has created a movement system in Newton for character movement would be most welcome.
Posted: 26th Jun 2007 8:00
Would anyone happen to know if there's a way to affect this behavior by increasing the mass of the object significantly? As it is, I have fairly low gravity (-9.8 i believe) and have a mass of about 10 for my Stickman and don't see any noticeable effect when the mass is altered or gravity increased. Does anyone else have any other experience?
Posted: 10th Aug 2007 13:57
I apologise for bumping old threads but the problem I'm having at the minute is virtually the same as this.


I have a cube position in a 3rd person perspective to the camera and for some reason the cube will randomly spin on the Y axis uncontrolably and veer off in random directions. Does anybody have experience of this problem? Does anyone know possible causes?



Cheers,
Rich
Posted: 10th Aug 2007 18:25
@Powersoft: What editor are you using? I had a similar problem with the default editor, but codesurge works fine.

@Weedfox: It's some apply force command. I cant remeber what it is off the top of my head but there is a command which will apply a force to move/rotate newton bodies.
Posted: 10th Aug 2007 18:48
editor? why would my editor matter? I'm using CodeSurge,

Thanks for reply though,
Posted: 10th Aug 2007 18:50
Not sure why, but the default editor screws up newton for some reason. Its strange and shouldn't have an effect, but it did!

I didn't believe it either!
Posted: 10th Aug 2007 19:17
Woah, that's some messed up code. No I'm using Codesurge, the IDE of choice, haha.


No basically I'll collide with the corner of a wall and all of a sudden the cube will start spinning frantically... :S
Posted: 10th Aug 2007 20:25
I saw behavior in the Newton Demos like that - and honestly - that is the MAIN reason (Try messing with the rag doll or "tossing" a linked model a few times) that I decided NOT to go through the learning curve. I would be so !@#$!@ mad if I spent weeks getting the physics right and the game all configured - both a physical and visual world - all tied together - to have some bug that is hideous and out of my control.

I'm personally looking for an alternative. If there was a newton function or setting that could "Dampen" Extreme "situations" and keep it from perpetuating out of control - I might give it a go.

Just something for your problem mentioned here - at LEAST then if something bizarre tricked out your character - it would be just a "glitch" that self corrected. Not a "WHOA - look at Physcho Spin dude!"

JAson P Sage
Posted: 10th Aug 2007 20:49
I never said it was Newton...It might be something I'm doing wrong/right...
Posted: 10th Aug 2007 20:54
True - but that funky behavior I saw in the demos sounds exactly like the "One second its fine.. the next its acting crazy" symptoms I saw.

Otherwise are you satified with the results using newton? I still haven't used it - I'm leerie.
Posted: 10th Aug 2007 20:59
Yea I'm quite happy with it, it just seems a kinda random action to do...
Posted: 10th Aug 2007 23:26
other than my character periodically spinning completely out of control, newton's really amazing. there is a bit of the learning curve with the language newton uses, but the engine works really, really well, and doesn't use a ton of memory to implement. (something i ran into with other collision DLLs such as Nuclear Glory)

I really like Newton, but apparently everyone is saying that Dark Physics is much better and more suited to game development. I just don't think Newton is created with third-person character models in mind. It really works best for first-person shooters (as the demos included with Newton suggest) or games involving vehicles that rely on inertia and the like. I don't think Newton's particularly suited for a third-person RPG at this point.
Posted: 10th Aug 2007 23:29
That...is a shame...my game isn't an RPG but is 3rd person...

hmmm...do we know what causes this phantom spin?
Posted: 11th Aug 2007 2:11
My game is 3rd person but the player is a marble! Problem solved.

If you're running a 3rd person view on a character, why not use an up-vector joint for a Newton body and just tie the model to that? I mean, basically use the FPS demo that comes with Newton, and pull the camera back and stick your model where the player should be? I haven't tried any 3rd person character type stuff so it's just off the top of my head.

I guess what I'm trying to say is first person vs 3rd person is a camera choice, it shouldn't affect the physics at all.

And what are you guys talking about with "acting crazy"? I've seen Rag-dolls go nuts under certain spinning forces, but never on anything else. I've never seen a simple compound collision spinning around on the Y axis on its own.

Can someone put up a demo of the spinning problem?
Posted: 11th Aug 2007 3:39
@TireSius - You nailed it - (For me wasn't a "Y" thing - PowerSoft said something about a "surface" would send his object spinning while it walked)

I was referring to how in the demo if I picked up a rag doll and tossed it - it would happen alot (or would just go really slow) also the "Wooden ant demo" does it also.

I would swing it back and forth enough to get momentum for a throw - and when it landed it would spin and the limbs would seem to "stretch" away from the center object - like it was in a cruel g-force science experiment.
Posted: 11th Aug 2007 8:47
This is the reason I dropped Newton from Geisha House. I did some initial tests with it. The rigid body simulator is nice, but there are some limitations. Basically, you have to be able to set the y-angle of the physics body. Newton doesn't let you do this. It treats everything like a rigid body. I used an upright joint for a character, but it would spin out of control no matter how I changed the friction or the local point of force.

Dark Physics allows you to easily solve this with either a character controller or a kinematic object. DP allows you to position and rotate an object like you need. There aren't many situations in a physics simulator that you need to manually control an object, but characters are definitely one of them.
Posted: 11th Aug 2007 10:47
Tiresius, I have an UpVector set on my cube at the minute,

I'll attach an exe. WASD to control, mouselook doesn't really work....
Simply move the cube into the corner of the wall and you should see it spin nicely


Cheers,
Rich
Posted: 11th Aug 2007 18:18
I did the whole upvector thing for my character as well. The problem comes from my terrain, which is not flat. I made some rolling hills and no matter how gradual the slope or incline, it always looks like the character "trips" over one of the polygons in the ground and goes spinning wildly out of control for no reason. And, like PowerSoft, if my character collides with the walls of buildings that I've set up, even though the elasticity is set to zero, the character will not "bounce" off of the walls, but he will spin out again if he hits the wall at an angle.

As near as I can tell, it looks like Cash Curtis is right... Newton seems to apply ALL forces ALL the time on your character body, regardless of how you think they should be applied. What tipped me off to this was when I was using the arrow keys to control my character. If you hit up, he'll go straight. (we'll call this North) Then, after he builds up enough speed, if you hit the left arrow key (West), he doesn't stop his forward motion and begin to move left. Instead, he gradually arcs to the left and starts moving in a Northwest direction, which is a combination of the two forces, the one propelling him forward and the one propelling him to the left. Plus, the character always "glides" to a stop rather than stopping completely as a person walking would do.

I absolutely love Newton, it's incredible. But it's definitely not made for the type of game I'm working on. Newton would be absolutely perfect for a first person shooter where you don't need a character model or a game like the rolling marble, as discussed earlier in the thread. It'd also be very useful for a physics demonstration for academia or the like. But for me, I think I'm just going to have to buckle down and buy Dark Physics.
Posted: 11th Aug 2007 18:40
That would indeed provide a bit of a nail in the coffin for this game, potentially, perhaps I'll have to go first person?
Posted: 11th Aug 2007 19:42
@Weedfox:
he doesn't stop his forward motion and begin to move left. Instead, he gradually arcs to the left and starts moving in a Northwest direction, which is a combination of the two forces


That is correct. In real life, you will apply a force as you walk to stop your forward movement. You just don't think about it when you do it. An asnwer to this would be to apply a force in the opposite direction to the direction you were just moving in to counteract the gliding.