Skip to content

Minor78's Games

My Freeware Games & Devlog Blog

If you’ve read the “About Me” page which is, well, erm, about me you’ll know that I’m a coding language and maths simpleton.  So I decided to learn some coding principles in Construct – Array’s and Loops.  I decided to make a small map generator using “Cellular Automata”.  Now you may be surprised here but I actually understand CA and have made a game prototype that used CA to make dynamically living and dying platfrom levels.

Things progressed nicely.  But I was stumped by two things:

  1. I was using my Array to spawn tiles that represented land or sea, but it was spawning 5x the tiles that it should.  A quick post on the Construct Forums and newt had the answer.  Construct has a “For Each Element” loop for array and it was looping through the 5 “Z” depths I had set up to hold data.  Problem sorted.
  2. If I couldn’t use the built-in loop.  I had no idea how to structure my own loop, I downloaded an example that was posted to the forums but that didn’t help.  My version didn’t work as planned and looped infinitely.  Again another quick post the the Construct forums and I had two answers.  An example by newt again with a fully working loop.

I’m pretty pleased with how the generator came out and with some of the techniques I’ve learned in Construct.  I would post the generator but it is rather slow when there are 10,000 tiles on screen, and I’m also running a loop on the tiles themselves to run a basic height map.  So I’ll just post a screenshot and a couple of generated maps.

Map Gen

Map Generator

Map Gen 2

Generated Map

Map Gen 3

Generated Map 2

Now I’m going to experiment with the “Perlin Noise” plug-in and see what I make using that.  I may come back to this when I’m more familliar with the programming principles that Construct and other “game making” programs can teach.

Advertisements

Tags: , , ,

%d bloggers like this: