Nightinggale
Deity
- Joined
- Feb 2, 2009
- Messages
- 5,385
It's not like it's the first time I looked into that particular file. It is like the breeding ground for python problemswow that was fastI should've known it might be the number of buildings..

It wasn't that hard to track down. It complained about line 1185 and something about reading a too high index. That array is set around line 430 using data, which is set around line 150 (or whatever it was). Those are the only places those arrays are mentioned in the first 1200 lines meaning they were fairly fast to search for.
I suspect we will end up with better performance than RaR. The last non 2071 commit was caching allowed professions. Considering how long the AI spend on browsing though professions all the time I say this should make a difference. If I keep improving whenever I spot something we will end up with nice performance.the current 2071 has about the same number of yields and specialbuildings as RaR, so hopefully performance and screen space won't be too bad once everything's working. But I definitely shouldn't add any more yields (that's another reason having combat effects not be inextricably linked to yields will be good).
As for having combat features linked to yields I say it wouldn't really hurt performance. It really depends on implementation and I had an idea where it wouldn't be bad.
If it's easy to do, then I say that's the best solution. There is no need to hide such data from the GUI. Also adding the bools to ProfessionInfo is likely the easiest solution to code.Sure that would be possible to do; with a batch macro in photoshop it would be fast to make alternate color versions of each button. OTOH the number of free promotions will likely be very small compared to the regular ones and will already look recognizably different, so the regular ones wouldn't need any changing. E.g for M:C, units have at most one Armor type which could use the existing Armor icon for that yield, and have at most 1-2 Weapon or Shield effects which can use buttons that also look obviously distinct from the blue experience promotion badges.
Now I wonder about performance regarding adding that many promotions. It would likely be a good idea to see how promotions are handled in the code before making a final decision on how to deal with this.