#Enter the Gungeon poison/water/oil ground creep

28 messages · Page 1 of 1 (latest)

sick nest
#

By looking at Enter the Gungeon passives and guns, I have added quite a few things, but one thing seems difficult to replicate, the ground creep mechanic. [SEE PICTURE]
For those who don't know, different weapons in game create creep, which can be water, oil, poison, etc.
They are, however, not just simple scenes with an area that does something. They cancel each other out whenever a weapon or ability is used that creates other creep.
Even more impressive is the fact that the outer borders are seemingly pixel perfect, and certain creep reacts with other effects, most impressively oil and and fire weapon continously burns away the oil to create ground fire.
While creating simple fields of poison and fire is very doable, the above attributes make it it an insufficent option.
The only way I could imagine recreating this is using multiple polygon2D, but even then it seem very difficult, having to dynamically add and remove from them.
Is that the most likely approach? Or am I missing something obvious?

gentle oak
#

I don’t know to much but I would assume you make a new asset for the poison and water ect and then set variables for each then increase make checks every time you use a gun: if this gun is poison and I’m doing a oil so do the combination. Sorry if this was no help

sick nest
#

I guess I get your intent.

sick nest
#

This will be my last attempt before I assume that the only way to do this is through multiple multipolygonal structures that add and deduct from each others dynamically.

vestal dagger
#

aaah that sounds like some kinda cellular automata?

#

how much do you want to learn about lowlevel gpu APIs and compute shaders to get that perfect? 😂

sick nest
#

I'm sorry?
That sounds more complicated then the Polygon2D solution i'm forming.

vestal dagger
#

a polygon2d (especially when automatically converted into a collisionpolygon) could approximate that, but sounds less accurate for stuff like "fire burning a hole in the oil"

#

it's definitely a million times easier tho than the cellular automaton idea

sick nest
#

So you would agree that it would be the most likely solution to the problem?

#

If you do, we can end it here and I form a solution myself.

vestal dagger
#

at least the most likely one you can easily implement to get stuff done and then tinker with and potentially refine into something more complicated later, yeah

sick nest
#

Okay, thanks.
I will ask about things like "how to fill a Polygon2D with a texture" some other time.
Will mark as solved.

vestal dagger
sick nest
#

I see, thanks again.

scarlet elbow
#

I don't know how they implemented it but Instinctively I would create a big square on top of my rooms and I would have a grid (like a 2d voxel grid with a resolution as high as you want depending of the performances you want) and when an element hit a position, just set the corresponding grid cell to a value like fire = 1, oil = 2, poison = 3... then you could send this as a texture to the GPU (I implemented something like this it's not verry hard but it's not as simple as a texture with float it it) as an uniform to your big square. You could use value like -1 for wall / void and make it impossible to override.

Then you could sample from this grid on entity position to know what will affect them.

And to avoid it looking to pixelated, you could implement the marching square algorithm in your square shader

#

Also, for cells that need to be updated (like fire or steam or anything that dispear overtime or spread) you could do it on your GPU but you may have poor performance depending on your resolution. I would recommend you to at least implement it using C++ with the GDExension but a compute shader is the must suited for the job here but I don't know how they work on Godot

sick nest
scarlet elbow
sick nest
scarlet elbow
sick nest
#

Sadly it can't be translated 1:1 into Godot, or at least the polygon approach i'm going with

#

since seemingly each cell would need to be its own "scene" that managed things like lifetime, or what the surounding "goop scenes" are doing

#

especially for the expanding fire, which is the really impressive part

#

I could still set oil on fire of course, but it would probably either be "all at once" or via an "fire setter" scene that roams around the fire polygon and turns oil polygons into fire

#

and that can wait for now, my goal was to have more refined ground effects then just overlapping areas, after all

scarlet elbow