Jump to content

1 step to having a 'from scratch' AFV in-game


Chilibird

Recommended Posts

Howdy all,

I've got my 3 .cob files. I've got a .physicalobjectgroup file. I've got .obj collision files. And it shows up in game.

Here is the problem.

First of all, it shows up badly distorted. (Literally, all twisted, ect). Is there something I should have done when exporting the model from blender? (All I did was save the model parts as google earth files, opened them in blender, and saved them as .cob files) They were saved with the appropriate points on the Axis in sketchup.

Second.. I'm still confused as to these collision models. I hear stuff about .bmp files, and naming, ect. Basically, I have 2 sets of 6 obj files. One set for the Chassis, and one for the turret. I didn't do anything special with these. Just opened em in Sketchup 5, deleted all faces/lines that weren't considered 'front', and export as .obj. Repeat 5 more times for each side.

They are named RamsesCollisionBack, RamsesCollisionFront, ect ect. Is that the correct naming convention?

And if I'm right, to throw these in, I use the <collisionmodel> tag in place of where all of those <collisiontriange> tags are. Or do I need to use something like <frontcollisionmodel>? (Sorry, I'm having a hell of a time with this xsd stuff, can't find a way to view em on OS X.)

Once I get this model stuff figured out, I should have a prelim screenshot of the model in-game at least. Then I'll get to making a nice texture for it, ect.

Link to comment
Share on other sites

It sounds like in one (or more) of those many conversion steps, the transformations for the model's primitives got hosed up. Since it sounds like you're able to export .obj files, why not just use those for your model? You do not have to use .cob files.

For the collision models, you do not need to do anything with image files of certain names. That was only for the CobDump tool which you don't need to use since you're using collision models instead. You use one tag for each of your 6 collision models for each object, like this:

</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;"><CollisionModelFront>RamsesCollisionFront.obj</CollisionModelFront>

<CollisionModelRight>RamsesCollisionRight.obj</CollisionModelRight>

...</pre>

Link to comment
Share on other sites

Sounds good tah me.

Now then, 2 questions/problems.

1- When referencing 'origins' ect, what is that relative to? A given point on the Chassis?

2- My Chassis doesn't like showing up. Everything else will, but there is a lack of Chassis. Could this have anything to do with the "animations"? What do those have anything to do with, anyways? (The "basemodelname" ect)

Actually, something that'd be nice is a list of what we do/don't need with a file created using .obj files/collision models vs .cob files/collisiontriangles.

Only other thing I'm having a problem with is figuring out how to go about texturing the danged thing. I figure it's an export option somewhere, but I have yet to find it..

[ September 17, 2006, 04:56 PM: Message edited by: IcemanUSA ]

Link to comment
Share on other sites

The origin for a particular physical object (e.g. a chassis or a turret or a gun, etc.) is defined by you when you create the model. It's the 0,0,0 point on your model. Which reference to an origin are you wondering about?

Yes, you need the Animation tags for your chassis to render. This is the same problem Yurch ran into. Here's how they work:

Those animation tags correspond to the various states the vehicle is in at any one time just as you said, such as idling, driving, etc. They do 2 useful things:

* Make the model animate (but as you can see none of the current set of vehicles makes use of this one) - this could be used to make pieces of the vehicle move when driving, for example, or make a little radar attachment spin around, or whatever kind of mesh animation you wanted

* Make the vehicle emit sound - so you can have a high rev sound for moving and an idling engine sound for the "idle" animation, etc.

The AnimationID specifies which state this animation corresponds to. It's an integer that specified one of these states:

LOITER - 0

MOVE - 1

AIM - 2

SHOOT - 3

DIE - 4

BURN - 5

EXPLODE - 6

MOVE FAST - 7

MOVE SHOOT - 8

MOVE FAST SHOOT - 9

You would generally only want to use the few that see being used in the existing vehicles.

The BaseModelName tag specifies a series of models that are to be used as an animation when in this state. Whatever you specify for this tag, DropTeam will go out and attempt to load that name with a 0.cob after it, then with a 1.cob after it, etc. until it stops finding matches. So, for example, if you had a 30 frame animation of a tank flapping its wings (?), then you might have these model files:

MjolnirChassisFlap0.cob

MjolnirChassisFlap1.cob

MjolnirChassisFlap2.cob

.

.

.

MjolnirChassisFlap29.cob

Then at runtime, those 30 different meshes would be swapped in for the original mesh at the rate specified in your animation's TotalTime tag to make an animation.

Once you hookup your Animation tags you will see your chassis. Just follow an existing chassis as a guide.

As for texturing, that's specific to the modelling program you're using. You need to apply UV coordinates to your vertices and then assign a texture image to the model.

Link to comment
Share on other sites

Thanks. Now showing up completely in a brilliant white ^.^

I used Sketchup to design and export this mess, but I'd imagine it does not have the ability to export the texture map like what is needed. So I saved it as a .kmz file, (Google Earth 3) and opened it in Blender (urk!). I really had no luck going from there, though. I saw a "UV Face Paint" and a "Vertex Paint" options, but I couldn't figure out what to do with em. Using them had no noticable effect. I figure that the image gets dumped somehow by using those tools?

