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.

Program Announcements / [STICKY] Newton Game Dynamics WRAPPER v1.53

Author
Message
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 12th Jul 2009 09:15 Edited at: 23rd Jul 2012 04:38
No, the topic on this post is not a typo. No, you are not seeing things. Some crazy fool actually updated the Newton physics wrapper to version 1.53. That crazy fool was me.

You've all waited patiently for 3.5 years, but here it is.

DBPro Newton Game Dynamics Wrapper 1.53
Grab it here: https://forumfiles.thegamecreators.com/download/1800941
Here is a list of things that have changed with the wrapper:
Fixed original 14 demos to work with DBPro 1.072
Added Demo #15: Time Slice demo - guaranteed physics simulation results regardless of frames per second
Bug extermination (including the ConvexHull random crashing that plagued me for years!)
Updated keywords_ndb.ini
Updated the documentation (fixed typos, put link to main list at top, changed color scheme!)
Further details can be found in the file NDB WRAPPER 1.53 UPDATES.txt included in the archive.
Changes/fixes made since release: (updated June 22, 2010)


But perhaps the most important thing is that there are many bugfixes in Newton itself between the latest version 1.32B and the 1.53 version. They are listed here:


Some things do behave different but for the most part, there are nice improvements to the physics engine itself. There have been nasty rumors about Newton not working in Vista. I would like this proven wrong, please any Vista users try this out and let us know how it goes. I think it was the ConvexHull bug fixed in this version.

Some eye candy of all 15 demos included:


July 22nd, 2012
PLEASE NOTE:
The Newton Wrapper 1.53 source has been released and can be found at my last post in this thread, in this location:

https://forumfiles.thegamecreators.com/download/2377519


A 3D marble platformer using Newton physics.

Attachments

Login to view attachments
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 12th Jul 2009 12:40
Waw, what a coincidence! I got back to newton programming yesterday, hoping for your update to come soon!

I haven't tested it properly yet, and the only problem I found is that the update function doesn't perform substeps as it should (it was the same in the previous version). Thus, the only solution is to do it by ourselves, like in your time slice demo, which is bad because the forces need to be reapplied each time. Is there a way to fix this in the wrapper? It might be a simple mistake because there are functions like NDB_NewtonSetMinimumFrameRate and NDB_NewtonGetTimeStep to handle this.

I have Vista and works perfectly, just like the previous version, actually, so the rumour is definitely wrong.

Anyway, thank you a lot for this update! It brings some hope for all the newton programmers!
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 12th Jul 2009 14:46 Edited at: 12th Jul 2009 18:52
Hi Math89-
NewtonUpdate does not perform substeps on its own, and the wrapper is calling this function directly, as it is shown in the SDK. This is from the SDK doc:
Quote: "This function will advance the simulation by the amount of time specified by timestep. The Newton Engine does not perform sub-steps, and does not need tuning parameters. It is the responsibility of the application to ensure that timestep is small enough to guarantee physics stability."

There may be a tie in to the minimimum framerate and the get timestep functions you've mentioned (I've never really used them) but the wrapper version of NewtonUpdate does not use these. I'd need to see an example using these functions in the raw SDK before I dared to futz around with the wrapper function for NewtonUpdate.

[EDIT]
Quote: "which is bad because the forces need to be reapplied each time. Is there a way to fix this in the wrapper? "

I looked into this further for you. The wrapper cannot perform substeps, nor would you want it to. There are a couple reasons for this right off the bat:
1) The wrapper doesn't record the forces put onto a body, it just pushes them along to Newton. Newton clears the forces during NewtonUpdate. It would be major changes to have the wrapper record these forces and reissue them to bodies during substeps. And even if we did that, you would have a problem with #2...
2) Another reason being that DBPro does not have real callbacks from Newton. We ask Newton to update for a particular timestep, then we need to poll Newton for the results (results do not happen automatically via a callback). If we had the wrapper do substeps (say 2 substeps per loop because the PC is slow) then the previous collision information from the first substep would be lost to us because of the second substep. We would be missing collisions to trigger certain events in our code.

