Map generator - how does it work?

General discussion and socializing.

Map generator - how does it work?

Postby JustasJ » Sun Sep 19, 2010 11:23 am

Is the code of map generator made public? How does it work? How does it's mechanics work?
Throughout the centuries there were men who took first steps, down new roads, armed with nothing but their own vision.
- Ayn Rand
User avatar
JustasJ
 
Posts: 205
Joined: Wed Feb 03, 2010 1:48 pm

Re: Map generator - how does it work?

Postby FritzPL » Sun Sep 19, 2010 11:42 am

Maps are generated totally randomly I guess. But it may be also made by hand of loftar because we had only 3 worlds before,and each world there is one,new and big map.
FritzPL
 
Posts: 100
Joined: Thu Aug 19, 2010 8:25 am
Location: Teknillan

Re: Map generator - how does it work?

Postby JustasJ » Tue Sep 21, 2010 7:59 am

"Generated randomly" is not an answer. I'm interested in the algorithms they use.
Throughout the centuries there were men who took first steps, down new roads, armed with nothing but their own vision.
- Ayn Rand
User avatar
JustasJ
 
Posts: 205
Joined: Wed Feb 03, 2010 1:48 pm

Re: Map generator - how does it work?

Postby DatOneGuy » Tue Sep 21, 2010 8:30 am

iirc there's no such thing as truly 'random' in computers.

Don't think it's public, I'm also interested though.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .Hi. . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
User avatar
DatOneGuy
 
Posts: 5553
Joined: Sun Apr 18, 2010 7:50 am
Location: I'm in Miami, trick.

Re: Map generator - how does it work?

Postby spectacle » Tue Sep 21, 2010 12:21 pm

DatOneGuy wrote:iirc there's no such thing as truly 'random' in computers.

True, but the difference between true randomness and a well coded pseudorandom generator is purely academic, you'll never notice any difference in real-life applications.
Once a man has changed the relationship between himself and his environment, he cannot return to the blissful ignorance he left. Motion, of necessity, involves a change in perspective.
-Commissioner Pravin Lal, "A Social History of Planet"
User avatar
spectacle
 
Posts: 950
Joined: Wed Nov 11, 2009 11:16 am
Location: Planet

Re: Map generator - how does it work?

Postby brohammed » Tue Sep 21, 2010 1:09 pm

Guys, I hacked the game code and found the terrain generator.

Code: Select all
10 {spawn [$coniferous_forest] "everywhere"}
20 {spawn [$deciduous_forest] "in blobs"}
30 {spawn [$heath,$grassland,$moor,$swamp,$marsh,$overgrown] "in smaller blobs"}
40 {spawn [$lakes] "in penis shapes"}
50 {spawn [$rivers] "connect rivers"}
60 Supergrid Complete
70 goto 10, repeat till all supergrids are done
User avatar
brohammed
 
Posts: 526
Joined: Sun Jun 20, 2010 2:41 pm

Re: Map generator - how does it work?

Postby DigDog » Tue Sep 21, 2010 1:40 pm

brohammed wrote:Guys, I hacked the game code and found the terrain generator.

Code: Select all
10 {spawn [$coniferous_forest] "everywhere"}
20 {spawn [$deciduous_forest] "in blobs"}
30 {spawn [$heath,$grassland,$moor,$swamp,$marsh,$overgrown] "in smaller blobs"}
40 {spawn [$lakes] "in penis shapes"}
50 {spawn [$rivers] "connect rivers"}
60 Supergrid Complete
70 goto 10, repeat till all supergrids are done

I lol'd.
burgingham wrote:You call that beer?
User avatar
DigDog
 
Posts: 711
Joined: Mon Jul 19, 2010 1:52 am
Location: Germany

Re: Map generator - how does it work?

Postby Lothaudus » Tue Sep 21, 2010 1:50 pm

I lol'd too but I don't think loftar would defile himself by actually using "goto".

Then again, there was that divide by zero error with the beehives...
Barry Fletcher Norwin
Lawspeaker of Crossroads - Leader of Codexia - Keeper of the Cheese
http://www.rpgcodex.net
User avatar
Lothaudus
 
Posts: 641
Joined: Fri Oct 23, 2009 12:32 pm
Location: Adelaide, Australia

Re: Map generator - how does it work?

Postby PLEP » Tue Sep 21, 2010 2:17 pm

brohammed wrote:40 {spawn [$lakes] "in penis shapes"}

ROFL
I thought I'm the only perverted one that noticed lakes looking like penises :lol:
PLEP
 
Posts: 13
Joined: Mon Aug 16, 2010 7:18 am

Re: Map generator - how does it work?

Postby loftar » Tue Sep 21, 2010 3:56 pm

It would potentially be a bit boring to publicize the code, since it might potentially reveal some secrets that can currently only be found by exploring. I wouldn't mind doing it after it's been replaced with a new map generator, though. Except the potential exploration issues, the current map generator is nothing I feel particularly secretive (or proud) about. :)

I can tell you that it's written in Python, at least. I also wouldn't mind handing out the code that generates the "patch" shapes (it uses libgd for drawing), if that's what you're interested in.

By the way;
Lothaudus wrote:[...]I don't think loftar would defile himself by actually using "goto".

While goto's reputation is understandably bad, the reaction against it is often exaggerated, too. The flow control in C is quite limited, and doesn't lend itself well to a lot of things, such as multi-level break or continue, or other non-local exits of structured blocks -- see the Linux kernel source for constant goto usage to emulate unwind-protection, for example.
You do not have the required permissions to view the files attached to this post.
"Object-oriented design is the roman numerals of computing." -- Rob Pike
User avatar
loftar
 
Posts: 9045
Joined: Fri Apr 03, 2009 7:05 am

Next

Return to The Inn of Brodgar

Who is online

Users browsing this forum: Claude [Bot] and 2 guests