Jump to content


Photo

Random Map Generation...


  • Please log in to reply
7 replies to this topic

#1 TomVD

TomVD

    Sergeant

  • Forum Members
  • PipPipPip
  • 12 posts

Posted 14 August 2006 - 04:23 PM

Hello die-hard X-Com fans,
I have been reading a lot in ufopaedia.org , the x-com wiki. I have learnt a lot about how X-Com works. But there is still 1 issue I did not find an answer for.

The wiki says: "A few dozen blocks make up a battlescape."

for X-Com bases it is very easy: it just reads your base structure and creates a battlescape out of it.
for Alien bases:
a ) what kinds of layouts of bases do exist? Are these layouts stored in files or hardcoded?
B ) is there any random factor in it, or are all the rooms every time in the same place?
for Terror sites:
a ) what kinds of layouts of terror sites exist? how many variations?
B ) is there any random factor in it, or are all kinds of terror sites the same?
for other terrains:
same question actually...

It is not totally random (you could have very weird and unplayable maps that way), but it isn't all the same everytime either, somewhere in between? Does someone know the trick behind this?
Maybe it can be added to the wiki, I don't think there is much more info in it than "A few dozen blocks make up a battlescape." now ;)

Somebody must have already tested this, Zombie? :)

Edited by TomVD, 14 August 2006 - 04:24 PM.

- OpenXcom Developer.

#2 Zombie

Zombie

    Colonel

  • Xenocide Creative-Text Departmen
  • 2,947 posts

Posted 14 August 2006 - 06:51 PM

I think I heard my name mentioned. :D

Truth be told, Hobbes knows quite a bit more than I know about this subject. After all, he creates his own maps all the time. I'll give this a shot though. Each landscape has a certain number of "blocks" of terrain it draws upon. I'll list how many here:

Terrain		  Blocks
Farm			   19
Desert			 12
Forest			 12
Jungle			 12
Mars			   11
Mountain		   13
Polar			  14
Urban			  19
Alien Base		 15
So for instance, if your site is Farm, the game draws from those 19 blocks to create a map. The selection, I believe is random.

I think this is true for all the maps except for Urban (Terror Sites). See, roadways usually run the entire width of the map so some organization is needed. :wink1:

Other than that, even an alien base layout is random except for the must-have command center and the two green staging rooms. ;)

- Zombie

Edited by Zombie, 15 August 2006 - 09:11 AM.

The Mr. Grognard of X-COM

Zombie: Empirical data's your only man, when formulating a research plan.
A soldier's death is never in vain if it makes the formula more plain.
A few dozen make a better case for refining that third decimal place.
They call me Zombie because I don't sleep, as I slowly struggle to climb this heap,
of corpses, data points, and trials, but from the top - I'll see for miles!


#3 Blehm 98

Blehm 98

    Colonel

  • [Global Moderators]
  • PipPipPipPipPip
  • 2,626 posts

Posted 14 August 2006 - 09:40 PM

well, the way it works is that it is completely random, but there are certain files that state that certain blocks cannot another block of a certain type. Roads cannot run into buildings, or into roads going the other direction. They can only run into roads going the same direction or off the map.

If you can get a copy of diashiva's editor you can look around, just make sure you leave at least one of the 3 or 4 top maps unedited or you'll crash the game...
Top Secret Xenocide Status report

BF2 Hackers =5SF= have busted
]sD[ Engageo <-- couldn't get him banned though, no screenshot of him ingame
]sD[Nomisser
an AK guy
The anti-logarithm of the logarithm of X plus the logarithm of Y equals X times Y, or 10^(logX + logY) = XY
Posted Image
I hate spider solitaire...

#4 TomVD

TomVD

    Sergeant

  • Forum Members
  • PipPipPip
  • 12 posts

Posted 15 August 2006 - 02:37 AM

Yeah, I have got diashiva's editor, that is a very nice tool.
So, I guess you are right, it is random, but it has a few rules:
1) an alien base must have command center
2) an alien base must have 2 entrance blocks
3) a road in a terror site must be connected to a matching road, or an intersection if 2 roads cross eachother.

Edited by TomVD, 15 August 2006 - 05:24 AM.

- OpenXcom Developer.

#5 NKF

NKF

    Commander

  • [Global Moderators]
  • PipPipPipPipPipPip
  • 4,798 posts

Posted 15 August 2006 - 06:08 AM

One way it could be achieved would be by doing the following rules on generation:

- Create an empty map consisting of the base tile (Grass, for example)
- Place fixed map blocks (Skyranger, UFO, access points, command centre, roads, etc)
- Fit random large 2x2 blocks in place if possible (large warehouses, or the alien storage yard with central guard tower)
- Fill in all the gaps with random small blocks

At least, that's how I'd do it. There may be a few rules when placing the fixed map blocks so that the entry points may be placed at certain distances away from the objective, but this could very well be random.


- NKF
Lord High Generalissimo Ruler Supreme of Norm's Anti Pedant Society (NAPS).

Number of members: 1

#6 Zombie

Zombie

    Colonel

  • Xenocide Creative-Text Departmen
  • 2,947 posts

Posted 15 August 2006 - 09:20 AM

At least, that's how I'd do it. There may be a few rules when placing the fixed map blocks so that the entry points may be placed at certain distances away from the objective, but this could very well be random.

At least in alien bases, the 2 green staging rooms are placed randomally on the map. I have had both of them touching each other and the command center, and one time a green room was at a corner of the map, the command center in the middle and the 2nd green room was diagonally across form the first. In one paricularily nasty Muton alien base mission, both green rooms were at one corner of the map and my troops had to fight their way to the command center which was at the opposite side. Talk about major losses. :P

Roads cannot run into buildings, or into roads going the other direction. They can only run into roads going the same direction or off the map.

Blehm, there are roadway intersections in the game so two roads can interconnect. ;)

Posted Image

- Zombie

Edited by Zombie, 15 August 2006 - 09:28 AM.

The Mr. Grognard of X-COM

Zombie: Empirical data's your only man, when formulating a research plan.
A soldier's death is never in vain if it makes the formula more plain.
A few dozen make a better case for refining that third decimal place.
They call me Zombie because I don't sleep, as I slowly struggle to climb this heap,
of corpses, data points, and trials, but from the top - I'll see for miles!


#7 Blehm 98

Blehm 98

    Colonel

  • [Global Moderators]
  • PipPipPipPipPip
  • 2,626 posts

Posted 15 August 2006 - 09:32 AM

ahh, i forgot about intersections, been a while since i played xcom or opened up diashiva's editor

but you guys got the gist of it
Top Secret Xenocide Status report

BF2 Hackers =5SF= have busted
]sD[ Engageo <-- couldn't get him banned though, no screenshot of him ingame
]sD[Nomisser
an AK guy
The anti-logarithm of the logarithm of X plus the logarithm of Y equals X times Y, or 10^(logX + logY) = XY
Posted Image
I hate spider solitaire...

#8 stewart

stewart

    Programming Department

  • [Xenocide Senior Members]
  • 10,529 posts

Posted 15 August 2006 - 05:45 PM

Here is my VERY humble contibution to xcom map "editing". You may find it useful or amusing.
Posted Image
I'm starting to like the heavy cannon more and more.