Hello dear game developer OR, people who love games, OR people who just wonder in my channel for fun
My name is Mohsen Zare
I love game, math and programming
And I just decided to create videos about those things that I love
English language is not my mother language so I am sorry if sometimes I make errors
I work with Godot as the game Engine, And I hope this open source game engine will grow day by day
Пікірлер
Which version of world machine are you using? Are these options all available in the free version or do you need to get the indie version/pro version? EDIT: I rewatched it and did hear you say free version, however I’m confused because the licenses for WM say that the pro version is needed for exporting tiles terrains. Any advice on this would be great! Thanks
I believe for free version there is a limitation for maximum terrain resolution! If I am not wrong it is around 1024! but you can check on their website to make sure!
very good. functional explanation.
Really turning into a very strong tool. Impressed by each new step. Good job!
Making great progress.
Fantastic as usual. Thanks, Mohsen!
Really enjoying seeing the plugin develop! (It's long after the fact now, but the process is educational.)
Really enjoying this. Thank you for sharing not only M-Terrain itself, but your description of how you developed it, how to use it, etc.
Glad it was helpful!
Fantastic video, on many levels. 2:11 "So now I solve one problem and then I create another." Human existence in a succinct statement! And one of the most enjoyable and maddening things about coding.
Thanks Jeff
It's working for me.. THANK YOU. I am having trouble getting my exported color map to show on the terrain, but I'm assuming I've done something wrong and will keep at it. Cheers again sir.
Can I use this map on my game ?
No problem with that, if this is good for you!
Technically Godot 4 is outdated. No HLOD, no ECS
What would be cool is if Godot added some highlevel class that makes using the Render/PhysicsServer easier for normal users. But then again how much data id the RID system using on its own?🤔
Currently in the game im working on, im combining multiple different meshes into 1 mesh using a modified mesh merger plugin. It's okay for a few 1000 meshes but it's cluttered and I'm feeling like I want to change it again
@@Chevifier Unfortunately also with rendering server we don't have a good news! As a testing just create 1 million instance in rendering server! it will take quite a lot RAM! OctMesh will create rendering server instance when the object is in visible range! Now my next step is to create something like this which also remove the node! then we are good to go!
@mohsenzare2511 plane C++ it is then. Vec3 struct and int id.😅 but Im not sure its possible to create our own renderer yet without recompiling the engine.
Are you still on Pop!_Os?
Not anymore, Now I use Manjaro
This is absolutely amazing! What a fantastic solution for handling large scenes. I do have a couple of questions and would greatly appreciate your clarification. Firstly, can this solution be applied to all types of models and assets in the game, such as foliage, trees, buildings, NPCs, and enemies? Secondly, can it function similarly to asset-streaming, where assets are loaded on-demand based on the player's position? For instance, when the game starts, not all assets are loaded at once; instead, only those within a specific radius around the player are loaded. Asset-streaming is crucial for managing large scenes efficiently, as it reduces initial loading times and optimizes VRAM usage. Thank you in advance for your time and insights!
Hi There! the answer to your question is yes! so let me clarify how all these things you are saying will work! By now I only implemented a OctMesh node which is similar to meshinstance3D which works on top of Octree! But you can create any other system you want on top of Octree! As an example you want to create something that load a bunch of stuff as camera get close to that! First you register yourself as a subsystem of octree! you send all of your loader position into octree! and then octree will send you a notification when the camera get close to one of your loader! For example you can say if my loader lod is less than 3 then load all stuff and if it is greater than 4 unload them! Now this take away the need of constantly checking if camera get close to one of your points! Also Octree will do this stuff really fast! ... By the way about octmesh you can use that for anything you want like enemy-mesh and so ... For vegetation maybe octmesh is not good enough! Maybe we can create another system on top of octree which create multi-mesh! But take in account if you are using MTerrain consider using Grass system for anything is possible! Grass in MTerrain has really small data! you an cover an entire terrain with few MB of memory! the only downside of Grass is that you can not set the exact position and rotation of each Mesh!
@@mohsenzare2511 so, for my first question, yes I can use any mesh or asset that want except for the foliage it’s better to use MTerrain’s grass system, this is totally clear, however if I used the grass system I won’t be able to set the rotation and exact position, but can’t I paint the grass and foliage manually? In large open spaces or forests I could add foliage and grass procedurally but in places where I need to place foliage in specific position can’t I paint foliage manually?
@@amirosman8797 Yes You can paint them. There is a grass paint tool! just select the grass and activate paint mode! and paint grass on Terrain where you want!
@@mohsenzare2511 Fantastic, thank you very much for your support and I would really love to see what else you have in store for us
memory allocation... With great power comes great responsibility.
Very Informative, Thanks for the in-depth explanation, Origin and historical dependency. I really love the knowledge density of your videos.
Glad you like it
Octree are always slower than grid, you can traverse visible grid very efficiently because you only query interval 'scanline' by 'radterizing' the frustrul in the 2d projection of the map. Ie direct query no rejection. If you need 3d query it's as simple as adding a vertical interval clamp after the 2d pass per columns.
Maybe I not understand exactly what you said, but correct me if I am wrong, you mean instead of octree using a grid and see each points belong to which cell? If I am correct, octree itself is also some kind of grid but it is just non uniform! it means less octant for places with no points and more octants for where there are more points! this better specially if we have more points in some part of the space and many empty places at other!
@@mohsenzare2511 it's all the same, BUT octree is great for really sparse distribution, IE vast empty space with very few random elements. But that's not your case, you have a really dense distribution, grid would be faster, and if you need it hierarchical grid would be the next option. Octree is also implicit to grid, except you aren't limited by boundaries. Think of it like query ranges you can hash by power of two the position+offset to get a virtual floating octree relative to the offset. There is a guy making name Geno's on gbadev, who used octree for 3d rendering on GBA, we told him the same, he took him a long time to shift, but it was faster. Godot itself used an octree until someone refactored it into a hierarchical grid and gained significant speed up. Grid have a nice lay out, coherent in memory. Octree have level of indirection and jump around the memory.
will this be integrated into your terrain plugin (btw i love it, from all the terrain plugins there yours gives the most fps)
Yeah it will be on top of MTerrain
Any suggestion for how increase perfomance when you have a lot of collision shape(enemy) that move to the player? I rised performace using sphere instead of capsule for collider but it is very limited
What you said depend on Godot physics itself! But yeah using more simple shape will help to gain performance!
Amazing tutorial! Definitely worth my subscription. Keep it up! ;)
Thanks for your support, I will
There is no where one million meshes in the scene, there is about 1.000 Godot would break into multiple pieces if you have 1.000.000 meshes showing at the same time. It's not even close. Click bait title
As explained in video only meshes in radius of 200 meter are visible in both method!
Clickbait? What does the title say in your language? Also, a scene with 1000 meshes is large, I think.
Love your work. Please keep sharing, teaching and explaining! Thanks you.
Thanks!! :)
man.. you're a legend.. excellent tutorials.
Glad you like them!
thanks a lot for these tutorials, you're the best :D
This is wild, thanks for sharing
Thanks for watching!
My idea has been to use a Multimesh and have some way (waves hands) to find the instance-indexes in an area around the player. Then you set the scale on those instances to zero and replace them with MeshInstances + Colliders. That way you walk-through a field of multis but the things around you are more 'real'. I also want to place smaller Multimeshes so that they can LOD by themselves as a group and not look too bad; also so they don't take to much time drawing off-screen. I do wish Godot had more functions built-in, like the quad-tree and so on. Their BVH system is very slow in the editor, so tools suffer. Another idea I have is to draw, say, a forest with MeshInstances (in the editor) and then have a tool that finds all common meshes across that forest and gathers those into (chunked) Multimeshes. So all the leaves becomes one multimesh, the trunks, etc. Last idea, sorry: I wish Godot would implement a way to 'enter into' a Multimesh and let me edit (move, scale, rotate, delete, add) instances just like one can with normal meshes. A partial solution for this is a node I made in the Library. Vid here: kzread.info/dash/bejne/nHmqt6-jctq3gbA.html Anyway, thanks for the work you are doing!
The things you explained to me are good! but don't think that multi-mesh is going to solve anything for your! MeshInstance and Multimesh both they have their use cases!
hardware specs?
Bro this is awesome thanks for doing this!
Thank you!
Each your video is mind-blowing!
Thanks you always! :)
Awesome video. Thanks for sharing!
Thanks for watching!
A spatially partitioned multimesh still has better performance. Divide your scene into a grid, where each cell is a list which contains the positions of each mesh in that cell. Every frame, concatenate the current grid cell, and the 8 cells around you into a list, and send the list into the multimesh. Esentially, this is faster by precomputing the object distance check
In this case as we have a bunch of monkey head with same mesh yeah it will work better! but in real game we can not create for every single mesh a multi-mesh! sometimes you need one mesh somewhere in your big map and another mesh beside that! you won't create for every single of them a multimesh! And in that case this MOctMesh has better performance! By the way my main goal here to create other things on top of this octree! not just MoctMesh!
Yes, that's a good point!
awesome work! I have a question - why use this and not a multimesh? or some variations of multimesh. multimesh as I know acts as a single node/object
Multimesh has some limitation! If you create bunch of meshes with multimesh, Even if you look at one mesh all multimesh should be rendered! But if you create that with MeshInstance if that mesh instance go behind the camera or get further away it will not be rendered! basically MeshInstance render only when camera look at it! Also with meshinstance we can control much better the LOD level! Both MeshInstance and Multimesh has different use cases!
@@mohsenzare2511 can't you control where the multimesh population is based on the camera movement at runtime?
Practically no! then you should destroy the entire Multimesh and resend all meshes transform data to GPU again and again! Multimesh usually used when you have one mesh which should be rendered a lot of time! like grass mesh! but for things like enemy mesh, car mesh, statue, doors, walls and ... which they have a lot of vertices in one mesh you better use MeshInstance3D with different LOD level!
@@mohsenzare2511 great explanations! thanks a lot. will a game ever need 1 million enemies, cars, etc?
That's depend on your game! If you don't make an open world game no! But if you make an open world game! if you want to populate that you will need a good system which handle a lot of meshes!
I have this working now and it is very impressive so far. I needed to remember to call create_grid() in the scene ready and with the current version, after a run, I need to click create for the terrain in the inspector to recreate the terrain in the editor as it does not show after a run. This is an alpha release so behaviour like this is to be expected. This has tremendous potential. I'm currently implementing DevMar's approach and am generating textures using satmaps in gaea. If I can implement a nine square loader and handle movement between scene tiles (so multiple MTerrain based tiles) as well as moving from satmap textures to splatmaps and small texture tiles, then this will allow me to have earth scale terrain (my very specific aim for my game) with high resolution textures close to the player at minimum resource cost. I'm very keen to see how this progresses and will probably implement this on a branch in my main game code base. Excellent work sir and the tutorial videos and wiki have been extremely helpful. As you say, some effort is required to understand the concepts of your specific implementation, but I'm getting there. Complex systems require effort to be clearly understood, but I think with this, the effort is well worth the reward.
Brilliant, just got this working by selecting Forward+ rendering mode. It crashed for me on Compatibility mode which I had had set for previous projects. This has great potential.
This is an extremely exquisite structure, thank you for bringing it
Great series, thanks for making it. It's full of useful information that's otherwise hard to find. One thing is troubling me though and as a SCons noob cannot seem to solve it. When building, the default place for compiled object files is right next to their source files. This makes a bit of a mess and interferes with version control. Is there a way to tell SCons to put object file into a separate directory?
Subbed
bro just make it so I can bring up mountains and lower valleys with the mouse cursor like in sim city otherwise if I have to go through a 45 min video I might as well just do it myself instead of getting an addon. Dont mean to sound harsh but thats honest user feedback.
i dont like that it so involved with scons and what not, i wish the process to write gdextension was much simpler
In c++ usually you need to put some time to learn its compile system! But it worse it!
Is it possible to do bake lightmap on terrain that is generated by this plugin?
I never tested! but even if is it possible it is not a good idea! baking light-map is not for big things like terrain! for this kind of things usually the best solution is global illumination!
Heyy, i was wondering whether this is heightmap or voxel based terrain?
This is heightmap base
really love your work, very informative and very inspiring
Thanks glad you like it
Fantastic! Many thanks 👍👍
duuuude this helped me so much, i am doing a build of ffmpeg for godot, wish me luck :v
I'm trying to learn from watching KZread vids. What should I watch to be able to learn how to understand what is on the screen? I guess I mean I need to learn to code... Should I get a book off Amazon? Thank you
If you are at beginner level, you mainly need to learn the game engine logic, and gdscript! there are a bunch of tutorial online, also Godot has a very good documentation, So I don't think you will need to buy a book! by the way in my channel I usually make more advance tutorial, so I suggest to watch other video from other channels!
This video series is really detailed and inspiring! The chapters are really well orgnanized too! Thank you so much for creating them!
very cool, now make this procedural endless world
thank you so much, your gdextension videos have been really useful to me. i have a question though, is it possible to add categories like you can in gdscript using "@export_category"?
Yes you can have it, in Property-info function there is a property usage which is PROPERTY_USAGE_CATEGORY and you can create a category with that! just create a dummy property and set its usage to above! by the way for adding group and subgroup we have two macro: ADD_GROUP, ADD_SUBGROUP, I can not find any macro for category so you can make them this way!
@@mohsenzare2511 it worked! thank you dude, time to get my hands dirty with gdextension
I arrived to this myself, using a little less efficient method, but I can see you have same problem, as in in exact places where there is transition between x-y-z planes there is an artifact line.
I actually like more how my method looks: float yDot = abs(lNorm.y); float zDot = abs(lNorm.z); vec2 uvCords = lVert.yz; float sDot = abs(lNorm.x); if (yDot - sDot > 0.001) { uvCords = lVert.xz; sDot = yDot; } if (zDot - sDot > 0.001) { uvCords = lVert.xy; sDot = zDot; }
"promosm" 🌸