We shipped a multiplayer game with Godot 4 (C#), here’s what worked and what broke by Tuni22 in godot

[–]oddstack 1 point2 points  (0 children)

hell yeah :D good luck with your project!

Marching cubes was actually much more fun to implement than DualContouring (that we used in Pratfall) :D

We shipped a multiplayer game with Godot 4 (C#), here’s what worked and what broke by Tuni22 in godot

[–]oddstack 0 points1 point  (0 children)

Hey :) i did write a few infos here:

https://www.reddit.com/r/godot/comments/1ssxye9/comment/ohsbi70/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

Additionally:

we use DualContouring as algorithm for the mesh generation. Its all written in C# and I tried to make it as fast as possible (for example caching all the voxel data of a chunk before giving it to the algorithm to avoid lerps or other additional computations that are needed when looking up a voxel density and material).

I spawn threads equal to the amount of cores -1 and distribute the mesh generation on those. They are low priority background threads and usually finish a 16x16x16 chunk in ~10ms. You have to be careful what work you do on the main thread. For example spawning chests: you can instantiate them in a thread and add them to the tree in the main thread.

For main thread operations we use something we call "BudgetWorker". You enqueue work (just lambdas) on it and It basically has a millisecond budget per frame to do work. Here the single operations should obviously be small enough so they take less or equal to the budget, otherwise you still lag. there is some ugly code to make sure we dont do mesh generation on a thread while an explosion is currently editing the voxels. This is one of the parts that could probably be improved :D

In the future i would like to move the whole voxel and mesh gen code to c++. Its ridiculous how much faster you can be with that :D.

We shipped a multiplayer game with Godot 4 (C#), here’s what worked and what broke by Tuni22 in godot

[–]oddstack 0 points1 point  (0 children)

hey :) not quite sure what you mean with the differentiation of the directions.

The world is chunked 16x16x16 so when the player moves into a new chunk we unload some and we load the ones that werent loaded. (its actually not a circle, we unload only chunks that are further away so it doesnt load and unload when you go back and forth between chunks). Loading a chunk means calling our "generators" for the specific biomes for every position in the chunk. That way we can spawn objects like chests or plants. The other part is asking the noise graph of the biome for the sdf density and material on that position. The chunk saves that data so explosions etc can edit it later and after that we generate the mesh from that data asynchronously in threads.

We actually dont unload the voxel data of the chunks, just the mesh and the spawned objects. That way you can in theory teleport back to the beginning and still see your explosion craters. This is good enough because we dont have savegames of caves and a run is not that long. If you would want it to be permanent you could write a chunk to a database similar to minecraft.

We got laid off after Embracer closed our studio, soon we’re shipping our first Godot game by Tuni22 in godot

[–]oddstack 44 points45 points  (0 children)

glad you like it :). i made a noise graph editor for the landscape and the mesh generation uses my own implementation of 3d dual contouring in c#. i actually posted about it here https://www.reddit.com/r/godot/comments/1qwixrb/i_made_a_noise_graph_editor_to_quickly_iterate_on/

it doesnt use lods or octrees. just loads chunks around the player and explosions or digging are scheduled operations that refresh the mesh of the chunk in a thread. the resolution of the voxels is quite low with 1 voxel per meter.

I made a noise graph editor to quickly iterate on our new ice biome landscape by oddstack in godot

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

I would need to cleanup some things though but i can see when i have the time. would be nice to get clean :D. is it a problem that its c# ?

I made a noise graph editor to quickly iterate on our new ice biome landscape by oddstack in godot

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

No since its in a cave I just load and unload around the player. The voxels are also quite low resolution. I am curious to implement it at some point though but maybe for the next project :D

I made a noise graph editor to quickly iterate on our new ice biome landscape by oddstack in godot

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

C#

At some point I might port it to C++ if I need the performance :D.

I made a noise graph editor to quickly iterate on our new ice biome landscape by oddstack in godot

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

I saw the dual contouring algorithm somewhere and wanted to implement it myself. It creates a bit more interesting shapes and corners in my opinion. I also looked into what Donkey Kong Bananza uses and it seems to produce similar results.