The TimeSlice example is the only way I know to achieve perfect simulation, and you're right it is a bit of a pain. But if it wasn't done in DBPro code, it would have to be done in C++ code when using Newton SDK directly. There's no magic bullet in the Newton DLL that allows for this.

My timeslice example is simplified, it doesn't record any player states (which is important to do, such as contacting materials, etc.) so here is a trimmed down version of the physics code I use in my main project, and it works quite well.

Hope this helps!

I'm not a real programmer but I play one with DBPro!
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 13th Jul 2009 10:02
wow you finally finished this thing actually.
Demos all work so fine.

Thanks for the share

There is always one more imbecile than you counted on.
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 13th Jul 2009 11:31
NDB_NewtonConvexCollisionCalculateVolume(col)

this command gives a parameter mismatch error.

There is always one more imbecile than you counted on.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 13th Jul 2009 15:15 Edited at: 23rd Jul 2012 04:37
Hmm I'm pretty sure it was working at one point. Thanks I'll take a look tonight, and confirm again all the other new commands working too.

[EDIT]LOL I hate string tables!! I see the problem I'll fix it tonight.


A 3D marble platformer using Newton physics.

Attachments

Login to view attachments
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 13th Jul 2009 15:22
I found a problem with the examples: the capsules can't be selected (but they are displayed correctly using the debug object).

And just a random question: how do you control the player in newton? Because I have always been facing some problems with it: if I don't apply large forces, the acceleration makes it feel like the player is sliding, but if I apply huge forces, the player can push absolutely every object without being slowed down. Do you have some kind of magical trick or is just about balancing the forces?
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 13th Jul 2009 15:57
Quote: "the capsules can't be selected "

That is a bizarre bug. You have to be fairly close to a capsule and then it can be selected. There must be an issue with NewtonWorldRayCast and the capsule primitive itself. I'll dig in a little bit but I'm afraid there might not be much I can do.

re: player controllers, this is where Newton has lacked up until now. It is being addressed in Newton 2.0 with a velocity based controller (that still plays nice with Newton principles), but at this time there is no standard player controller for 1.5x. The FPS demo has a primitive which seems to move and stop quickly, you can check the settings for that. But we've always had issue with player characters and sliding collision (it wants to rotate the player).

I'm not a real programmer but I play one with DBPro!
Dark Dragon
16
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 13th Jul 2009 16:25
Just got my dbpro installed. this looks...........GREAT. Cant wait to test it! I think i'll like dbpro.

Your signature has been erased by a mod because it was too big.CHANGE IT OR DIE!!!!!
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 13th Jul 2009 18:52
Quote: "NDB_NewtonConvexCollisionCalculateVolume(col)
this command gives a parameter mismatch error."

I believe this is fixed, please check it out -- I've uploaded the latest archive. Thanks buddy.

I'm not a real programmer but I play one with DBPro!
Jimmy
20
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Back in the USA
Posted: 14th Jul 2009 03:18
Works wonderfully in Windows 7.

You'd make Walaber so proud :') if he wasn't dead.

NaGaFailMo.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 14th Jul 2009 04:43
Wow a Win7 report, thanks!

As for Walaber, remember that some birds are not meant to be caged. With his programming skills and aspirations he could not be held in DBPro-land for very long. We should be glad he visited us for the time he had, and never forget what he did for us.

I'm not a real programmer but I play one with DBPro!
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 14th Jul 2009 10:00
I started testing things,

Meanwhile, there was a bug in the old wrapper about tree collision, and it is still there.

When you make tree collision with limbs, it just misses the limb 0.

As can be seen in advanced terrain, the limb 0 is the first segment of the terrain, there is no collision object created for that part.

Maybe you can check that out too?

There is always one more imbecile than you counted on.
N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 14th Jul 2009 11:56
can i kiss you?

lol

