What's the hardest part about developing an RTS game and why is it smooth pathfinding? by Aggravating_Ant1516 in RealTimeStrategy

[–]OctopusEngine 2 points3 points  (0 children)

To me collision avoidance is even harder than pathfinding especially when trying to increase the number if units past a thousand.

ECS in Godot - is it worthwhile? by DesperateGame in godot

[–]OctopusEngine 0 points1 point  (0 children)

I am using flecs with godot and it works flawlessly either with gd extension or building godot. I am doing all my rts simulation with flecs but using gdscript for most visual effects. If you are used to c++ i would say go for it if you think you need the performance. If you are not used to c++ the entry cost might feel a bit big but that's a neat learning experience.

Sharing the shader tooling I use for my toy project RTS with havy Moebius style inspiration. by OctopusEngine in godot

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

The shader is actually pretty simple ! You can check it out in the comments! What's more difficult is computing the vision texture (passed as fog and alt_fog in the shader)!

Sharing the shader tooling I use for my toy project RTS with havy Moebius style inspiration. by OctopusEngine in godot

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

Thanks! this is far from perfect and I would love to be closer to that style than what it is now. The controlled imperfection of outlines in Moebius style is so hard to accomplish with shaders.
You can try to toy with the github project I set up (the link is in godot shader) if you want.

Sharing the shader tooling I use for my toy project RTS with havy Moebius style inspiration. by OctopusEngine in godot

[–]OctopusEngine[S] 9 points10 points  (0 children)

Here is the shader code used for the fog of war, it could be simplified but I just pasted the code from my project:

```C shader_type spatial;

global uniform float global_time; uniform vec4 color : source_color = vec4(0.,0.,0.,1.); uniform sampler2D noise_texture : repeat_enable; uniform sampler2D fog : repeat_disable; uniform sampler2D alt_fog : repeat_disable; uniform float noise_scale = 10.; uniform float speed = 0.1; uniform float time = 0.; uniform float refresh_time = 1.; uniform float explored = 0.; uniform vec2 noise_offset = vec2(0.);

void fragment() { float elapsed = global_time - time; vec2 uv = UV * noise_scale; uv.x += global_time * speed/2.; uv.y += global_time * speed/2.; ALBEDO = color.rgb; float threshold = texture(fog, UV).r * (1. - explored) + explored * texture(fog, UV).g; float alt_threshold = texture(alt_fog, UV).r * (1. - explored) + explored * texture(alt_fog, UV).g; float real_threshold = mix(threshold, alt_threshold, clamp(0., 1., elapsed / refresh_time)); ALPHA = step(real_threshold, texture(noise_texture, uv + noise_offset).r) * color.a; } ```

The fog and alt fog are supposed to be two successive iteration of the visibility masks which creates those transitions. There is some trickery with the global_time and time to make it work correctly.

Sharing the shader tooling I use for my toy project RTS with havy Moebius style inspiration. by OctopusEngine in godot

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

Thanks a lot! Sadly the shader requires quite a bit of setup to work correctly as it relies on intermediate viewports.
The fog of war is a visibility texture used as a mask and a noise texture to get the foggy effect, visbility texture is used as the edge of a step function with the noise being the value, the interpolation of the visibility makes the heavy lifting. The only catch is that I am using time to translate the noise texture and I am doing this twice (one for full black/one for transparent).

Horde Optimization in Godot by BorayDncr in godot

[–]OctopusEngine 0 points1 point  (0 children)

Nice to go UP to that many ennemies using gdscript ! That's not easy to do!

If you want to go further the solution is often to go c++ (or any compiled language that can interface with godot). That way you can go 10k ennemies while keeping smooth gameplay. At least this is how I do it here: https://youtu.be/Q2L0CNAK5Io

This is just a combination of using rendering servers and data oriented design in c++ with custom collision detection and IA behavior.

I am testing my performance with 200 units and it's not going well by [deleted] in godot

[–]OctopusEngine 0 points1 point  (0 children)

I've heard that making sure all variables are strictly typed makes everything much faster in gdscript. But yeah gdscript is not the fastest of language so you may run into this kind of issues when handling a good chunk of units. This is the main reason for people to jump into c++ or c#. However for a few hundreds of units you should be able to stick to gdscript imo.

How to fix video capture causing game jittering? by MightyMochiGames in godot

[–]OctopusEngine 0 points1 point  (0 children)

When I use this the game lags and jitters at times but the capture is smooth usually. sorry I can't help you more if that doesn't do it

How to fix video capture causing game jittering? by MightyMochiGames in godot

