The 3rd Age

Game Enhancement Mod

Game Enhancement Mod

Enhances the expansion by adding new units, new features, and a new faction: Arnor!

Button for The 3rd AgeButton for The Dwarf HoldsButton for The Elven AllianceButton for Helm's Deep Last HopeButton for GothmogtheOrcButton for BFME+Button for The Four AgesButton for HDR HeadquartersButton for Middle Earth CenterButton for Project Perfect Mod

Become an affiliate!

   

Quick Lists

Top Rated Popular New Updated Last Comments Users

Register and log in to move these advertisements down

Optimizing Upgrade.ini to avoid crahes\bugs

Tutorial for Battle for Middle-earth BFME

Avatar of Lauri

Lauri

Category: Code
Level: Beginner
Created: Sunday November 7, 2010 - 7:30
Updated: Sunday November 7, 2010 - 8:44
Views: 5104
Summary: A tips guide to optimizing the usage of Upgrade.ini because it has a maximum number of upgrades

Rating

Staff says

4.0

Members say

4.4

Average

4.3/5.0

6 votes

Page 1 2
This is merely a guide to keep Upgrade.ini clean and cool, to avoid bugs like the ones I've had for well over a year but never knew why.

Page 1: Tips and tricks
Page 2: Known crashes and bugs


Okay, so first things first. Upgrade.ini has a maximum number of Upgrade's possible. For BFME1, that limit was previously thought to be at 190, but after extensive testing for a couple of hours I found it possible to have 205. Upgrade number 206 and above won't be read by the game, and depending on their usage, will crash or made weird bugs. Exaples of that are on Page 2!
Now, EA already use 153* (see below) of them, so that means that you have 52 upgrades to use, in BFME1. That might sound like much, but depending on your mod it might not be enough.

I do not know the maximum on BFME2 or RotWK, however, but my tips will still pay off, so keep on reading if you're modding BFME2\RotWK.
I'll eventually check out BFME2.

*EA acctually use 154, but have used Upgrade_GandalfLightningSword twice. They are identical, so you're free to delete either one of them. They both look like this:
              
Code
Upgrade Upgrade_GandalfLightningSword
Type = OBJECT
End


Tips:
Okay, so how do we optimize the upgrades? Well, the best thing to do is simply to use as many as possible that EA already use. If you're making a new leadership for a new hero in your mod, do you really need to make a new upgrade for it? No you don't, you can simply use one that EA already has for leadership, because almost every EA hero has their own, when they in reality could do with simply having two. Upgrade_HeroLeadership and Upgrade_HeroLeadership2 for those that use two. Most use one.

If you want you can make those two. EA uses 7 that have Leadership in their name, but there's acctually more than that.
However, one way to save even more in the long run, something I've found to be the best way, is to simply make Rank\Level specific upgrades.

              
Code
Upgrade Upgrade_Level2
Type = OBJECT
End
Upgrade Upgrade_Level3
Type = OBJECT
End
Upgrade Upgrade_Level4
Type = OBJECT
End
Upgrade Upgrade_Level5
Type = OBJECT
End
Upgrade Upgrade_Level6
Type = OBJECT
End
Upgrade Upgrade_Level7
Type = OBJECT
End
Upgrade Upgrade_Level8
Type = OBJECT
End
Upgrade Upgrade_Level9
Type = OBJECT
End
Upgrade Upgrade_Level10
Type = OBJECT
End

Now you can use these for all heroes. There is no need for a Level 1, because they won't need an upgrade to be unlocked. Or you can simply reuse all that EA already has to save even more (I only use this because it's easier to keep control on)

And you can even take it down even further, by making something like this instead:

              
Code
Upgrade Upgrade_SpecialPower1
Type = OBJECT
End
Upgrade Upgrade_SpecialPower2
Type = OBJECT
End
Upgrade Upgrade_SpecialPower3
Type = OBJECT
End
Upgrade Upgrade_SpecialPower4
Type = OBJECT
End
Upgrade Upgrade_SpecialPower5
Type = OBJECT
End

Both of them will work good. If you use either of these, you have more than enough left. However, there is a risk if you're adding new factions, or actual upgrades that units use (Heavy armour, ect). In my mod 20 of the upgrades are simply Heavy Armour, Forged Blade, Fire Arrows and so on for two new factions. And then I have 9 Level upgrades, 3 spellbook related (that can't be reused) and 4 specific ones. That is 36 upgrades. That means that I have 16 left to use, and I think I'll manage just fine.

If you do run out, you might look at the opportunity to move the upgrades EA made but doesn't use to the bottom of the file, where they won't work, but will still be read by the game. You'll have to find some yourselves, but I'm pretty sure that you can move Upgrade_PlantShield, Upgrade_RaiseShield, Upgrade_ElvesBetterStealth.. take a look at the other ones in the start (all until Upgrade_RohanDualEconomyChoice seems to be simply leftovers from EA that weren't used)
The best way to check is to extract the INI.big from BFME to a new folder, and drag the entire folder in Notepad++ with ColourINI (link below), find upgrade.ini in that mess, and search for the upgrades you're wondering about. (Ctrl+F, write the entire upgrade, ie, Upgrade_PlantShield, the click Find All in All Opened Documents) That should tell you how used they are (look at the bottom, that's where they get listed). If they are commented out everywhere (with a ; somewhere before them.. if using ColourINI the text that is green is commented out), you're pretty much free to move that upgrade to the bottom of upgrade.ini. The same can be done if there's an upgrade that isn't commented out, but isn't used none the less. (the "upgrades" in the start of Upgrade.ini aren't the real upgrades that we use in-game, they are further down the list. The ones in the start are merely what the porters use to grant units upgrades, which was scrapped from the game and thus not used).
Do all this on your own risk however, as I do not know if it will cause crashes anywhere. Some might just do that.

Links / Downloads

 HitsAdded
Known game.dat errors1560November 7, 2010 - 8:43
colourINI1376November 7, 2010 - 8:43

Credits

GothmogtheOrcFinding the first limit

Comments

Display order: Newest first

Gandalf17 - Monday December 13, 2010 - 21:54

well my campaign started having these weird crashes suddenly. The game kept crashing right when i win a campaign level. i read this article and realized i had gone over the upgrade limit so i tried deleting a few and now the campaign works perfectly. this article is very helpful, thanks

BigBrainiac - Wednesday November 17, 2010 - 17:10

Thanks, I actually based an experiencelevels.ini on this (like a #define GoAHeroes and GoAEliteHeroes)

This is a well written (and useful) tutorial on upgrades and deserves to be rated 5 stars.

Go to top

 

"One site to rule them all, one site to find them,
one site to host them all, and on the network bind them."

 
14:40:14