CTP2 Bureau
The Modding
Apolyton CTP2 forums
Apolyton CTP2 archives
Source Code Project SVN



Recent Changes Search

Create a new page:

AE Modding Wiki : Main : ScenarioStructure

Since May 2006 the Scenario Structure of CTP2 AE is (almost) fully functional, which makes the handling of Mods much easier, without the need of renaming (prefixing) the modded files, and without the need of an external utility like ModSwapper. Within this structure a Mod is just a scenario without saved game and may be loaded via the in-game scenario menu. In order to "install" the Mod, the modded texfiles, graphics, sounds, and eventual SLIC files need to be put into a "scen000#" folder inside the Mod's scenario folder like this:

File Structure

The Ultimate Mod
|- scen0000
|- scen0001
|- ...
|- ...
|- ...

In "The Ultimate Mod" scenario/mod-folder you need a packlist.txt - as an example:

The Ultimate Mod
The biggest maps, the most extensive SLIC, and every single line of text has been modified.

The number in the last line indicates the number of subfolders (here: scen0000 and scen0001).

You also need a "packicon.tga" (TGA, 160px x 120px, RGB, 16 bits/pixel).

In each scenario folder (scen0000, scen0001 etc.) you need a scenario.txt - as an example:

In "scen0000":

The Ultimate Mod
Super-Ultra Gigantic Maps
For real-time strategy experience.

In "scen0001":

The Ultimate Mod
Less Gigantic Maps
For those who are in a hurry, or have a real life, or something else.

And you need a "scenicon.tga" in each subfolder with the same specs as "packicon.tga".


The functioning of the scenario structure for "bare" Mods should also imply the possibility of modifying the "timeline" for Mods via turnlength.txt, which might be useful in order to finetune the date displayed according to the possible/probable level of advances. There is also a utility for editing turnlength.txt.

Modded DB-/Stringfiles, and SLIC

Within the "scen000#" folders you may reproduce the folder structure usually found under \ctp2_data\ (without adding any prefix to the filenames). The game should load files found in the scenario folder and its subfolders from there and the rest from \ctp2_data\ and its subfolders. As fas as I can tell this works with the 2009-06-01 version, including the soundfiles which used to be ignored by earlier versions.

SLIC files go into \default\gamedata\ as usual, with a "scenario.slc" as the file the engine recognizes and from which all other SLIC may be included.

Text strings

In CTP2 AE you only need to provide text strings that should either differ from the original ones or that are not present in the original game. Thanks to DefaultStringLoading it is not necessary to reproduce the entire, original strings database (well, I have not yet tested this one, but this is what the changelog promises).

Real Scenarios

Of course, real scenarios with premade maps are handled in the same way. There is an ongoing discussion about how the handling of Mods and Scenarios should possibly be separated, but with no results so far. Currently you could e.g. put a "bare" Mod into the "scen0000"-folder and a "real" scenario with a saved game into the "scen0001"-folder. Of course this implies copying all other modfiles from "scen0000" to "scen0001", which IMHO doesn't hurt.

CTP2 AE compatibility of old Scenarios/Mods

To get old scenarios and mods running under the new engine, several textfiles need to be adapted. I don't have a complete list, but you should find all needed info in the Database and Main sections of this WIKI. The other thing you need to take care of is SLIC: The Apolyton Edition is a bit more demanding regarding correct use of functions and event handlers. As far as I can tell it is necessary to use int-functions in a "conditional" way, i.e. to evaluate their return value. This means: A function call that used to work like this:

// do something
GetCityByIndex(player, index, cityvar);
// do something else
// and do the rest

will possibly fail in CTP2 AE and should be replaced by:

// do something
if(GetCityByIndex(player, index, cityvar)) {
// do something else
// and do the rest

Similarily it seems to be a good idea in pre-EventHandlers that

return STOP;

to also

return CONTINUE;

if the conditions for stopping the event are not met.

Obsolete Fixes / Workarounds

Some bugfixes and workarounds to overcome weaknesses of the original game are no longer needed in CTP2 AE:

  • The neutral tile improvement pillage fix via SLIC (fixed in the source code)
  • Diplomod SLIC: AI-AI diplomacy routine (fixed in the source code)
  • SLIC to make the AI build fisheries in deep sea (possibly fixed in the source code according to this Apolyton thread)
  • SLIC to make the AI build useful commerce improvements around their cities (possibly fixed in the source code according to this Apolyton thread)
  • Infrastructure / empty AI build queue bugfix via SLIC (possibly fixed in the source code according to this Apolyton thread)
  • SLIC to make the AI build a new capitol when they loose their original one (fixed in the source code)

The following SLIC codes to improve AI tactics may no longer be useful due to even better improvements in the source code:

  • SLIC to clear the AI's orders every few turns (may even be counterproductive, but this is just my guess)
  • BetterAI SLIC by Martin Gühmann (since he implemented all of it and even more in the source code)

Improved Modding Capabilities

Of course, depending on the Mod-specific demands, all of the improved modding capabilities should be used & tested ...

This is a summary of an old Apolyton thread

Page last modified on July 05, 2009, at 01:16 AM
AE Modding Wiki built with PmWiki Design: BureauBert
Share this page:  VK Facebook Twitter LiveJournal OK MR Google+ LinkedIn tumblr Pinterest Blogger Digg Evernote