How to create models in XSI and other 3D applications and make them work in Battlefront 1 & 2. Post models, tips for application usage and share anything XSI, 3DMax, SketchUp, etc.
(yes it is real, the ai even targeted the tiny primitive that I made for ordnance collision)
It is a very easy process.
1. Load your unit model into xsi. It should have the bone_root as it's child.
2. Add collision primitives. I would make a primitive (a large cylinder type) for vehicles, terrain, and buildings as the child of the dummyroot. To make collision primitives for specific parts of the skeleton, make it the child of the desired bone. For perfect collision, make sure each bone has a primitive (e.g. collision for the left thigh bone make a primitive as the child of bone_l_thigh). When you are done hide all the primitives by selecting them and pressing "h".
They follow the same rules as any other collision primitive:
Hidden/Spoiler:
[quote]Collision Primitives
--- Collision Primitives are a cheaper and faster way of computing collision for the game engine.
It is also the only way to have collision on moving parts such as turrets or bones.
Collision primitives can be either cubes, cylinders, or spheres.
Cubes can be scaled in x,y, and/or z to better fit the geometry they are conforming to.
It is best to leave the original size of 8 units as is and scale the cube from there.
On the other hand, cylinders and spheres CANNOT be scaled. Instead, use the polygon properties such as Radius and Length to control the size of those 2 primitives.
Whether you use cubes, cylinder or spheres you'll want to keep the default Subdivisions.
Also very important, primitive collision pieces CANNOT be frozen(Freeze or Freeze M) or lose their primitive properties.
This information is taken directly into the game engine and if it is lost, the engine will most likely ignore the primitive collision.
Lastly, DO NOT move the center or Freeze the Transforms of primitive collision either or else the proper information will be lost as well.
---There is a limit of 64 collision primitives per model (or 63 primitives + 1 collision mesh).
NEW BFII UPDATE FOR COLLISION AND USING PRIMITIVES
The game now supports the use of new naming conventions in XSI – no more ODF magic required!
The old naming conventions are still valid – naming primitives "p_name" and mesh "collision_name" - but if you use these you still need to do soldier/vehicle/etc separation the old way through ODFs. Nothing old will break, but there’s no reason to do anything new using ODF definitions.
f -- Flag collison -used on flyers specifically for Space CTF to collide with the flag
So if you made a cube and wanted it to be used for soldier and vehicle collision, you’d name it
"p_-sv-SomeName"
Or if you wanted it to be used for ordnance collision only, you’d name it
"p_-o-SomeName"
Typicly ordnance collision needs to be more accurate so you could make a mesh and, you’d name it
"collision_-o-SomeName"[/quote]
ZETools allows you to skip step 3. You must have the primitive type name included in the name, so for example a cube that would be collision for terrain only would be called p_-t-cube(_name optional). Without this you must do step 3.
3. (optional) Add a custom parameter under each primitive. Select the collision primitive in the explorer and then go to Animate > Parameter > New Custom Parameter (or press Shift+P). For the parameter name, use "type". I made the value range from 0 to 10. Press OK. Then rename the parameter to "collprim". The "type" slider should be set to 2 for cylinders, 0 for spheres, and 4 for cubes.
4. Now you are done with the modeling part of it. Export like you would any other unit (I used ZETools).
5. In your unit's odf add the line IsAcklay = 1. This tells the game to use your custom primitives. Without any primitives your unit will just fall through everything.
6. (optional) To define your critical hit location, add the line HitLocation = "p_-so-head 4.0" (this is an example, use your own primitive's name).
Hidden/Spoiler:
[quote]HitLocation – The location of its critical hit point. The number at the end determines its multiplier. For instance, the “4” means this location causes 4x the normal damage[/quote]
This also means you can add shields. Yes, shields! just make the modifier less than 1 and you have a functional shield. 0 takes no damage at all! So now you can have area specific damage! Perfect for a medieval mod. The crosshair will not display a critical hit unless the multiplier is more than 1. a multiplier of 0 means no damage marker at all!
7. In your map's lua, add the line SetMemoryPoolSize("AcklayData", 20) next to the other Set MemoryPool lines. I assume it has to be set to a number the same as (or greater than) the number of units with custom collision.
8. That's It!
Theoretically, This should allow for units of any size and shape *coughdinosaurscough*. No longer are you restricted to that dumb 2 sphere pre-defined collision. Enjoy!
Last edited by MileHighGuy on Sun May 03, 2015 3:33 am, edited 21 times in total.
So IsAcklay = 1 also makes it so the units don't jump around like maniacs, they don't roll, crouch, or sprint on their own. They still sprint when following you. This is totally fine by me and is in fact preferred. So you wont have to worry about having your dinosaur jumping all the time and rolling away from grenades.
EDIT: The above statement is wrong. When given a gun, the collision still works and they seem to behave like normal units. With a sabre, they don't jump on their own.
I think they still will jump or crouch with hint nodes, because the acklay odf has IgnoreHintNodes = 1 in it, which makes me think it is separate.
With the prone animation the collision is fine but the origin of the ordnance is the same as crouching.
EDIT: Wow, I put terrain collision on only his feet and got real walking! When I rolled his body sunk into the ground because it did not collide with the terrain!
Last edited by MileHighGuy on Thu Jul 24, 2014 9:31 am, edited 4 times in total.
3. Add a custom parameter under each primitive. Select the collision primitive in the explorer and then go to Animate > Parameter > New Custom Parameter (or press Shift+P). For the parameter name, use "type". I made the value range from 0 to 10. Press OK. Then rename the parameter to "collprim". The "type" slider should be set to 2 for cylinders, 0 for spheres, and I assume 1 for cubes. EDIT: So far, I have not been able to get cubes to work. Only spheres and cylinders.
You can skip it if you follow ZE Tools collision primitive naming conventions. p_ + "cube" for cubes, "cyl" for cylinders and "sphere" for spheres.
Examples: "p_cube_01", "p_cyl_barrel".
The way you do it is actually used for importing collision primitives because of course most meshes don't follow those conventions. That's also why there's no easy way/tool to add that property.
I just tested it again, you're right. You have to name it p_-so-cube(_name optional). Without the cube in the name you have to use custom paramters. First post updated.
EDIT: you guys are gonna like this:
Hidden/Spoiler:
I'd really like to make the walking up hills normal again, but so far only a really large sphere has almost worked, and it was really buggy too. Anyone got any ideas? This kinda ruins the idea for bipeds using this.
So I'm trying to follow this tutorial to import a famba unit from BF1, but I have no experience with modeling and it still seems be missing collision geometry in game.
Here's a link to the BF1 .msh that I had originally hexeditted to make the texture transparent (in order to hide the shield generator), and the 2.msh is what I just exported out of XSI Mod Tool. It actually came with collision primitives, so I just deleted the two collision primitives that corresponded to the shield generator, renamed all the others to match the BF2 system, and exported. However, I don't see any change in the collision geometry in game (bullets still go right through it).
You must follow the exporting rules based on your method and toolset.
nab1_walk_fambaa2.msh says you used ZETools to export it, therefore you must use the naming convention ANDE wants for exporting primitive collision with ZETools.
Your:
p_-svbo-cyl_collision12
would be:
p_-svbo-cylinder_xxxx12
(if you were to keep it the same length)
SWBF2 really only cares about this part for the new naming convention:
p_-[types]
after that you can put an underscore and whatever text you want, though i'm sure there has to be a character limit.
If I was exporting with the Pandemic Tools I would just do this:
p_-[types]_somename
While you have the Fambaa in XSI you could easily remove unneeded geometry.
Okay, I changed all the names to match the format, and also shortened them, but for some reason I am only seeing collisions on the lower legs (#4, 6, 7, 12).
razac920 wrote:Wait a sec, the names of the primitive collisions has to stay the same length as when they were made?
No, only if you'd rather hex edit the names instead of exporting the scene again, but ZETools needs the right naming convention on export so it knows how to handle the objects.
Oh okay, maybe it took a little while to upload? I'm not sure.
Another strange thing: when I go to look at the collision geometry in game with the console command, it does appear correctly, but I have to be pointing the cursor at the legs of it for it to appear (other models pointing anywhere on them gets the display to show).
EDIT: So I'm thinking that the .msh file is not the problem. When I comment out the SkeletonName from the unit's .odf file, the collisions work correctly. And same for the unmodified nab1_walk_fambaa.msh file. Any idea what in an animation bank could break custom soldier collisions?
Last edited by razac920 on Fri Apr 17, 2015 12:50 am, edited 1 time in total.