Posted: Fri Dec 30, 2011 2:27 pm Post subject: Intelligent Random Map Generation V2
Hey there,
This thread is a continuation from my last. (Click Me). I managed to create a some what cool looking map generation but theres a problem. Sometimes it works perfectly with no errors were as others it breaks.
If you run it a few times you should get it to work. Im using Turing 4.1.1
Sponsor Sponsor
Aange10
Posted: Fri Dec 30, 2011 3:42 pm Post subject: RE:Intelligent Random Map Generation V2
Like I said you need to keep track of all your variables and see what variables are different in each execution and why they are causing an error. Instead of trying to have us do it for you
pers2981
Posted: Fri Dec 30, 2011 8:32 pm Post subject: Re: RE:Intelligent Random Map Generation V2
Aange10 @ Fri Dec 30, 2011 3:42 pm wrote:
Like I said you need to keep track of all your variables and see what variables are different in each execution and why they are causing an error. Instead of trying to have us do it for you
I don't recall you ever telling me this, Also do you really think I didn't attempt to fix it already. I only post asking for help after several hours of trying to fix it myself. How dare you sir. How dare you.
chipanpriest
Posted: Fri Dec 30, 2011 8:51 pm Post subject: Re: Intelligent Random Map Generation V2
for i :0.. 500 for j :0.. 500 drawdot(j, y, Rand.Int (9, 14)) endfor
y -=1 endfor
Heres my random map generation
mirhagk
Posted: Fri Dec 30, 2011 8:59 pm Post subject: RE:Intelligent Random Map Generation V2
Turing:
for i :1.. 100 if RowX > 9then
RowX :=0
RowY := RowY + 1 endif if RowX > 0and RowX < 9and RowY > 0and RowY < 9then
if TileType (i - 1)="Water"and TileType (i - 10)="Water"then
There is your problem. Let's say that i is 1, and that the if statement for rowX is between 0 and 9 and rowY between 0 and 9, well then what is the value of TileType(i-10)? well that is TileType(-9), which doesn't exist.
pers2981
Posted: Fri Dec 30, 2011 9:10 pm Post subject: Re: RE:Intelligent Random Map Generation V2
mirhagk @ Fri Dec 30, 2011 8:59 pm wrote:
Turing:
for i :1.. 100 if RowX > 9then
RowX :=0
RowY := RowY + 1 endif if RowX > 0and RowX < 9and RowY > 0and RowY < 9then
if TileType (i - 1)="Water"and TileType (i - 10)="Water"then
There is your problem. Let's say that i is 1, and that the if statement for rowX is between 0 and 9 and rowY between 0 and 9, well then what is the value of TileType(i-10)? well that is TileType(-9), which doesn't exist.
In order for RowX to be between 0 and 9 and rowY between 0 and 9 "i" would have to be higher then 1. RowX/RowY are both set to 0 before the for loop and on each pass RowX is increased by one, If RowX is higher then 9 then its set to 0 and RowY is increased by one. Therefore if RowX is between 0 and 9 then I is between 11 and 88
Raknarg
Posted: Fri Dec 30, 2011 9:11 pm Post subject: RE:Intelligent Random Map Generation V2
Also, he's not generating a fractal map, which is ugly and unrealistic. He's making a map that created tiles in a logical order. This makes an island, while yours creates nothing, in reality
RandomLetters
Posted: Fri Dec 30, 2011 9:32 pm Post subject: RE:Intelligent Random Map Generation V2
Nature is not logical. Please do not generate circular islands
Posted: Fri Dec 30, 2011 9:40 pm Post subject: Re: Intelligent Random Map Generation V2
So I couldn't find out why there were empty tiles, so instead I initially set all the tiles to water before random generation. It seems to had rectfied the issue.
A;so, I rewrote it, if you're interested. It's not better or anything, I just like it better this way
One change you'll notice is that I made the TempColour obsolete by saving the type as an integer according to its colour. If you end up using my code, you may want to change that to accomodate for tiles other than solid colours. Anyways, hope that helps.
pers2981
Posted: Fri Dec 30, 2011 9:40 pm Post subject: Re: RE:Intelligent Random Map Generation V2
RandomLetters @ Fri Dec 30, 2011 9:32 pm wrote:
Nature is not logical. Please do not generate circular islands
I want sometime in-between. Something 'Logical' hence the title of the thread, Intelligent-Random map generation.
Raknarg
Posted: Fri Dec 30, 2011 9:42 pm Post subject: RE:Intelligent Random Map Generation V2
@Randomletters no, it isnt logical. However, it's not absolutely random, either. It's a mixture of both, technically. However, if I were to make a choice, a logical island would make more sense than a fractal island, with sand more common in the middle than the outside.
RandomLetters
Posted: Fri Dec 30, 2011 9:47 pm Post subject: RE:Intelligent Random Map Generation V2
I don't know what you're talking about. This looks pretty real to me
Posted: Fri Dec 30, 2011 9:49 pm Post subject: RE:Intelligent Random Map Generation V2
You should note that some things in nature are more chaotic than others. You can use this island as an example. If you look at an island as a single entity, the island itself isnt very random. It has a logical order where the innermost parts of the island are higher than the outside. The shape may vary, but that idea is constant. If you were to look at a string of islands, than that heightmap example is more meaningful, as islands occur in random places in a non logical order.
Same thing goes with that picture. The island is the same as a mountain. In itself, a mountain is less of a fractal than the land altogether is.
pers2981
Posted: Fri Dec 30, 2011 9:56 pm Post subject: Re: RE:Intelligent Random Map Generation V2
RandomLetters @ Fri Dec 30, 2011 9:47 pm wrote:
I don't know what you're talking about. This looks pretty real to me
Exactly. I don't want my island to be a perfect circle BUT I do want the sand to be on the outside (As seen in your picture), stone on the steep areas and what not.
Can we get this back on topic instead of debating the "More realistic" forms of map generation.
Raknarg
Posted: Fri Dec 30, 2011 9:59 pm Post subject: RE:Intelligent Random Map Generation V2
Sure. Now do you have any other questions? IF you didnt read it back there, all I did was set all the tiles to water to begin with and it worked fine.