PDA

View Full Version : Complete Guide to BPI - model_info files



RedFox
07-12-2008, 19:40
I've dug around the forums and haven't found much topics relating to the collision files in RTW, so I decided to start one myself, with a fairly detailed tutorial including images and a sample file.
This tutorial is based on the assumption that you know how to set up a working building items and I will only concentrate on Wall info files, because they contain most of INFO objects.

For additional resources, you can also check official info (https://forums.totalwar.org/vb/showthread.php?t=61234) provided by JeromeGrasDyke and another tutorial (https://forums.totalwar.org/vb/showthread.php?t=104187&highlight=building+info+bpi+files) by Thor the Bassist.

List of known BPI INFO directives during conversion of *.cas -> *.bpi


>>building_description
fire_exclude
ejector
collision
collision_3d
collision3d
kill_zone
>>building_physical
slot_platform_
platform_
tunnel
arrow_horizontal_
arrow_vertical_
banner
dock
spawn
muster_
entry_
respawn
dock_sap
dock_ram
dock_ladThis is the basics that I could dig out from the ALX executable and pretty much provide everything we need to build a working collision info file - obviously I don't know all the effects of some of these objects and will exclude those for now. I will continue with examples of known info objects.


1) Spot FX Files
These files are only used by gates and towers. They include flags, oil jets, torches and are not converted into BPI files. They are still essential for walls - BI had 2 examples of these files, one of them conveniently being for a gateway. For that reason I will skip this part for more important matters.

If you have problems exporting your CAS file without any materials, just use the dummy.tga.dds I included in the sample file as a texture. To avoid the chance of any errors, you should copy the dummy texture to your models_building/textures/ folder.
Also make sure your new info objects are assigned to the scene root and have a pivot position in the center of the scene (x0,y0,z0)


2) Model INFO Files
I will start with the most essential and will end with the most exotic object types. These object types will make the whole of your INFO file, which is exported as a cas model and then converted into BPI when the battle is loading the building item.

-) 2D Collision
(examples: collision, collision_planx, collision_setx, collision_01 - cannot be collision3d / collision_3d!!)
This is a simple 2d shape that is used to draw out the necessary boundaries of the building. It will simply block the area so that troops won't be able to walk into buildings. Separate 2D collision shapes must be as separate objects. For example 2 separate squares with a gap between them need to be different objects like collision_01 and collision_02
https://img293.imageshack.us/img293/5410/collision2dod2.th.png (https://img293.imageshack.us/my.php?image=collision2dod2.png)



-) 3D Collision
(examples: collision3d, collision3d_buildingA, collision_3d_wallsX)
This collision object is only used for detecting projectile hits and mouse interaction. It serves no other purpose. This object is a simplification of the building model and shouldn't be too detailed to spare the CPU.
https://img300.imageshack.us/img300/451/collision3dae5.th.png (https://img300.imageshack.us/my.php?image=collision3dae5.png)



Now to actually get your walls to function like walls, they first need physical INFO. Physical info is essential for proper unit interaction in the game. Without Physical info, you can't dock rams, siege towers or anything else for that matter.


-) Platforms
Platforms are surfaces on buildings where units can walk on. For this to work, you need a platform and a slot_platform.
Platform syntax is "platform_<N>_<edges>" - A platform is always 4 sided, and to designate the front edge, both vertices adjacent to it must have vertex coloring of RGB 0,0,0 (Black). <N> (0-9) designates the number of the platform. Each platform must have an unique number, or the info file will not work. <edges> designate the description of the four edges of the platform, starting with the first edge that has vertex coloring. There are 3 main types of edges: H (hard edges, blocks troop movement), S (soft edges, unlucky troops can fall down from these edges) and C (clear edges, troops can fall off or traverse onto another platform from this edge). There also seems to be a special type of edge: G (probably 'Ground') - troops can traverse onto the platforms without a tunnel via this edge, which must be close to the ground ofcourse. This allows for special info files, like making troops walk on the rubble of a destroyed wall piece.

A regular wall platform looks like this: "platform_0_HCSC"
https://img367.imageshack.us/img367/6941/platform0hu9.th.png (https://img367.imageshack.us/my.php?image=platform0hu9.png)

