Godot-proposals: Mesh Based 3D Terrain (Not Height Map Based, Not Noise Based)

Created on 14 Aug 2020  路  20Comments  路  Source: godotengine/godot-proposals

Describe the project you are working on:
i'm not sure if i want to give too many details, but having an easy to use terrain editor, which doesn't make me want to shoot myself would be nice

Describe the problem or limitation you are having in your project:
there's a limit to both heightmap and noise based terrain systems, they tend to look very samey, they are too uniform, and both systems don't have as much control, as i'd like them to have, plus there's far more room for all kinds of optimizations when all your terrain is just another 3D mesh, and i also feel like it would make things more intuitive and easier to work with as a whole, just gotta make the user interface for it really good (age of mythology has a really nice, easy to use interface)

meshes allow you to have far more detail overall, and it gives the artist far more control, meaning that you can create any kind of game world, and at the same time, it would make the editor easier to use, a heightmap just feels very finnicky to work with in contrast

heightmaps are, okay for really general terrain, but if you ever wish to do anything more complex, like a cave like system, filled with all kinds of details, underpasses, or just anything really extreme, you are kinda screwed - if you'd like to do some really fancy geometry, or if your level design is non-standard, then you'll have to fight against all the limits of these two systems

i'd like a system which gives the artist 100% freedom, a system which doesn't force the artist to adapt to the limitations of the heightmap system

it might also help in games where level streaming is a thing, plus i think a mesh based system gives people the extra artistic freedom, and i wouldn't be surprised if most games actually ended up running better with it as a whole

you could stich multiple meshes togheter, and i'm sure that there are methods to get some nice performance out of it

heightmaps just kinda suck at, adding really specific details, there are just so many annoying limitations

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
well i already did above... so this feels redundant....

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
it would just be a really basic plane, with little squares in it i immagine, i'm not sure how a mesh based system would actually work, but it's probably something like this
mesh base 1

the level of detail would, mostly be defined by how big the squares are i immagine, so you could get fancier looking geometry, by making the planes smaller, and so on
mesh base 2

then you'd just have some general tools, which would allow the player to "paint" the geometry, or add trees or, make cliffs or, detail it or whatever (i did this in photoshop, i would draw a cliff but, i'd rather not go insane, but you get the idea)
mesh base 3

age of mythology has an example of a really nice and easy to use interface

if you ever used the Source Engine, this will likely feel very familiar to you already

and yes, i agree, displacements are a nightmare to work with, but ideally we would have a better UI and some nice painting tools like in Age of Mythology, to make it all very pleasant and nice to use, also ideally things wouldn't be as nightmarishly prone to corrupt as the Source Engine is keen to, but that engine is mostly taped togheter with glue and black magic, so i wouldn't worry too much about it

If this enhancement will not be used often, can it be worked around with a few lines of script?:
uh, no, it needs to be fast as hell

Is there a reason why this should be core and not an add-on in the asset library?:
yes, it needs to run REALLY FAST, and gd script is VERY SLOW

core

Most helpful comment

I thought reduz already confirmed that when we add a terrain system it would have to support both heightmap and transvoxel?

I feel like this PR is a discussion that should be had after we decide to add a terrain system in the first place. If there is no agreement on whether or not we add a built in terrian system, it is kind of moot what kind of algorithm we use for the terrian. For further reading see: https://github.com/godotengine/godot-proposals/issues/445

All 20 comments

Asset library addons are not necessarily GDScript. Did you look at Zylann's plugin, for example?

Asset library addons are not necessarily GDScript. Did you look at Zylann's plugin, for example?

that's a heightmap, not a mesh

if you ever wish to do anything more complex, like a cave like system

What about Zylann's voxel plugin (merging cubes)? https://youtu.be/WxZK_Yg5kU0

What about Zylann's voxel plugin (merging cubes)? https://youtu.be/WxZK_Yg5kU0

it's not just, a plain old cave system with boring holes, it's would be more like, something on par with this (immagine something a bit more fancier and complicated than that)

height maps only go up or down, it's elevation based, you cannot have like, stuff that's hanging over things, or detail like under stuff (overhangings, etc)


this type of detail is impossible with a height map, since that's what literally a height map is, it uses the HEIGHT, so it can only go up or down, you can't have things below it, and the simplest solution is to just have a mesh based system

it feels like you guys never worked on a game if you have to ask me these questions as to why i need this system xD

