Author Topic: Template land objects for AC3D  (Read 640 times)

Offline 8thJinx

  • Silver Member
  • ****
  • Posts: 990
Template land objects for AC3D
« on: December 16, 2017, 12:02:25 AM »
I generated templates for the 1x1, 2x2, and 4x4 land objects for AC3D for anyone who wants to take a stab at making a land object.  They all work, and produce no errors when inserted into a terrain.  AC3D will also generate a mesh from a grayscale bitmap, so if you want to you could go crazy in MS Paint at 512x512 resolution, save it as a bitmap, load it as a texture for one of templates, and it will automatically generate the mesh for a 1, 2, or 4 mile land object.  You'd have to go back and in AC3D and redo the edge vertices so they match the 660 foot requirement, but that's pretty straightforward. 

Also, I noticed that for the existing land objects, the original author broke down the 2 mile or 4 mail object into a group of objects, with each object 660 ft x 660 ft.  Not sure what the reasoning was, but it must have been good.  The templates are all a single object, but it's a couple mouse clicks to break up the polys from the group, then regroup.

Also I know Easycor understands the text file that the Object Editor reads, but now I do too, for large land objects.  It looked like Greek when I first started with this, but now I know exactly what's going on with the flags and hexadecimal values.  I just wish there was a table of values for each flag.  That would make modifications super quick.

And somewhere on the planet, two geeks are sitting in an office laughing at someone who just walked into a glass door, saying "Is Ground."
Join Date: Nov 2012

B-24H Liberator SN 294837-T, "The Jinx", 848th BS, 490th BG, 8th AF, RAF Station Eye, delivered 1943.  Piloted by Lt. Thomas Keyes, named by by his crew, and adorned with bad luck symbols, the aircraft survived the entire war.

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10888
Re: Template land objects for AC3D
« Reply #1 on: December 16, 2017, 02:29:36 AM »
Sounds like you're getting a handle on it.
Easy in-game again.
Since Tour 19 - 2001

Offline 8thJinx

  • Silver Member
  • ****
  • Posts: 990
Re: Template land objects for AC3D
« Reply #2 on: December 17, 2017, 07:54:36 AM »
Regarding land objects, after studying the town, tank town, Ndisles center, and 2 mile GV base meshes, it looks like this was the original process:

1. Make the land object edges to the correct outer perimeter vert spacing (660), using quarter-mile square objects snapped together.
2. Rough out the main features at the interior and along the perimeter with rough, 660 foot mesh-poly objects, not attached or welded to the edge objects described above.
3. Make finished, finer-mesh features, and place them over the roughed out features described in 2 above.
4. Make the set of polys for the yards, and lay them 8 inches or so above the street surface.

Now, one thing HTC told me was that they built the land objects in L3DT, finished the details in AC3D, and then placed the various objects and buildings into the land object using the Object Editor.  The cool thing about AC3D is that it allows you to do all three steps inside of one software package.  Yes, starting in L3DT is quicker when it comes to pushing terrain mesh around.  That's not easy at all in AC3D, particularly for real earth terrains.  It's just easier to use terrain.party to generate a heightmap and bring it into L3DT.  But fine-tuning can be done quite easily in AC3D.

Also, regarding the addition of objects like town buildings, or non-strat structures, or berms, that all can be added from AC3D using a library.  So I'm creating a library with all of the various AH3 objects, and I am placing them into my model directly from inside AC3D.  This lets you quickly place, rotate, scale, angle, etc, right inside AC3D, and lets you modify the hierarchy right from the software.  No need to open it notepad.

So for example, I could be making a land object, and if I want to test a location for a bridge, berm, gun pit, motor pool hanger, etc, I do it right from AC3D using my library of objects.  No need to get out of AC3D and into the OE.  This saves a huge step.  It also not only preserves the object models inside of the AC3D file, but also all of the hexadecimal flags!

At some point I'll share the templates and object libraries, but they're a big, hairy mess at the moment.  But I do want to share them, so anyone else that gets interested in making these land objects doesn't have to re-learn/re-do all of the steps I did.



 
Join Date: Nov 2012

