forked from dkfans/keeperfx
-
Notifications
You must be signed in to change notification settings - Fork 0
Test THST on keeperfx for querying nearby creatures 2
Evan edited this page Nov 3, 2024
·
4 revisions
Changes compared to the previous test:
- Do not process the ranged buffs every turn. Only do it every 4 turns.
if (( ( game.play_gameturn + thing->index ) & 3 ) == 0) {
// If this creature didn't cast anything to itself, try to help others.
// Do not do it too often because it is expensive.
process_creature_ranged_buff_spell_casting(thing);
}
Test map:
Team 1:
- Player 0: 10 Avatars, 10 Time Mages, 10 Druids, All are level 10.
- Player 1: 10 Avatars, 10 Time Mages, 10 Druids, All are level 10.
Team 2:
- Player 2: 10 Wizards, 10 Time Mages, 10 Monks, 10 Druids. All are level 10.
- Hero player: 10 Wizards, 10 Time Mages, 10 Monks, 10 Druids. All are level 10.
140 creatures in a big room and fight.
- Avatar is granted RANGED_ARMOUR, RANGED_REBOUND, and RANGED_HEAL.
- Druid is granted RANGED_HEAL.
- Wizard is granted RANGED_REBOUND and RANGED_HEAL.
- Time Mage is granted RANGED_SPEED.
- Monk is granted RANGED_HEAL and RANGED_ARMOUR.
All creatures have certain ranged buffs.
Build in Release mode.
Base commit Id: 50116406fbf4ceca9493c8e426f6cfd524633db7 (development branch of Linvail/keeperfx)
Includes these branches:
- measure_logic_update_elapsed
- feature/battlefield-awareness
After the change, the average time is 2198 microseconds (in the 349 game turn).
If the turns/seconds is set to 20, we have 50 ms for each turn to process logic and drawing.
Now the logic part only takes 2.2 ms, We should not need to worry too much about the performance issue of ranged buffs.