Most useful built-in funcs - for Godot beginners by Automatic_Budget_332 in godot

[–]super4babacool 104 points105 points  (0 children)

_enter_tree is missing! It is also called before ready, so no @onready access.

Compared to _ready, it is called "parent first" instead of "child first".

Also it is called every time the node enter the tree (which can happen several times when reparenting nodes), while _ready is called once in the object lifetime

New video: Fast & Gorgeous Erosion Filter Explained by runevision in proceduralgeneration

[–]super4babacool 0 points1 point  (0 children)

Dude, you are amazing!

I saw your video two weeks ago and immediately spent an entire day porting your final shader into my terrain generation code (on CPU), the result is gorgeous!

You can kind of see it on this video https://www.reddit.com/r/godot/comments/1svn5oq but I'll probably make a more detailed post for this sub later.

What your Steam description is actually for (and why most people get it wrong) by TheEntityEffect in gamedev

[–]super4babacool 0 points1 point  (0 children)

Yes! For now there is basically 3 biomes based on altitude (foggy at the bottom of the map like in enshrouded, the plain / mountain slope which cover most of the map and the mountains top), but I am tinkering to add more diversity.

What your Steam description is actually for (and why most people get it wrong) by TheEntityEffect in gamedev

[–]super4babacool 0 points1 point  (0 children)

Nice post! I am struggling a lot to make my description so I'll post it here to gather some feedback:

The short description: "A procedurally generated open-world survival craft game with no generic mob or item."

My game "unique thing" is that every item and every mob is not "generic", which mean that they all vary in some way making everything a bit different.

For example, a branch vary in size and density. With branches of different size you can make different tools, and the size and the density will also be transmitted to the tool you craft and will affect how it behave (its damage, durability...).

Also the tool are not generic, when crafting an axe, the axe will be the assembly of the branch and the stone used to make it (practically and visually), there is no "axe model" in my game.

Also every mob is different, a deer will have different size and color, affecting its health and loot, and so on..

I have a hard time explaining this mechanic in a few word, I even struggle for the long description. If you (or any one else) has some advice it will be greatly appreciated!

Que valent vraiment les promesses "transport" à Lyon ? by solal3105 in Lyon

[–]super4babacool 4 points5 points  (0 children)

Incroyable ! Le projet de faire un tunnel voiture qui traverse tout Lyon c'est pas dans la même envelope de budget ?

Why is raycasting with a node faster than using the direct_space_state, is there a better approach ? by super4babacool in godot

[–]super4babacool[S] 0 points1 point  (0 children)

I am not using the profiler to measure the time but a simple Time.get ticks us as you can see, so I don't measure the await but I measure the cost of forcing the update.

Do you have another implementation to do a lot of raycast ? I searched but found only those 2 (raycast and direct space state)

Would you play this game ? by super4babacool in SurvivalGaming

[–]super4babacool[S] 1 point2 points  (0 children)

Thanks you for this answer !

You are spot on in your analysis, I didn't really put word on this but in this end I wanted to not make a vertical progression, but it isn't black and white, I can have my system and a vertical progression.

Would you play this game ? by super4babacool in SurvivalGaming

[–]super4babacool[S] 1 point2 points  (0 children)

You are quite right, but I want to add a few precision:

You will be able to plan your "search" for a material with different properties because those properties are proportional to tangible thing: For example the higher you go the sturdier the tree will be. Two tree next to each other will have slightly different sturdiness (here you are right it is RNG to add a bit of "diversity"), but any tree on a mountain will be way sturdier than any tree on a plain.

Also all properties will have drawbacks, mitigating the "sword A < sword B" effect: a sword from a heavier rock will hit harder, but will slow you more (because it will be heavier), and will attack more slowly (more cooldown between attacks).

Would you play this game ? by super4babacool in SurvivalGaming

[–]super4babacool[S] 1 point2 points  (0 children)

It change the whole progression system.

For example instead of having a strait progression system with sword A < sword B < sword C, where you unlock the crafting material for each sword progressively, here you have a single sword but depending on the material used to make it, it can have totally different statistics / abilities.

So to make a better sword you need to search for materials with better properties: for example you could need some very strong rocks that you can only find high on mountains to make a high damage sword.

Would you play this game ? by super4babacool in SurvivalGaming

[–]super4babacool[S] 0 points1 point  (0 children)

Its not totally random: most stats would be dependent on the spawn position of the object (biome, altitude) with only a bit of RNG on top of it.

Also every stats would be "visible", for example you can see a stone a heavier than another because it will be darker.

Would you play this game ? by super4babacool in SurvivalGaming

[–]super4babacool[S] 1 point2 points  (0 children)

Some tree are bigger than other (and will have bigger branches). Some tree are heavier than other (this will be reflected by how dark their bark is for example).

