Map events #60/#61 are implemented very inefficiently

Bug #992109 reported by DCoder DCoder on 2012-04-30
This bug affects 1 person
Affects Status Importance Assigned to Milestone

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
Chanterier (speederyr) wrote :

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

AlexB (alexander-b) on 2012-05-11
Changed in ares:
assignee: DCoder DCoder (dcoder1337) → AlexB (alexander-b)
milestone: none → 0.2-rc1
AlexB (alexander-b) wrote :

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

AlexB (alexander-b) on 2012-05-14
Changed in ares:
status: In Progress → Fix Committed
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.

Chanterier (speederyr) wrote :

TechType Does Not Exist definitely works.

Chanterier (speederyr) wrote :

TechType Exists also works.

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  Edit
Everyone can see this information.

Other bug subscribers