Difference between revisions of "Talk:Battlescape Map Generation"

From UFOpaedia
Jump to navigation Jump to search
Line 152: Line 152:
  
 
:: OOH... that's an interesting thought! Yes, I have noticed that the number of survivors does seem to correlate to the destruction level... Hmmm hmmm hmmm... well, maybe someone can perform the happy fun test where they blow up aliens using UPS modules, over and over and over, lol...
 
:: OOH... that's an interesting thought! Yes, I have noticed that the number of survivors does seem to correlate to the destruction level... Hmmm hmmm hmmm... well, maybe someone can perform the happy fun test where they blow up aliens using UPS modules, over and over and over, lol...
 +
:::The explosion power is hard coded and does not change with craft type, damage taken during dogfight or whatever other things like time of the day or planet alignment... [[User:Seb76|Seb76]] 14:19, 19 March 2009 (EDT)
  
 
== KABOOM!! ==
 
== KABOOM!! ==

Revision as of 18:19, 19 March 2009

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)


Finally got around to pulling in the figures.

  • Total number with WE roads on their own: 456 ( 23.59027 %, or 31.46998 % of single road maps)
  • Total number with NS roads on their own: 993 ( 51.37093 %, or 68.53002 % of single road maps)
  • Total number with WE roads: 940 ( 48.62907 %)
  • Total number with NS roads: 1477 ( 76.40973 %)
  • Total number with both roads: 484 ( 25.0388 %)
  • Total number with no roads: 0 ( 0 %)
  • Total number with a single road: 1449 ( 74.9612 %)
  • Total trials: 1933

- Bomb Bloke 22:07, 17 March 2009 (EDT)

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)

Units VS PSUs

Arrow, please discuss here before you edit this stuff... hmm... I'm going to look for an editor, and see what happens if I hack Mutons to have 250 Health and 250 armor in all directions. If my suspicions are correct, the UPS explosion will STILL kill them... anyone know which editor can edit Muton stats and UPS explosion damage? ... I haven't seen any editors which can do that, so far... Jasonred 12:45, 17 March 2009 (EDT)

I admit I was a bit hasty in editing; I'm fairly low on sleep. I would ask you recall to do the same on some other pages. :) IIRC, from Zombie's The UFO power source explosion actually exceeds a Blaster Bomb in power. What I think happens is that the game might respawn some aliens after the explosion in the event they're all killed by the blast, as a failsafe. If no aliens are present, the battle would never begin because the aliens would never pass the "Any units alive?" check before the beginning of Turn 1. And I have seen wounded aliens near Power Source explosions on occasion. So it is possible. Arrow Quivershaft 13:05, 17 March 2009 (EDT)
I bet the Mutons survive, as I see plenty of merely damaged aliens from power plant explosions (CE Edition). -- Zaimoni, 14:21 17 Mar 2009 (CDT)
... Ok... I need to either get an editor or bring in Mind-Probes to confirm this... Jasonred 18:22, 17 March 2009 (EDT)

Ah, but there's always some aliens OUTSIDE the spaceship, right? Is it hard-coded always, or is it just very very very likely that there will be aliens outside the ship? ... hmmm... but, as I've said... the UPS explosion behaves very strangely. The inconsistant blast pattern, among other things. If you tried to SIMULATE a UPS explosion by editting Heavy Explosives, and set them off right in the center of a Medium Scout, you would get the same blast pattern every single time. A crashed Medium Scout can have anything ranging from the floor ceiling and walls being intact to a hole in the ceiling to near total annihilation with even the outer hull shredded. ... Heck, you can usually recover an intact UFO navigation from a crashed medium scout. Try firing off a Blaster Bomb in the middle of one, and see what happens...

I definitely agree with your failsafe theory... every combat MUST start with live aliens. But I think that is in ADDITION to any weird behaviour exhibited by the UPS kaboom.

Just checked... UPS blows with strength 215, but has a random modifier too... they already know that UPS boom is weird vs terrain. Let's see how weird it is vs units...