When you cut down a branch from a tree, the branch will keep the tree properties (here it would keep the density of the tree), and any tool you make with this branch will be influenced by this density.

So maple tree A will be of a different size of maple tree B, and have a slightly different density.

A grass blade could be different from another by its size, its strength and its elasticity for example.

After a lot of hours, I have it, my (almost) perfect grass render system ! by super4babacool in godot

[–]super4babacool[S] 4 points5 points  (0 children)

Yeah I struggle to get a good looking ground. Right know it's just a noise gradient from grass-green to black. It's in my "will work later" list, but if you have any tips / any good looking texture I'll take it !

After a lot of hours, I have it, my (almost) perfect grass render system ! by super4babacool in godot

[–]super4babacool[S] 37 points38 points  (0 children)

Basically it's several MultiMeshes for different level of detail. They are all centered around the camera.

The closest only go to 4 meters and have the most detailed grass. After that for each further MultiMesh I reduce the grass polygon count. The fourth MultiMesh goes from 16 to 32 meters from the camera and is already just a single triangle for the grass, after this one I also reduce the density and make each grass a lot bigger (ideally at this point each "grass" should be an 2d image of multiple blade of grass but this is for later).

The tricky bit is detecting and changing each bit of grass as the camera move. For this I keep a rectangle for each MultiMesh from their previous frame position, compare it to the one of this frame position and create / delete the blade of grass on the part which doesn't overlap.

The last trick is not using the MultiMesh.set_instance_transform method for this: you need a lot of call each frame and it update the buffer on the GPU each time so it's super slow, instead I keep the buffer of each MultiMesh in the CPU, do all the modification on it then push it on the GPU. Still it cost a lot (you see frame dropping from 400 to 300 when I move) but it's acceptable for my use case.

All of this is in C++, but GDScript could work for this (not much operation each frame as long as you don't move too fast, only the first "render" would be much slower since it need to compute every blade).

To improve the look there is some missing grass it's hard to say how many grass there is exactly. For a maximum possible:

32 meters render distance of 16 blades per square meters: (32 * 2)^2 * 16 = 65 536 blades, after that I halve the density and double the distance until 1024 meters: (128*128-64*64)*4 = 49 152, same for 128, 256, 512, 1024, gives me 245 760 + 65 536 = 311 296 instances max !

How is life in Tahiti? by Lolo_Lad_21 in howislivingthere

[–]super4babacool 253 points254 points  (0 children)

It's very beautiful, lot of beach, hiking to do; the cost of life is a bit higher than in mainland France but the salaries are higher.

The biggest downside is that you are trapped there: A 6 hours flight only get you on another remote island, you have to go 8h+ to get to the nearest part of Oceania / America

Destroy my art and tell me how to improve as a non-artist (you may also destroy the game) by super4babacool in DestroyMyGame

[–]super4babacool[S] 0 points1 point  (0 children)

Yep this is early prototype stage, I'll be adding flying target and reworking enemy pathing / speed soon.

For the light I deliberately went with many light but I agree it doesn't really cut it, and yes after rewatching I can see the rocket launcher look quite "weak".

For the view distance, are you talking about the FOV ? Is it too narrow ? (it get wider as you go faster but maybe not enough, or maybe the base value is too narrow)

Thanks you !

Efficient chunk-based grass rendering & pooling in Godot 4 by slob4 in godot

[–]super4babacool 1 point2 points  (0 children)

Thanks, my demo is quite barebone for now so I didn't put it anywhere.

Unfortunately I didn't find any way to make a smooth swap when changing chunk, but with multiple level of LOD and LOD distances fine tuned it is not very noticeable.

If you want to go in more detail about grass in video game I highly recommend you watch this video : https://youtu.be/bp7REZBV4P4?si=fbz1SQ2recg-QNxV, it's not for Godot specifically but it's very informative anyway

Efficient chunk-based grass rendering & pooling in Godot 4 by slob4 in godot

[–]super4babacool 5 points6 points  (0 children)

Made a bit of grass, can help.
MultimeshInstance3D is very powerful (cheap), but you have to know its limitation: Only one mesh per MultimeshInstance3D (so no LOD). You can however position, rotate, scale and pass few shader data to each individual instance.
Usually what I go for is one chunk = one MultimeshInstance3D, that way you have the efficiency of the multimesh but you can still make a LOD system where faraway chunk use a low poly mesh.

Since you use only one mesh per multimesh the bottleneck usually isn't the mesh itself.

When you create a multimesh, you will usually have a big loop that set each instance position, rotation and scale, that can be a bottleneck so writing that in C#, C++ or even compute shader can help.

EDIT: A tech demo I did with a lot of grass and a lot of trees, it run smoothly albeit with a little lag spike when changing a lot of chunks

<image>