Waterloo AI Questions

Let's talk about the issues in converting the SOW engine to handle Waterloo. Ideas, suggestions, feature requests, comments.
mitra76
Reactions:
Posts: 933
Joined: Wed Mar 31, 2010 1:21 am

Re: Waterloo AI Questions

Post by mitra76 »

Ciao Da Vinci

No you're the first to ask :)

the modding of AI works like this:

in the base directory of game now you have a additional directory "module" with two DLLs, one for the battle AI and one for the campaign AI, in the SDK directory you find the VStudio projects for both the DLL; you can modify them using visual studio express. The code is C++ but you don't need to be a professional C++ programmer to understand and change it mainly know the syntax and the base concepts, but of course is necessary to have good basis of how to program and learn to use the the functionalities of Visual Studio.

Inside the main .h file of project call different subroutines linked to the various game objects type: cavalry,infantry,artillery,brigade officer ,officer cavalry brigade,officer arty brigade,division officer ,ammo wagon,courier,army officer,corps officer, which are defined in unitglobal.csv.

The link between the routine called and the object type is done in a new csv file, unittype.csv which contains these links.

The campaign AI doesn't need links because it works only with officer sprites representing the army subdivisions, and the logic is event triggered (with in addition a 30 minutes time event triggered), not loop based.

In common to both the projects there're includes which contains the classes, constants, tables to use for the AI.

In order to create your mod you have to follow the same principle of old mods; you have to replicate the structure of directory "base" inside your mod directory, so inside the mod "alpha" at example you will need to insert a directory "module" and place inside your modded DLL.
Visit my wargames blog: http://warforgame.blogspot.it/
con20or
Reactions:
Posts: 2541
Joined: Fri Jun 11, 2010 8:49 pm

Re: Waterloo AI Questions

Post by con20or »

Mod heaven :)
Saddletank
Reactions:
Posts: 2171
Joined: Sat Dec 24, 2011 4:49 am

Re: Waterloo AI Questions

Post by Saddletank »

Indeed. Sounds like you can rewrite the whole game there. SoW:Somme 1916 here we come!

*needs to go learn VStudio and some basic C++*
HITS & Couriers - a different and realistic way to play SoW MP.
Davinci
Reactions:
Posts: 3034
Joined: Wed Jul 02, 2008 12:53 pm

Re: Waterloo AI Questions

Post by Davinci »

*needs to go learn VStudio and some basic C++*
YES, I think that its time to start reading up on both of those subjects.

davinci
The only true logic is that, there is no true logic!
Davinci
Reactions:
Posts: 3034
Joined: Wed Jul 02, 2008 12:53 pm

Re: Waterloo AI Questions

Post by Davinci »

Because drawing a fixed line or a square on the basis of something which can move continuously (flags) in different direction on the basis of battle flow is impossible.
Mitra76 – I do enjoy the back and forth discussions that yourself and MTG are having, it sheds a little bit of light on things that we never knew about the AI.

Now, given the knowledge that you have after editing the AI , here is the question.

Do you think that it is possible to alter the AI so that they would communicate and support each other during battles?

I know that you said that there are no fixed coordinates, but if one part of the army is fighting on a particular part of the field, can the AI send a message to another Corps to march in that general direction.

This would give the appearance that the AI is at least working together, instead of the current game that has the AI working as a separate army.

Basically, can the player alter the AI to do this, or is this something that has to be done by NSD ?

Thanks,

davinci
The only true logic is that, there is no true logic!
Saddletank
Reactions:
Posts: 2171
Joined: Sat Dec 24, 2011 4:49 am

Re: Waterloo AI Questions

Post by Saddletank »

Following on from what DaVinci said, the AI knows its own status (strength, relative losses vs enemy, condition of units). It also knows the position of AI commands. We could assume the AI is sending situation reports between its commands and the senior commander so *he* knows the situation his corps/army is in. Could the C-in-C stats then be used to compute a response to order divisions unengaged or only lightly engaged to assist divisions that were heavily engaged or in trouble?

Using such a calculation, the AI could count enemy unit types/numbers visible (cav, inf) vs its own and know that it had enemy cavalry near one of its infantry-only formations and respond by moving its own cavalry to that location.
Last edited by Saddletank on Thu May 14, 2015 11:43 am, edited 1 time in total.
HITS & Couriers - a different and realistic way to play SoW MP.
mitra76
Reactions:
Posts: 933
Joined: Wed Mar 31, 2010 1:21 am