I'm downloading now

Yours
N3wton

Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 14th Jul 2009 12:10
I can't find the continuous collision commands, is this feature completely removed? (I know it never worked before )
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 14th Jul 2009 14:59 Edited at: 14th Jul 2009 15:03
EDIT: My mistake, nevermind.

There is always one more imbecile than you counted on.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 15th Jul 2009 07:29 Edited at: 15th Jul 2009 07:35
Quote: "Math89-I can't find the continuous collision commands, is this feature completely removed? (I know it never worked before)"

I've never used these commands so I didn't miss their lacking in the wrapper. It looks like they are not really set up in the wrapper. I will think about adding them in a few days (will require a new function), and maybe use it as a chance to update the wrapper to VC++ Express 2008, right now I'm using VC++ 6.0 which is well over a decade old. :/

Quote: "Cucumber-EDIT: My mistake, nevermind."

Nevermind about the limb=0 issue? Or nevermind about something I didn't get a chance to read? If the Tree Collision issue is real, can you try both flavors of the call and let me know your results?
NDB_NewtonCreateTreeCollision(obj,1)
NDB_NewtonCreateTreeCollisionUnoptimized(obj,1)

Thanks.

I'm not a real programmer but I play one with DBPro!
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 15th Jul 2009 16:54
actually, you should check the tree collision command and if possible update it to use new vertex commands rather than memblocks and mesh commands, i dont know if it will be faster or not though.

also, if possible you can update the newton draw debug lines command to use d3d plugin instead dbpro 2d commands.

These above are not necessary though, the problem is with newton debug object command. It crashes my big project, but strangely my small test works.

I use memblocks and i work on different parts of memory in my big project, maybe that collides with something? anyways theres a problem with it.

There is always one more imbecile than you counted on.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 16th Jul 2009 00:01
Quote: "actually, you should check the tree collision command and if possible update it to use new vertex commands rather than memblocks and mesh commands"

Right now the Tree Collision converts the object into an FVF list of vertices with a normal DBPro function... resulting in only the stuff Newton wants. You're suggesting to do it manually but I don't see a benefit.
Quote: "d3d plugin instead"

Speedy debug data always sounds good but I'm afraid I don't want to require another 3D plugin for Newton to work, it should work out of the box.

There could be a way to get some specific body debug data. For instance, something new like NDB_DebugMakeNewtonBodyObject(int body,int flag) where you could tell the wrapper which specific body you want to make the debug object for. This would help if your terrain/level is broken up by multiple bodies.

If you explain your project and how big the objects are, how many of them there are, perhaps we can come up with something you can use? And unless you're using more than 255 memblocks, I don't think your heavy use of memblocks is messing with the wrapper's, unless someone is poking in data they shouldn't be.

And I'd be interested to know exactly where your project crashes. Place trap in there to see if it is crashing in a Newton wrapper function, or in "sync"? Danger of too many polys comes to mind...

I'm not a real programmer but I play one with DBPro!
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 16th Jul 2009 14:08
Well, it will take some time to find what crashes debugnewton object command.
I will let you know.

Meanwhile, instead using d3d, then also make a flag to the drawnewtonlines command, and if this flag is set to on, it will only show the bounding box of the body with 8 lines on screen instead of every edge.

That will not show the entire perfect collision representation, but its good enough to show where the body is actually and will surely be much faster. Aaaand in most cases, it will be enough for debugging.

How about that?

There is always one more imbecile than you counted on.
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 17th Jul 2009 11:28
With a slightly exaggrated local force applied, the ball joint limits are broken. It wasnt like this before.

There is always one more imbecile than you counted on.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 17th Jul 2009 17:24
Quote: "the ball joint limits are broken."

I've found the reason for the stacked boxes getting all jittery and falling on their own. The older version of Newton had the inertial dampener set to 0.1 as standard. That kept things from getting funky. He changed it to 0.001 in the 1.5x releases, I believe.

