Jump to content
Sign in to follow this  
cifordayzserver

[Tutorial] BI Sample Data Modding 102 - Intro to Static and Dynamic Objects in O2

Recommended Posts

This tutorial assumes you have a functioning modding environment and P drive, and are familiar with the Bohemia Interactive Public Data Releases. (as covered in my previous tutorials Intro to Modding in Arma and BI Sample Data Modding

=============================
BI Public Data Modding 102 Part 1
=============================


=============================

BI Public Data Modding 102 Part 2
=============================


=====
NOTE

=====
This tutorial assumes you have a functioning P drive, and are familiar with the Bohemia Interactive Public Data Releases.
For guidance on these points please refer to my previous tutorials:

Introduction to Modding in Arma Video/Text Tutorial Series
and

Bohemia Sample Data Modding 101


===========
Introduction
===========

I will be providing a broad overview of the various LODs (levels of detail), their purpose, and some general 
requirements/tips for those LODs FIRST.

In order to cover all the LODs and the most functionality available we'll take a look at a few of M1lkm8n's SMD buildings.

Lets breakdown the ways you can add dynamic features to a static object.

1. Destruction - Static Objects can have various destruction types (destrtype) in order to define how they react when they have been

dealt enough damage in game to be destroyed. Ref - https://community.bistudio.com/wiki/...ence#destrType

Here is a quick/easy reference in order of least to most complicated

- DestructNo = No effect, object can not be destroyed, this is mostly used for "ruin models" IE already destroyed buildings

- DestructTent = Object is "flattened" this not used very often, unless it is a very 2 dimensional and simple model like a tent

- DestructTree =

- Arma 2: Falls over, eventually disappears

- Arma 3: leans at random angles

- DestructBuilding = Object sinks into the ground with smoke/dust particle effects

- DestructEngine = Smoke/Explosion

- DestructWall = *new to Arma 3 The wall will fall over when destroyed

When an object has been classed as a building you can then script in a call to a ruins model. (ruins models are

destroyed rubble versions of of the original building)

This can be done in several stages, and in combination with Rvmats to allow for the a more dynamic effect than the standard sinking

The most advanced form of destruction available would be custom animated destruction. This involves breaking a model into parts, and then

defining how and when they are hidden, or even animate frame by frame how they will fall to the ground. For the ultimate in realism

adding custom particle effects can allow for a truly realistic and dynamic building.

2. Materials - By defining materials in the Fire Lod you enable objects to properly interact with players, ai, and other objects.

This also calls the built in particle effects so that when you shoot something wooden, splinters fly instead of dust or concrete chunks.

3. Sound - You can give objects custom sound files to be played during an animation such as creeking doors, or electric motors etc etc.

4. Custom Particle Effects - As mentioned above you can create and include your own custom particle effects to add more depth to a model

5. Custom Animated Destruction - Also mentioned above, it is possible to carve a model into sections and animate the manner in which it will

come apart

Now that we've covered the basic concepts and some of the components in general, lets get a bit more specific.

The above features are often required to be defined in 3 places:

1. The p3d model - The model is obviously, exactly that, the physical asset that has been created and textured The entries created in Oxygen 2 (o2)

BI's model editing software.

2. The model.cfg - This is a text file that you can edit in any text editor. It defines bones from a model in order to create a skeleton that

can then be animated according to animation sources that already exist in the engine, or ones that you have custom defined based on available sources.

3. The Config.cpp - The Config . It's recommended you use a GOOD text editor

such as Notepad++, in that specific case (and others) there are plugins that make editing the files more intuitive. In the config you call the

animation sources you have created in the model.cfg and define how/when/who calls those animations or other effects to be triggered.

Now lets look at the LODs themselves:

Resolution LODs

0 - Full Model

2-5 (or more) Resolution LODs (generally half poly count each drop until you're at a box)

Shadow Volume LOD - has to be within the model and no textures ALL FACES must be CLOSED

- Do two, one for the closest lod, and one for the farthest

Geometry lod - Shapes must be closed and convex, it stops units from moving through the object. When done, Select all and add weight

- ALL COMPONENTS MUST BE FOUND (structure - topology - find components)

Memory - allow bones, buttons, door lights, alice module AI etc

Roadway - Flat Plane defines where characters can walk, AND the sound it makes when you walk on it. (including top of walls etc)

- Can define textures and the sound it makes

- All faces face UP!! If faces are down character will fall through

Paths - Defines how AI interact

- In positions - in1 in2 etc - points where AI can begin their walk in

- pos1 pos2 pos3 are places they can stop

Hit Points - Defines destructable points

View Geometry - What can and can't be seen/rendered

- ALL COMPONENTS MUST BE FOUND (structure - topology - find components)

Fire Geometry - define materials, (E - materials - CA/Data/penetration - all RVMats for materials)

- Thickness of material will influence the density (too thick glass is bullet resistant/proof)

- ALL COMPONENTS MUST BE FOUND (structure - topology - find components)

==========

New For A3

==========

Geo - Phys Lod - Copy/paste Geo or Fire Geo -INCORRECT as per Fennek

Note thrown objects will interact with this lod and the roadway lod.

BI References

Model Config - https://community.bistudio.com/wiki/Model_Config

Model Named Selection Translations - https://community.bistudio.com/wiki/ArmA:_Selection_Translations

Model Class Named Properties - https://community.bistudio.com/wiki/Named_Properties

How to Animate - https://community.bistudio.com/wiki/ArmA:_How_to_animate_a_model

Vehicle Config - https://community.bistudio.com/wiki/CfgVehicles_Config_Referenc

Edited by cifordayzserver
minor edits and links fixed

Share this post


Link to post
Share on other sites
Geo - Phys Lod - Copy/paste Geo or Fire Geo

Note thrown objects will interact with this lod and the roadway lod.

Using Firegeometry for PhysX LOD would be very bad, firegeometry is alot more complex then PhysX LOD should be most of the time. Maybe for simple buildings they dont differ, but for detailed stuff (or non-walkable objects, like vehicles) it should be avoided.

Edited by Fennek

Share this post


Link to post
Share on other sites
Using Firegeometry for PhysX LOD would be very bad, firegeometry is alot more complex then PhysX LOD should be most of the time. Maybe for simple buildings they dont differ, but for detailed stuff (or non-walkable objects, like vehicles) it should be avoided.

Good to know! I will adjust the tutorial.

If you want to expound at all on why the less complicated GEO lod is preferred that'd be awesome!

I've only done a few buildings and objects for A3, so the A3 stuff is very new to me.

On one of the buildings I did, the GEO lod doesn't have any openings where the windows are, so I assumed that would be better to use for physx. The thinking being, that a grenade with physx should pass through the window, but this was just my own assumption.

Share this post


Link to post
Share on other sites

physx and geo LOD need to be as optimized as possible, as the game checks those for collision every frame the entire time. Therefore it will run slower if it has complex geometry to check. You will find that this is common practice in every game, everything that involves collision checking needs to be as optimized as possible.

From what i can tell, geometry LOD determines where players collide when walking. Physx LOD is used for vehicle collisions (everything that uses simulation=CarX , TankX , ...)- but it seems that there are issues currently or something like that. I would guess that physx LOD is also used for character ragdoll, but i have not checked it.

Bullets also need to check often, but they dont fly permanently, they have an "expiration date" so to speak - either they hit something or their lifetime ends at some point. That's why you can afford to have a bit more detailed fire geometry. But you shouldn't go overboard with it either. Fences for example should either be a single cuboid (in case woodplanks for example) or have no firegeometry (in case of wire mesh for example), plus one cuboid for each fencepost for example.

Idk what LOD grenades use, haven't tested it myself. I heard someone say they use Geo LOD (not Physx LOD), but better check it ingame to be sure. If the grenade uses geo LOD, i would not include smaller windows in the physx LOD for example. Only very large windows, where you a drone could easily fit through after shooting the window.

Edited by Fennek

Share this post


Link to post
Share on other sites

Throw objects use the physx lod as well as the roadway lod.

The thing to remember between the physx and geo is unless you want a character to be able to go out a window then there's no need to represent a "hole" where the window is in the geo lod You can save components this way. Of course in the physx lod you will want to so that grenades can pass through a destroyed window.

Share this post


Link to post
Share on other sites

Hi sorry for being new, I cannot post any new topic, I have a skewed character animation problem in O2, can someone help?

 

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  

×