Alpha Centauri 2

Sid Meier's Alpha Centauri & Alien Crossfire => Modding => Topic started by: Mart on April 08, 2015, 03:29:52 PM

Title: Map/scenario file exe procedure
Post by: Mart on April 08, 2015, 03:29:52 PM
This is question to exe modders.
In the decompiled code, is the map generation procedure visible?
Or, more accurately, what would be useful is map (and/or scenario) files writing procedures, so their format can be known.
Is it something, that can be printed into txt?

My idea is to create external program for generation of such .mp and .sc files, a CMN tool allowing for fast generation of scenarios, especially for multiplayer.
Thank you!
Title: Re: Map/scenario file exe procedure
Post by: Yitzi on April 08, 2015, 03:37:21 PM
This is question to exe modders.
In the decompiled code, is the map generation procedure visible?
Or, more accurately, what would be useful is map (and/or scenario) files writing procedures, so their format can be known.
Is it something, that can be printed into txt?

My idea is to create external program for generation of such .mp and .sc files, a CMN tool allowing for fast generation of scenarios, especially for multiplayer.
Thank you!

I've found some of the sub-procedures of the map generation procedure, but haven't conclusively identified (never mind parsed) the main procedure yet.

It's fairly complex, though.
Title: Re: Map/scenario file exe procedure
Post by: Mart on April 08, 2015, 03:44:07 PM
Even partial info can be used, e.g. knowing parts of the format, they could be modified in generated files by the game.
Then some of the unknowns might be deduced by trial and error.
Title: Re: Map/scenario file exe procedure
Post by: Yitzi on April 08, 2015, 05:01:54 PM
Even partial info can be used, e.g. knowing parts of the format, they could be modified in generated files by the game.
Then some of the unknowns might be deduced by trial and error.

Ok, the addresses for landmark creation are as follows:

5C8630: Main function (in some cases, but sub-functions seem to cover most or all cases):
  5C5EF0: jungle
  5C5C70: crater
  5C6DB0: volcano
  5C7F40: mesa
  5C8150: ridge
  5C69E0: uranium
  5C64A0: ruins
  5C7750: unity
  5C7A80: fossil
  5C7540: nexus
  5C7CB0: Nessus Canyon (by default/without mods, not created on random maps)
  5C7020: borehole
  5C6200: sargasso
  5C6740: dunes
  5C6C40: fresh
  5C83B0: geothermal

Some map details:

Flat map: 94988C, bit 1
Half map width: 68FAF0
Map width: 949870

Data for map squares:

  Height category (thousands of feet): +0, bits E0
  Height is determined by +1
  Raininess: +0, bits 18
  Rockiness: +4, bits C0 00
  Improvements: +8:
    Base: bit 1 (but seems to be a bit more complicated)
    Unit(s): bit 2 (probably, but also has same complications as base)
    Road: bit 4
    Magtube: bit 8 (so has C)
    Mine: bit 10
    Fungus: bit 20
    Solar: bit 40
    River: bit 80
    Resource bonus: bit 4 00
    Monolith: bit 20 00
    Farm: bit 80 00
    Enricher: bit 8 00 00
    Forest: bit 20 00 00
    Condenser: bit 40 00 00
    Mirror: bit 80 00 00
    Borehole: bit 1 00 00 00
  Landmarks: +C:
    Crater: 1
    Volcano: 2
    Jungle: 4
    Uranium: 8
    New Sargasso: 10
    Ruins: 20
    Dune: 40
    Freshwater: 80
    Mesa: 1 00
    Canyon: 2 00
    Geothermal: 4 00
    Pholus Ridge: 8 00
    Borehole cluster (actual holes): 10 00
    Manifold Nexus: 20 00
    Unity: 40 00
    Fossil field ridge: 80 00
    Higher seems to be control rules.
Title: Re: Map/scenario file exe procedure
Post by: Mart on April 08, 2015, 05:32:39 PM
Thank you!
I will try to write something working on the maps.
:)
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 33 - 892KB. (show)
Queries used: 19.

[Show Queries]