A Randomly Generated World

Hmmm @glithctyrus

and I thought I’m the only one that has memory problems with my old wannabe PC.

Works fine for me as it is, did you change something before you tried?

not sure ill try again…

Try not to edit much code but see what may o re may not be in his game that is in yours @glithctyrus

I’m relatively new here (and to coding in general) but I found this conversation and I like where this is headed. Have you guys made any more progress on this?
Also, although its nothing fancy, I had created my own random land generation for a top-down game you might be interested in (https://flowlab.io/game/play/1415906). There’s not much there but the land generation and a weapon pick up mechanic, but if you have any feedback on those I would love to hear it.

@“thebrickccentric”, that’s a good random generator. To be honest, I forgot about my own random level generator after I took a quick break from Flowlab, so in terms of progress, I have not made any.

@thebrickccentric Wow… All I have to say is wow… Your generator, is almost exactly what I need but on a smaller scale! It had different biomes, even some rivers, and enemies! I really like it! For someone acclaiming to be new to flowlab and coding - well let’s just say you could of fooled me.

So Imagine your game, but if it was zoomed out. Lile you got the map, and made it 10x bigger, so each biome you spend some time in. Essentially you have done what I said just, too small, which I am sure wr can do.

Thank You! I say we make it bigger, than start customising shortly after. Than, we need @TinkerSmith s help to make it so we can save the map you are on instead if generating a new one each time - just top down.

@Superstargames If you could try to make a structure block bundle just for top down that would be pivotal to this.

Okay, I Know this was confusing, so let me go over it simpler:

@thebrickccentric Using your code to create a map but making the sperate biomes bigger

@TinkerSmith Using your “seed” code and Idea to save the map just for top down

@Superstargames Using your structure block - Just also for top down - we can customize the map by adding specific structures and trying to generate it in certain biomes.

Can this be done here? :
https://flowlab.io/game/play/1345465

I might invide the people above to my dev group so thst you can work on the game yourself without me having to try to copy your advanced code to the game, so so press “Accept” and work on it whenever you can!

Maybe @“JR 01” Can help us reduce the lag with the map somehow as he has suggestee before.

Woah, I didn’t expect such great feedback, thank you!
And I’m honored to join your team . . . I’m a beginner, but I guess I learn fast.
So I get what you mean about increasing the scale of the biomes, and I think I can do that.
Only problem so far is that whenever I click on your game there, the page loads partially and then freezes. I did accept the invitation, but I notice that your Random Generated World Game is not on the new list of ‘My games’, which I’m assuming means I cannot permanently edit it (though right now I cannot even access the ‘edit’ mode for the game either).
Is the game just really big and I need to be more patient? (I have a fairly fast computer, so maybe it’s an internet problem?)

Yeah, I can’t seem to load the game either. I tried opening the console log but I found no errors or warnings.

Good to know its not just me…perhaps The Kodex can make a new map?

@thebrickccentric … beginner … “Liar Liar, Brick On Fire”

LOL, kidding, well done. I see you even used @“JR 01” 's flexi joints for your fences/walls :slight_smile: cooool

Like it that you created ‘smart tiles’, that’s the way to go up to the day Flowlab might have lists/tables/arrays. Also like how you changed the propabilties of the random numbers by filtering out ranges.
Take notes everyone, that’ how it is done :wink:

@“The Kodex” … I can’t open your example, it crashes my browser.
But yes, to make the result repeatable you could use something like my Pseudo Randum Number Generator PRNG

That way you only have to save the seed and you get the same map every time you use it.
In a map scenario I would probably use the tile index itself as part of the seed number wink wink

Thank you for the feedback!
Yes, JR 01’s tutorials are what really got me started on this site.
Now, how does this “seed” thing work? I’ve read the previous posts and it still doesn’t make sense to me. I suppose it doesn’t have to, but at least how can it be used in this situation? Does it function like a random number generator but just saves the random number each time?
One problem I have with the land generation so far is that it’s a bit too linear still. Do you know a way to solve this?

@thebrickccentric
The thing is, no random generator is really random. All of them pick their choice from some sort of numerical range. So if you randomize long enough you end at the start again. The only difference is how they pick them.

Each random number generator needs to start somewhere, that is called the ‘seed’. Some grab milliseconds from your computer, some access weather chart for atmospheric pressure (YES, REALLY).

A PRNG now for example just allows me to define my own seed. The routine I used to create the sequence is actually a quite common one that has a more or less even distribution, you can run a test if you want (no random is perfect).

So lets say I start with a seed of 5000. The PRNG creates a number and increase the seed by 1. Next number, increase, next number, increase.
The advantage, I can repeat those ‘random’ results if needed.
So let’s say I create a map, using the seed XXX.
Every time I come back and use XXX again I will get the same map.
Or like in this test of mine, this time used for a side scroller:
PRNG_terrain
PRNG Terrain Test
So basically the side scroller could be endless :slight_smile:
If I get bored to run along, I just save the state of the seed at that moment in time. When I come back I use that to continue from there

… makes sense? I see I blabber again ,LOL
For a map scenario I would even encode the X/Y tile positions into the seed. That way I could delete map areas that are outside the view area to save memory and regenerate them when I come back.

So no, you don’t save the random number, you save the seed.
Other way to describe it, imagine an excel spreadsheet where one column is filled up with a seemingly random distribution of numbers.
The seed is basically the row number to pick a result from that list. Does that make more sense?

Yes, I think I understand. That seems really quite powerful! You could have endless maps, in both side-scrolling and top-down games . . . Wow.
Now, do you know how to integrate this into a top-down design? I’ve looked at your game’s code and I have almost no idea what’s going on. You mention saving X/Y tile positions; does that work with my current system of map generation? Sorry to ask so many questions here.

Wait @“TinkerSmith”, randomization sometimes uses atmospheric pressure to create seeds? That’s amazing, and quite interesting!

Correction, had it wrong in my mind @Superstargames , it actually is now atmospheric noise :slight_smile:

@thebrickccentric , yes it should work, but I need to have another look how your map is set up. Working right now, so not much time to do so :slight_smile:
And yes, that’s how other create those endless maps in other games, it just depends on how you use those numbers.
I mean look at “No Man’s Sky” … they used procedural generation to create a whole freaking universe with planets, plants, etc. How freaking cool is that.

That’s still pretty incredible that it uses atmospheric noise.
I’ve heard No Man’s Sky is amazing in that regard, so this must be good way to generate things.
Alright I won’t bother you any more.

No worries, you can bother :slight_smile:
I just can’t reply now, of to a meeting yawn
But I will send you more details later.

Sorry I was offline for a while. So @thebrickccentric Use the link bellow instead. Sorry about the other thing guys… That was me trying to make this but the code was so complex it kept on crashing.

Anyway, use this for now. Use what @TinkerSmith posted above combined with @thebrickccentric main map idea. Hopefully, we can try to make this work.

@Superstargames If you could try to make your top down structure bundle that creates some kind of structure, that would be good progress.

P.g I am working off my phone so I cannot do much. Heck, backspace does not work on flowlab for a reason, so nothing besides the title is named.

So I have not named the green, grey, blue and character objects. They are grass, stone, water (to build lakes) and a character. Please name them. The grass and stone will act as biomes like in @thebrickccentric game just the biomes are signififsntly bigger.

https://flowlab.io/game/view/1450992

I still can’t edit the game permanently; can you make it part of the group?

@thebrickccentric That should do it