Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Confused about newton vehicles

Author
Message
Kryogenik
14
Years of Service
User Offline
Joined: 22nd Sep 2009
Location: Heidelberg, Germany
Posted: 13th Mar 2010 19:13 Edited at: 13th Mar 2010 19:15
Hey guys. I've been messing around with the vehicle commands in Newton for the past couple of days, and I'm kind of confused. I made a little program that just makes a vehicle out of spheres and a box that goes forward when you press w. Here's my code

When I run this code, the car will move forward, but there are 3 problems.
1.The car moves pretty slow. I have to keep it at 30 fps because I was hoping to put vehicles in a game I am working on.
2.If I accelerate the car before it has rested on the ground, it goes crazy and flys away.
3.When I press control to see the world accordiing to newton, it resets the camera.
Does anyone know about newton vehicles who can help me? And plus, I have know idea what the last 3 paramters in NDB_NewtonVehicleAddTire mean: susShock, susSpring, and susLength. Thanks in advance.

Codesurge is so awesome, thanks Hyrichter.
Kryogenik
14
Years of Service
User Offline
Joined: 22nd Sep 2009
Location: Heidelberg, Germany
Posted: 22nd Mar 2010 22:23
I fixed the second problem, but the others are still there. Decreasing the radius of the wheel makes it faster, but it makes it really bumpy and makes it look too close to the ground. Can anyone tell me how to make it faster without changing the wheel radius? Thanks in advance

Codesurge is so awesome, thanks Hyrichter.
Kryogenik
14
Years of Service
User Offline
Joined: 22nd Sep 2009
Location: Heidelberg, Germany
Posted: 26th Mar 2010 18:56 Edited at: 26th Mar 2010 18:57
I fixed the vehicle speed, which was was the last important thing but now I have yet another problem. I tried making terrain for my vehicle to drive around on and it doesn't work, heres the code

This code works fine. But it doesn't work in my older version of DBPro, which I use to compile my games because it isn't dx 9.0c reliant. In the newer version, the vehicle collides with the terrain as normal. But in the older version, it goes through the visible terrain object and hits something invisible under it(I checked with the hide and show object with shiftkey thing in my code). It's the same version of newton, so why would an older version of DBPro affect an outside plugin that is the same in both versions? I know there is a vehicle tutorial in newton, but it can't help me, since my vehicle is bigger then the one in the example, plus it won't compile in the older DBPro because it uses a .dbo. I want to get some decent vehicles working by monday or so, can anyone help me? Thanks in advance

Codesurge is so awesome, thanks Hyrichter.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 26th Mar 2010 20:49
What does NDB_DebugDrawNewtonLines show for you?

I don't know why an older version of DBPro has problems, how old is it? It has some bindings to the 3D language but I think they should still work with older versions, within reason of course.


A 3D marble platformer using Newton physics.
Kryogenik
14
Years of Service
User Offline
Joined: 22nd Sep 2009
Location: Heidelberg, Germany
Posted: 26th Mar 2010 21:37
It shows the debug lines, but it resets the camera and I can only see a little bit of the debug stuff. This works in the examples, so I must be doing something wrong. The older version of DBPro is v1.057, or at least thats what the help:about thing says.

Codesurge is so awesome, thanks Hyrichter.
Kryogenik
14
Years of Service
User Offline
Joined: 22nd Sep 2009
Location: Heidelberg, Germany
Posted: 1st Apr 2010 18:44
Now I have another problem. The game randomly crashes when it starts up. I was messing around with this code and I noticed it crashed at times.

I compiled it 7 times in a row with the exact same code and one of them crashed. The new functions are setupnewtonvariables, makenewtonworld, makevehiclebody (which isn't used yet) and controlvehicle. Why is it crashing, and why does it only do it every once in a while, thanks in advance.

Codesurge is so awesome, thanks Hyrichter.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 5th Apr 2010 17:54
An infrequent crash is much worse than one that happens all the time. There's no magic bullet for them you have to take things away and add things back and see what is causing it. Trapping things out to disk to determine what line crashed is helpful too. This is a pain but if it wasn't crashing before then something was added to cause it. Did you try compiling in the latest DBPro version or are you still using 1.57 ? I'd try using the latest and see if there is a difference.


A 3D marble platformer using Newton physics.
Kryogenik
14
Years of Service
User Offline
Joined: 22nd Sep 2009
Location: Heidelberg, Germany
Posted: 5th Apr 2010 22:48
I was compiling in the newer version. I tried compiling with the older one, and it crashec right when the car wheels touch the terrain. I must have added something to the code it doesn't like

Codesurge is so awesome, thanks Hyrichter.

Login to post a reply

Server time is: 2024-03-29 13:27:38
Your offset time is: 2024-03-29 13:27:38