I've manually set the inertial/angular dampeners (forget the functions right now) to 0.1 in DBPro and the stack of blocks are as stable as before (and not as hard on the CPU, too). The MI needs to be set up as well it seems or results get a little off.

I say all that because it's possible you have to do the same thing for bodies connected to the joints. Perhaps try setting the above values to 0.1 and also set joint stiffness to a higher amount?

Remember the rag-doll issue where you whip the body around fast and joints start spreading uncontrollably and getting all wacked out? That still happens, haven't figured out how to fix that (automatic built-in angular dampeners or something?).

I'm not a real programmer but I play one with DBPro!
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 17th Jul 2009 17:37
Convex
Tree
Treeunoptimised
tree from serialization
Manual tree collision (Adding polygons myself)
all the above crash the program.

I checked my own stuff, and it really isnt my fault. It is newtons fault.

Same above thing works with 1.32b, but not with 1.53.

box, sphere, cylinder, cone..etc these all work without problems.

There is always one more imbecile than you counted on.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 17th Jul 2009 17:48
Are they working in the wrapper demos for you? They work for me (except manual tree collision which isn't in a demo so I can't confirm). They also work in my own project (I use optimized/unoptimized trees, serial saving/loading, and hulls) so you're going to have to whittle away to find the root cause. In order for there to be a chance of me fixing these issues I will need simple examples of them not working. You said you "checked your own stuff", what does that mean?

Just in case you missed it, you are re-serializing all your stored Tree Collisions in 1.53, right? Loading a serialized tree collision made in 1.32B will crash 1.53, as stated in the wrapper notes.

I'm not a real programmer but I play one with DBPro!
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 18th Jul 2009 09:21
Well, i found it.
Everything works now perfectly.

The only thing doesnt work is the treecollision unoptimised.

And also very strangely, when you make a mesh out of an object and make another object out of this mesh and use tree collision, it wont work either.

Anyways its not anything important. And id like to thank you again for this update it works great

There is always one more imbecile than you counted on.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 18th Jul 2009 17:40
Hey Cucumber-
Glad you got your stuff working. What parts of your project didn't work and what did you do to fix it? Perhaps these tips would help others migrating to 1.53 and I can include warnings in the wrapper text file.

Btw, I found the bug with Limb=0 for TreeCollision using the Limb flag. Unoptimized w/ Limb doesn't have this issue, but the regular version does. I'm going to upload a new version with fixes for Continuous Collision type commands, the bug you found for Limb=0, and JointStiffness documentation.

I tried the ball joint with large forces and if I set MI and dampeners for the body it doesn't seem to happen. I'm starting to think that setting the MI is of utmost importance in 1.53 and the solver can't do without it.

I expect to have this out in a week or two...

I'm not a real programmer but I play one with DBPro!
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 20th Jul 2009 09:45
there is a bug with DBPRO latest beta upgrade, it wont return correct values for instanced objects actual sizes.
I worked this around and it worked.

There is always one more imbecile than you counted on.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 20th Jul 2009 17:31 Edited at: 20th Jul 2009 23:14
There's a reason why I run a couple releases behind (1.072) the latest.

I'm not a real programmer but I play one with DBPro!
Brick Break
User Banned
Posted: 20th Jul 2009 21:57
Would it be possible to make the wrapper compatible with DBC? Could it be done? Could a version be written?

WINNER list:
Latch, Lee Bamber, TDK
Thanks for the help!
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 20th Jul 2009 23:11
Quote: "Would it be possible to make the wrapper compatible with DBC? Could it be done? Could a version be written?"

I don't think so. At least not this wrapper. It uses the DBpro interface so that the wrapper can move DBpro objects itself. This DBPro interface doesn't work with DBC.
If you really need a 3rd party physics plugin I would recommend just moving from DBC to DBPro, since we have a few 3D physics engines to work with (ODE, DarkPhysics, and Newton). I don't know of any for DBC. Sorry.

