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.

Dark GDK / physics attempt

Author
Message
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 20th Sep 2007 19:03
I was just talking to a member here in 3d chat about physX, and how there is nothing for GDK yet. He mentioned making a linker class to basically copy the physX object properties to the GDK object. I'm thinking of giving this a shot to allow us the use of a physics engine, anyone doing anything like this?
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 20th Sep 2007 19:37 Edited at: 20th Sep 2007 19:38
That sounds like a C#'ish solution. I forget if you're C# or C++ Unitech?

I would think any C++ libs out there - like Newton, PhysX and maybe that (not free) one you see advertised here call "RotorCraft" or something - (Heli Physics) - should all be simply learning the headers/docs and calling them directly - with the correct params. Going back to why I chose C++ (Even though I knew I'd have to finally REALLY learn the $%@#%$ language) I knew it would be fastest and that it would allow me a bigger selection of "things" I could code against and link to.

You always hear things like "Partially implemented" for Dark this or there is a wrapper for most of that etc. With C++ - (In theory) It's just a matter of what you want to use. And frankly - I almost bought the C# AFTER I had C++ for ease of use but now that I'm getting better with it and from tips from IanM and you guys and the net - I'm starting to feel quite content with it.

In fact - between IanM and other C++ old hands - I'm learning about even more possibilities to write things - from design perspective etc - so I have a ton of options - and my main reason for going on and on is because - Physics engine tend to slow ya down - but look great or at least very promising - and I'm trying to HINT that for the best performance using that stuff - the Nitrous fuel seems to be in the C++ and add the compatibility with many free libs and pay-for-ones - seems the way to tie in your physics to me. (No prep work)

Jason P Sage

unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 21st Sep 2007 04:58 Edited at: 21st Sep 2007 04:59
Oh my... For the love of all that us holy. No not C Flat, I mean c++ ++ I mean C sharp or is that C#, .. Leave it to m$ to take a perfectly good language and turn it to crap. OH I guess I may not make friends saying that. Ok to each there own then. Yes I'm writing in C++

I just don't see this an easy task, tying a physics engine in but I may be underestimating it. Are you saying its been done? I have not found a topic on it yet.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 21st Sep 2007 05:27
(hehehe) (first part) Um... No tying in physics isn't easy - but seeing how you're C++ - in theory ... um "We" should be able to link directly to the real deal - no middle man.

Easy... Well the physics lib alone is tough no matter how you get there...at least from what I read - and for newton - it can go bannanas pretty easy if it gets bumped to hard - just try the demos and throw the rag doll around - or the ant creature wooden thing - you'll see... anyway gotta crash...

but I have made my own "Sorta physics" for my game - dead reckoning on what looks reasonably correct. Many would be like ICK - but - less processing, more "controlable" - perfect - NOT - works for me! Using Timing (timer driven movement) and a special 10th Second fixed "Physics Timer" - I can get decent enough response. Eventually I may switch - but not the way I see many physics engines slow down when underload especially considering the scale of action I'm shooting for.

Red Ocktober
20
Years of Service
User Offline
Joined: 6th Dec 2003
Location:
Posted: 21st Sep 2007 14:32 Edited at: 21st Sep 2007 14:48
not being too sure if i will be able to successfully implement physics into my gdk version is one reason i'm simultaneously developing a version of my engine in 3Impact... the built in physics (i think it's based on ode) is the easiest implementation i've worked with yet...

and more and more i'm seeing games with real time physics as part of the gameplay or where it contributes to the immersion factor...

i was up late one night this week with another dev on the forum over there getting familiar with the ins and outs of some simple physics in a small project, and once we got it down, the results were most seductive... and fun...

if anyone is interested, the thread is here... http://www.3impact.com/3Impact_Engine/forum/index.php?topic=2200.0



i'm sure there should be a way to implement an existing physics lib into the gdk without too much grief... nothing too complex, mind you...
i'll be looking into that real soon myself... as a matter of fact, i'll be searching the forum threads here on the topic today...

************ added ************

ok, here's one brave soul who's going the ode route...
http://forum.thegamecreators.com/?m=forum_view&t=114171&b=22



--Mike
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 21st Sep 2007 22:24
This has come like a bolt out of the blue ... but I have to say a most welcome one .. I was starting to think I was the only one out there interested in getting a physics engine up and running in DARKGDK.

First and foremost, I'm no C++ programmer, but have had some considerable C programming experience in the past so moving from Dark Basic to C++ seemed a really sensible move as C++ IMHO combines the best in speed with superb object oriented functionality.

As I couldn't find any evidence on the forum of anyone successfully integrating a physics engine into DARKGDK I decided rather than tackle the raw ODE interface straight away, I'd see if I could port what I had done so far in Dark Basic using the ODE plug-in.

