# Procedural generation

**URL:** https://forum.makecode.com/t/procedural-generation/5383
**Category:** Show & Tell
**Tags:** game
**Created:** [January 6, 2021, 6:15pm UTC](https://forum.makecode.com/t/procedural-generation/5383 "2021-01-06T18:15:27Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [January 6, 2021, 6:15pm UTC](https://forum.makecode.com/t/procedural-generation/5383/1 "2021-01-06T18:15:27Z")

</div>

Since procedural generation seems to be the new hip thing (ex. @GameGod’s [Otherwordly](https://forum.makecode.com/t/otherworldly/5314)) and the fact that we now have [seedable RNGs](https://forum.makecode.com/t/fast-random-extension/5365) (haha shameless self-promotion) I’ve decided to make a top-down procedural generator!

> **[Procedural Generation v1.0.0](https://arcade.makecode.com/86639-54341-37016-62619)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Input a seed, (the seed used in the preview above is `1234`) and walk around! When you go past the screen you will enter a new “chunk.” You also can’t walk through stuff like trees and stumps, but you can walk behind and in front of it! (And since I suck at pixel art, all of the images came from the gallery!)

There are 3 biomes you can find in a chunk:

- A plains (will have flowers, some trees)
- A forest (will have lots of trees, mushrooms, and stumps)
- A dark forest (same as a regular forest, but the greens are darker)

I have yet to see a dark forest. 🤔

Please share a GIF of an interesting seed you found!

Known bugs:

- Inputting the seed `0` will cause the game to hang.
- Inputting really large numbers for seeds sometimes might be too big for the RNG. @richard do you know the biggest number possible I can use as a seed? (I’m guessing 65535)

It also works on my PyGamer! The seeds will also stay the same!

---

<div class="post-metadata">

### Author: ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)
#### Post date: [January 6, 2021, 6:17pm UTC](https://forum.makecode.com/t/procedural-generation/5383/2 "2021-01-06T18:17:09Z")

</div>

yep, the max is 0xFFFF (aka 65535) and the min is 1

---

<div class="post-metadata">

### Author: ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)
#### Post date: [January 6, 2021, 7:00pm UTC](https://forum.makecode.com/t/procedural-generation/5383/3 "2021-01-06T19:00:26Z")

</div>

Cool, I live it! I have a challenge for you, but of course, you don’t have to do it. The challenge is -

Convert this into a survival game, where you can -

- Chop wood, gather flowers, etc.
- Craft tools and shelters
- Fight monsters and gather animal meat
- Others too, like maybe farm?

Again, you don’t have to if you don’t want to. It’s just an idea!

---

<div class="post-metadata">

### Author: ![omnisImperium](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/omnisimperium/32/2728_2.png) [@omnisImperium](https://forum.makecode.com/u/omnisImperium)
#### Post date: [January 6, 2021, 7:41pm UTC](https://forum.makecode.com/t/procedural-generation/5383/4 "2021-01-06T19:41:06Z")

</div>

This is pretty cool! I have no idea how this might have been made, and I have seen the code.

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [January 6, 2021, 8:01pm UTC](https://forum.makecode.com/t/procedural-generation/5383/5 "2021-01-06T20:01:15Z")

</div>

Ah ha found one!

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/e/e264e6cd8a42ffc7a450440d1a47311ca0dc45a3.png)

You can also leave the seed input blank and it will use a random seed. Although there is no way **currently** to see what seed you are on…

> [@GameGod](#):
>
> Chop wood, gather flowers, etc.

I want to do this soon but the problem is about figuring a way to remember which sprites I’ve destroyed and in which chunks, etc. I’m probably gonna have to figure out some sort of ID system for the objects… (time to import Vivian’s favorite extension!)

---

<div class="post-metadata">

### Author: ![GameGod](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gamegod/32/2756_2.png) [@GameGod](https://forum.makecode.com/u/GameGod)
#### Post date: [January 6, 2021, 8:31pm UTC](https://forum.makecode.com/t/procedural-generation/5383/6 "2021-01-06T20:31:59Z")

</div>

> [@UnsignedArduino](#):
>
> (time to import Vivian’s favorite extension!)

Yes, I was thinking that too. Maybe you can store the location in sprite data? Is what I thought.

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [January 8, 2021, 6:02pm UTC](https://forum.makecode.com/t/procedural-generation/5383/7 "2021-01-08T18:02:05Z")

</div>

You can now destroy stuff! Press A while touching something and a status bar will show how much “health” is left in the thing!

> **[Procedural Generation v1.1.0](https://arcade.makecode.com/96799-49526-13712-58465)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

It will also keep a list of everything you destroyed, and when you leave and re-enter that chunk, it won’t be there anymore!

You can also press the menu key and show the seed and what chunk you are on.

---

<div class="post-metadata">

### Author: ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)
#### Post date: [February 6, 2021, 9:20pm UTC](https://forum.makecode.com/t/procedural-generation/5383/8 "2021-02-06T21:20:59Z")

</div>

Have an Idea on seed make a separate var named seed and make the rng var to the seed, and on menu pressed, open a command console, and then when you type in `seed` you will get a splash message with the current seed.

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [February 7, 2021, 3:51am UTC](https://forum.makecode.com/t/procedural-generation/5383/9 "2021-02-07T03:51:51Z")

</div>

> [@UnsignedArduino](#):
>
> You can also press the menu key and show the seed and what chunk you are on.

Fixed it!

---

<div class="post-metadata">

### Author: ![LcAtonal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/lcatonal/32/16800_2.png) [@LcAtonal](https://forum.makecode.com/u/LcAtonal)
#### Post date: [February 8, 2021, 4:32pm UTC](https://forum.makecode.com/t/procedural-generation/5383/10 "2021-02-08T16:32:53Z")

</div>

Could you make more biomes? Like deserts and oceans and Savannahs … Just make minecraft biomes since this is related to minecraft.

---

<div class="post-metadata">

### Author: ![gusiscute64](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gusiscute64/32/3556_2.png) [@gusiscute64](https://forum.makecode.com/u/gusiscute64)
#### Post date: [April 26, 2021, 3:27pm UTC](https://forum.makecode.com/t/procedural-generation/5383/11 "2021-04-26T15:27:01Z")

</div>

a dark biome can be found n 99999 just go left then up

---

<div class="post-metadata">

### Author: ![gusiscute64](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gusiscute64/32/3556_2.png) [@gusiscute64](https://forum.makecode.com/u/gusiscute64)
#### Post date: [April 27, 2021, 3:41pm UTC](https://forum.makecode.com/t/procedural-generation/5383/12 "2021-04-27T15:41:18Z")

</div>

> [@gusiscute64](#):
>
> just go left then up

in other words go to -1 -1

---

<div class="post-metadata">

### Author: ![kmcgerald](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kmcgerald/32/4022_2.png) [@kmcgerald](https://forum.makecode.com/u/kmcgerald)
#### Post date: [April 27, 2021, 11:10pm UTC](https://forum.makecode.com/t/procedural-generation/5383/13 "2021-04-27T23:10:28Z")

</div>

I really like this procedural generation and that you’re tracking which objects have been destroyed. I need to look closer at the code. Not sure why I can’t zoom in or out when I’m in show code. The game I’m working on has a static map but I do try to keep track of periodically spawned sprites and where they are. When I load a different map, I have to put them all in a list and destroy them but then respawn them where they were when I go back to the original map. Sometimes it’s a bit glitchy so I’ll have to see if what you’re doing is more reliable than mine. I also see a use for using this procedurally generated world for randomized side quests to keep the player from getting bored.

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [April 28, 2021, 12:29am UTC](https://forum.makecode.com/t/procedural-generation/5383/14 "2021-04-28T00:29:35Z")

</div>

Every sprite I make is procedural so it takes the “seed” (forgot the formula for the seed) of the chunk and then seeds the RNG with it. Then I check every sprites “ID” (forgot the formula for that too, it’s been too long) and if that ID is in the list of supposed to be destroyed things, then I destroy it.

> [@kmcgerald](#):
>
> Not sure why I can’t zoom in or out when I’m in show code.

Ah yes it doesn’t work, click edit code instead and use the zoom tools in the editor.

---

<div class="post-metadata">

### Author: ![PixelDoodle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/pixeldoodle/32/24129_2.png) [@PixelDoodle](https://forum.makecode.com/u/PixelDoodle)
#### Post date: [October 24, 2022, 5:01pm UTC](https://forum.makecode.com/t/procedural-generation/5383/15 "2022-10-24T17:01:56Z")

</div>

I know this topic is litteraly dead but is this a dark forest?

 ![Woow](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/0/0642b22a5db5b3d7a86edae96aad78c236578590.jpeg)  
Seed: 21564360 (Seed: 21564, X: -3, Y: 6)

---

<div class="post-metadata">

### Author: ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)
#### Post date: [October 24, 2022, 7:23pm UTC](https://forum.makecode.com/t/procedural-generation/5383/16 "2022-10-24T19:23:53Z")

</div>

Yes, it is!

---

<div class="post-metadata">

### Author: ![PixelDoodle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/pixeldoodle/32/24129_2.png) [@PixelDoodle](https://forum.makecode.com/u/PixelDoodle)
#### Post date: [October 24, 2022, 7:24pm UTC](https://forum.makecode.com/t/procedural-generation/5383/17 "2022-10-24T19:24:20Z")

</div>

Woah!

---

<div class="post-metadata">

### Author: ![isoffline](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/isoffline/32/8791_2.png) [@isoffline](https://forum.makecode.com/u/isoffline)
#### Post date: [October 25, 2022, 7:51pm UTC](https://forum.makecode.com/t/procedural-generation/5383/18 "2022-10-25T19:51:01Z")

</div>

is it possible to spawn in a dark forest and it looks like the garlands in Minecraft likes the same

---

<div class="post-metadata">

### Author: ![Kiwiphoenix364](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kiwiphoenix364/32/14368_2.png) [@Kiwiphoenix364](https://forum.makecode.com/u/Kiwiphoenix364)
#### Post date: [October 25, 2022, 7:58pm UTC](https://forum.makecode.com/t/procedural-generation/5383/19 "2022-10-25T19:58:41Z")

</div>

WOW @UnsignedArduino ! I made a game like this a while back using your seeded random extension without EVER seeing this topic! I eventually abandoned it, but before that I added 2 biomes and placeable/saveable blocks using arrays!

> **[PROJECT: MINECRAFT](https://arcade.makecode.com/95418-49555-60778-85354)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![Blobbey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/blobbey/32/20831_2.png) [@Blobbey](https://forum.makecode.com/u/Blobbey)
#### Post date: [October 25, 2022, 9:31pm UTC](https://forum.makecode.com/t/procedural-generation/5383/20 "2022-10-25T21:31:07Z")

</div>

![Dark Forest](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/0/0aac623928aeb7fdc5530eb24079dc976da34c0e.jpeg)  
I found a dark forest!

[Next page](https://forum.makecode.com/t/procedural-generation/5383.md?page=2)
