Map events #60/#61 are implemented very inefficiently

Bug #992109 reported by DCoder DCoder
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ares
Fix Released
Medium
AlexB

Bug Description

These two events use highly inefficient logic to reach their goals. Every frame they recalculate which of the 600+ TechnoTypes is in the condition (waste of time - this answer is not going to change in the middle of the game) and then count the instances of that TechnoType in the global TechnoClass::Array .

Changing them to precompute the wanted conditional TechnoType at match start and then summing the amount of that type each HouseClass has would bring this down from a waste of time to a compact and acceptably fast check.

Changed in ares:
assignee: nobody → DCoder DCoder (dcoder1337)
importance: Low → Medium
status: Confirmed → In Progress
Revision history for this message
Chanterier (speederyr) wrote :

Well, they do seem to work. I'm going to do more tests for lag though.

AlexB (alexander-b)
Changed in ares:
assignee: DCoder DCoder (dcoder1337) → AlexB (alexander-b)
milestone: none → 0.2-rc1
Revision history for this message
AlexB (alexander-b) wrote :

The fix is not official yet. The binary was just one of my debug builds.

AlexB (alexander-b)
Changed in ares:
status: In Progress → Fix Committed
Revision history for this message
AlexB (alexander-b) wrote :

Now it's official. The v02 branch, aka Fatman, contains two replacement implementations for both events. If you notice problems using these tags, or they don't behave as always, please notify me.

Event 61 is used in the first missions of both the allied and Soviet campaigns.

Revision history for this message
Chanterier (speederyr) wrote :

TechType Does Not Exist definitely works.

Revision history for this message
Chanterier (speederyr) wrote :

TechType Exists also works.

Revision history for this message
AlexB (alexander-b) wrote :

Thanks for testing, Speeder!

Changed in ares:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.