Platforms can also be sloped if necessary.


Slot_platforms are simple isoceles triangles (both edges must be equally long) that are used to place troops. Without slot platforms you cannot place troops on the walls and the INFO file will not work.
If you fail to get a platform to work, then faulty slot_platforms are probably the reason for it.
Slot_platform syntax is "slot_platform_<N>_<rank>", where <N> must match the number of the platform it used for and where rank designates the number of the the slot_platform, first being 0.
A typical platform has more than 2-3 slot_platforms and they should look like this: "slot_platform_0_0" "slot_platform_0_1" "slot_platform_0_2" These are all meant to match "platform_0_HCSC". Slot platforms are usually placed right above the platform.
https://img300.imageshack.us/img300/9454/slotplatform0hp9.th.png (https://img300.imageshack.us/my.php?image=slotplatform0hp9.png)



-) Tunnels
To actually get your troops onto a platform, you need a tunnel. Tunnel works as a simple bridge that can send troops through anything onto the platform it goes through. Tunnels can have either 4 edges (like a simple square), or have an addition of 2 edges, to form a slightly more complex tunnel (tunnel that has corners/bends). Tunnels must be named as "tunnel_<X>" where X is any number or letter necessary for identification. Example: "tunnel_01" , "tunnel_02".
Without tunnels troops can't get onto platforms and the tunnel MUST only go NEAR the platform. The following image shows the 2 possible applications of tunnels, notice how the tunnels clip through the platform as needed.
https://img503.imageshack.us/img503/1307/tunnel0nu8.th.png (https://img503.imageshack.us/my.php?image=tunnel0nu8.png)


If you have done everything right, you should have a building that troops can get into/onto and fight in/on. But how about attacking with siege rams, ladders, huge siege towers and the likes? Well its fairly easy in theory.

-) Dock Points
There are several types of dock points that are used to test if a building can be attacked by rams/ladders/towers.
These dock points are: dock (no idea!?), dock_ram (rams, elephants), dock_sap, dock_lad(ladders and dock_lad01 is for siege tower).
A dock point is marked by a simple cube in the part of the wall where you need the siege engine to attach. So far, docking a ram is fairly easy: Just make a simple box, name it dock_ram, put it to a desired position, assign to parent Scene Root and export the cas info file.
https://img295.imageshack.us/img295/1899/dockrambm0.th.png (https://img295.imageshack.us/my.php?image=dockrambm0.png)https://img503.imageshack.us/img503/2818/0018jh3.th.jpg (https://img503.imageshack.us/my.php?image=0018jh3.jpg)https://img515.imageshack.us/img515/753/0019ep6.th.jpg (https://img515.imageshack.us/my.php?image=0019ep6.jpg)

-) Arrow slots
These are essential if you plan on making towers that shoot arrows. Without arrow slots, your towers won't do anything useful. The theory behind arrow slots is also fairly easy. There are two objects: "arrow_horizontal_<N>" "arrow_vertical_<N>" - where <N> marks the number of a given arrow slot.
Each slot consists of 2 of these objects. Both must be isoceles triangles that have a shared vertex position.
To make it easier for you to understand, here's an image of how an arrow slot should look like:
https://img181.imageshack.us/img181/452/arrowslot0ei7.th.png (https://img181.imageshack.us/my.php?image=arrowslot0ei7.png)
Notice the tips of both these triangles meet at the same point. The shape of the triangles (aspect ratios of triangles height and its bottoms width) determines the angle the arrow is able to be shot out of the arrow slot. The dotted red lines should give an idea on that arrow slots field of view. Horizontal and vertical arrow slots don't have to be identical, just need to be isoceles and the top vertices must share the same point in space.
Example: "arrow_horizontal_01 arrow_vertical_01" "arrow_horizontal_02 arrow_vertical_02"