A Medium Scout where no aliens spawn outside is rather likely to start with zero aliens. This is most common on Beginner (have seen twice in ??? missions). Saving the game is impractical as the battle ends before XCOM starts its first turn. -- Zaimoni, 14:12 17 Mar 2009 (CDT)
Eh... really? So you CAN start a mission with zero aliens? Interesting... what version of the game are you playing, BTW?
Eh... this gives me a thought for yet another crackpot theory... which is about the spawning of units for the higher difficulty levels... I tend to find quite a number of aliens inside the UFO to be much greater on Superhuman... maybe the "extra" aliens from superhuman were spawned after the UPS explosion?
Eh... come to think of it... if it ended so quick, how do you know the map had zero aliens? Maybe it was tactical.exe crashing and made you think the mission succeeded, but it was just the prior mission results?

Jasonred 18:22, 17 March 2009 (EDT)

As mentioned above: CE edition (XCOMUtil'd, as the graphics need patching to display at all; however, the only binary executable code patching XCOMUtil does is to remove the Difficulty Bug). The forked tactical.exe did not crash; the start of the turn is displayed properly, I get a brief glimpse of the BattleScape, and then the Mission Over sequence. No reaction time to speak of. -- Zaimoni, 18:10 17 Mar 2009 (CDT)
If the mission results says success and no aliens killed, no aliens captured, that's a pretty good hint the exe didn't crash. Your previous mission presumably had kills. No survivors happens, from time to time. Knan 19:18, 17 March 2009 (EDT)
It's not uncommon for a crash to kill all units in TFTD, however in that case you get a message stating that's exactly what happened. I cannot remember it happening in UFO, though I've had aliens non-fatally injured by the UPS explosion. Also seen them knocked out from it, but that could be due to subsequent exposure to smoke (never done a proper check into the matter).
Remember that units under alien control never sustain fatal wounds, so you won't notice an alien was "just winged" by the blast unless you mind control/probe it. Less health means a unit will go down to smoke faster, too.
XCU does not edit the CE game executable to remove the difficulty bug. That version of the game doesn't have it in the first place. f0dder's loader is what fixes the graphics (that edits the binary executable code, but only the copy you're running in RAM, not the original file).
- Bomb Bloke 00:29, 18 March 2009 (EDT)

I'm not really sure when aliens are spawned on a map. My assumption is that they are placed there after the map is generated but before the Power Source(s) has/have exploded (this is correct - BB). Because of the high spawn priorities for aliens inside the Medium Scout, you would think there would be a high probability that the aliens which do spawn would all be killed. This is far more likely to happen on Beginner than on the higher difficulty settings because less aliens will be present and the probability of them spawning inside the craft high. When you get to Superhuman, there are usually a lot more aliens than spawn points inside the craft and this results in more showing up around the landscape. But this type of auto-win mission is still hard to come by. The reason is two-fold. First, just because a spawn point has a priority of 10, it doesn't mean that point will automatically get filled before another one with a priority of 1. It's a weighted probability, so in this example, there would be a 10/11 (90.91%) chance the alien will go in the 10 priority while there is a 1/11 (9.09%) chance it will spawn in the 1 priority. Secondly (and this is the kicker), the landscape plays a huge role in where aliens will get placed. For example, on the farm landscape, there are a few high-priority spawn points within the buildings which dilutes the probability of aliens all going within the craft. In the same manner, a landscape may have a lot of low priority spawn points which lowers the probability too.

As for how much damage a unit will take from a UFO PS explosion, I don't know. I'm only up to gathering numbers on the amount of recoverables. But it shouldn't be too hard to bash together a testing scenario. I think the one problem I had before was that the damage for the explosion was so high that it forced me to edit soldier armor to compensate (even with 255 health). More armor would skew the results more. I suppose the easiest way would be to edit the blast strength of the PS explosion to a small (but constant) level to avoid the armor problems. --Zombie 00:56, 18 March 2009 (EDT)

Just to add my experience, I've had the auto-win scenario happen to me with the medium scout a few times before after painstakingly arming my troops to an exact configuration. You tend to remember something like that! I've had it happen in both the dos version (untainted) and CE (XComutil split executable). I suppose it was one of those odd occasions where all aliens just happened to spawn inside the UFO. -NKF 02:02, 18 March 2009 (EDT)
This is all VERY interesting to me... learnt a lot. Hmmm... Explosions do a minimum of 50% damage to units, right? So, how can a sectoid/floater survive 50% of a 180 damage explosion? ... intruiging... OH YEAH, I remember the TFTD no survivors thing! Those were hilarious... One more thing... am I going senile things, or is it possible for Navigation to be intact when the UPS blows up? ... maybe I am confusing the large scout results? ... hmmm.... Jasonred 03:36, 18 March 2009 (EDT)
On occasion, the Navigation will survive a power source explosion in a Medium Scout. However, this is not a particularly reliable means of acquiring UFO Navigations. Arrow Quivershaft 05:36, 18 March 2009 (EDT)
Yeah, that's what I thought... however, doesn't a UPS explode with minimum strength 180? Cause it looks like the Console Navigations only have 40 armor, and they're not actually that far away from the blast, I'm surprised that they can survive at all? Anyhow, heh, I find that I have many more Navigations than Power Sources... but X-com craft either need 1N1P, or 1N,2P.My fleet of Avengers means that my required ratio is close to 2 Power Source to 1 Navigation. Jasonred 06:01, 18 March 2009 (EDT)

At least from my tests on the UFO Crash Recovery Talk Page navigations never survive a crash where the power source explodes. How can a Sectoid survive? Well, if it spawns between the chair and the wall, the chair will absorb some of the blast strength. Also, at that distance, the explosion goes to facing armor, not under armor which may be just enough to keep it alive. --Zombie 11:16, 18 March 2009 (EDT)

How much HEB does the chair have? It's not listed on the explosions page. Jasonred 11:38, 18 March 2009 (EDT)

Chairs have 20 HEB. So that means the min damage on the tile beyond that is 40. Sectoids have a max health rating of 30 and front armor of 4. That's still 6 points short of surviving though. Don't really know what's going on there. --Zombie 22:30, 18 March 2009 (EDT)

Any chance the minimum blast strength varies from craft to craft? - Bomb Bloke 23:16, 18 March 2009 (EDT)
OOH... that's an interesting thought! Yes, I have noticed that the number of survivors does seem to correlate to the destruction level... Hmmm hmmm hmmm... well, maybe someone can perform the happy fun test where they blow up aliens using UPS modules, over and over and over, lol...
The explosion power is hard coded and does not change with craft type, damage taken during dogfight or whatever other things like time of the day or planet alignment... Seb76 14:19, 19 March 2009 (EDT)

KABOOM!!

The game does actually feature vertical damage from explosions, and not only for UPS. I guess the reason it's believed otherwise is that the flying armor gives good protection against ground explosions. The UPS explosion being up to 250 in explosive power can destroy roof tiles, as well as a modified blaster bomb would. And I can assure you that UPS explosions use the same routine as standard explosions ;-) Seb76 15:11, 17 March 2009 (EDT)

Other than the fact that UPS does 215 +/- 35 damage to terrain? hmm... Wait, methinks me gets that part... sort of... basically, the initial strength of the explosion is randomly determined, then it henceforth behaves like a normal explosion? ... How much damage is applied to alien units nearby then? Do they get hit for the full damage or something? ... Sigh... I need to wait until my current game reaches the point where I have a full developed Psi Corps.
As for vertical damage from explosions, er... SORT OF. Explosions do vertical damage, but only to floor/roof tiles. Units and objects appear to be untouched. Not only flying armor, even Floaters and Ethereals will be completely untouched by an explosion occuring underneath them. I have been wondering about that, actually...
Jasonred 18:22, 17 March 2009 (EDT)