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.

Author
Message
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 17th Nov 2007 23:26
Hey,
Ok, here's the problem. I have one large static mesh for my world, which works great, but now I want to have separate static mesh's for each ship (just start with one for now though), so they can be manipulated separately from the world.

You may know that static mesh's cannot be positioned, rotated, or scaled. This creates a problem because, as you well know, ships move. My current work around for being able to load the ship with the right scaling, rotation, and position right now is to load the original model, attach it as a limb to a cube at 0, 0, 0, save that using save object, then load the adjusted object and use that as collision, but obviously this is impractical to do every time the ship moves.

So my question is, is there some other workaround that would work? If not, will there be in the next upgrade, and when will that upgrade be? If not, what other collision system should I use for ships? Thanks.


Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 18th Nov 2007 01:43
I think you use kinematic objects for this application, no?

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 18th Nov 2007 01:49 Edited at: 18th Nov 2007 02:17
Sorry, don't know what you mean by kinematic objects ? Is that something in DP? I'm using character controller, btw, despite what everyone says about it, it works fine for me .


vorconan
18
Years of Service
User Offline
Joined: 4th Nov 2006
Location: Wales
Posted: 18th Nov 2007 11:41
It's where you can manually control an object's position and rotation, the example should be in this path, "projects\dark physics\demos\rigid body\kinematic objects".



Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 18th Nov 2007 16:35 Edited at: 18th Nov 2007 16:39
Quote: "It's where you can manually control an object's position and rotation, the example should be in this path, "projectsdark physicsdemosrigid bodykinematic objects"."

Ahh, ok, thanks, I'll check it out. Will it still work like a static mesh working with camera controller?

EDIT: It seems that only works with dynamic mesh's, but I need it to work with a static mesh, because I can't use a dynamic mesh with the ships for two reasons, a) it's too slow, b)they get an error that I can't collide two convex mesh's.


BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 18th Nov 2007 17:31 Edited at: 18th Nov 2007 17:32
What's the purpose of ships in your game? Can they collide with other ships, and be hit by cannon fire? Depending on how accurate you need to be, you could construct the rigid body representation from boxes and convex meshes.

Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 18th Nov 2007 17:48
Quote: "What's the purpose of ships in your game? Can they collide with other ships, and be hit by cannon fire? Depending on how accurate you need to be, you could construct the rigid body representation from boxes and convex meshes."

Yeah, they can collide and be hit by cannon fire. So how would I create a rigid body representation from boxes and convex meshes? Would this be efficient speed-wise? Would it work with camera controller? Thanks for the help.


BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 18th Nov 2007 21:28
You need to find a way of representing them that is accurate enough for the game to work, without destroying what the user perceives. For example, many commercial first-person titles use a simple capsule to represent the player, because the perception of the user is not diminished in any way by this. Making a perfect mesh collision would not improve the player's experience, it would just make the game slower.

So maybe you can "glue together" a few rigid body primitives that make the collision accurate enough, without killing the frame rate.

Maybe plains would help. Use a box for the main section of the ship, and a small number of plains for the hull.

thebulk71
18
Years of Service
User Offline
Joined: 2nd Jan 2006
Location: takin a poop
Posted: 18th Nov 2007 22:52
hmmm... BatVink seems to have a good idea there. I can imagine that this would work quite well.
I believe that the Newton physics engine comes with an editor that allows you to make a collision object out of primitives for complex dynamic objects. Should be 'doable' in DP, though it would be with rigid bodies, not static meshes.
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 18th Nov 2007 22:56 Edited at: 18th Nov 2007 23:00
Quote: "Maybe plains would help. Use a box for the main section of the ship, and a small number of plains for the hull."

hmmm...ok, but what would I use? Dynamic? Wouldn't using rigid body dynamic physics objects make them go wacko when they collide with something? And how would I attach them to the ship? Would I just have to manually define their positions in relation to the ship and attach them as limbs? Seems like a pain .

EDIT: Also if you don't mind could you give a small simple example, because I don't see how a) I could attach physics objects as limbs if that's what I'm supposed to do, b) how they won't go crazy whenever something collides with them, and c) how to know where to offset the limbs without manually finding out in game. By the way, all I really want it for is collision with the character controller, I can find other ways to simulate collision with other ships or cannonballs, if that makes a difference. *sigh* would be so much easier if they just let you move the static object.


BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 19th Nov 2007 01:03
You connect rigid bodies with joints. You would make your rigid bodies in the correct positions, then make fixed joints to attach them. This shows 4 primitive objects attached to each other...



Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 19th Nov 2007 11:41
If you could move a static object then it would essentially become a dynamic object I think that you're going to have to think outside the box here, where Dark Physics is concerned.

Essentially, you want ships that can move, collide, and battle accurately. I wouldn't actually turn the ships into physics objects at all.

I'd use Sparky's collision for the ships. For cannonballs, I'd use Sparky's + Dark Physics. Essentially when you fire a cannonball Dark Physics controls it and you can test for accurate collisions with the ship.

Moving the ships with Sparky's would be very easy. You'd set each one up for polygon collision, and if it's on screen update it's collision each time it moves. I'd divide the ship into limbs based on what areas could take damage. Each loop I'd position a collision box at the limb position. If the two ships collided or a cannonball hit, then I'd check the limb collision boxes and proecess the results based on which part was hit. You'll have to do this yourself anyway, Dark Physics would do nothing for you where this is concerned. I'd then transform the limb into a damaged section and generate rigid body debris at the location of impact.

