Using Tok + Blitz Collision, will it work?

Blitz3D Forums/Blitz3D Programming/Using Tok + Blitz Collision, will it work?

OrcSlayer(Posted 2005) [#1]
I'm getting close to the point where my game engine is going to start taking shape, and one thing still concerns me: The particle system. I want to have particles that can interact properly with the enviroments, like spent brass bouncing off surfaces properly, etc...

However, for the game itself, I want to use simple Blitz collisions. In other words...
Entities on Entities = Blitz Collision
Entities on Environment = Blitz Collision
Particles on Environment = Tokamok?

Is this possible, and would it cause problems to use the two systems at once? I've never messed with Tokamok, but I'm willing to learn what I need if it can do what I want with particles without interfering with the normal blitz collision system, and without causing any slowdowns, etc.

Please let me know if this is a good idea, or if there are better alternatives.

-Orcslayer


Sweenie(Posted 2005) [#2]
To tell you the truth I'm not very impressed with Tokamak's particle-system.
I think it's slow.
You're probably better of writing the particle-system yourself.


Sterling(Posted 2005) [#3]
Yep, work together really well, I'm using tokamak for those entities that use physics and blitz collisions for static entities that dont move. At this stage I haven't really experimented with large amounts of entities and whether there is a huge perfomace hit from using both systems.


Danny(Posted 2005) [#4]
I let tokamak do all my collisions (100's of objects + static mesh) including particles. The cool thing is for example you can actually have smoke go through the chimney, etc. Have flames and smoke be affected by wind, have dust be affected by someone throwing rocks through it, etc.

I do set the Blitz entityType (and pickmode) for objects because in that way when I do a line pick for example, the collision response type from blitz tells me if it's an object, the player, an npc etc.

I give each entity a name$ that is it's type handle(), so in that way I can track back very quickly what kind of object it is, and access it's type to get whatever info on that unique entity..

But I keep blitz's Collision table empty to prevent blitz waisting time on calculating collisions that tokamak is doing...

d.


OrcSlayer(Posted 2005) [#5]
But wouldn't it be a nightmare to do FPS characters with Tokamok? Having a character stay upright seems like it would be nearly impossible...


RGR(Posted 2005) [#6]
OrcSlayer, this is one of those remarks when you as reader believe you are in a nightmare and not in a programmers forum...
Having seen the ragdoll example you think everything in Tokamak fells apart? Why don't you experiment a bit more with the examples first - look at other places (eg playerfactory forums) what others have achieved with it. You soon will find out that your particle engine is very likely possible if you use tokamak in an intelligent way... its a question of balance and effort you want to invest.
And then you will find out also that the Tokamak programmers were no idiots that had only in mind to produce matchstick men with the ability to play death ;-)


RiverRatt(Posted 2005) [#7]
RaGr; You should take up story writing. That responce was extremly articulate. I love this part "OrcSlayer, this is one of those remarks when you as reader believe you are in a nightmare and not in a programmers forum..." LOL

Orcslayer: Ya once you get into Tokamak, it realy handles things nicely.
Here is a very basic example I did. It was my first thing in tokamak, realy just and expansion of one of the examples, and Bottbuilders code and comments on blitzcoder, and a hackjob of Marks camera in the castle demo. Sorry its kind of messy. Also in a real game I am working on, I am doing a FPS using censors, and is quite stable, and fast, and I use blitz collitions as a backup to tokamaks, and it works ok.




OrcSlayer(Posted 2005) [#8]
Well, first off, let me explain one thing...I have very little knowledge of Tokamak, and I had heard some intimidating things about it so I wasn't too sure it would be suitable for what I want. However, I've done some research and I think I'll give it a shot. I downloaded the Tokamak DLL and the blitz wrapper, but it doesn't work for some reason. Did everything you're supposed to with lib's like this, put both DLL's in the blitz userlibs folder, put them in the folder with the examples I'm trying to run, and I still get the user lib not found error. Anyone know what's wrong here?


RiverRatt(Posted 2005) [#9]
That is the or was for me the hardest part, just getting it to work. I don't know if this is completly correct but it worked for me.
Try puting all these files in the blitz userlib folder.
TokamakWrapper.dll
tokamak
tokamak_m
tokamakdll
demolib.decls
Tokamak.decls
tokamak (C header file)
tokamak_d
tokamak_md
tokamakdll.dll

Put them straight in, not in another folder.
Then when you look at the blitz start screen you should see the Tokamak command referance along with the rest of the normal help files. Then try typing in a tokamak comand. it should highlight like a normal blitz command. Again I am not sure all those files are needed or mabye more are needed but I have had no problems. One mor thing you need to be sure of is that you are not trying to run an old example. They don't always work with the new version of tokamak.

Also make sure you have the TokamakWrapper.dll and tokamakdll.dll in the same folder as your code, not in a folder like userlib. Does that make any sense at all?


RiverRatt(Posted 2005) [#10]
Ok I had to look it up again.

"Tokamak Headers and Lib
-----------------------
The only headers you require to integrate Tokamak into your application
are under the (root)/include directory. That is, TOKAMAK.H and all the maths
and inline maths headers. The only library you need is TOKAMAK.LIB
under the (root)/lib.

tokamak.lib single threaded version
tokamak_d.lib same as tokamak.lib.
tokamak_m.lib is multithreaded version.
tokamak_md.lib same as tokamak_m.lib.

Sample Framework
----------------
The sample programs are inherited from the sample framework, but the sample
framework is not part of the Tokamak library. To see how to use Tokamak,
study the sample1-sample10.cpp and the samplebase.cpp."
This is from the readme files in the wraper documantation folder. I forgot maths and I think of course you need to put the wraper docs in the blitz help folder if you want the comand referance on the blitz start screen.


OrcSlayer(Posted 2005) [#11]
Hmmm, I put all of those files into the Blitz userlibs folder and the folder with the samples I'm trying to run...this is frustrating.

Perhaps the 1.2 demos aren't compatible with the 1.22 library? Seems to hang on the first Tok command every time...


Raitsun(Posted 2005) [#12]
hmm.. i'm trying to get Tokamak to work all the time.. can some who is using it say exactly what file has to be put where?


OrcSlayer(Posted 2005) [#13]
This is annoying...I had it working once a long time ago but I just took a quick look at it then, and have reformatted my computer since then. Now that I really want to get into it...it won't work.


RiverRatt(Posted 2005) [#14]
Ok, I have had some sleep and I will try this again.
First go here and make sure you have the latest versions of Tokamak and the Tokamak wrapper.
http://playerfactory.proboards25.com/index.cgi?board=tokamak&action=display&num=1075570526

Then open the blitz folder from Mycomputer>c>program files>blitz. Do not run blitz, just open the blitz folder.
Now open the userlibs folder, and minimize it. Now open the Tokamak folder. You should see these folders there:
documentation
lib
include
tools
and you should see two readme files. Open the one that says readme and verify that it says:
Tokamak Game Physics SDK Version 1.2.1
Now close that or read it if you want.

Now maximize the the blitz userlibs folder.
Copy and paste all the contents from the Tokamak lib folder into the blitz userlibs folder. Those should be...
tokamak
tokamak_m
tokamakdll
tokamak_d
tokamak_md
tokamakdll.dll

Now in the tokamak folder go up 1 leval, and open the include folder. You should see Math (folder) and tokamak C header file. Copy and paste both into the blitz userlibs folder.

You can close the tokamak_lib folder for now but keep the blitz userlib folder open.

Now open the twrapper06 folder, and read the readme txt.
Now copy and paste the files from the twrapper06/userlibs folder:
Tokamak.decls
TokamakWrapper.dll
into the blitz userlibs folder. (I did not have to link as the readme says but you might.)
Now Tokamak is installed, but there is one more thing you can do.
Go up 1 leval in the twrapperv06 folder, and open the Documentation folder, as the readme says copy the help folder into the Blitz 3d folder (not the blitz userlibs). And thats it. Its installed.

One more thing though. For conveniance I put the twrapper06 folder into the blitz samples folder. This might be why I did not have to link it, but I am not sure. And then all my Tokamak projects are located in the sample folder of twrapper06 that already has the DLLs you need to include with your games.


OrcSlayer(Posted 2005) [#15]
Well, followed that to the letter...nothing.

One thing I noticed, I can't get version 1.2.1 that you mentioned, the tok site only has version 1.2.2. I'm not sure but maybe I can't make it work because the wrapper is for version 1.2.1, not sure how that works but it's a guess. Could that be it?


Raitsun(Posted 2005) [#16]
It still doesn't work... have tokamak v.1.22... see no chance to get v.1.21 cause you can download the newest version only, on the tokamak website...


RiverRatt(Posted 2005) [#17]
Did you do this?
"This distribution include Tokamak in DLL format. To use TokamakDll.dll, include the header file
Tokamak.h, and define TOKAMAK_USE_DLL in your compiler setting, and link TokamakDll.lib." from download page

That's a bummer. Try emailing Sweany or ask at the player factory.

I think you just need to open the blitz command line (click program > command line), type TOKAMAK_USE_DLL . You may also need to put Tokamak.h with your game and type Include "TokamakDll.lib". I might have that backwards though.


OrcSlayer(Posted 2005) [#18]
I guess I'll email Sweenie, nothing here is helping. This is frustrating, I hear ODE is easier to work with but not as stable so I really want to get Tokamak working.


Raitsun(Posted 2005) [#19]
It works now...
http://www.blitzbasic.com/Community/posts.php?topic=46395

Raitsun