id Tech Forums

id Tech 4 (Doom3/Prey/Q4) => id Tech 4 Level Editing => Topic started by: bitterman on September 01, 2016, 07:47:40 AM

Title: Create terrain: path mesh vs brushes vs model
Post by: bitterman on September 01, 2016, 07:47:40 AM
As I think there is a three ways to create a terrain (correct me if I'm wrong):

1. Simple path mesh (bend mode).

2. Brushes.

3. Model (e.g. ASE).

Now I think about next problems:

1) textures & UVW;

2) AAS organization;

3) bot/NPC navigation;

4) animation of walking on uneven/distorted surfaces.

What are the advantages and disadvantages of each way? Any recommendations & tutorials?

Thanks.

Title: Re: Create terrain: path mesh vs brushes vs model
Post by: motorsep on September 01, 2016, 09:14:53 AM
AAS doesn't support meshes, only brushes.

Animation works fine on mesh-based terrains.

There are no bots in Doom 3, but AI navigates using AAS (although it can navigate without AAS, it's better to have AAS).

In Doom 3 mesh based terrain is what you want. You could do brushes, but it's a pain in the ass. Plus performance will suffer if you have crap load of brushes.

Bezier patch surfaces will never give you good terrain.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: bitterman on September 01, 2016, 11:21:21 AM
AAS doesn't support meshes, only brushes.
...
In Doom 3 mesh based terrain is what you want.

This sounds a bit contradictory. Perhaps you mean mesh which in turn covered with aassolid.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: motorsep on September 01, 2016, 01:46:25 PM
AAS doesn't support meshes, only brushes.
...
In Doom 3 mesh based terrain is what you want.

This sounds a bit contradictory. Perhaps you mean mesh which in turn covered with aassolid.

No, I mean mesh for terrain and you can block out walkable areas with caulk brushes underneath the mesh (doesn't even need to align with terrain) and use aas* brushes to block off sides/vertical areas (aassolid is for AI to be temporarily blocked or walk on it; I don't think it's what I used in my tests, but I don't remember now what I used)
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: The Happy Friar on September 02, 2016, 07:22:43 AM
I never did the model terrain but I did play with patch terrain in D3 and you have to do the brush+caulk method with it like with models.  It works as expected. 
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: BielBdeLuna on September 02, 2016, 06:47:35 PM
a simpler answer idtech4 from doom3 can't handle complex terrain unless something is added for the AI to navigate it properly
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: The Happy Friar on September 03, 2016, 06:22:58 AM
The AI system doesn't "see" model geometry or curved surfaces.  It can walk on it w/o issues, just doesn't know it's there.  It will be like Doom Q1/2 AI when that happens (which I've used to my advantage, sometimes I didn't want the AI to think, just go to the player).
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: BielBdeLuna on September 05, 2016, 07:03:40 AM
with one exception, AI will never abandon AAS for an unknown area, so you either have a character on the terrain or on the AAS but never on both, it might be that the character starts on the terrain and then afterwards it enters an AAS but he will never leave it. if you want AAS on the terrain then you have to clip the whole navigable area, defeating the purpose of using a terrain mesh. maybe an improvement on the AAS compiler needs to be added in order to make it compile AAS areas for terrain meshes.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: bkt on September 05, 2016, 08:10:14 PM
huh?

Just put caulk/clip under the terrain and it'll generate AAS that the AI can use to navigate over the mesh.  The AI will see the AAS zones generated by the flat brushes while they will collide with the mesh.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: BielBdeLuna on September 07, 2016, 02:55:43 PM
it might not be as trivial or easy as this, specially if the terrain isn't flat which should be the point of making any terrain with a mesh.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: motorsep on September 07, 2016, 04:24:44 PM
it might not be as trivial or easy as this, specially if the terrain isn't flat which should be the point of making any terrain with a mesh.

It's is as trivial as he described and works out of the box.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: bkt on September 07, 2016, 05:29:40 PM
it might not be as trivial or easy as this, specially if the terrain isn't flat which should be the point of making any terrain with a mesh.

It's is as trivial as he described and works out of the box.
Seconded.

Title: Re: Create terrain: path mesh vs brushes vs model
Post by: bitterman on September 08, 2016, 12:01:54 AM
More info:

http://wiki.thedarkmod.com/index.php?title=Pathfinding
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: motorsep on September 08, 2016, 12:26:48 AM
More info:

http://wiki.thedarkmod.com/index.php?title=Pathfinding

Here is proof it just works (and that map didn't have AAS compiled at all):

Title: Re: Create terrain: path mesh vs brushes vs model
Post by: bkt on September 09, 2016, 01:03:35 AM
More info:

http://wiki.thedarkmod.com/index.php?title=Pathfinding

Here is proof it just works (and that map didn't have AAS compiled at all):

Showing a video that has no AAS compiled is useless as an example.  Without AAS the AI can't see anything in the environment and won't be able to navigate any obstacles, meaning the AI's simply honing in on the players position blindly.

For bitterman:  caulk underneath the static mesh, the AI will see that and navigate over it using the AAS areas generated.  So long as the mesh doesn't exceed an angle the AI can't navigate, then they will be able to navigate effectively.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: bkt on September 09, 2016, 01:10:25 AM
Here is an example area from False Dawn. The entire section of the map up to the elevator is comprised of a static mesh floor.  Caulk brushes are underneath it and generate the AAS allowing the AI to completely navigate around the hallways as if walking on flat brushes.
(The russian stream playthrough is the best quality commentary-free playthrough I've found).
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: bitterman on September 09, 2016, 05:33:40 AM
Thanks.

I think the question is "will NPC/monster to collide with the mesh or running right on the surface of the underlying brush (through mesh)?".

Other words "in what cases AI/model will collide with brush/mesh/simple path mesh?".

My custom monster was flying and I'm not sure about this. If the motorsep's canyon is ASE model then answer is "yes".

And another advantage of terrain model is vertexColor (blended textures) IMO.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: motorsep on September 09, 2016, 08:14:32 AM
Showing a video that has no AAS compiled is useless as an example.  Without AAS the AI can't see anything in the environment and won't be able to navigate any obstacles, meaning the AI's simply honing in on the players position blindly.

It's useful nevertheless - showing AI walking on the terrain. Plus AI in Doom 3 does have dynamic obstacles avoidance system.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: motorsep on September 09, 2016, 09:17:32 AM
I think the question is "will NPC/monster to collide with the mesh or running right on the surface of the underlying brush (through mesh)?".

Other words "in what cases AI/model will collide with brush/mesh/simple path mesh?".

It collides with the first surface it touches (assuming surface is collidable, which is default).

My custom monster was flying and I'm not sure about this. If the motorsep's canyon is ASE model then answer is "yes".

Nothing truly flies in Doom 3. It still "walks".

My terrain is ASE, it's pretty obvious from the video  ???
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: oneofthe8devilz on September 10, 2016, 10:35:33 AM

This multiplayer/coop map "Dalen" is entirely built with meshes. Once you've figured out how to properly work the navigation brushes you can quickly produce fairly convincing results.

The map has many different heights, slopes and even a bridge and yet the AI maneuvers reliably through the 3D terrain. It took me less than 30 minutes to setup the navigation brushes in order for the AI to "understand" the geometry of the map.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: bitterman on September 10, 2016, 10:49:57 PM
Guys, your videos are good, but this is more advertisement than a tutorial on creating terrain. I had a thousand questions, how it is implemented, but who is going to answer them?  ;)

The main idea is simply to create the mesh and place in one of the game models and it works out of the box. But if you take a step to the side (custom monster, custom AI scripts etc, own assets) - and the process gets stuck.

Here is my workflow.

motorsep, how you combine your custom maps with the original BFG resources? I have no idea how to migrate this D3 mod to D3BFG.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: bitterman on September 11, 2016, 08:51:48 AM
ASE works in BFG too but there is some problems with lightning.
Missing lights assets perhaps.
And some unexpected problems with correct cubemap rendering.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: The Happy Friar on September 11, 2016, 02:47:45 PM
No tutorial needed: just make your mesh, place it in the map, make your supporting brushwork with clips/caulks so the monsters AAS can compile.

The collision is all in the material files, not the models.   If the in game material doesn't have something to say it's nonsolid, you should be ok.  It will react with anything else colliadable in the world as expected.  You do the brush work with the clips/caulks to make the AAS system work (and make some things easier to navigate).  That's just like Q3A & curves.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: bkt on September 12, 2016, 01:25:09 PM
Guys, your videos are good, but this is more advertisement than a tutorial on creating terrain. I had a thousand questions, how it is implemented, but who is going to answer them?  ;)
You're not getting a tutorial from me.  Why not jump into the editor, find an example from the Doom3 campaign that works as intended then reverse engineer it, instead of waiting for step by step instructions from those who've done that very step.

Everything you need has been explained here, simply connect the dots.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: bitterman on September 12, 2016, 10:09:15 PM
Thanks for answers.

A little question for walking guys, please :)

Is ASE terrain needed for collision model or it's for moveables only? What will happen if I throw a barrel at those high-poly rocks?

*************************

More info:

http://www.katsbits.com/tutorials/idtech/make-megatexture-terrain-models-from-brushwork.php
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: BielBdeLuna on September 13, 2016, 07:12:07 AM
the fact that terrain has to be caulked underneath show that idTech4 as it is in doom3 doesn't have support for terrain, that one has to force the aas to create the aas for that surface with added effort. Sure the monsters will walk, but walking to the player can be done without path-finding (like quake1) the question is that without added effort taking the shortest path to the player saving the obstacles is not possible.

@oneofthe8devilz your video shows a fairly even environments with two levels and one bridge, but more uneven terrain could be problematic to recreate with brushes. specially when the quads on the mesh are not squared, or when the quads from their neighbours are angled very different.

the solution would be to add to the aas compiler some form of aas data adapted to triangles instead of strictly brushes, somewhat similar to the triangle based process Robert Beckebans added to RBDoom3BFG dmap compiler, so that the two systems coexisted and worked along. without any added effort by the mapper.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: The Happy Friar on September 13, 2016, 07:54:16 AM
That would be nice but then it wouldn't be Doom 3 compatible.  It might be easier to extract faces in the modeler & export that new set of poly's as brushwork (Q3A .map), then it's all done.  I'm sure there are a lot of tricks that could be done nobody has thought of.  I was (apparently?) the first person to take a Q2 map, export to a .obj, import in to Blender, then particle pain models all over, then export the models as a single (or a couple) .md2's & use them in a map for foliage.   I was also (apparently?) the first person to make a Q2 player model & only use certain verts in certain frame so new geometry was created while the model was playing w/o it doing it's auto-inbetweens.   Many people also thought it was cool I'd take a monster/object model, use all the model slots in the entity's definition & make entities that had higher poly counts then he engine supported with a single model.  So a monster could have 4x as many verts in a stock engine.

That's what experimenting does.  So, someone (you?) needs to start experimenting with the compiler to see about getting this in there.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: motorsep on September 13, 2016, 08:25:30 AM
Folks, do yiu realize you don't have to follow terrain closely?!

And by that I mean you can use regular brushes (bottom is caulk and the rest AASsomething) and crudely block out terrain.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: bkt on September 13, 2016, 10:54:42 AM
Folks, do yiu realize you don't have to follow terrain closely?!

And by that I mean you can use regular brushes (bottom is caulk and the rest AASsomething) and crudely block out terrain.
Exactly.

The AI only sees the AAS sectors and will blindly collide with the terrain.  It's not a matter of 'Doom 3 doesn't support terrain', it does.  It's just a matter of working within the boundaries of its implementation. 

There's no gray area for whether or not an AI will be able to navigate terrain.  Consider that if the AI only see's the valid AAS areas (generated from brushwork), then you simply need to make sure that the terrain represents this valid space.  There will be a certain angle at which an AI/Player can't walk up and if any tri's in the mesh exceed said angle, the AI won't be able to navigate correctly.  So, based on that simple logic, if you create geometry that matches the logic in terms of playable space, you'll have completely valid terrain.

Seriously though, enough with the conjecture.  If the examples given by those of us who have worked with aspect of the engine isn't enough, then go and dissect an example from Doom 3.  Open maps/game/recycling1.map and work it out.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: The Happy Friar on September 13, 2016, 09:00:37 PM
Don't even need to caulk, D3 automatically removes the stuff that faces the void!  Even easier then Q3A! :)

I just loaded up a terrain I made ~a decade ago & I just copy/pasted the curve & put a monster_clip on it.  I must of had an issue with monsters going through or something at the time.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: bitterman on September 13, 2016, 10:23:37 PM
Quote
D3 automatically removes the stuff that faces the void

What do you mean?

If your ASE terrain is simply a cube in which all sides (except the top) are adjacent to caulk (an external bounds of the level) then this sides will be automatically removed when you compile the map?
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: The Happy Friar on September 13, 2016, 10:37:15 PM
In Quake engine it would render faces that are facing the void unless you caulked.  D3 automatically removes faces that are facing the void.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: motorsep on September 14, 2016, 11:57:18 PM
@bitterman

I think you got a wrong engine to mess with. If you never modded Quake 1/2/3 and have hard time using what's available for Doom 3 (iddevnet, modwiki, TheDarkMod wiki, 3dbuzz and Doom 3 assets itself), you are better off using CryEngine or UE4 (those are the only FPS engine with bunch of docs and tutorials, including step-by-step guides; UE4 is a better choice as it was very active and large community, including pretty good Russia-spoken youtube videos).
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: bitterman on September 15, 2016, 04:04:43 AM
Is it a crisis of faith that hurts not only me? ;)

Btw I learned also a bunch of engine-unrelated things and pulled my English (but it's still poorly, I know).

So in essence I should be grateful for that choice.

Thanks, guys!

P.S. motorsep you forgot visucore and doom3world via web archive.
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: motorsep on September 15, 2016, 10:40:40 AM
Is it a crisis of faith that hurts not only me? ;)

Nothing to do with faith. Just practical and clear thinking. Telling you this out of 3.5 years of wasted dev time. Even for personal reasons, if you want to express your creativity, this is the wrong engine to start with (unless you already have solid experience with idtech modding).
Title: Re: Create terrain: path mesh vs brushes vs model
Post by: kat on September 18, 2016, 02:20:53 PM
@OP: If terrain models are causing particular problems with collision/AI the way to work around the problem is to block out your expected path using brush volumes manipulated into shapes the AI can use and then export this for work in a 3D app - the 'path' is minimally edited or changed, the terrain built up around it. Once imported back into the editor the model will sit exactly over the top of the previously prepared brush 'path' the AI should be able to follow.