Jump to content
Sign in to follow this  
jed89

Questions on modelling a bridge

Recommended Posts

Sorry for the very vague title, but I've got a couple of questions concerning optimization and general configuration of a bridge in ArmA III. First of all, I'm not new to modelling, but I'm new to getting models into the game properly, so you can expect a certain level of knowledge from me. This is also the first 'real' object I'm trying to get into the game.

1. My first problem is size. The bounding box of half my bridge (other half will simply be mirrored ingame) currently measures 360x32x124, which I know is way to big for the engine to handle properly. I've digged up some old threads on the forum stating that an object should have a maximum size of 50x50x50 (2009), but someone wrote in another thread (2011 I think) that up to 100x100x100 shouldn't be a problem anymore. Can I just reduce the size of parts of my bridge until ResLOD, GeoLOD and RoadwayLOD behave like they should instead of bugging out to far from the center or is there really an absolute maximum I should not exceed at all?

Here are some pictures showing size and shape:

http://i.imgur.com/zuqLGlk.jpg (285 kB)

http://i.imgur.com/pGXwAzZ.jpg (211 kB)

Credits for the reference ship go to TxT btw.

2. If I split up my bridge in multiple smaller components, can I just leave the centers of all the new .p3ds where they are and have the components keep their coordinates from before or will the centers affect what the engine handles as the object's size? I wanna know this for ease of usage, since you could place all components at the same world coordinate, if the actual meshes could be some 100 meters from the center of the model.

3. This is more of a general question towards game design: My object doesn't contain a lot of independent meshes right now. The pylon for example is a single mesh aside from the foundation and the brackets holding the steel cables, making it 3x32x105 big. Would this be a problem or is it okay to do that?

4. My Bridge currently is a subclass of 'House_F'. I know that there's a class called 'Bridge_base_F', so I guess I should rather pick that one as superclass, but I don't really understand PathLODs yet. Neither the ones you have in every building, nor the additional ones that the already existing bridges have, like 'Land_Bridge_HighWay_PathLod_F' for example. AI compability is really something that doesn't bother me yet, but would I need the additional '_PathLod.p3d' to make AI cars able to pass the bride? And could the sloped surface prevent AI from acting properly here?

Thanks for bearing with my lengthily questions. I'm a bit short on time right now, so I can't try all these things out myself at the moment. Thank you in advance.

Share this post


Link to post
Share on other sites

First off...sweet looking bridge!!!!

It's tough to say the max size because I don't think anyone knows for certain. What you can do is split your model by selecting parts and sending them to proxy.

Inheriting from house_f should be fine. I did that for the bridges I brought into a3 from a2 and they would fine complete with animated destruction.

For Ai vehicles all you need is a roadway Lod. Once the Ai pass from the terrain road to the bridge they *should* traverse the bridge fine.

It looks like in a3 bis created an addition p3d with only a pathway lod and places them over the bridges for better Ai navigation. The problem you will run into with your bridge and the size is creating a pathway lod that big.

See the ai once on a pathway lod can not traverse from object to object. They can only go from terrain to object or visa versa.

I would say to try and create a pathway lod the entire size of your bridge as a separate p3d and see if it works

Share this post


Link to post
Share on other sites

Thanks for the advice M1lkm8n

I've chopped the bridge into pieces of 60 meters length and all LODs seem to work perfectly now, though I didn't have time to do more than one segment yet, so I don't know how good they'll fit together. Maybe I'm done with the functionality in some days and can continue with texturing, which I horribly suck at...

Share this post


Link to post
Share on other sites

So, I didn't have a lot of time during the last two weeks, but I've managed to get most of the stuff working.

There are three things left that I'm not sure about.

1. One of the GeoLODs is not working and I really don't get why. Here's a picture of the GeoLOD:

http://i.imgur.com/pxYHACU.jpg (278 kB)

As you can see the LOD only contains 6 cuboids that are convex and have their normals pointing in the right direction. The fire geometry is simply a duplicate of this one and works perfectly fine. Also, rotor blades get damaged by the object, but the rest of the helicopter and everything else can pass right through without taking any damage. I've already redone that LOD, but I can't seem to fix it.

2. Right now I'm assembling the bridge like this:

config.cpp

class JED89_HarborBridge: House_F
{
scope = 2;
displayName = "Harbor Bridge (complete)";
model = "\A3\Weapons_F\empty.p3d";
map_size = 720.4;
vehicleClass = "JED89_HarborBridge";
destrType = "DestructNo";

class Eventhandlers: Eventhandlers
{
	init = "_init = compile preprocessFileLineNumbers ""\HarborBridge\init.sqf""; _this spawn _init";
};
};

init.sqf

private ["_center"];

_center = _this select 0;