B-24H Liberator SN 294837-T, "The Jinx", 848th BS, 490th BG, 8th AF, RAF Station Eye, delivered 1943.  Piloted by Lt. Thomas Keyes, named by by his crew, and adorned with bad luck symbols, the aircraft survived the entire war.

Offline 8thJinx

  • Silver Member
  • ****
  • Posts: 990
Re: Template land objects for AC3D
« Reply #3 on: December 17, 2017, 08:04:33 AM »
I also think the vert counts are much higher for a completed land object in AH3. The mega base terrain - just the land - has 21,000 vertices, not including the verts for the town buildings, bridges, hangars, runways, gun pits, bunkers, etc.  A single town building has an average of 8,000 verts and 2,500 polys (for the dead and live versions)!  Multiply that by 150, and that's over 1,200,000 vertices, just for the building and structure objects!  Add the land, gun pits and runways, it's probably pushing 2 million vertices.

Fortunately, for my purposes, I can cut the building verts in half by only including the live or dead versions, since I'm not interested in making a destructible town.  Towns already exist.  I'm interested in juiced-up GV terrains.  So ultimately, this will lead to simple land-only land objects in the neighborhood of 15,000 verts for (hopefully) MA use, or full-scale land objects for the AvA arenas with over a million verts.
« Last Edit: December 17, 2017, 08:18:26 AM by 8thJinx »
Join Date: Nov 2012

B-24H Liberator SN 294837-T, "The Jinx", 848th BS, 490th BG, 8th AF, RAF Station Eye, delivered 1943.  Piloted by Lt. Thomas Keyes, named by by his crew, and adorned with bad luck symbols, the aircraft survived the entire war.

Offline 8thJinx

  • Silver Member
  • ****
  • Posts: 990
Re: Template land objects for AC3D
« Reply #4 on: December 19, 2017, 11:27:46 AM »
More info on how you should plan your land objects:

The game engine relies heavily on calls to a section of code called the collision modeler, or collision traverser.  The collision traverser is essentially a continuous check on where you're at and if you're going to collide with something.  And frame rate is impacted enormously by the ability of the traverser to keep up with detecting collisions of your plane or vehicle with the terrain and objects.  And that speed, and your frame rate, is super critical when it comes to large land objects and how they are set up.

In layman's terms, each land object is actually a hierarchy of groups, and each group header is a node.  So a simple, square, 1 mile, single poly, 4-vertex object could in theory have a hierarchy of the following:

world
  group 'model'
    group 'ground'
      group 'low'
        group 'g01'
          poly 'tex0'

Each line above that starts with 'group' represents a node. To detect a collision, the traverser is constantly looking at where you are at and what is close.  The nearest nodes have to be instantly processed, and then the polys inside it have to be assessed by the traverser to tell the game that a collision happened.  With just one poly, the collision traverser would only have to process that single poly.

Now consider the same 4 mile object, with 18,340 polys, called 'ttown2x2m'.  This is the land object we see at the center of Ndilses in AH3.  If you kept all 18,340 polys in the one node "group 'g01'", the traverser has to process all 18,340 polys in one step, at every moment.  That can impact frame rate.  It would take the traverser 100 times longer - every instant - to traverse all 18,340 polys at once, than it would if the traverser only had to traverse 183 polys in the one node out of 100 that the game was interested in, had you broken up the hierarchy into 100 nodes of 183 polys.   

And it would be even more efficient for the traverser if you broke up those 100 nodes of polys into 25 nodes of 4 nodes, and those 25 nodes into 7 groups of 1 to 4 nodes, and those 7 groups into groups of 1 to 4 nodes.  That reduces the traverser's work load.  So game execution becomes more efficient the more hierarchical the terrains and objects become.  You don't want it to be ragged, or unbalanced.  You want it hierarchical.   

So, when planning a land object, you want to think in terms of hierarchy and balance.  Break it up into quadrant nodes (nw, ne, sw, se), then grid nodes (g01, g02, ...) within the quadrant, all the way down to nodes that are 1/4 mile squares.  This 'breaking up' can include areas of highly detailed meshes: if you really want a detailed mesh, like the high ground at the very center of the Ndisles tank town, or a series of berms, create those as meshes that drape over the rough-mesh terrain, and make those draped meshes as their own nodes.  The traverser won't look at the hidden mesh, just the stuff that is on top and visible.   

