-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|644|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Blogs Home -> Blogs


 
Pakz
Created : 04 June 2019
 

Another All nighter (genetic algorithm)

Random maps using Genetic Algorithm

I spend the night again coding. This time I created a Genetic Algorithm that creates maps.

I did some reading online and found a pdf that showed you can use turtle commands to generate maps for this. I first created the main routines and then modified it to run so it can show the results in realtime.

I was thinking I could use it in a game and let it run in the background. If you enter a random dungeon I would delete the results and then create new maps.

The example here on this webpage(emscripten) does not use the full CPU power as the method gets called per screen update and 1 core.

cromdesi.home.xs4all.nl/emscripten/geneticmaps/Untitled1.html

A genetic algorithm works by creating random data and then giving it a score. Some of the data with the best scores get mutated and re used. These steps then get repeated and should give output with ever increasing scores.

I am stil rather fresh with Genetic Algorithms. There are complete books with information how to improve them. I have a couple of books with only basic information on them.

 

Comments


Tuesday, 04 June 2019, 06:31
Jayenkai
This Generator + Rope Guy = A Game..
Tuesday, 04 June 2019, 07:56
Pakz
I first want to spend more time creating reusable code and learn how to create better gfx
Tuesday, 04 June 2019, 08:02
Jayenkai
Bah, gfx are overrated

If you can bulk up the rope physics, and maybe add bouncy physics to the ball, then ..
Ball on a String!?
You could definitely get away with that!
Tuesday, 04 June 2019, 08:09
Pakz
Maybe I can do some kind of Cybernoid like game with some of the output