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 Physics & Dark A.I. & Dark Dynamix / Making trees with physics

Author
Message
Ashy
18
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 12th Feb 2008 14:52
Hey guys.

Crysis has inspired me to try and make a tree that you can shoot up. I've modeled and textured one, set all the branch's with some leaves attached and saved them out as individual .x files. Cut the trunk up into sections and saved them out as individual .x files. All models had their local xyz set to world xyz so i can just load them up in the gdk and they will position properly to form the tree. All up about 15 different models with a total of about 1600 poly's (theres a low version too for lod .ect). Now in game i've got the tree assembled, looks good. I've gone and done a dbPhyMakeRigidBodyDynamicBox out of all the models just to see if it will work and when I run the game, BANG, tree explodes sending crap everywhere for miles lol.

So ok, I read something about joints in the manual, went back and made a whole bunch of fixed joints (figure they don't need to move?) assembling the whole tree, from the root base up to the top of the trunk, then attached all the branches to the trunk. Sounds like a plan. BANG! tree explodes. Ok, i go and add dbPhySetJointBreakLimits to the power of like 10000000. BANG! tree explodes.

What is the right way to do this? Is it because I've set the model's local xyz to the world xyz, instead of positioning it where the branch touch's the trunk - for example. Is it because some parts of the models intersect others and then physics goes crazy and flings them apart on start up? I was looking through the advanced machinery demo and noticed it uses a bunch of revolute joints (fair nuff) but it doesn't have a single dbPhyBuildRevoluteJoint() ??? I thought you'd have to have it to "When a joint is built it is entered into the simulation". I removed all my buildfixedwhatever() functions and the tree still explodes.

Any ideas?
Ashy
18
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 12th Feb 2008 15:04
I get a;

Quote: "
Unhandled exception at 0x00378680 in AshTek.exe: 0xC0000005: Access violation reading location 0xfeeeff0e."


When using dark physics but everything seems to run fine still. I have an advanced terrain set up as a phyx static terrain, file saved and loaded to make it quicker. Character controller that works. Guessing my tree is just me not using the functions right?
JerBil
20
Years of Service
User Offline
Joined: 8th May 2004
Location: Somewhere along the Z axis...
Posted: 12th Feb 2008 16:47 Edited at: 12th Feb 2008 16:48
As you may have guessed, physics objects can't occupy the same space at the same time.
I'm not sure how you can position all the tree parts so they look together but are not, but thats the idea.

Heres a thread where someone had a similar problem with objects, so your model is not the problem.
http://forum.thegamecreators.com/?m=forum_view&t=118719&b=30

Ad Astra Per Asper
Ashy
18
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 13th Feb 2008 16:05
Thanks for that bil, thats what i thought.

I've come up with a rough solution in the meantime, took a hell long time to come to since i'm new and basically try every route lol

Ok, I can't make a tree, then export all the limbs individual cos DP just flings em apart (the damn dynamic shapes are waaaaaay too big compared to the .x object!!! and i don't know bout you guys but dynamic mesh don't work for me, even if i save it out it falls through me static terrain). And trying to position them all seperately so none of the DP shapes touch is a nightmare to imagine so i didn't bother with that one.

I tried a whole heap of approaches and in the end i found the simplest and best way to get the results i want is to simply load in all the branches and trunks separately with their xyz set to world location so they all line up and look like a tree when loaded. Then save out a branch as a separate object with it centered in the world xyz - this is basically your hero branch, its the one you see falling, getting blown off .ect So make it look nice and position it on the world xyz in your 3d editor so it will look nice when its sitting on the ground in-game.

Now you make a little sphere and dynamic sphere it (cos that works fricken beautifully in DP) and use sparky's collision ( <-- i want your babies sparky) and ray cast into your many branches you have (so you aim up into the tree and fire) and whatever branch you hit, you position your little sphere there (invis of course) and delete the branch the ray hits, then in a main loop constantly position your hero branch at the location of the sphere and presto!

Works a friggen treat!!! But i have to set up DP materials cos it bounces like a ball at the moment lol.
Ashy
18
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 13th Feb 2008 16:13
Forgot to mention (no edit post button? *looks around* ) In the "firing" function where you raycast the tree... i position the sphere, check if a dynamic sphere exists, delete it, dynamic sphere it then sit back and watch it fall to the ground.. thing is tho, I don't need to delete the dynamic sphere and make a new one each time i fire at the tree.. i can simply do dbPositionObject on my .dbo sphere that gdk made and the phyx rigid body still works perfectly.... but in the manual it sez

Quote: "You will not be able to move this object using commands such as position object."


Is that referring to the dbMakeObjectSphere or the phydynamic one? I assume its both since when you phydynamic DP takes over control of both during the simulation and the only way to move them is sposed to be apply forces to the dynamic sphere yeah?
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 14th Feb 2008 01:13
do I smell a bug?
geecee3
20
Years of Service
User Offline
Joined: 25th Feb 2004
Location: edinburgh.scotland.
Posted: 14th Feb 2008 15:23
there have been changes to darkphysics since the original book of words was written, so you may find that there are some things you can do now that you couldnt before, some of the commands are slightly different as well as some new additional commands that have not found their way into the official documentation yet. this is something you will have to get used to i'm afraid, check through all the DP update texts (for DBP) to see what changes and additions have been made to the system since it was first released.

cheers, grant.

Ohd Chinese Ploverb say : Wise Eskimo, not eat yerrow snow.
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 21st Feb 2008 03:17
You can move an object around - with a phy call - plus you can nudge stuff various ways. Though "Do I smell a bug" - I Smell a FEW and I just got Dark Physics!

Pardon me while I search for answers to what brought me online just now - this whole scaling issue. you Scale an object - then physics still acts like its full size! Same thing with the DarkGDK ObjectSize commands etc. UGH!!

Login to post a reply

Server time is: 2024-05-19 23:27:05
Your offset time is: 2024-05-19 23:27:05