i find it odd just how perplexed everyone seems to be, like, this is such a common, or hell necessary game development tool, it's the most basic thing a game needs, in order to create a large, detailled game world with ease

this is how you get people to use Godot, this is how you sell people on the 3D, otherwise, people won't dare to touch the engine if even the most basic of features are just missing

if you tell people that height maps are perfectly fine, they'll just look at you weird, they'll just walk away and they'll use another engine

This is not something every game needs (most Godot projects are not open-world large detailed projects), and an assetlib addon can use C# or GDNative (as both of Zylann's addons do) so this is something that is best left for an addon.

Remember, if devs have to work on your mesh based terrain, they can't improve core Godot itself (that's why there is a rule that says if it can be done via plugin, it should be so).

if you tell people that height maps are perfectly fine, they'll just look at you weird, they'll just walk away and they'll use another engine

Have you used Unity or Unreal? I used both, and I am 99% sure that Unity's terrain is heightmap based...

see that's the thing, you are missing the point, this helps with SMALL levels too, it allows you to easily add all kinds of details, and it keeps the system, and the engine ULTRA ACCESSIBLE, plus it makes the engine easier to use as a whole for everyone

i come from old school game engines, and they have these things, i don't care what unity or unreal do, i think those engine suck

they are height based, ok, so what? just because those two engines lack this system, it means that we should have an engine that's as sucky and as hard to use? come on, this would make the engine an actual consideration for a ton of people, and i would be willing to bet that people, would gladly give up unreal or unity for such a system

guys, just because other engines DON'T do these things, it doesn't exactly mean that the lead developers are making the right choices as a whole, epic games can just throw billions on dollars on 3D modellers and on people who can vomit out environments like they are nothing, but i can't, i have to make things, fast, quickly, and easily, and it all has to look really nice, so when you tell me that, "well those other engines don't do this thing", then you gatekeep a whole audience, which would've never had any real chance of making a fully fledged game in the first place, i feel like this truly limits the engine's growth, and it would give you an edge over everybody else

or you could just be, like everybody else, and never stand out, but i feel like not having this feature would be a bit of a shame, since it would definitely elevate the engine to new heights

As I said, devs are swamped enough with existing features. This thing you'd like to have would be months of work to "look nice", and the simplest version (a plane and placing some meshes on top) can be easily done by yourself using built-in meshes and some tool script to place.

Prime candidate for an asset in the library. You need to understand there is not an infinite amount of devs working on Godot and that their time is also finite.

what's the point of making a proposal if, everyone is just gonna say "no" anyway tho? i mean, if they are too busy that's on them, i'm just bringing something up, i'm not holding anybody at gun point to add the feature, this instant xD

plus i don't feel like godot has gotten any usability features or anything really useful as far as the latest updates go, i mean... sure we got the lightng system, and i guess the fog thingy, but that's just eye candy, and to me it feels like the 3D is mostly focused on, looking nice, instead of allowing all kinds of game developers, of varied skill levels, to easily make a game

(the shadows still look pretty horrible most of the time tho, they have this horrible banding like almost constantly, i wish i could just, bake shadows into the level instead sometimes)

i don't really care for the gd script re-write, and i don't know, i find 99% of game engines to be pretty underwhelming, i mean the Source Engine is the closest thing to, what i would like to see, as far as ease of use goes, that thing while, broken as hell, was so far ahead of everything else i've ever used, and just being able to make stuff and not open a 3D modelling program was nice for a change, and i wish more game engines had that philosophy

uh, i didn't claim that, it would just be a basic plane, and that would be it, but i'm not sure how else to illustrate the most basic idea or the most basic implementation - ideally you could, paint cliffs and other terrain features over it, like you would in Photoshop or something

i feel like you guys tend to just sorta look at, everything very literally, and i'm not sure how to illustrate this differently, since i've totally seen games where such systems where available

but to me saying that, they are too busy is just some lame excuse, and it would mean that i would have to just be silent forever, and i think that's kinda lame - that's on them, i can still propose an idea, so

AFAIK there are some plans to have some official terrain editor in the engine, but heightmap/voxel-based. I get what you are suggesting, but it sounds like something more for prototyping (similar to CSG), as complex 3D maps are usually created in a modelling software.

Whether this gets added depends probably on whether it's more simple to implement and use than the planned terrain system.

AFAIK there are some plans to have some official terrain editor in the engine, but heightmap/voxel-based. I get what you are suggesting, but it sounds like something more for prototyping (similar to CSG), as complex 3D maps are usually created in a modelling software.

