Quote: "This is basically how I generated the maps for Kingdom. The maps were procedurally generated too. It's amazing what you can do using random numbers and the more I did the more ideas I had. It's great fun to play with this kind of stuff and if you are clever with it you never have to build a level manually again. It can also give the player effectively an infinite number of maps to play / explore!"
Kingdom looks really awesome!
If I can get my scenery half that nice I will be very happy.
I'll definitely be checking out the stuff you are sharing there, because I have a lot of work left for the plants, and animals in 2d.
Yeah, an old idea that is still the way to go and the future. You are right about the fun and flow of ideas for using the random numbers. I am just getting started playing around with it, but I'm already hooked and will be using procedural generation in all of my future games.
Quote: "This project of yours is oddly very VERY similar to a project I'm working on right now, with allot of the same science fiction ideas and the randomly - procedural levels and similar details. I've been designing my game for over 2 years now and have just recently started it as my next major project. My offer is we could team up, or at the very least help each other out.
Let me know what you think and take a read of my private message and get back to me. Thanks bud!"
PM's sent
I am willing to share my algorithms for PG ideas, except one. I developed it for finding extremely long prime numbers with limited math processors (digit limitation removed - coded in DB). Part of that algorithm will be used for infinity, and that part I don't plan to share freely. Most of my math is very basic, so no big secrets. Some of it so simple it will probably be laughed at, but it gets the job done. I plan to openly share the simple stuff to anyone interested.
I worked on Name Generation yesterday, and it was a lot of fun.
// Project: procedural_names_2
// Created: 2016-08-24
// set window properties
SetWindowTitle( "procedural_names_2" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
DIM alphabet$[26] = ["-","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
DIM consonants[20] = [0,2,3,4,6,7,8,10,11,12,13,14,16,17,18,19,20,22,23,24,26]
DIM vowels[5] = [0,1,5,9,15,21]
seedit = 1
SetRandomSeed(seedit)
do
if GetRawKeyPressed(13)
new_name$ = ""
name_length = Random(2,4)
for n = 1 to name_length
new_char = Random(1,20)
new_name$ = new_name$ + alphabet$[consonants[new_char]]
if new_char = 13
new_char = 5
else
new_char = Random(1,5)
endif
if n = name_length and Random(1,2) = 1
// skip the last vowel
else
new_name$ = new_name$ + alphabet$[vowels[new_char]]
endif
next n
endif
if GetRawKeyPressed(38)
seedit = seedit + 1
SetRandomSeed(seedit)
endif
if GetRawKeyPressed(40)
seedit = seedit - 1
SetRandomSeed(seedit)
endif
Print( ScreenFPS() )
Print( "" )
Print( "Hit ENTER to generate a new name." )
Print( "UP & DOWN Arrow Keys to change seed." )
Print( "" )
Print( "Seed = " + str(seedit))
Print( "" )
Print( new_name$ )
Sync()
loop
EDIT
Here is another snippet...
// Project: procedural_names_2
// Created: 2016-08-24
// set window properties
SetWindowTitle( "procedural_names_2" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
DIM alphabet$[37] = ["-","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","ch","cl","sh","th","tr","ll","mm","nn","ss","ee","oo"]
DIM consonants[29] = [0,2,3,4,6,7,8,10,11,12,13,14,16,17,18,19,20,22,23,24,26,27,28,29,30,31,32,33,34,35]
DIM vowels[15] = [0,1,5,9,15,21,1,5,9,15,21,1,5,15,36,37]
seedit = 1
SetRandomSeed(seedit)
do
if GetRawKeyPressed(13)
new_name$ = ""
name_length = Random(2,4)
for n = 1 to name_length
// randomly pick a consonant
new_char = Random(1,29)
// avoid starting consonants with doubles... ll, mm, nn, ss
if n = 1 and new_char > 25
new_name$ = new_name$ + alphabet$[consonants[new_char-4]]
elseif n <> name_length
new_name$ = new_name$ + alphabet$[consonants[new_char]]
endif
// avoid ending consonants with combos... ch, cl, sh, th, tr, ll, mm, nn, ss
if n = name_length and new_char > 20
new_name$ = new_name$ + alphabet$[consonants[new_char-9]]
elseif n = name_length
new_name$ = new_name$ + alphabet$[consonants[new_char]]
endif
// if consonant was a Q then follow it with a U, else using any vowel will do
if new_char = 13
new_char = 5
else
// randomly pick a vowel
new_char = Random(1,15)
endif
// 50/50 chance of dropping the last letter to end with consonants and vowels
if n = name_length and Random(1,2) = 1
// do nothing here in order to skip the last vowel
// else prevent the last vowell from being a double.... ee, oo
elseif n = name_length and new_char > 13
new_name$ = new_name$ + alphabet$[vowels[new_char-2]]
else // just add a random vowel
new_name$ = new_name$ + alphabet$[vowels[new_char]]
endif
next n
endif
if GetRawKeyPressed(38)
seedit = seedit + 1
SetRandomSeed(seedit)
endif
if GetRawKeyPressed(40)
seedit = seedit - 1
SetRandomSeed(seedit)
endif
Print( ScreenFPS() )
Print( "" )
Print( "Hit ENTER to generate a new name." )
Print( "UP & DOWN Arrow Keys to change seed." )
Print( "" )
Print( "Seed = " + str(seedit))
Print( "" )
Print( new_name$ )
Sync()
loop
As you can see, I add combinations of consonants to the alphabet, as well as combinations of certain vowels.
I also, avoided using double letters like "ll" or "nn" as the first consonant selection in a word, and also avoided ending with double vowels like "ee" and "oo"".
This was a simple addition to the code above that gets somewhat different results, and shows how simple expansions are possible to the snippet.
If you run the second snippet and set it to seed #5, then hit ENTER twice, the answer to the question of "when will this game be finished?" will be revealed.
On a side note:
The bouncing ball has its trajectory based on the number of the image used.
For instance, the above 24 tile shown would result in 2 - 4 = -2, so the -2 is used in the algorithm to set the X value of the force.
If the tile were a 42, then is would be angled in reverse, and the 4 - 2 = 2, so a 2 would be used to calculate the X of the force.
The ImageID for each sprite is used to read the number for the tile, so an array for those values did not need to be created.
EDIT
My last routine had an error for following a "q".
I changed the next vowel to a "u", but I should have added a u instead, so another vowel would follow it.
lol easy fix though.
Here is my latest
demo.
It names the Planet, and it's ten most abundant minerals, for each seed, and also sets that planets colors for land and air.
I have changed the name generation since this screenshot, but it gives you an idea...
Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1