How has anyone else done this? (JDevlin?)

Link to comment
Share on other sites

Hi-

Try a copy of XSI Foundation - its demo is uncrippled and free for a month. If you can ghost your system at the end of the month, you can use it indefinitely too.

There will still be a learning curve, of course..

How about a snapshot of your design? I'm really curious!

-Joe

Link to comment
Share on other sites

Basically what you have to do is to take the surface of your model and unwrap it to a flat image ( sometimes called UVW unwrapping ). Then you take the image, fill in all the faces with your graphics, and the game engine maps this image to the coordinates specified during the unwrap phase ( or something ).

Hope that helps!

-Joe

Link to comment
Share on other sites

Alright, I'm gettin there tongue.gif

Ah blast, XSI Foundation is not mac-compatable :\

--

If I read that correctly, in Blender (I'd presume Sketchup can't do this) I have to (manually?) flatten out the image. Then use the Vertex paint tool to define where all of the edges are? Then paint it? I didn't think it was possible to do that in Blender.

I guess I'm basically confused as to how to obtain the image that I can mess with and paint, and subsequently bind it to a model. After I have the outline image, I can go crazy on it, but I'm stuck getting the image to paint at all.

Any help there is appreciated.

Once I at least have a texture that isn't quite so hard on the eyes (That black w/ outlines like you have for now, for example tongue.gif ), I'd be more than happy to put up a screenshot. Besides, right now, it's kind of hard to see the differences in the polygons. (What's up, what's down, what's what)

Link to comment
Share on other sites

Blender has several ways to unwrap the model semi-automatically and produce an outline that you can then paint over to texture map an image. The key part is specifying where the seams are (imagine having a paper model of the 3d object and deciding where to cut in order to flatten it out).

LSCM unwrap gives the least distortion but may not produce what you want. You can do six projections along the axis and produce UV maps from that - those might be easier to paint.

UV unwrapping is a big topic - try these links:

http://blender3d.org/cms/UV_Unwrapping.363.0.html

http://www.blender.org/modules/documentation/htmlI/x5336.html

http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/UV_Map_Basics

http://biorust.com/index.php?page=tutorial_detail&tutid=85

Link to comment
Share on other sites

Thanks smile.gif

I'm successfully unwrapping said objects, though I still have some things to learn about where to put some seams. (A lot of funny looking shapes) However, I'm lost as to getting them onto the model in the game.

*edit* I've managed to successfully create & edit a UV image for Blender (It shows up in the Renders), but I can't figure out how to export it so that it shows up in-game as well. I do just export it as .obj, and problem solved?

As for the screenshot.. I'd put one up, but without texturing, it's REALLY hard to see the difference between the turret/chassis.

Though, I did encounter something kinda 'fun' while testing. With the muzzle velocities I gave it, the Ramses's Main Gun is capable of piercing Point Defense shields. That could really mix things up on maps like Raid... (Well, I think it pierced it. It could be that the ion towers just didn't fire on it. More to come once I have it textured)

[ September 18, 2006, 06:48 PM: Message edited by: IcemanUSA ]

Link to comment
Share on other sites

Heh.. well, here's the ramses.

Well.. the Hosed version of it, anyways. Using .obj turns the chassis on its side, and also causes interior sides to be invisible, and using .cob produces this.. interesting.. result... as well as (seemingly) turning the directions around(front is back, ect), though the thing is too hosed to really tell tongue.gif .

picture2vu1.png

Perhaps a blender side-effect? Could someone perhaps suggust a better program for doing this on Mac? (I know sketchup does this well, but it can't produce UV maps)

Link to comment
Share on other sites

Alright.

It shows up in game.

It works.

It has a 'texture'. (Nothing special, still gotta make an actual one)

Still 3 things

1- Gotta do collision models/contacts/all that other good stuff

2- Gotta find out whats causing the one sided faces problem. (You can see the face from one side, but not the other)

3- Gotta find out how to put the treads in there, and make em animate. (Get the tread texture on em)

Any help on any of these 3, particuarly 2 and 3, would be very much appreciated.

Link to comment
Share on other sites

2- Gotta find out whats causing the one sided faces problem. (You can see the face from one side, but not the other)
Faces are always going to be one-sided. If you really do *need* 2-sided faces, then we will have to give you a tag that enables that. Rendering all faces of an object this way generally causes a ton of redundant rendering to happen for the end user (since he can't see most such faces on any closed object). That's why we don't render things as 2 sided normally. So the question is: do you really need that? It's better, if possible, to make your model "well formed", which is to say it is a closed shape with no infinitely thin planes.

3- Gotta find out how to put the treads in there, and make em animate. (Get the tread texture on em)
The 2 tracks should be named LeftTrack and RightTrack. The meshes themselves should be so named. DropTeam looks at the names of the meshes as it loads a model and in the case of the tracks it uses those 2 special names to know that they need to be animated. Map your texture to the tracks so that the texture can be repeated along the V-axis. At runtime, DropTeam will move the V texture coordinate and leave the U coordiante alone.

And, yes, the General is quite right - everything must be triangulated (if you don't do this, it may even crash).

Link to comment
Share on other sites

×
×
  • Create New...