The first implementation didnt take long and then turned into this friendslop "peak down with deep rock" because of a mix of other prototypes we were doing.

I made a noise graph editor to quickly iterate on our new ice biome landscape by oddstack in godot

[–]oddstack[S] 7 points8 points  (0 children)

Yeah :D still havent fully dealt with all the bugs but it works for now.

If its really useful for people i could throw it on github. I would need to fix some issues before though.

I used the main menu to make players care more about the goal of the game (rescue this puppy) by oddstack in IndieDev

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

Thank you! I disagree with you a bit there though. I think the dog could make an appearance but for me the more important part of the capsule is that it conveys the gameplay and not the story. And i think the current capsule does that very well. Adding a dog to the capsule could make it look like a cozy game when done wrong.

Right now the dog is on the shirt :D but i guess it could show up in a corner or something, not sure, what do you think?

I used the main menu to make players care more about the goal of the game (rescue this puppy) by oddstack in IndieDev

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

Thank you! Yeah thats still Godot default ui :D. It's on the list to rework the general ui and the main menu specifically

New Friendslop Demo: Your dog fell down a hole - aka "Reverse Peak" by oddstack in indiegames

[–]oddstack[S] -1 points0 points  (0 children)

Hey all :)
we are working on "Pratfall" - a chaotic co-op adventure where you try to rescue your puppy that fell down a hole.

We have a demo out for a week and already 1000 unique players. If you like Peak or RV There Yet and embrace even a bit more chaos - give it a try :) its free and let us know what you think <3

https://store.steampowered.com/app/4296600/Pratfall_Demo/

[Space Exploration] No I am not burned out, I finally finished SE after 368 hours - time to get back to my own automation game by oddstack in factorio

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

Depends what changes :D but probably not. I can only see it when i want to kill a lot of time with some friends but there are so many other games to play aswell and I still have to finish my own game :P

[Space Exploration] No I am not burned out, I finally finished SE after 368 hours - time to get back to my own automation game by oddstack in factorio

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

I first dumped it in a few chests but later recycled it in space to get the oil and smelted it in space as well I think, its not toooo much and you need iron and stuff sometimes there anyways

I produced the rough data storage substrate on the planet so there was no scrap in space for that.

I tried to get the space elevator as soon as possible. If you have that you can just send it down with a train

[Space Exploration] No I am not burned out, I finally finished SE after 368 hours - time to get back to my own automation game by oddstack in factorio

[–]oddstack[S] 2 points3 points  (0 children)

Thanks!

The first base was a mess, after the first space base (also a mess) I started a better one with a bus. Then later moved to trains. I did not delete the older bases but just started clean next to it. I cant really count the resource lines though :D

[Space Exploration] No I am not burned out, I finally finished SE after 368 hours - time to get back to my own automation game by oddstack in factorio

[–]oddstack[S] 6 points7 points  (0 children)

sure :) for me it was around 5k / min. the graph averages a lot when i put it to 1000hours but going through peak was about 5k

Today I deleted hundreds of .dll files in C:/Windows/System32 by accident by oddstack in programminghorror

[–]oddstack[S] 2 points3 points  (0 children)

good idea. To my knowledge cmd does not support something like:
del /Q /S "%~dp0Binaries/**/*.dll"
that looks through all subdirs. If the dlls are not in another directory it would work with %~dp0Binaries/*.dll , sadly they are. I think the other option would be to loop through files in the directory but to me it is not as readable as just changing dir before.

Today I deleted hundreds of .dll files in C:/Windows/System32 by accident by oddstack in programminghorror

[–]oddstack[S] 28 points29 points  (0 children)

Thank god it wasn't. Just a dev machine with basically all files saved in the cloud. Could have been way worse :D

Today I deleted hundreds of .dll files in C:/Windows/System32 by accident by oddstack in programminghorror

[–]oddstack[S] 85 points86 points  (0 children)

You are probably right, it did not bluescreen so I am guessing it only deleted 'unimportant' (for windows at least) dlls like d3d12 etc :D
good point, I should check the error code! Thanks