I'm not a real programmer but I play one with DBPro!
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 21st Jul 2009 09:17 Edited at: 21st Jul 2009 09:18
Ok I've uploaded a new version of the 1.53 wrapper. Most notably here is what has changed:
* Fixed TreeCollision with limb (Limb=0 would not have collision)
* Compiled with VC++ Express 2008 edition (should not make a difference)
* Fixed up some doc
* Made the stacking boxes in demo code more stable (with MI and dampening now set)
* Wrapped the following Continuous Collision commands and confirmed they work as expected:
NDB_NewtonMaterialSetContinuousCollisionMode
NDB_NewtonBodySetContinuousCollisionMode
NDB_NewtonBodyGetContinuousCollisionMode

As always, let me know if you have any problems with it. If you do find something, please try to narrow down the issue to a small code sample so I can debug it further. Thanks!!

I'm not a real programmer but I play one with DBPro!
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 21st Jul 2009 14:11
continuous collision mode sometimes misses the collision check but very rarely.
I must be doing something wrong. Do you have any simple examples of how to use it?

There is always one more imbecile than you counted on.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 21st Jul 2009 18:12
Hi Cucumber-
I put the continuous collision commands in the Terrain demo. I have a long comment in there instructing how to tweak the demo to test the continuous collision. From my tests it seemed to work as it is supposed to. Read the long comment in the doc for NDB_NewtonMaterialSetContinuousCollisionMode, it explains the intended behavior. Good luck!

I'm not a real programmer but I play one with DBPro!
N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 22nd Jul 2009 14:39 Edited at: 24th Jul 2009 00:38
Hey, I'm having some trouble with ragdolls, I've posted a topic here

TOPIC

Any help is good help

Yours
N3wton

heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 25th Jul 2009 03:46
Is there any chance that you could make a Newton wrapper for Dark GDK?

Use Google first... it's not rocket surgery!
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 26th Jul 2009 05:52
Quote: "Is there any chance that you could make a Newton wrapper for Dark GDK?"

I'm afraid not. What you have to do is put some work in to integrate Newton into DarkGDK directly, which is what Newton is intended for. C++ has all those juicy function pointers for callbacks which is what Newton uses.

I'm surprised nobody has done it yet. This post is the closest I've found.
http://forum.thegamecreators.com/?m=forum_view&t=123933&b=22

I'm not a real programmer but I play one with DBPro!
SK_Designs
14
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 30th Jul 2009 12:03
WOO! can't wait to start programming again

Cellulo
14
Years of Service
User Offline
Joined: 30th Jul 2009
Location: France
Posted: 30th Jul 2009 19:43
Hi tiresius , thanks to continue this wrapper, i wait a long time to see this wrapper in version 1.53, now it's real

I have just one problem, i don't know if it's bug or not, the problem come in all demos, the compilation of the executable work good but the text flickering all time ( text with explanation in high of the screen), the same thing happen with the wrapper 1.32b, my dark basic pro use the last upgrade (the 7.4) maybe its the last upgrade make this problem.

My Pc

Windows xp home sp3

AMD athlon 64 3700+

geforce 9800 GTX + (nvidia driver : 190.15)

3gb ram

darkbasic pro 7.4

I have attached the executable file of the demo2 to test. i have change nothing in the code of the demo2.

Attachments

Login to view attachments
Cellulo
14
Years of Service
User Offline
Joined: 30th Jul 2009
Location: France
Posted: 31st Jul 2009 17:57
I forgot to say that the demo 15 work fine, the text in the top of the screen don't flicker.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 1st Aug 2009 00:56 Edited at: 1st Aug 2009 05:34
Hi Cellulo-

