Difference between revisions of "Talk:Battlescape Map Generation"

From UFOpaedia
Jump to navigation Jump to search
Line 52: Line 52:
  
 
- [[User:Hobbes|Hobbes]] 12:34, 18 February 2008 (PST)
 
- [[User:Hobbes|Hobbes]] 12:34, 18 February 2008 (PST)
 +
 +
----
 +
 +
I guess you'll have to trust me on this one, but base assault mission are generated by code starting at 0x0044D030 ; there you can see:
 +
 +
.text:0044D042 mov    eax, 5
 +
.text:0044D047 add    esp, 0Ch
 +
.text:0044D04A mov    pGeodata.map_xsize_10, ax
 +
.text:0044D050 mov    pGeodata.map_ysize_10, ax
 +
.text:0044D056 mov    pGeodata.map_zsize, 2
 +
.text:0044D05F mov    pGeodata.terrain_type, 4
 +
.text:0044D068 mov    pGeodata.craftsToDraw, 0
 +
.text:0044D06F mov    word ptr missionDescriptor, 3  ; 3 -> base offense
 +
 +
which means (if you're not fluent in x86 ;) ) that the alien assaults maps are hard coded to 5x5x2 size.
 +
 +
Similarly for base defense, you'll find:
 +
.text:0044CD6B mov    eax, 2
 +
.text:0044CD70 mov    ebx, 6
 +
.text:0044CD75 mov    pGeodata.map_zsize, ax
 +
.text:0044CD7B mov    word ptr missionDescriptor, ax  ; 2 -> base defense
 +
.text:0044CD81 add    esp, 0Ch
 +
.text:0044CD84 mov    pGeodata.map_xsize_10, bx
 +
.text:0044CD8B mov    pGeodata.map_ysize_10, bx
 +
.text:0044CD92 mov    pGeodata.terrain_type, 3
 +
.text:0044CD9B mov    pGeodata.craftsToDraw, 0
 +
 +
which translates into 6x6x2 map size. [[User:Seb76|Seb76]] 14:12, 18 February 2008 (PST)

Revision as of 22:12, 18 February 2008

Urban Roads

I've observed a 45-50% chance of an east/west road appearing, and a 75% chance of a north/south. Both appearing at once occured 20% of the time. Only done 110 trials at the present time however.

- Bomb Bloke 03:55, 10 February 2008 (PST)


I'm pretty sure I encountered road-less terror missions before. It's been a while since I ran random terror missions though. BTW: the max number of 20x20 modules which can happen on a Cydonian base map is 8 (including the brain room). In an alien base, it's 4 (including the command center). In both instances, the game has to create 2 green staging rooms so that your soldiers have a place to start. Therefore, the min number of small 10x10 modules (neglecting the 2 green rooms) in the Cydonian base is 2 and in an alien base it's 7. Of course, this assumes the game's map generation engine is purely random.

- Zombie 22:45, 13 February 2008 (PST)


Can't remember ever seeing a terror map without a road... Are you certain?

What I plan to do is create a special logger and run a few thousand samples through it. That'll get the percentages that much more clear.

I'll be doing the same regarding the odds of any other module turning up in a given space. I suspect the limits as to how many large modules can appear are, as you say, solely based on how many can actually fit; but I'd like to have it nailed down for certain. :)

- Bomb Bloke 23:41, 13 February 2008 (PST)


Like I said, I'm not 100% certain on seeing road-less terror missions, but I'm pretty sure. If the map generation engine is completely random, it guarantees the possibility. Technically, there is a 6.67% (1 of 15) chance of spawining a road in a N/S or E/W configuration and the same chance of a dual roadway. It's possible that because the roads come first in the map area, the game might be more inclined to to include them. Then again, if the game engine spawns a road section somewhere, it might have to re-work the whole map so that the road goes across. In either case, the probabilities of a N/S or E/W road configuration should be identical so perhaps more trials are needed to gain a better understanding. --Zombie 00:42, 14 February 2008 (PST)

Map Sizes

XcomUtil may generate oddly shaped maps?

- BB


No, but the engine should accept rectangular maps (at least TFTD does, in the case of the ships). BladeFireLight once designed a Battlefield Generator that was supposed to allow you to create your own maps but i never quite figured it out.

- Hobbes 13:52, 13 February 2008 (PST))


So XcomUtil didn't generate those 60x60x2 alien bases?

UFO does support rectangular maps, and even maps more then four units high. My throwing logger generates them to spec, but the maps aren't intended for playing on.

There were also some odd issues where adding extra levels would cause all sorts of rendering artefacts... Can't quite remember how high you had to push things for that to happen.

- Bomb Bloke 17:36, 13 February 2008 (PST)


I'm not sure about the 6x6x2 alien bases anymore, might just be my memory playing tricks on me.~

- Hobbes 12:34, 18 February 2008 (PST)


I guess you'll have to trust me on this one, but base assault mission are generated by code starting at 0x0044D030 ; there you can see:

.text:0044D042 mov     eax, 5
.text:0044D047 add     esp, 0Ch
.text:0044D04A mov     pGeodata.map_xsize_10, ax
.text:0044D050 mov     pGeodata.map_ysize_10, ax
.text:0044D056 mov     pGeodata.map_zsize, 2
.text:0044D05F mov     pGeodata.terrain_type, 4
.text:0044D068 mov     pGeodata.craftsToDraw, 0
.text:0044D06F mov     word ptr missionDescriptor, 3   ; 3 -> base offense

which means (if you're not fluent in x86 ;) ) that the alien assaults maps are hard coded to 5x5x2 size.

Similarly for base defense, you'll find:

.text:0044CD6B mov     eax, 2
.text:0044CD70 mov     ebx, 6
.text:0044CD75 mov     pGeodata.map_zsize, ax
.text:0044CD7B mov     word ptr missionDescriptor, ax  ; 2 -> base defense
.text:0044CD81 add     esp, 0Ch
.text:0044CD84 mov     pGeodata.map_xsize_10, bx
.text:0044CD8B mov     pGeodata.map_ysize_10, bx
.text:0044CD92 mov     pGeodata.terrain_type, 3
.text:0044CD9B mov     pGeodata.craftsToDraw, 0

which translates into 6x6x2 map size. Seb76 14:12, 18 February 2008 (PST)