Whether this gets added depends probably on whether it's more simple to implement and use than the planned terrain system.

uh i can already tell you that, it won't be simple, but you'll pretty much make a whole world of artists happy by having such a system

the most common issues you'll be dealing with are likely, with the pathfinding system, since, you'd need a system which works with a fully 3D world

a height map based world is mostly 2D, so you only need to design a 2D path finder
on the other hand, a fully 3D world, would need a fancier pathfinder to handle some weird edge cases

you'd likely encounter these pathfinding issues if you were to make an RTS game, since that's where you can get the most out of a terrain system such as this one

here's a common edge case, which you'd need to fix (how would the pathfinder, handle a building, placed above another building?) - in a 2D system, the coordinates wouldn't be taken into account properly, so it would cause some problems

anyway a fully 3D pathfinder is just something you gotta figure out with this system, with a heightmap you only need to worry about the elevation, and you could simply use more colors to store more data if you have really weird heights, but these are mostly hacks, or just dirty tricks, they just sorta hide the problems away, plus you still force the artist to deal with a finnicky system, which is a huge downside to me - plus, you still need to deal with all kinds of technical limits, which are just, plain annoying and totally arbitrary

anyway i'm sure this is fixable

you would also need to solve all the performance issues, you'd need to compress or optimize the terrain in itself, but it would allow artists and hell even programmers to create game worlds with nearly infinite detail, since you basically would end up with a sculpting system, depending on how detailled you want things to get, and i'm willing to say that, you could go for a photoshop style mask layer system (you could stack up a bunch of textures on top of each other, and you could re-order them, just like in Photoshop), as far as the textures go, depending on how crazy you want to get with this, with a mesh based system

the system wouldn't need to be that complicated in the first place, but it would be nice if there was a way to just, prototype a level in engine, and texture it without needing to juggle with a billion different environments

it opens up a ton of possibilities for an artist, and this is a long term system, and a ton of people would benefit from it, but it would be a ton of hard work, but you could sorta wing it and develop it as it goes, and just build on top of it as time goes on

either way, not having to open up blender or maya or 3ds max, would be a huge advantage for most people, and it would simplify the workflow, while allowing everybody to be far more productive, plus blender is quite frankly, a bad tool for this job, having to stich a buncha 3D models by hand is really finnicky, but if you could just make all the terrain in engine, and then throw in your custom meshes, it totally makes everything A WHOLE LOT easier for everyone

i do believe that this can be done, but this is a fairly ambitious proposal, compared to most i immagine, but i'm sorta looking at the long term value you get out of this, compared to, a heightmap system

this would allow the engine to stand out, and i wouldn't be surprised if this ended up being a game changer for a whole lot of people, i mean having a lightweight engine, that's fast and easy to work with, is a dream come true for any artist

the unreal engine 4 is okay but.... ehh the whole thing is just too damn bloated, and it's so limited, as far as the terrain goes, it really feels like i'm stuck in the 90s, i feel like terrain systems in games haven't seen any real improvements put into them, and yet i see so many games which have, really ugly geometry, and it just feels so surreal, we have these beautiful graphics, and yet, we can't make a hill or a mountain which looks good enough on modern day hardware, it's kinda absurd to me

plus you can throw in some erosion on top of it, or an erosion mask, and boom, free detail, and now every game looks awesome

here's a common edge case, which you'd need to fix (how would the pathfinder, handle a building, placed above another building?) - in a 2D system, the coordinates wouldn't be taken into account properly, so it would cause some problems

3D pathfinding is already possible, in this case you would separate the wall mesh so it's not part of the navmesh (so there has to be another hill to get to the top with pathfinding). But would be another proposal anyway as it's not really related to terrain mesh generation itself.

I thought reduz already confirmed that when we add a terrain system it would have to support both heightmap and transvoxel?

I feel like this PR is a discussion that should be had after we decide to add a terrain system in the first place. If there is no agreement on whether or not we add a built in terrian system, it is kind of moot what kind of algorithm we use for the terrian. For further reading see: https://github.com/godotengine/godot-proposals/issues/445

I thought reduz already confirmed that when we add a terrain system it would have to support both heightmap and transvoxel?

I feel like this PR is a discussion that should be had after we decide to add a terrain system in the first place. If there is no agreement on whether or not we add a built in terrian system, it is kind of moot what kind of algorithm we use for the terrian. For further reading see: #445