My initial approach, much along the lines of Jason's comments, was to simply add the readily available source code for the Dark Basic ODE plug-in into my project and statically link it into the ODE libraries, after all they are both written in C++. However, as Red has indicated via his link to my previous thread on this matter, I have hit problems which I have still no managed to surmount seemingly to do with the calling convention used by some of the code encapsulated in the ODE library.

So I decided, seeing that all of the source code is available for ODE to build my own static library and include that in my project. This initially seemed to work and except for having to use /FORCE:MULTIPLE to resolve some run time library conflicts I encountered, produced no errors. However, I soon encountered problems when attempting to call ODE_GetBodyLinearVelocityY function. This just hangs the ODE Loop and the only debug info I have managed to get is a simple text output of the first value returned which is nonsense. Attempts to do any serious debugging just seem to hang the app.

My new stance, is to remove the requirement to link to the static libraries altogether by including all the source code in my project so I can hopefully build a debug version that is stable. I am currently in the middle of doing this and whittling down the number of initial build errors. I'll let you know if I succeed.

By the way, I also had to fix various issues with the Dark Basic ODE Plug-in code which failed to compile initially in Visual C++ 2005 Express including modifying a couple of functions which I could never see as having worked, so perhaps there are issues with the maintenance of Code or different compiler issues!

Anyhow, sorry to babble on so much, would be really interested in any input or experience you guys could provide.

I have to say, I'm not entirely convinced I'll stay with ODE. If I can't eventually get the eliptical and or trimesh to trimesh collision up and running then I'll probably be looking else where. Does anyone have any feedback on Newton, Tokamak or PhysX (now that its free)?

No matter how good your code is, someone will improve on it
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 21st Sep 2007 23:47 Edited at: 22nd Sep 2007 01:00
Quote: "as C++ IMHO combines the best in speed with superb object oriented functionality."
My humble opinion is FreePascal - but only directx headers work - DarkGDK won't do it. (Has better OOP) More atomic inheritance control and reads a whole lot easier, faster and better for parallel programming than C++ could ever be without a complex add-on library written for it. Unfortunately - no complete Game Engines work for it - only DirectX Directly, OpenGL, and many other things - C++ for me for now Actually liking it more that I'm into it now - but no matter what you code - physics are a pain in a few places usually clothed.

<can you tell I'm a fan!> Thats why I bought FreePascal - to link with DarkGDK but they made it impossible!
[edit] Um This sounded funny when I reread it... Let me fix the above sentance but keep it in tact for others to laugh at[/edit]
(What I meant)
<can you tell I'm a fan!> Thats why I bought DarkGDK - to link with FreePascal but they made it impossible!



Ok feedback - I've HEARD - Newton - Great - Some People Love it - I've seen the demo go whacky and others have had that problem in their projects. Something also about character movement is a pain - and DarkPhysics is supposedly better - but the Release for it is not out for connecting DarkPhysics to DarkGDK though I hear its coming or is in the works or something - the Tomaky or whatever engine has some nice looking demos and SEEMS more stable from Norton but I don't know how it fairs for speed. The ODE one I heard on these forums is a simpliefied physics engine not really good for a lot of things - just newtonian physics - rocks faLLING and that kind of thing. I Like Newton's Vehicle thingy and I heard that dark physics has vehicles but I also heard gripes about it never being updated and only having 4 wheel vehicles not treaded, 3 wheel, 2 wheel, or a programming way to have as many wheels or whatever.

I know programming one and programming for one (integrating a game) are both a pain. Especially how you need to set up two "worlds" the physics one and the visual... link and let go kinda.

That's my two cents for now - thanx for this thread - I'm very curious what people say here because I do not want to waste time ripping my game to nothing and rebuild wiuth a physic engine just to have nightmare after nightmare wishing I didn't bother (Can't blame me...already in a rewrite for DarkGDK from DarkBasic)

[edit]I just got an Emailed response to the above stuff - but when I click the link .. there is nothing below this message - tried multiple times - is there lag? Save Msg, Email, then shows up for others to read? [/edit]

Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 22nd Sep 2007 00:46
Thanks for the feedback Jason, the only evidence I've seen of Newton in action was in the freeware game Penumbra, and I have to say, it looked very impressive in that. As for ODE, I have heard a lot of criticism from some people, however, the recent top selling game S.T.A.L.K.E.R. Shadow of Chernobyl used ODE (or a modified version of it) and that’s one of the best games I've played in a long time. So I guess a lot is down to how people choose to use the tools and how inventive we are with them.

As for PhysX, I just got my registration confirmed by Ageia and have downloaded their SDK, so I'll be looking at how easy that might be to integrate into DARKGDK in the near future. Unless the powers that be decide to give us a working version of DarkPhysics in the meantime (I'll gladly pay for it).

Currently, I'm just exploring possibilities and have no volume of existing game engine code, so its a prime time to experiment a little with the available Physics engines before making any firm decisions. I'm not looking to write the next Crysis, so a simple physics engine will probably suffice, so long as its stable!

I take your point though, if I had an existing games engine coded I would be extremely wary of ripping it apart to integrate a third party physics engine unless I was completely convinced of the benefits.

