Show HN: Little Procedural Pixel Worlds (jason.today)
Took a break from the falling sand simulation blog posts this week to work on another small project. It's a little pixel world generator- each time you visit, you'll see a new little world. I really like this stuff and had a blast building it yesterday!
62 comments
[ 2.3 ms ] story [ 160 ms ] threadThis looks lovely, well done!
Are you familiar with the procedurally generated worlds in Dwarf Fortress (they have some similarity to your project)?
This is much simpler! Just hand-picked thresholds of some parameterized perlin noise.
Almost like a pristine world, still unsullied by the various races & evils that inhabit a usual DF map. Peaceful.
¹not really ASCII, ofc.
[edit] Also I'm getting a lot of "out of bounds" errors when I resize my window.[/edit]
I'm probably going to continue working on it as a personal creative project, so I'm not planning on taking PRs- I hope that's ok!
Maybe I should make a community fork?
("Oh, man, my hit points are like, inexcusable in this dungeon, man. I need to find some elixors or something.")
Between noise, color conversions, prebuilt draw loop, event handling and working with images…
It’s not so easy to give it up for quick projects.
Suddenly 10 minutes in p5js is an hour or very difficult without a replacement library (noise) and focusing on boilerplate instead of the interesting bits
I'm mostly saying this as if talking to an earlier version of myself since I spent a lot of time learning threejs when I in hindsight now realize doing it with raw webgl (while building up a little boilerplate abstraction library and generally gaining comfort with the API) might have been a better use of time (especially long term). Kinda depends on what you overall goals are though too (and how eager you are to make the idea you have come into reality) etc etc.
I am more interesting in the explanation of your code that the code itself.
This is a real, self-contained HTML page as intended by the old ones.
Not trying to contradict TheRealNGenius, just hoping to put some bounds on what works and what doesn’t. Perhaps there was a fix in Safari 14 that allows this but was broken in 13. I don’t have access to an older Safari to test against.
This is what I get on my laptop. Probably don't have to worry too much, I'm generally a hold out when it comes to updating OS versions, so things that expect newer features might not work for me
map gen and hydrology project hydrosim:
http://aperocky.com/hydrosim/
pet map gen and having "people" living on it:
http://prehistoric.tech/
Do you mind if I dig into the code and figure out how it works?
I'm really finding the market that you've got going interesting, how in-depth is it?
I've got a thing[0] I've been prototyping which does a market simulation that I'm working on and I'd be curious how far you've gone down that rabbit hole? =)...
- [0]: https://folcon.itch.io/fruit-economy
Just have to meet in the middle by dynamically accumulating orders by quantity from both sides and after the prices met, set that as the actual sell price and discard the rest of the order as not filled.
Pretty different from my approach, so that's worth trying, thanks!
https://archive.org/details/msdos_Wilderness_-_A_Survival_Ad...
Refreshing the page for more worlds reminded me - at some point someone recommended this[1] Chrome extension to me and it's been neat to have a new satellite view of earth show up every time I open a new tab
[1] https://chrome.google.com/webstore/detail/earth-view-from-go...
It looks like you're using some kind of perlin noise, one idea I had (probably been done a million times before) is rather than using the "height" of the noise to decide on a tile, you could have it decide on a biome, which itself has a list of tile types with a weighted random choice of which one it picks; so you're forest areas can still be populated with grass for example, but tree's are more common.
Just wondering what's the easiest way to do something fun like this (procedural generation with tiles, but also basic rogue gameplay perhaps).