That is odd, your exe flickers for me too. The only difference I can think of is that you have demo02 as a full screen project (I don't have DBPro here to test right now). Also the notes state above I did this on DBPro 1.072, I guess I could upgrade and see what it's doing. Meanwhile, can you try making it a windowed project and see if it flickers?
If it doesn't flicker then I'll have to figure out a fullscreen exclusive-friendly way of displaying that stuff, although it is just using box and text commands...

[EDIT] I tried this with DBPro 1.074 and it is not happening to me. I even tried full screen exclusive. Sorry but I'm not sure why the text & box is getting all blinky for you. Perhaps you have a messed up DBPro installation/update? Third-party plugin interference? Try similar box/text commands without Newton's involvement, and if it happens still at least we've taken Newton out of the equation.

I'm not a real programmer but I play one with DBPro!
Cellulo
14
Years of Service
User Offline
Joined: 30th Jul 2009
Location: France
Posted: 1st Aug 2009 13:56
Tiresius , it's a fresh installation i have made before to compile the demos of the wrapper 1.53. i don't use a third-party plugin and no problem encounter during the installation of dark basic pro and the upgrade 7.4, i have only strange thing, it's the version of my IDE after the upgrade patch 7.4 , i open the dialog box "About" and the IDE show me the version 1.071, normally the upgrade 7.4 it's a cumulative patch ?

My IDE is in french version, i have dark basic pro in french.

For the bug,maybe it's my driver video, i will try another driver video and reinstall darkbasic pro with the upgrade 7.4.

I will test your suggestion with similar box/text commands without Newton.
Cellulo
14
Years of Service
User Offline
Joined: 30th Jul 2009
Location: France
Posted: 1st Aug 2009 22:21
Tiresius , i have changed my driver video and reinstalled dark basic pro with the upgrade patch 7.4 ,but i have always the same problem.

I have tested box/text commands without newton , and it's work fine no flickering text under pure darkbasic pro code.

I have tested on my second pc, i have the same problem of flickering text when i compile the demo 2 or others demos, but i have discovered one thing, when the text flickering, my fps is blocked at 29 no increase at 60 ( 60 in the demo2 code source), i think newton or other thing divide by 2 my fps, but when i change 60 by 120 in the demo 2 code source , my fps is 60 and no flickering text, but when i move the camera , the box text disappear or reappear randomly.

Maybe the problem come from newton with the last upgrade or it's only on my pc

it's a very strange problem maybe others users can say if they have this problem.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 2nd Aug 2009 05:03
Hi Cellulo-
One thing to try is go back to Darkbasic 1.073, 1.072 or earlier and see when it happens. Perhaps there is something funky with the "Backdrop" since that area of DBPro has been touched by the devs recently. Although I would think it would affect us all.

You can also try to "repair" your installation of DBpro and see if that helps but I forget how to do that.

Here is a stripped down version of Demo02 (no newton). Let me know if it flickers for you.


I'm not a real programmer but I play one with DBPro!
Cellulo
14
Years of Service
User Offline
Joined: 30th Jul 2009
Location: France
Posted: 2nd Aug 2009 14:00
Hi Tiresius, i have good news. i have tested:

DBPRO + 7.4 + NEWTON + DEMO2 = text flickering
DBPRO + 7.3 + NEWTON + DEMO2 = text flickering
DBPRO + 7.2 + NEWTON + DEMO2 = text flickering
DBPRO + 7.1 + NEWTON + DEMO2 = text flickering

One thing: i compile the demo 2 and the others with the native IDE of darkbasic pro and i think it's him that produce the flickering bug in the text. i checked the date of the executable file of editor.exe , date : 03/11/2003.(too old for newton)

And i have repeat my test with the new IDE and codesurge 1.3 IDE, all demos work fine no bug encounter, using the upgrade 7.4 and Newton.

I have tested your code example without Newton, with the upgrade 7.4 and i have no bug in the text.

Finally the native IDE work good without Newton and it's good for coding game without physics. But if coders want physic with Newton, the best way is to use the new IDE or Codesurge IDE or maybe this damn bug is just related to my pc.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 3rd Aug 2009 03:57
So just to clarify, using the old editor.exe is what causes the text to flicker? But the code example without Newton does not flicker, even in the old editor.exe ?

That is bizarre. I haven't used the old editor in years.

Do you have the 1.09 patch? And have you cleared out your windows temp and your DBpro temp folders? Perhaps an old DLL is hanging around or something...

Well I'm glad you got it working in any case.

I'm not a real programmer but I play one with DBPro!
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 3rd Aug 2009 13:41
What does ide have to do with text flickering anyways.
I mainly use the old ide (1.09b) and codesurge sometimes and the only flickering occurs when i forget or misuse the sync command.

There is always one more imbecile than you counted on.
Cellulo
14
Years of Service
User Offline
Joined: 30th Jul 2009
Location: France
Posted: 3rd Aug 2009 18:42
Hi Tiresius and CuCuMBeR , effectively the old ide in version 1.09b
don't have the bug and all demos of newton 1.53 work fine. I don't have update my old ide because i have compared with the release date, when i install the french darkbasic pro the editor.exe have the date of 2003 but the patch 1.09b have the editor.exe file with the date of 2002, In reality the editor.exe of the french version 2003 is the first version of the ide.(no 1.09b),maybe when they translate the ide, they make a new executable file, i think that was the last version i have when i installed darkbasic pro in fact no but now my ide is in english language, not a problem

Now the problem is resolute but i don't have tested with this non-official update of the old IDE find in this topic:

http://forum.thegamecreators.com/?m=forum_view&t=29734&b=15

I think i will stay with the old ide in 1.09b and codesurge 1.3, i'm tired to install/uninstall darkbasic pro, try compile demos again with upgrade 7.1, 7.2, 7.3 AAAHHHH.

Now all work fine.

Thanks Tiresius and CuCuMBeR for your help.
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 7th Aug 2009 17:28
Soo, ive made the perfect car finally.

But i have no idea how to artificially drive one of those and any help or ideas will be appreciated.

I need help with the following:

How to steer the car so it faces to a point in space?
How to adjust the speed in order to aid steering as mentioned above?
How to adjust the speed to stop at the point mentioned above?

I have these main variables to control the car.

currentSteerAngle = its the given angle to wheel and its between -45~+45 degrees locally

speed = current amount of force for the torque. (actually i have shifts, but for the sake of making artificial driving simple, i just use a constant speed for now)

There is always one more imbecile than you counted on.
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 8th Aug 2009 00:59 Edited at: 8th Aug 2009 01:04
I'm afraid you're the vehicle expert with DBPro & Newton, so if you don't know.... What you're asking for is fairly advanced stuff. I haven't seen anything in DBPro for this but you can work on it yourself after consulting some AI books. It's not necessarily physics related although that does complicate the situation since we don't have direct control over bearing and speed as much as we'd like.

One thing I've done to make objects react to situations is to state a goal (like certain speed) for the object and check on the progress of that goal (and modify) every loop. If the speed is not at the goal then use forces to increase/decrease the speed until it is where I want it. So I check the speed every loop with Newton.
For a car to stop after a certain distance you can make the target speed get lower and lower the closer you get to the end, eventually the speed will be 0.0 and your code will stop the car.
As for steering and angles, it's something similar. Set a target angle and have your code steer left or right until your car is at that angle.
Tricky stuff but it should be possible.

I'm not a real programmer but I play one with DBPro!
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 8th Aug 2009 11:11 Edited at: 8th Aug 2009 11:16
Too bad less people are interested in Newton wrapper which i believe better than any other solutions for DBPro.

If we could have more people around here who contribute tutorials and such stuff, things would be easier for all of us.

Anyways, ill try to do somethin for my problem and share if i get anything.

But meanwhile, if you or any other c++ guru can make a wrapper for the below thing, then it will be all solved.

A C++ library to help construct steering behaviors for autonomous characters in games and animation

And check this page for java samples of what can be done.

http://www.red3d.com/cwr/steer/

There is always one more imbecile than you counted on.

Login to post a reply

Server time is: 2024-04-19 17:08:44
Your offset time is: 2024-04-19 17:08:44