Re: Waterloo AI Questions

Post by mitra76 »

Do you think that it is possible to alter the AI so that they would communicate and support each other during battles?
You can always give commands from a AI to another AI, or because is visibile or because you search using the hierarchy connections. But you have to make attention to check the object is not player controller. Of course is not logically coherent that a child AI give orders to own or not related parent AI
I know that you said that there are no fixed coordinates, but if one part of the army is fighting on a particular part of the field, can the AI send a message to another Corps to march in that general direction.
There're fixed coordinate, all the object on the map have fixed coordinates on the map. The flag give the coordinate of units or officers. The easier practic is to have the parent AI to check the child AI and send help; child AI can send help requests to parent like for the courier message in the gameplay, but only corps and army level react to them sending eventually a subunit which is applying the reserve tactic. This last part (the logic of decision to\if send the reserve) is hardcoded not part of AI code.
Basically, can the player alter the AI to do this, or is this something that has to be done by NSD ?
In the library of AI you find a good measure of the orders and variables you find now in the SDK and now you apply in the battlescripts and GUI buttons and many thing mores (of course in different forms), and in the future there will be more additions to the library, and you can sure experiment with what you asked also making something new.

But i'm not telling is easy, is not like mod a file csv. First thing to do is not to start to change randomly, but read the code and understand how it works, what the hardcoded functions do (or ask here), debug it for see the flows, make little change as experiments, increasing in complexity gradually and test test test every change (I think I had played 50 time the same scenario for every 5 changed lines I did in the cavalry code)
Visit my wargames blog: http://warforgame.blogspot.it/
Davinci
Reactions:
Posts: 3034
Joined: Wed Jul 02, 2008 12:53 pm

Re: Waterloo AI Questions

Post by Davinci »

Mitra76 - Thanks, for the answers, and Yes, I will experiment with the settings as soon as I buy the game.

It will be interesting to see exactly how much of the code is changeable.
Thanks again.
davinci
The only true logic is that, there is no true logic!
mitra76
Reactions:
Posts: 933
Joined: Wed Mar 31, 2010 1:21 am

Re: Waterloo AI Questions

Post by mitra76 »

Following on from what DaVinci said, the AI knows its own status (strength, relative losses vs enemy, condition of units). It also knows the position of AI commands. We could assume the AI is sending situation reports between its commands and the senior commander so *he* knows the situation his corps/army is in. Could the C-in-C stats then be used to compute a response to order divisions unengaged or only lightly engaged to assist divisions that were heavily engaged or in trouble?

Using such a calculation, the AI could count enemy unit types/numbers visible (cav, inf) vs its own and know that it had enemy cavalry near one of its infantry-only formations and respond by moving its own cavalry to that location.
Following on from what DaVinci said, the AI knows its own status (strength, relative losses vs enemy, condition of units).
Yes, morale strenght, original strenght, various condition, blocked,highground,defensive ground, formation, troubled, stance, tactics, etc.. are know for all the objects in every AI loop.
It also knows the position of AI commands.
Yes
We could assume the AI is sending situation reports between its commands and the senior commander so *he* knows the situation his corps/army is in. Could the C-in-C stats then be used to compute a response to order divisions unengaged or only lightly engaged to assist divisions that were heavily engaged or in trouble?
Report is a human concept, not a coding concept. Every AI have the information above of all the AI objects under him at the instant: you have to read the variables associated to their classes and using the functions of objects for give commands.
Could the C-in-C stats then be used to compute a response to order divisions unengaged or only lightly engaged to assist divisions that were heavily engaged or in trouble?
Using such a calculation, the AI could count enemy unit types/numbers visible (cav, inf) vs its own and know that it had enemy cavalry near one of its infantry-only formations and respond by moving its own cavalry to that location.
Nothing prevent to make this calculation and to order the movements of this kind
Visit my wargames blog: http://warforgame.blogspot.it/
mitra76
Reactions:
Posts: 933
Joined: Wed Mar 31, 2010 1:21 am

Re: Waterloo AI Questions

Post by mitra76 »

Another change that something we forgot us too because was one fo first, the division AI will not force anymore the road movement for the brigades if the enemy is in sight.
Visit my wargames blog: http://warforgame.blogspot.it/
Post Reply