ls612's C2C AI thread

I was thinking that having some kind of sub-ai definitions established when a unit is in a stack, defining the cause for it being there (fulfilling a 'build-to' call for what should be considered a volumized need in a 'well balanced stack') and how it may wish to act independently on certain triggers, could be useful.

Stack composition will be a big issue to make the ai use the combat mod effectively so you may wish to plan how to improve on that in light of some of the combat mod documentation I'm about to add later tonight (though I may not get through it all right away - there's a lot to it.) I have a lot to suggest there for the AI modding that I'm not above trying to help with myself but I'm not in full understanding of the whole ai maze yet, just some fuzzy understanding of basic employed principles so far.

If you're wanting to focus mostly on AI, I could use a bit of improvement on the Cure mission AI as well... which I think is going to require setting up a whole new AI definition for Healing units, which is probably a good idea anyhow for numerous reasons.

I don't think trying to add sub-stack AIs is a good idea (it changes too much of what the entire unit AI is predicated on). What I had (vaguely) in mind was adding a concept of a coordinator stack to a group of stacks (so each stack would have the id of its coordinator, which in many normal cases would just be itself, but in some case might be another stack). When executing its turn part of the regular AI would (at the appropriate point for its own AI type) consult with the coordinator in some way for 'suggestions'. Mostly I'd plan to use this to break up AI SoDs, but keep them loosely coordinated such that they all head for the same target city and so on, but retain the flexibility to make separate local attacks, and to spread out for surround and destroy purposes.

In principal the coordinator doesn't need to be another stack - it's just an abstract suggestion-giver, but pragmatically putting it on a stack gives a vehicle for persisting any data it needs without adding totally new object classes that need serializing (I might change to the more abstract approach as this gets fleshed out however - no sure yet)
 
As far as I understood that, it sounds brilliant! This is why I consider you the 'AI guy'. Your concepts are way ahead of the curve in that arena especially.
 
@Koshling:

I've added changes to the AI Crime unit behavior, as well as another change to how the AI handle pillage units and stacks of doom. Could you please look these changes over and tell me if I did anything wrong or if it won't function as intended?

Also, I have some more ideas in store for Pillage and Attack units, but those need your system for group management over multiple tiles. Are you still planning on doing that, and if so when? Thanks. :goodjob:.
 
@Koshling:

I've added changes to the AI Crime unit behavior, as well as another change to how the AI handle pillage units and stacks of doom. Could you please look these changes over and tell me if I did anything wrong or if it won't function as intended?

Also, I have some more ideas in store for Pillage and Attack units, but those need your system for group management over multiple tiles. Are you still planning on doing that, and if so when? Thanks. :goodjob:.

I will, but as a general note it is absolutely critical with AI changes (ideally all changes, but especially AI ones) that you find a test case and walk through it the debugger and make sure it does what you expect in terms of the resulting AI behaviour. Have you done this for these?
 
I will, but as a general note it is absolutely critical with AI changes (ideally all changes, but especially AI ones) that you find a test case and walk through it the debugger and make sure it does what you expect in terms of the resulting AI behaviour. Have you done this for these?

I would if I could get conditional breakpoints to work, but whenever I try and add them it says that it can't evaluate the expression for the condition. I'm probably doing something wrong there, but I can't figure out what.
 
How are you trying to add them?

If you click on the leftmost margin on any page open in visual studio, you'll see it adds a red dot. That red dot is where it will stop. I think you're getting that part. However, I've been finding it won't show the values on THAT line so its best to stop it just after it processes the line you want to evaluate.
 
@Koshling:

I've added changes to the AI Crime unit behavior, as well as another change to how the AI handle pillage units and stacks of doom. Could you please look these changes over and tell me if I did anything wrong or if it won't function as intended?

Also, I have some more ideas in store for Pillage and Attack units, but those need your system for group management over multiple tiles. Are you still planning on doing that, and if so when? Thanks. :goodjob:.

Ok I looked, and I don't think either change will work. I'm going to remove them in my push shortly and PM you a more detailed response.
 
How are you trying to add them?

If you click on the leftmost margin on any page open in visual studio, you'll see it adds a red dot. That red dot is where it will stop. I think you're getting that part. However, I've been finding it won't show the values on THAT line so its best to stop it just after it processes the line you want to evaluate.

I understand unconditional breakpoints, if I only want it to break for a specific unit I can't get it to do that for me.
 
I understand unconditional breakpoints, if I only want it to break for a specific unit I can't get it to do that for me.

Ah... yeah, I find that a bit tough still myself.
 
Ah... yeah, I find that a bit tough still myself.

The condition you want is:

m_iID==12345 && m_eOwner==0

(change 12345 to whatever unit id you are looking to trap on, and 0 to whatever owner id - 0 is the human in anything but a scenario or multiplayer)

Edit - that is assuming the breakpoint is on a CvUnit or CvUnitAI method of course
 
The condition you want is:

m_iID==12345 && m_eOwner==0

(change 12345 to whatever unit id you are looking to trap on, and 0 to whatever owner id - 0 is the human in anything but a scenario or multiplayer)

That's the part I was missing, thanks.
 
Back
Top Bottom