i don't know, that proposal is so barebones, it's barely anything - plus i don't really care for voxels much, but i'm not looking for an automated system, this would mostly be handmade, there wouldn't be an algorithm, the artist IS the algorithm, so he would be in full control of what the terrain looks like, that's what i'm arguing for anyway, this isn't a terrain generation system, this is a terrain CREATION TOOL, the proposals are wildly different in that case

this is the kinda tool you would use, to create whatever you want, however you want it to look like, so it would be very manual, there wouldn't really be any kind of automation - the 3D plane is just the canvas your terrain would use, everything else is up to the artist himself (how the terrain looks, what details it has, etc)

what i'm proposing is a very, "do it yourself" kind of approach, just give the artist enough power to do, whatever the hell he wants to, u know?

i would automate the whole, uv map stretching thing, to stop the textures from looking weird if the geometry gets really strange, since i personally always found myself, having to deal with that problem in the Source Engine, and i always had to fix it by hand, but i'm sure that it's fixable, with some minor automation, but beyond that, i would allow the artist to go nuts

here's a common edge case, which you'd need to fix (how would the pathfinder, handle a building, placed above another building?) - in a 2D system, the coordinates wouldn't be taken into account properly, so it would cause some problems

3D pathfinding is already possible, in this case you would separate the wall mesh so it's not part of the navmesh (so there has to be another hill to get to the top with pathfinding). But would be another proposal anyway as it's not really related to terrain mesh generation itself.

i thought pathfinding wasn't gonna be added as a core engine feature?
i mean, i'm not complaining if it's a thing now xD

i thought pathfinding wasn't gonna be added as a core engine feature?

There is even a demo for it:
https://github.com/godotengine/godot-demo-projects/tree/master/3d/navmesh

i thought pathfinding wasn't gonna be added as a core engine feature?

There is even a demo for it:
https://github.com/godotengine/godot-demo-projects/tree/master/3d/navmesh

that's cool and all but, how does it handle an actual, complex game scene? was it used in a real game before?

it's a nice thing to have but, it's kinda pointless if nobody ever used it in a real world scenario yet, with some complex geometry, i mean, most games are not gonna look like a bunch of rectangular paths, so who knows what the pathfinder might interpret as an actual path, when in some cases, it might not realize that, maybe it stumbled on a background detail you were not supposed to walk on in the first place

i feel like that's pretty important to keep in mind either way

Godot 4.0 is using Recast/Detour (which is used in pretty much every engine), so pathfinding will be fine for the situations you posted above with the overhang. With that being said I do agree that having something other than a heightmap or voxel based terrain system would be very beneficial. Being able to manually move verts around would make detailing a world very powerful, and you wouldn't have to have custom models for rock overhangs and cave systems. I come from Source based tooling and although displacements are a giant pain to work with, it gives you great power and flexibility with what you can create. I'm not sure if its possible or not, but maybe have a voxel base terrain, but allow the mesh created to be modified (push/pull verts), this would of course make the voxels be non editable. Halo wars uses a vectorfield based terrain system, they have a GDC talk about it (https://www.youtube.com/watch?v=In1wzUDopLM). Having something like that in an engine out of the box would be a giant upgrade from just a heightmap based approach.

Godot 4.0 is using Recast/Detour (which is used in pretty much every engine), so pathfinding will be fine for the situations you posted above with the overhang. With that being said I do agree that having something other than a heightmap or voxel based terrain system would be very beneficial. Being able to manually move verts around would make detailing a world very powerful, and you wouldn't have to have custom models for rock overhangs and cave systems. I come from Source based tooling and although displacements are a giant pain to work with, it gives you great power and flexibility with what you can create. I'm not sure if its possible or not, but maybe have a voxel base terrain, but allow the mesh created to be modified (push/pull verts), this would of course make the voxels be non editable. Halo wars uses a vectorfield based terrain system, they have a GDC talk about it (https://www.youtube.com/watch?v=In1wzUDopLM). Having something like that in an engine out of the box would be a giant upgrade from just a heightmap based approach.

well I guess it's a good thing to know that i am NOT insane xD

i still hate voxels like the plague though, just give me a real 3D model - i'm just not a fan of voxels, to me it always felt like 3D but with extra steps, you always need to use some sort of trick to make it look decent, and i'm not a fan of taking weird shortcuts like these in general, if i can avoid them

For the moment, if you want to create 3D terrain with a mesh, consider using an application like Blender.

Was this page helpful?
0 / 5 - 0 ratings