Regarding FreePascal, I have never come across that before but you make it sound very interesting! However, having a foundation in C already and C++ being an industry standard, I think I'll invest my time in that. I don't have the time or the desire to program the DirectX API directly!!! Being able to access the power of DirectX through DARKGDK gives me just what I need. The guys at The Game Creators have done a great job with this!

No matter how good your code is, someone will improve on it
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 22nd Sep 2007 22:22 Edited at: 23rd Sep 2007 11:17
Some progress to report. I have managed to get a reasonably stable version running that I can now use to debug the various issues I'm encountering.

I have fixed the initial problems I was getting with some of the DBPro ODE function calls by modifying them. As a result I now have a running ODE loop within DARKGDK with active gravity and dynamic objects which fall.

Trouble is they keep falling ... right through my static objects so clearly collision is currently not working!!! Curses ... just when I thought I'd cracked it ... lol

Will update you all again when I've managed to fix that.

By the way unitech, I'd be interested to know if you're still planning on having a go at integrating physX!

No matter how good your code is, someone will improve on it
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 23rd Sep 2007 22:31
I'm pleased to say that I now have the DBPro ODE Plug-in commands up and running in DARKSDK. The code needs a little tidying up and some more testing to check the rest of the features I haven't used as yet but essentially it's there!

I can load a 3D World Studio Level and Collision Mask and navigate within it will full collision and dynamic physics.

I'm back to work tomorrow but hopefully should have this finished and packaged up by the end of next weekend. Would be nice to just produce a DLL or a static library that others can link into along with a header file listing the functions and their descriptions, or if preferred I could provide full details of how and what source code to include and compiler / linker settings.

I would like to emphasise that this is essentially the code from the ODE Plug-in originally produced for DBPro and not my own implementation of the ODE Interface, I have just tweaked and persuaded it to work with DARKGDK and Visual C++ 2005.

Let me know if you are interested.

No matter how good your code is, someone will improve on it
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 30th Sep 2007 02:24
Latest update on my progress.

I now have it working from a single library file and an associated header allowing anyone to include these in their projects and static link to it. Apart from a slight problem with surface friction, which I think I have a good handle on and am hoping to have fixed sometime tomorrow, I'm just working on getting Bat Vink's excellent 'Ball and Wall of Blocks' example (from DBPro) ported as an example to accompany the library.

The first release will be a debug version of the library, as I'm still getting unexpected crashes with the release version. The debug version seems really stable though and will at least give everyone an opportunity to play around with Physics in DARKGDK whilst I try and resolve the outstanding issues.

All being well I should be posting the library and documentation on here tomorrow.

No matter how good your code is, someone will improve on it
unitech
17
Years of Service
User Offline
Joined: 27th Jun 2007
Location:
Posted: 30th Sep 2007 05:50 Edited at: 30th Sep 2007 05:51
Great news Pixel Perfect, glad to here it...


I started a new project here a bit a go, and have not used any collision or physics in it yet. Ill give the debug version a go and see if I can give you some feed back.
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 30th Sep 2007 12:44
Thanks for that unitech, that would be great!

No matter how good your code is, someone will improve on it
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 1st Oct 2007 01:13 Edited at: 1st Oct 2007 01:15
Ok, here it is. Please see the header file for the function prototypes and the accompanying text document for instructions on linking to the library. I have also included a C++ ported copy of Steve Vink's classic ODE demo program for DBPro.

I have not provided any detailed info on the available functions as there is quite a bit of code knocking around on the forums for the ODE Plugin for DBPro. These illustrate the use of the library functions quite well.

Have fun and enjoy!

No matter how good your code is, someone will improve on it

Attachments

Login to view attachments
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 6th Oct 2007 20:04
I'm pleased to announce that I now have a new build containing both Release and Debug Libraries. I have also managed to reduce the size of the Libraries.

The zip file includes updated instructions and the original demo file. This now supersedes the previous release.

No matter how good your code is, someone will improve on it

Attachments

Login to view attachments
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 6th Oct 2007 21:39


Now I can do 3 things.... buy GDK for C++, wait till somebody puts it in .NET or try to do it by myself

Niels Henriksen
Working on a (MMO)RPG right now in LightEngine
http://noggs.netopcom.dk/forum/default.asp - Forum for the game
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 6th Oct 2007 22:31
Niels ... ApexNow has already produced an ODE plugin for .Net! I've no idea if it's based on the ODEDBPro dll plugin, as mine is, but the link is below:

http://www.apexnow.co.uk/ode-physics.net-v1.1.rar

No matter how good your code is, someone will improve on it
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 7th Oct 2007 11:38
oh... thanks

Niels Henriksen
Working on a (MMO)RPG right now in LightEngine
http://noggs.netopcom.dk/forum/default.asp - Forum for the game

Login to post a reply

Server time is: 2024-11-19 16:35:03
Your offset time is: 2024-11-19 16:35:03