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 Discussion / Tokamak physics in DBC (enhanced)

Author
Message
aticper
19
Years of Service
User Offline
Joined: 27th Jan 2006
Location:
Posted: 24th Aug 2006 20:31
Hello all.

I'm attempting to program an RTS, and I've been researching ways to try and get some decent physics running within it. I found the Tokamak engine on a list of game making tools, and I was wondering if anyone had any experience trying to use this engine in DBC. I know that someone created a wrapper for it in DBP, but I don't know if it can be used in DBC. I have the enhanced version, so I can load DLL's, and I can load the Tokamak DLL, but I don't know specifically what terms to call to activate its various functions. If anyone can give me a helping hand here, it would be very much appreciated.

Thanks in advance,
aticper

I'm not paranoid. Stop thinking that I'm paranoid!
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 25th Aug 2006 04:21
hi there,

The documentation that comes with the Tokamak API will tell you what functions are available, and what they do - although it is a bit cryptic. Calling the DLL from darkbasic, you would have to use the decorated C++ function names, which is no fun at all in my opinion. I was messing around with it a while ago with the intention of creating a dll that would be easy to call in DBC. I got frustrated because of the lack of documentation available.

I started working with the ODE dll with the same intentions. I got much further on that, and it actually helped me to understand Tokamak a little better. But like so many projects, that one is also sitting in a basement cabinet somewhere.

Anyway, check out this website for some info on Tokamak:
http://www.adamdawes.com/programming/tokamak/index.html

And here is a list of the decorated C++ functions. Reference the API docs to match which function does what with the real function names.



One of the main problems I had was getting pointer information out of the DLL and back into DBC. For the sake of clarity, a pointer points to a memory location where the data you want is stored. From what I can tell, DBC doesn't have any means to reference a memory location. It can send a pointer via memblocks, but I don't know how to make it "look at" or point to a specific memory address.

I was thinking that an intermediary dll - a sort of "buddy" dll - could be created to companion Tokamak or ODE, that could change the reference to a pointer to the hard data and send the data back to DBC as floats, or integers, or whatever, that DBC could use. Once that was done, a series of functions could be written in DBC that would break up the data appropriately based on the prototypes of the original ODE or Tokamak dll function.

Enjoy your day.
aticper
19
Years of Service
User Offline
Joined: 27th Jan 2006
Location:
Posted: 25th Aug 2006 05:43
Thanks you immensely. You've been a great help. I'm going to see what I can do just calling the DLLs and ignoring the more complex systems (ones that involve passing information back and forth in between the command and program) that are unsupported. While I'm trying to work this out, would you happen to know of any, perhaps better documented, third party physics systems that work in DBC?

Thanks again,
atic

I'm not paranoid. Stop thinking that I'm paranoid!
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 25th Aug 2006 09:33
You're welcome!

There's something called Newton floating around somewhere, though I've never been able to find it and therefore never used it. Not sure if it's DarkBASIC classic compatible.

From my own experiments, ODE seems like a viable option. Again, the problem I ran into was with pointers. I can get info into the dll from DarkBasic Classic (DBC), but I have no method for retrieving a pointer from the dll. But the function calls are pretty straight forward. You would have to use memblocks though. If you're not familiar with those, there's a lot of info on these forums.

I ran into errors when using ODE and coding in DarkEdit. I didn't run into the same errors when using the DBC default IDE. Probably has something to do with memory management.

If you were just interested in collision you might take a look at:

http://forum.thegamecreators.com/?m=forum_view&t=31051&b=5

I'd be curious to know your results with using Tokamak if you decide to try it.

Enjoy your day.
aticper
19
Years of Service
User Offline
Joined: 27th Jan 2006
Location:
Posted: 26th Aug 2006 05:21
In terms of "Newton", could this be what your looking for?

http://forum.thegamecreators.com/?m=forum_view&t=50438&b=5



The link you provided looks interesting - I'll check it out.

I'm not paranoid. Stop thinking that I'm paranoid!
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 30th Aug 2006 13:41
Oh yeah, that's the right link! Now I remember, I was trying to download the Newton sdk, and I kept getting interrupted - and since I had dialup, I ran out of patience having to restart the download.

Enjoy your day.

Login to post a reply

Server time is: 2025-05-25 22:08:36
Your offset time is: 2025-05-25 22:08:36