I don't personally see the benefit of each ship being a rigid body. You'll have to code the ship's behaviors yourself, you'll have to manage the collisions and damage yourself, and it presents all kinds of problems. The most it might do for you is make it float on the water but you could effectively code this behavior yourself. Besides, if it did float it would probably tip over every time you tried to turn.

If the ship became badly damaged, you could just it into a rigid body and let it bob around in the water.

I think that using rigid bodies for ships in this would be the equivalent of using rigid bodies in a space combat simulator - unnecessarily complicated. It makes sense to me to simplify things to give you the results that you need.


Come see the WIP!
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 19th Nov 2007 22:32
@BatVink: Ok, thanks, but Cash seemed to address the concerns I had about it, like the fact that it would tip over every time I turned .

@Cash:
Quote: "I'd use Sparky's collision for the ships. For cannonballs, I'd use Sparky's + Dark Physics. Essentially when you fire a cannonball Dark Physics controls it and you can test for accurate collisions with the ship.

Moving the ships with Sparky's would be very easy. You'd set each one up for polygon collision, and if it's on screen update it's collision each time it moves. I'd divide the ship into limbs based on what areas could take damage. Each loop I'd position a collision box at the limb position. If the two ships collided or a cannonball hit, then I'd check the limb collision boxes and proecess the results based on which part was hit. You'll have to do this yourself anyway, Dark Physics would do nothing for you where this is concerned. I'd then transform the limb into a damaged section and generate rigid body debris at the location of impact."

Ok, good idea, I was thinking of using Sparky's for ships. The problem I had with sparky's last time I tried it though is that I could only have a radial collision with spheres, meaning my collision radius would be as large as I was tall . I guess I could try using just a box for that instead though.

Thanks for the help, I'll let you know how if I have any more problems .


Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 20th Nov 2007 15:44 Edited at: 20th Nov 2007 15:50
I only use sphere collision on spheres, which is next to never. Sliding collision uses spherecasting, but I only use that for characters, plus sliding collision would look silly for ships. For the ships I'd use either box or polygon, depending on the shape. Probably polygon since they're going to be able to collide.

If you put together a tech demo of the ships I'd be happy to help you with it - setting up the collisions and movement and fighting, but stripped of most of the rest of your engine (designed to be dropped in as is and it works). I have some pretty decent pseudo car physics programmed and I think they'd work nicely with ships. I'm eventually going to code the limb collision system myself because I'll need it for my bosses in Geisha House so if I can help you out with your project then it would be well worth my time.

If you need help setting up the ship limbs I can do that too, I just need a diagram of the collision zones you'd want.


Come see the WIP!
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 20th Nov 2007 21:52 Edited at: 20th Nov 2007 21:57
Quote: "I only use sphere collision on spheres, which is next to never. Sliding collision uses spherecasting, but I only use that for characters, plus sliding collision would look silly for ships. For the ships I'd use either box or polygon, depending on the shape. Probably polygon since they're going to be able to collide.

If you put together a tech demo of the ships I'd be happy to help you with it - setting up the collisions and movement and fighting, but stripped of most of the rest of your engine (designed to be dropped in as is and it works). I have some pretty decent pseudo car physics programmed and I think they'd work nicely with ships. I'm eventually going to code the limb collision system myself because I'll need it for my bosses in Geisha House so if I can help you out with your project then it would be well worth my time.

If you need help setting up the ship limbs I can do that too, I just need a diagram of the collision zones you'd want."

Great, I'll see if I can put something together with ships to get you to help me out with . Thanks for the offer . How much do you want done in the tech demo? Obviously movement, but do you want me to give you what I have for collision now? Or do you want me to attempt to use sparky's, or just not have any in at all? Also, do you want cannons for combat? I'm really more concerned about collision for now, but it wouldn't be a big deal if I worked on combat now too .


Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 20th Nov 2007 23:28 Edited at: 20th Nov 2007 23:29
How about this - put in the water and two ships (in a way that is easily scalable to more ships), the ability to move and the ability to fire cannonballs. No collision is necessary at all. Physics are only necessary if you want the cannonball to look good when it fires. Basically, make it look about how you want and move, but no collision. You probably aren't in the mood to make the cannons functional but I'd rather just make all of the collision work in one go.


Come see the WIP!
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 21st Nov 2007 02:44
Quote: "How about this - put in the water and two ships (in a way that is easily scalable to more ships), the ability to move and the ability to fire cannonballs. No collision is necessary at all. Physics are only necessary if you want the cannonball to look good when it fires. Basically, make it look about how you want and move, but no collision. You probably aren't in the mood to make the cannons functional but I'd rather just make all of the collision work in one go."

Ok, sounds good . I don't really care about the water physics, I can easily program something to simulate that. Cannon should be easy, seeing as I already have the code for it . I'll email you when I get it done, which could be a few days since family is in town for Thanksgiving. Thanks again for the offer for help.


Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 30th Nov 2007 22:17
Cash, I've emailed you, and just wanted to confirm you got it? I emailed to cash.curtis-at-gmail-dot-com.


Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 1st Dec 2007 03:11
Hey, sorry for the delay, I'm e-mailing you back.


Come see the WIP!
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 1st Dec 2007 03:13
Ok, thanks, no problem, take your time .


Login to post a reply

Server time is: 2024-11-24 20:49:22
Your offset time is: 2024-11-24 20:49:22