I wrote a Rust version of @runevision 's LayerProcGen: https://crates.io/crates/layer-proc-gen
It has a small demo in the examples (i'll set it up on GitHub pages so you can try it out in the browser soon™️)
Initially I replicated the C# 1:1 (modulo internal layers and multithreading), and then modified it to feel more Rust-like (to me) as I extended the demo further.
It's entirely game engine independent, even though the demo is written for macroquad
=> View attached media | View attached media
=> More informations about this toot | More toots from oli@hachyderm.io
@oli This is really interesting, and sounds cool!
I'm curious to better understand the differences in your version, like not having to implement layer types, and data being generated just-in-time. Unfortunately I don't know Rust well enough to really understand the code. Do you think these might work in C# as well or do they rely on Rust features?
What would be equivalents of the GetRoadsOverlappingBounds and GetRoadsOwnedWithinBounds example functions on this page?
https://runevision.github.io/LayerProcGen/md_Patterns.html
=> More informations about this toot | More toots from runevision@mastodon.gamedev.place
@runevision one thing I only noticed because Rust doesn't have a GC, is that DecrementUserCountOfLevel
can be automated by using weak reference counted pointers. C# appears to have them in the form of https://learn.microsoft.com/en-us/dotnet/api/system.weakreference?view=net-8.0
It should be possible to put the actual chunk data behind this weak ref. If all strong refs (well normal C# by-ref values) have been GCed, the weak ref allows the actual chunk data to be GCed, and future attempts to access that chunk will fail
=> More informations about this toot | More toots from oli@hachyderm.io
text/gemini
This content has been proxied by September (3851b).