Open pandaro opened 8 years ago
i notice that in the second half of the game, when there are to much builders, the game slowdown cause all builders help and a little number build
Yes! One of the nasty side effects is that the AI is very slow to expand to available metal spots in the latter half of the game.
if metal full < 0.3 and Energy full < 0.3 force to much builder to assist (and leave one per type able to build stuff)
I don't think this is the right condition for more assistance. If metal is low, don't we need more mexes, in other words more builders and less assistance? And if resources are low, more assistance does nothing because the amount of resources the construction units can use far exceeds the amount available to them.
I definitely agree that the number of assisters vs builders needs to be managed differently.
@eronoobos as i say in the head this is my first approach,i start to manage assist system to take confidence with it. So i need help to ensure me to work in the right way. My intention is to re-handle a bit the number of assister in the battle.
IDEAS: 1-differentiate the max assist per name in base on certain condition 1.1 number of already builded unit of a type / max buildable of a type( if i have build only 5/10 i can use only a minor part of it) 1.2 economic condition ( atm i think about the equilibrium of the resource(hi metal and low energy = many assister) 1.3 level of builders(hi leveled can assist in minor percentage).As an aside: Adv builders can assist? 1.4 total available builder: if hi then we can assist with more unit 1.5 type of unit: the unit that can help the needswater factory must assist factories more then other
so the major question are:
using function AssistHandler:Release(builder, bid, dead)
is the right way to remove an assist from assistants and make it available for other behaviour?
and in general what do you think about this work? is a good approach at moment?
using function AssistHandler:Release(builder, bid, dead) is the right way to remove an assist from assistants and make it available for other behaviour?
As it says in the comment above the function, AssistHandler:Release(builder, bid, dead)
releases assistants from the specified builder (with either unitID bid
or engineUnit builder
). self:Release(self.free[fi].unit:Internal())
probably isn't doing what you want, because anything in self.free
is an active assistant. If it's an active assistant, nothing is assisting it.
As an aside: Adv builders can assist?
things in `advConList don't get an assistbehaviour, because I felt it was unnecessary. Using them to assist seems like a waste to me, except possibly in the very very late game.
Huh. Apparently, whether an assistant is active is entirely determined by ai.nonAssistant[self.id]
. And that is set by... assistbehaviour, assisthandler, and taskqueuebehaviour? I don't fully understand what I wrote years ago.
you have good ideas of how to change assisthandler, but there are some problems with your implementation
self.free
is not a list of non-assisting builders. it's a list of active assistants not assigned to anythingai.nonAssistantsPerName
needs to be replaced by something indexed by name in all the places it is used. it looks like your replacement for this is maxAssistPerTypeLimit[unitName]
, but this specifies the opposite thing. personally, i think it's less complicated to determine how many units per type to not assist than it is to determine the maximum number of assistants per type. changing it to the other thing would require more refactoring.I think i might've messed something up in a commit not long ago? Because i don't remember assistant management being this bad. Right now, in the early game I see 4 construction bots assisting the factory, and only one out doing anything!
edit: Never mind. I don't think anything has changed, but the algorithm for deciding how many non assistants really is terrible. Confirms that your rethinking is needful.
with calm, i work to fully understand the handler
1-big mystery is function AssistHandler:AssignIDByName(asstbehaviour)
what must be done this function?
2-self.IDByNameTaken are a list with the units to assist and relative assister atm?
and if i understand correct: self.free contain assister available to assist but not assisting atm self.working contain the units that the assisters assist self.ai.nonAssistant: if true is a builders, if nil the unit dont build but can assist
sorry for boring you
It gives the asstbehaviour an ID among the same type of unit. The ID number will not be higher than the number of units of that type. This is how ai.nonAssistant
assigns unit IDs (confusingly, the actual Spring unit ID, not the ID by name/type). It just checks if the ID by name/type is above the number of nonassistants per type. It does this within AssignIDByName
, after an ID has been found.
if self.ai.IDByName[asstbehaviour.id] > self.ai.nonAssistantsPerName then
self.ai.nonAssistant[asstbehaviour.id] = nil
else
self.ai.nonAssistant[asstbehaviour.id] = true
end
you're not boring me, just making me realize how convolutedly i wrote assisthandler.
self.working
has keys of the unit IDs of builders that the assisters are assisting, and each value is a list of the assistant behaviours assigned to assist that builder.
i open this issues for you, i read assistbehaviour a tons of time and i reach a discrete handling in the past. Now i will know (very calmly and without haste) what are the scheme behind assistbehaviour, what the concept and how to manage. For me is not bad at all. One particular issues: i notice that in the second half of the game, when there are to much builders, the game slowdown cause all builders help and a little number build. My idea is: under certain condition( for example lots of metal and energy incoming and full resource storage and advanced factory builded and and and what do you want) the managment of assister change, and is so handled: if metal full < 0.3 and Energy full < 0.3 force to much builder to assist (and leave one per type able to build stuff) if metal full > 0.7 and Energy full > 0.7 force to much assister to build stuff ( and leave to much builders free to build stuff) in the middle use for assisting the strictly required number called by getHelp