-) Muster planes
A possible way to use these is to make ambush buildings, or just places to send troops into. I have no data on whether the troops will fight once mustered or not, but they will most probably be grouped into one single point, which is the center of the muster plane.
These consist of two types of objects: muster_ (this is where the troops will be gathered) entry_ (way to enter the muster plane).
A muster plane can be a simple square; troops will be mustered into the center of this square. Example "muster_0"
There can be several entryways for a muster plane. Examples: "entry_0" (1 entryway for muster_0), "entry_0_0 entry_0_1 entry_0_2" (3 entryways for muster_0)


This is the end of the tutorial for now. I will keep adding more data as is found out.
You can also download this file (http://www.wmwiki.com/hosted/redfox/sample/BPI_tutorial_example.zip) (Max 9) with a very basic wall setup to get you started, it also includes a .3ds version of the file, in case you don't have Max 9.

RedFox
12-21-2008, 20:02
I have taken some further interest in the INFO BPI files yet again and have managed to complete a fully functional set of walls.
During that process I discovered major flaws in my previous tutorial, namely:

Naming of tunnels is rather strict and must be: tunnel_01 or tunnel_02. Usually having tunnel_0 can cause problems
Same applies to arrow slots, which must be: arrow_horizontal_01 etc..

Complex/bending multi-piece tunnels do NOT seem to work, even though stated so by CA. You need to have a slot_platform where you need the tunnels to turn (for example watchtowers require a ' Y ' shaped setup)..

Muster planes do not seem to work even after some testing it didn't show any promise..

!2D Collision!: Separate pieces of collisions must be different objects! 2D Collision pieces must form a continuous shape that closes around itself. If you have two squares with a gap between them, they need to be different objects, or one of them will not work. Again, collision_01 and collision_02, not collision_0

SPOT FX Files: I have encountered graphical artifact problems with these and have decided not to mess with it..

>>There also seems to be a special type of edge: G (probably 'Ground') - troops can traverse onto the platforms without a tunnel via this edge, which must be close to the ground of course. This allows for special info files, like making troops walk on the rubble of a destroyed wall piece.


Problem detection:
CTD's while loading battle, ~1/5 of the loading bar: Your INFO file has unrecognizable mesh data. Try converting all mesh into 'Editable Mesh' or 'Editable Poly'.
Or, the material assigned to your mesh does not appear in the material editor (typical if you merge files). Just re-apply the texturing to the mesh from material editor slots.

Platforms not working: You have set up your platforms, but they still don't work! That means you don't have proper slot_platforms!! Make sure they start as: slot_platform_0_0, slot_platform_0_1 etc..

Cannot walk onto platforms, even though you have tunnels: Tunnel shape or naming is incorrect, make sure it is tunnel_01 and tunnel_02, not tunnel_0 and tunnel_1


Final notes:
If anyone is interested on my progress on this new set of walls, visit the thread in XGM - Diadochi forums:
http://www.twcenter.net/forums/showthread.php?t=207462
The final version of the walls differs greatly from the initial concept, so make sure you check all of it!

RedFox
12-23-2008, 01:46
Here's a little preview of the possibilities that working with INFO files offers:

These walls are approximately 60% the height of regular stone walls and can be breached by elephants or rams...


Units lined up at the start of the battle.
http://www.wmwiki.com/hosted/redfox/sample/walls/0028.JPG

The Gateway with support struts
http://www.wmwiki.com/hosted/redfox/sample/walls/0029.JPG

Transitions between platforms work flawlessly
http://www.wmwiki.com/hosted/redfox/sample/walls/0030.JPG

The towers shoot arrows perfectly fine =)
http://www.wmwiki.com/hosted/redfox/sample/walls/0032.JPG

The watchtower with new supportive struts..
http://www.wmwiki.com/hosted/redfox/sample/walls/0033.JPG

Getting on the walls is simple as always
http://www.wmwiki.com/hosted/redfox/sample/walls/0036.JPG
The ram is attacking the wall
http://www.wmwiki.com/hosted/redfox/sample/walls/0037.JPG

The wall is breached!
http://www.wmwiki.com/hosted/redfox/sample/walls/0038.JPG

Carnage between Hypaspists and Polybian Principes
http://www.wmwiki.com/hosted/redfox/sample/walls/0039.JPG

A sad day for the Seleucid Empire =(
http://www.wmwiki.com/hosted/redfox/sample/walls/0040.JPG