so gamedev stuff. i do actually have some stuff to talk about this time! idk if it really falls neatly into a '2 week project' but those are pretty solidly dead at this point unfortunately.
anyway first things first on a whim (playing more amazing cultivation simulator) i reassembled this thing. very very early on thinking about hell game 2 and also playing amazing cultivation simulator i threw together that body viewer and then later when i decided that was not in fact what i wanted to do with hell game 2 i ended up deleting it. i almost never delete code stuff since, hey, what if i want to do something with it again in the future? but this, i deleted. the only evidence i had of its existence was some real old screenshot i happened to take of it two years ago.
so, anyway, i have no clue if i'll ever do anything with that again but it's a goofy little thing to mess around with. the next thing i was going to add was species stuff and material modifiers, so if you wanted to be, like, a bull furry but also a skeleton with bones made out of obsidian and muscles made out of bound gold wire then you would be able to change the template to a bull template, strip off fur and skin layers, and do material transformations on the body. this would also handle things like prosthetics, where the various layers of your body could be made of different things.
(i had some vague idea for a xianxia-styled html game associated with that where you mostly did hexcrawl-style exploration of a big primeval forest loosely inhabited by various monster towns mostly on the river. there's a whole other demo of that but i never actually found a connection point between them. just imagine you are moving around hunting for spirit springs or alchemical reagents by yourself or with a companion. probably it would also be monster porn. you know the drill.)
anyway that was early september. mid/late september i played the wildmender demo and kind of got obsessed thinking about erosion and hydrology. as a kid i could be kept entertained by giving me a big pile of dirt and a hose so i could slowly drip water on the top and watch how water built up and soaked down / eroded through the pile. really this says a lot about me as a person.
the thing i wanted to do was run something like soilmachine. but, it requires c++ boost libraries and my ubuntu install is hopelessly outdated so i can't use apt (using ubuntu was a mistake. next time i do a system reinstall it's back to debian for me). so what's the most reasonable thing to do? totally port over the code to a different language so i can run it, of course!
at first i was going to port it over to javascript, since, webgl2, actual opengl, playable in browser, it would be a neat thing i could show off in the procjam discord, etc. the main problem with that is that the rendering technique it uses (which also seems pretty interesting, as somebody with very little knowledge of how to do efficient modern rendering) is opengl4 specific. webgl2 doesn't even expose the pointer access it would need to use its rendering techniques!
(an aside: i mentioned that webgl2 doesn't support this, and multiple people were like 'well what about using something like node & wasm to use actual c++ libraries, so you can target whatever version of opengl you want?' i didn't dismiss this completely out of hand since it seemed for a second like it would be possible -- i don't really know how wasm works but i guess it can compile all sorts of stuff to wasm, so, why not opengl? somebody had put together a demo of actually targeting a canvas with wasm opengl, so like, maybe there is some mystery thing to get a 'real' opengl context? but, no. if you dig around in the 3k+ line autogenerated javascript file accompanying that demo you'll see that the way it does it is it... gets a webgl2 context from the canvas element. so it doesn't magically break the chains of webgl2 being the only context available, it just obfuscates it. i mean i guess theoretically somebody could target webgpu but i don't think anybody does, so.)
anyway so after that i was like, well, fuck it, i'll just write it in haskell.
the main issue with that is that, if you look at the soilmachine code, it contains 1 (one) general-purpose noise-generation library (fastnoiselite) and 1 (one) very tricky pointer-based linked list datastructure (layermap) and together that was enough to wear me down a little. i did convert almost all of fastnoiselite to haskell! and i managed to replicate about half of its rendering code, including properly compiling and linking its shaders! so, a pretty decent chunk of progress given that i was only working on it for like a week. but i did not get the entire thing working.
i do kinda want to return to that, since... idk, it'd be nice to actually modernize my rendering techniques. there's plenty of cool shader stuff you can do to simplify your geometry model, which i dearly need b/c i don't know what i'm doing wrt rendering stuff. and all that hydrology/erosion stuff is just prime real estate for turning into a compute shader, if i actually knew how to use compute shaders at all. so idk if i'd go so far as actually learning how to use compute shaders (soilmachine makes a point of saying how it's cpu-only), but i do still kinda want to port over the rendering setup at least. we'll see
anyway first things first on a whim (playing more amazing cultivation simulator) i reassembled this thing. very very early on thinking about hell game 2 and also playing amazing cultivation simulator i threw together that body viewer and then later when i decided that was not in fact what i wanted to do with hell game 2 i ended up deleting it. i almost never delete code stuff since, hey, what if i want to do something with it again in the future? but this, i deleted. the only evidence i had of its existence was some real old screenshot i happened to take of it two years ago.
so, anyway, i have no clue if i'll ever do anything with that again but it's a goofy little thing to mess around with. the next thing i was going to add was species stuff and material modifiers, so if you wanted to be, like, a bull furry but also a skeleton with bones made out of obsidian and muscles made out of bound gold wire then you would be able to change the template to a bull template, strip off fur and skin layers, and do material transformations on the body. this would also handle things like prosthetics, where the various layers of your body could be made of different things.
(i had some vague idea for a xianxia-styled html game associated with that where you mostly did hexcrawl-style exploration of a big primeval forest loosely inhabited by various monster towns mostly on the river. there's a whole other demo of that but i never actually found a connection point between them. just imagine you are moving around hunting for spirit springs or alchemical reagents by yourself or with a companion. probably it would also be monster porn. you know the drill.)
anyway that was early september. mid/late september i played the wildmender demo and kind of got obsessed thinking about erosion and hydrology. as a kid i could be kept entertained by giving me a big pile of dirt and a hose so i could slowly drip water on the top and watch how water built up and soaked down / eroded through the pile. really this says a lot about me as a person.
the thing i wanted to do was run something like soilmachine. but, it requires c++ boost libraries and my ubuntu install is hopelessly outdated so i can't use apt (using ubuntu was a mistake. next time i do a system reinstall it's back to debian for me). so what's the most reasonable thing to do? totally port over the code to a different language so i can run it, of course!
at first i was going to port it over to javascript, since, webgl2, actual opengl, playable in browser, it would be a neat thing i could show off in the procjam discord, etc. the main problem with that is that the rendering technique it uses (which also seems pretty interesting, as somebody with very little knowledge of how to do efficient modern rendering) is opengl4 specific. webgl2 doesn't even expose the pointer access it would need to use its rendering techniques!
(an aside: i mentioned that webgl2 doesn't support this, and multiple people were like 'well what about using something like node & wasm to use actual c++ libraries, so you can target whatever version of opengl you want?' i didn't dismiss this completely out of hand since it seemed for a second like it would be possible -- i don't really know how wasm works but i guess it can compile all sorts of stuff to wasm, so, why not opengl? somebody had put together a demo of actually targeting a canvas with wasm opengl, so like, maybe there is some mystery thing to get a 'real' opengl context? but, no. if you dig around in the 3k+ line autogenerated javascript file accompanying that demo you'll see that the way it does it is it... gets a webgl2 context from the canvas element. so it doesn't magically break the chains of webgl2 being the only context available, it just obfuscates it. i mean i guess theoretically somebody could target webgpu but i don't think anybody does, so.)
anyway so after that i was like, well, fuck it, i'll just write it in haskell.
OpenGLRaw has the entire c-level opegnl api up to 4.6, so i could use glfw and openglraw and do all my rendering that way. i've gotten a little fed up with gpipe anyway so might as well go back to raw opengl. at least then i'll be able to write my own shaders.the main issue with that is that, if you look at the soilmachine code, it contains 1 (one) general-purpose noise-generation library (fastnoiselite) and 1 (one) very tricky pointer-based linked list datastructure (layermap) and together that was enough to wear me down a little. i did convert almost all of fastnoiselite to haskell! and i managed to replicate about half of its rendering code, including properly compiling and linking its shaders! so, a pretty decent chunk of progress given that i was only working on it for like a week. but i did not get the entire thing working.
i do kinda want to return to that, since... idk, it'd be nice to actually modernize my rendering techniques. there's plenty of cool shader stuff you can do to simplify your geometry model, which i dearly need b/c i don't know what i'm doing wrt rendering stuff. and all that hydrology/erosion stuff is just prime real estate for turning into a compute shader, if i actually knew how to use compute shaders at all. so idk if i'd go so far as actually learning how to use compute shaders (soilmachine makes a point of saying how it's cpu-only), but i do still kinda want to port over the rendering setup at least. we'll see