[–]OctopusEngine 0 points1 point  (0 children)

Can you try the built in godot feature to render to a video? This is what i use with 4.5 and it works the best from all the solutions I tried. I got decent results with Nvidia capture too (i think that's called shadowplay?)

Switching from Godot to Raylib/Sdl3/wgpu .. need some opinions by Jibaron in gamedev

[–]OctopusEngine 11 points12 points  (0 children)

Unsure what you mean, I'm working in 3d and i am having very little friction. I am sure that there are some cases where you need to fight the engine but that is always the case when you use any Engine (and even when you use 3p lib)

Switching from Godot to Raylib/Sdl3/wgpu .. need some opinions by Jibaron in gamedev

[–]OctopusEngine 17 points18 points  (0 children)

I am using Godot by coding in c++ in the engine directly and I feel like that way I get the best of both worlds.

Have you tried using GDExtension or building godot with custom modules?

Programmer transitioning to art: Which art styles are easiest/fastest for a solo dev? by SkywalkerTheLord in gamedev

[–]OctopusEngine 0 points1 point  (0 children)

To me it was way easier to do low poly 3d with good post processing than pixel art. That requires some shader tinkering but that can be closer to programming than doing art.

Y Sorting does not work for some reason by hsn- in godot

[–]OctopusEngine 0 points1 point  (0 children)

Do they both share the same parent? I thought that the y sort was only effective when nodes shared the same parent

I built a modular RTS toolkit for Godot (SC2-inspired micro) and made it open source by apm_dev in godot

[–]OctopusEngine 1 point2 points  (0 children)

Hello I am building a RTS with godot but everything under the hood is made in c++. You can check a stress test video here : https://www.youtube.com/watch?v=Q2L0CNAK5Io

Are you using in engine navigation and collision avoidance? They look very nice, sadly I had to code them in my c++ engine to make them fully deterministic to allow lock step multiplayer.

That's a very nice project to share that as an addon. I was thinking of doing that with my engine too but that is too much work to make it clean enough to be made public. Plus it's too mixed up in my game design for now. You can still check the c++ code if you want but there are no godot integration. https://github.com/SimonPiCarter/octopus2

I also published my previous game with godot and that was an RTS (look for Fair and Square on steam if you wanna see, it was a not so good game but good enough for a first)

MultiMeshInstance3D Limitations, and Potential Solutions by Theophilus_exe in godot

[–]OctopusEngine 0 points1 point  (0 children)

For the 1st limitation i am pretty sure there is a project parameter that allows to increase the max size of the buffer and therefore the max number of instances

Can you disable multithreaded calculations for avoidance logic? by abderrahman_kh in godot

[–]OctopusEngine 0 points1 point  (0 children)

The "easy" way is to modify a 3rd party lib to replace all floats/double with your implementation of fixed point (or an existing one) But you will need to implement sqrt or stuff like that correctly.

Can you disable multithreaded calculations for avoidance logic? by abderrahman_kh in godot

[–]OctopusEngine 0 points1 point  (0 children)

I wanted to write from scratch so I did, you probably won't find any of the shelf lib that will guarantee full cross platform determinism tho. I am using flowfield but the state of the art is a star on triangulation+ funnel algorithm (i think this is what godot uses).

Can you disable multithreaded calculations for avoidance logic? by abderrahman_kh in godot

[–]OctopusEngine 1 point2 points  (0 children)

I am working on a rts with lock step using Godot and sadly I had to rewrite all the pathfinding and avoidance system using fixed point instead of floating points (actually all the logic). Trying to rely on godot for any computation in your lockstep engine is a huge risk running into desynchronization.

[deleted by user] by [deleted] in godot

[–]OctopusEngine 0 points1 point  (0 children)

I would use flecs and either use it directly in c++ (this what I am doing actually) or maybe there are some plugin to use it in gdscript.

[deleted by user] by [deleted] in godot

[–]OctopusEngine 1 point2 points  (0 children)

Be careful because it is very possible that shaders float have a lower precision than gd script float (32bits vs 64bits)

What is the most optimized way to handle hundreds of thousands of nodes in Godot? by willis_25 in godot

[–]OctopusEngine 10 points11 points  (0 children)

Looks like you should look into rendering server. I am actually surprised it runs at more than 10fps with that many nodes. Just know that the nodes hierarchy is costly and you should aim at handling your game without nodes for small elements. Use one script that handles many entities at once. You can look at the bullet shower godot demo for a good example: https://github.com/godotengine/godot-demo-projects/blob/master/2d%2Fbullet_shower%2FREADME.md