Comments (7)
The scanning of HarvesterBotModuleCA
is the causing of heavy lag-spikes.
After I set "ScanForIdleHarvestersInterval" to 800, the lag-spikes almost disappear. Although AI also not building harvesters correctly at this point.
If you also confirm that, I guess you have to check the HarvesterBotModuleCA
which seems to have very serious performance issue, especially in the late game at certain map.
from camod.
The new Harvester Module still cause lag spikes here but more unpredictable (so I am not certain if it is really causing the lag spikes)
from camod.
The new Harvester Module still cause lag spikes here but more unpredictable (so I am not certain if it is really causing the lag spikes)
Thanks for the info.
It's pretty strange as I've played multiple hundreds of bot games using the trait (in its old form, and a few in updated form) and not noticed lag spikes like that.
I haven't tried on the map you mentioned though, so can investigate more.
The changes to HarvesterBotModule are pretty small, the AI just counts how many harvesters it has, and compares it to the MaxHarvesters config, to determine whether to produce more, whereas in the normal version it just compares to the number of refineries, so it'd be odd if that caused a major change in performance, though I'm not particularly well versed in C# or game programming.
from camod.
In fact, me neither on those game program.
I happened to find this map, because at that time, I thought protection squad caused the spike lags so a map could trigger protection actions frequently can be good (by minefield at middle and harvester get frequently attacked) . It was very confusing when I found the protection squad was not the cause.
from camod.
It is said found actors in world is a high cost measure, but it is useful and vital to any bot module. We can only use as less as we can.
from camod.
The lagspike is expected in the harvester bot module on specific maps. It shouldn't be CA-specific because it shouldn't come from the scanning but from the pathfinder though which is called during assigning idle harvesters to work.
Nonetheless, I have a minor performance optimization suggestion here:
CAmod/OpenRA.Mods.CA/Traits/BotModules/HarvesterBotModuleCA.cs
Lines 163 to 171 in 1e1f9f1
which I would rewrite to
var numHarvesters = AIUtils.CountActorByCommonName(Info.HarvesterTypes, player);
if (numHarvesters >= Info.MaxHarvesters)
return;
var harvCountTooLow = numHarvesters < AIUtils.CountBuildingByCommonName(Info.RefineryTypes, player) * Info.HarvestersPerRefinery;
if (!harvCountTooLow )
return;
var harvInfo = AIUtils.GetInfoByCommonName(Info.HarvesterTypes, player);
if (unitBuilder.RequestedProductionCount(bot, harvInfo.Name) == 0)
unitBuilder.RequestUnitProduction(bot, harvInfo.Name);
to avoid the iteration on the harvester info on the GetInfoByCommonName
call if the end result isn't even used.
from camod.
Therefore, as you can see I drop this AI module on SP AI. I mean the original one.
from camod.
Related Issues (20)
- PointDefense makes Armament ignore Ammo or ReloadDelay seemingly HOT 1
- TransformOnCondition: with SkipMakeAnims: false on a Building triggers sell animation first
- [Linux] AppImage stuck on loading screen HOT 3
- Aircraft transformed mid-flight using a TransformOnCondition: do freeze HOT 1
- If Actor to be converted into has BuildLimit defined the conversion fails.
- Lower priority of mobile stealth generators and mobile sensor arrays. HOT 1
- Game crashes when losing technology HOT 1
- Flag of the UkrSSR is wrong. HOT 2
- SabotageHPRemoval will damage Shielded instead of bypassing it
- EMP spark on mothership should be set with larger ZOffset HOT 1
- [Linux] Flatpak/Flathub?
- Comparison Bot AI HOT 8
- Pressing V (upgrade) with atomic heavy tanks selected upgrades them to lasher tanks even for soviet factions other than Psi Corps. HOT 1
- As ARC, upgrading battle tanks equipped with minidrones removes the minidrones. HOT 1
- Game crashes on Tomahawk missile fire HOT 4
- A tiny error reported by Utility
- Crash on master
- Soviet faction causes desync when building barrack
- Game crashes when helicopter lands on coast
- Crash with 1.0.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from camod.