Two important notes:
1. Object count matters a great deal to the game overall.  The current limit is roughly 50,000.  However...
2. A single object can have many surfaces and vertices.  The current limit for a single object is roughly 60,000 verts.

The templates I am creating will have a library for use inside of AC3D, with this hierarchy already baked in.  The library will also include various objects like road sections, railroad sections, bridge abutments, berms and families of berms, small hills, cliffs, that you can pull from the library and drop onto the terrain.  And I almost hesitate to add this, but caves and railroad tunnel entrances are possible.  But in all cases, you need to constantly check the Tools / Model Info to make sure your vert count isn't getting too high.
Join Date: Nov 2012

B-24H Liberator SN 294837-T, "The Jinx", 848th BS, 490th BG, 8th AF, RAF Station Eye, delivered 1943.  Piloted by Lt. Thomas Keyes, named by by his crew, and adorned with bad luck symbols, the aircraft survived the entire war.

Offline Easyscor

  • Plutonium Member
  • *******
  • Posts: 10888
Re: Template land objects for AC3D
« Reply #5 on: December 19, 2017, 11:52:54 AM »
Yep, I'd say you got it. Just remember, draw calls are slightly different and all objects are not the same.
Easy in-game again.
Since Tour 19 - 2001

Offline 8thJinx

  • Silver Member
  • ****
  • Posts: 990
Re: Template land objects for AC3D
« Reply #6 on: December 19, 2017, 12:44:03 PM »
Yep, I'd say you got it. Just remember, draw calls are slightly different and all objects are not the same.

Yes.  I haven't touched on any of the object flags, nor on draw calls and batching, and how different materials can screw with frame rate.  I think that's for another day.   
Join Date: Nov 2012

B-24H Liberator SN 294837-T, "The Jinx", 848th BS, 490th BG, 8th AF, RAF Station Eye, delivered 1943.  Piloted by Lt. Thomas Keyes, named by by his crew, and adorned with bad luck symbols, the aircraft survived the entire war.

Offline ghostdancer

  • Aces High CM Staff
  • Platinum Member
  • ******
  • Posts: 7562
Re: Template land objects for AC3D
« Reply #7 on: December 19, 2017, 01:34:02 PM »
I don't have any experience with AC3D but with your notes here I might try to make the Cliffs of Dover land object now.
X.O. 29th TFT, "We Move Mountains"
CM Terrain Team

Offline 8thJinx

  • Silver Member
  • ****
  • Posts: 990
Re: Template land objects for AC3D
« Reply #8 on: December 19, 2017, 02:17:49 PM »
I don't have any experience with AC3D but with your notes here I might try to make the Cliffs of Dover land object now.

Get the heightmap of the area from terrain.party, then follow the method described in this thread:

http://bbs.hitechcreations.com/smf/index.php/topic,390917.0.html
Join Date: Nov 2012

B-24H Liberator SN 294837-T, "The Jinx", 848th BS, 490th BG, 8th AF, RAF Station Eye, delivered 1943.  Piloted by Lt. Thomas Keyes, named by by his crew, and adorned with bad luck symbols, the aircraft survived the entire war.

Offline 8thJinx

  • Silver Member
  • ****
  • Posts: 990
Re: Template land objects for AC3D
« Reply #9 on: December 20, 2017, 08:28:07 AM »
A thought just occurred to me.  Since the traverser is constantly searching for the nearest polys along your trajectory, maybe it's wise to put a higher piece of terrain at the center of any complex land object.  That way the traverser is more likely only going to process the polys for that hill, not all of the various features below it.  The game would still have to render everything, but the collision traverser wouldn't have to process the lower terrain. 

And, that is likely why all of the current land and structure objects have "high" nodes and "low" nodes.  Less work. 
Join Date: Nov 2012

B-24H Liberator SN 294837-T, "The Jinx", 848th BS, 490th BG, 8th AF, RAF Station Eye, delivered 1943.  Piloted by Lt. Thomas Keyes, named by by his crew, and adorned with bad luck symbols, the aircraft survived the entire war.