_SA_L_1 = "JED89_SA1" createVehicle (position _center);
_SA_L_2 = "JED89_SA2" createVehicle (position _center);
_RW_L_1 = "JED89_RW1" createVehicle (position _center);
_RW_L_2 = "JED89_RW2" createVehicle (position _center);
_RW_L_3 = "JED89_RW3" createVehicle (position _center);
_RW_L_4 = "JED89_RW4" createVehicle (position _center);
_LP_L = "JED89_LP" createVehicle (position _center);
_UP_L = "JED89_UP" createVehicle (position _center);

_SA_R_1 = "JED89_SA1" createVehicle (position _center);
_SA_R_2 = "JED89_SA2" createVehicle (position _center);
_RW_R_1 = "JED89_RW1" createVehicle (position _center);
_RW_R_2 = "JED89_RW2" createVehicle (position _center);
_RW_R_3 = "JED89_RW3" createVehicle (position _center);
_RW_R_4 = "JED89_RW4" createVehicle (position _center);
_LP_R = "JED89_LP" createVehicle (position _center);
_UP_R = "JED89_UP" createVehicle (position _center);

_SA_L_1 attachto [_center,[0,-330,8.25]];
_SA_L_2 attachto [_center,[0,-264.5,6.75]];
_RW_L_1 attachto [_center,[0,-215,19.5]];
_RW_L_2 attachto [_center,[0,-150,26]];
_RW_L_3 attachto [_center,[0,-90,31.5]];
_RW_L_4 attachto [_center,[0,-30,34.75]];
_LP_L attachto [_center,[0,-125,3.2]];
_UP_L attachto [_center,[0,-125,64.33]];

_SA_L_1 setdir 180;
_SA_L_2 setdir 180;
_UP_L setdir 180;
_LP_L setdir 180;
_RW_L_4 setdir 180;
_RW_L_3 setdir 180;
_RW_L_3 setdir 180;
_RW_L_2 setdir 180;
_RW_L_1 setdir 180;

_SA_R_1 attachto [_center,[0,330,8.25]];
_SA_R_2 attachto [_center,[0,264.5,6.75]];
_RW_R_1 attachto [_center,[0,215,19.5]];
_RW_R_2 attachto [_center,[0,150,26]];
_RW_R_3 attachto [_center,[0,90,31.5]];
_RW_R_4 attachto [_center,[0,30,34.75]];
_LP_R attachto [_center,[0,125,3.2]];
_UP_R attachto [_center,[0,125,64.33]];

sleep 1;

detach _SA_L_1;
detach _SA_L_2;
detach _RW_L_1;
detach _RW_L_2;
detach _RW_L_3;
detach _RW_L_4;
detach _LP_L;

detach _UP_L;
detach _SA_R_1;
detach _SA_R_2;
detach _RW_R_1;
detach _RW_R_2;
detach _RW_R_3;
detach _RW_R_4;
detach _LP_R;
detach _UP_R;

Does using Proxies and assembling it like the LHD in ArmA II have any advantages over this method or wouldn't it make any difference?

3. The last question is concerning the PathLOD. If I make an extra object that's only containing this LOD, how exactly do I do it?

I've got an idea of how the PathLODs work, but do I have to pay attention to something special when drawing paths that are to be used by vehicles? As far as this guide tells, I'd have to do a series of connected faces from one end of the bridge to the other and define in-points. But does the AI make any difference between infantry and vehicle movement along paths? Do I have to span the path over the whole roadway (lane) or is a path of let's say 10cm width in the middle of a lane enough? And is there a possibility to tell AI to only use a path in one direction, so they don't crash somehwere in the middle or do I have to rely on my luck when sending AI above the bridge?

I know the last question is basically to explain path modelling in it's basics to me, but I don't have enough time for try and error and didn't find something that really helps me. Thanks for helping again.

Share this post


Link to post
Share on other sites

I know i would love to use this bridge on my upcoming terrain, it's absolutely beautiful :)

I have a span of 926 meters to bridge, roughly 250 meters from ground to water below.

Share this post


Link to post
Share on other sites

attachTo has a negativ effect on Geometry and i think also on the PhysX LOD so the will not do what they should do (i think it is a simulation problem but im not sure)

Try to just createVehicle them no attachTo.

The best would be if you offset the model from the center in OB to the position where it should be so you can createVehicle them all on the same position ingame.

Edit: nvm, have not seen that you use detach in the end so this should not be the problem...

Edited by Lappihuan

Share this post


Link to post
Share on other sites

Yeah, I know that attachto makes the collision kinda random, especially when it comes to vehicles, but I didn't really get how to set up the whole structure via proxies back then. I've sorted out almost all the problems now and the only things missing are proper textures and a working PathLOD, so if you don't mind ugly textures and lazy UV mapping or don't want AI to walk or drive on it a human player could already use it properly. So the only thing left to do is setting up a PathLOD that enables correct AI behaviour, maybe I'll find something that helps me in the ArmA II samples BIS made public.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×