Level Names to Avoid, Start Pylons, & ILB

Talk about your new mod or map here

Moderators: jelco, bert_the_turtle

brice
level2
level2
Posts: 167
Joined: Fri Feb 23, 2007 6:04 am

Level Names to Avoid, Start Pylons, & ILB

Postby brice » Thu May 31, 2007 3:27 am

UPDATE: this behavior does occur under Windows patch 1.42, so I'll guess it also occurs for the latest Mac version.

Mods which share level names with the main game will experience strange errors about UniqueIDs being non-unique for buildings that don't even exist in the mod. I've figured out what the game engine is doing, and it may explain why ILB never affected the original game. It also means that if you reuse the original level names, you must be careful about your building IDs. For example, this behavior will affect your hidden "generator" level if you use Start Pylons in your mods.

In a nutshell, if you have a mod level called "escort", the game engine will read in your map and mission files, AND THEN it will also read in the mission file for the original "escort" level. If the building IDs in the original mission conflict with your mod's building IDs, you will get errors. The errors will complain about the dynamic buildings from the *original* game mission, so you will see errors about the Incubators, Triffids, etc. which you might not have in your own level.

The old-mission buildings are not instantiated in your mod level. But if the original mission lists global Incubators, these will get game.txt entries in your mod, using the original building IDs, but your own mod's level IDs. This seems to be the only purpose for this behavior. Besides the UniqueID errors, it is the only effect.

This may be why ILB didn't affect the original game (it didn't, did it?). The affected level names are not hardcoded in the executable, so they must either be coming from the levels directory in the main.dat package, the original game.txt, or from the location strings in the language.txt file. I haven't checked which one it is. But clearly there is a built-in mechanism for scanning these mission files and adding their dynamic global buildings to game.txt. Isn't that the entire issue with ILB?

This may just be a linux thing. I'm running 1.4.0b9 under linux. Maybe this was IV's way of patching the ILB bug? Can anyone verify this on another platform? I don't have Darwinia running on my XP partition yet.

EDIT: to verify this behavior, just create an empty level called "escort". Then exit and erase your game.txt, re-enter the WorldMap, exit the game, and redshirt the game.txt. If you see the following two lines in your game.txt, they came from the original escort mission file. The level ID (locId) will be different.

Code: Select all

Buildings_StartDefinition
   # Id  teamId  locId   type   link  online
   # =======================================
     14    2      2     29     -1      0
     15    2      2     29     -1      0
Buildings_EndDefinition


In any case, if you use StartPylons you will want to be aware of this. The original "generator" level lists four buildings in it's mission file:

Code: Select all

        Triffid             72      3562.97 1688.75 1       0.07    -1.00   0   
        Triffid             73      3620.10 1655.57 1       0.99    0.15    0       
        Incubator           50      1139.57 1278.63 1       -0.61   -0.79   1            0
        Incubator           53      3114.28 473.76  1       0.02    1.00    1            0

These building IDs are effectively taken and unavailable to your mod. Since they are high numbers, your hidden "generator" level probably won't bump into them. But be aware that you will get global entries for the two Incubators in your game.txt, even if you don't place any in your level.

The upshot is: if you want to avoid mysterious UniqueID errors, you should avoid using level names that appeared in the original game.

If this behavior is cross-platform, and if the engine is taking the level names from the locations listed in language.txt, then there is a possibility this mechanism can be used to fix any ILB problems that might come up in mods. I haven't tried this yet, but you could try adding location entries in your strings_default.txt for each of your own level names. The engine might scan those missions for global dynamics (or maybe just Incubators?) and make the appropriate entries in game.txt. I'm not sure how to test this since my 1.4.0b9 seems to be free of ILB at the moment.
User avatar
The GoldFish
level5
level5
Posts: 3961
Joined: Fri Mar 01, 2002 9:01 pm
Location: Bowl / South UK
Contact:

Postby The GoldFish » Thu May 31, 2007 7:54 pm

Further to this, the engine seems to have always been expecting multiple missions per map, with their name and then their overall objective (example mission_generator_enable.txt). It's because of this behavoir that temple_again (in stricken) occasionally turns up the triffid ID issue.
-- The GoldFish - member of former GIT and commander in chief of GALLAHAD. You could have done something, but it's been fixed. The end. Also, play bestgameever!
User avatar
Lowell
level3
level3
Posts: 428
Joined: Mon Jan 02, 2006 8:03 pm
Location: Atlanta, Georgia
Contact:

Postby Lowell » Tue Jun 05, 2007 5:11 am

Thanks again...this is where I am right now. I have one map in set one that needs the start pylon for sure, the "Lepton" map has a hidden generator for a fix...I may try and rebuild Lepton completely, I never wanted that stupid building with the generator hidden inside it.

I will give it a try.

Return to “Mod Projects”

Who is online

Users browsing this forum: No registered users and 4 guests