Does the AI see what the player sees?

Let's talk about Gettysburg! Put your questions and comments here.
Saddletank
Reactions:
Posts: 2171
Joined: Sat Dec 24, 2011 4:49 am

Does the AI see what the player sees?

Post by Saddletank »

Starting at post #15, I thought this was a conversation worth continuing here.
I don't actually know what data the AI is given, but if I were a betting man I would bet money that the AI does NOT in any way analyze rendered graphics to determine what units are where, which implies that T-mode has no meaning for the AI, and that changing the sprites in the game would have no effect on the AI.

Changing the sprites would clearly affect what a human player using HITS would see.

Thus, what the AI commanders can be aware of is independent of what the player can physically see in the game's graphics.

My last statement above is a simple deduction; it must be true if the first two parts are true.

The first part would require Norb to verify, although as I said, I am very confident that it is true.

The second part I think is obvious, if anyone disagrees, please say so.

You make the erroneous assumption that if the game knows two units are in sight of each other all the AI commanders do.
I did not ever say or imply that I thought that.
I thought this discussion was interesting enough to deserve its own thread and so here it is - so that we don't annoy LaissezFaire and his thread on the AI's tactics and also so that Norb might see it and comment.

All of what follows is just my guesswork and assumptions but based on a lot of logic and a lot of experience with playing games both from an elevated camera position and HITS (set to 2 yards, something the game can't normally do - you have to edit the SOWGB.ini file to get a true first person game view).

To me I think the flags are the critical things. We all know that if the flag of a unit is close to a wall, or a fence or it's in woods or on a road, or in a field of wheat... then the entire unit is granted an effect from that terrain - it gets a cover bonus, or a movement bonus (or penalty), or a morale effect, or whatever. It is also hidden or visible to enemy (you can check this in the unit stats in the OOB screen).

So first, I think its the flag that is "seen". Notice that when you look way over there, 1500 yards into the far distance, what you first see of a unit is a single figure with a flag. What is the flag? Its a central point described in the 3D battlespace very close to the ground surface that is used to measure all kinds of things, one of them being whether flag A is visible from flag B. I don't know how high off the ground surface the "flag" is, but I suspect its something like 6 feet, possibly a bit more, 8 or 9 feet to cover the chance of seeing mounted men or actual real flags held aloft by foot soldiers. For all I know it could vary - 6 feet for infantry and dismounted cannons, 9 feet for cavalry, generals and limbered cannons. *shrugs* I'm just guessing but its logical.

I think Garnier is right... well, half right, in that what he's saying is that the AI and the player are using the same piece of code when the game is deciding if they can "see" an enemy unit. Then again MTG is also right... or half right, when he says the AI and the HITS player see the same thing.

To me there is only one LoS calculation going on. The game takes the location (altitude and surrounding terrain) of an AI flag (lets say its a General commanding a brigade) and looks at all enemy flags on the battlefield, calculating their distance, altitude, terrain they are in and then checking on a direct line between the two flags for blocking terrain (woods, buildings, elevated ground). If <LoS=true> then the AI general is given an XY co-ordinate of a unit ID, knows its an enemy and can react to it. In other words the AI "sees" the flag. The computations going on between all flags are done in a neutral environment away from the battle AI and the <LoS=true> results are fed to those AI flags that are affected.

Now, if the flag in question is a human player general (still a flag, remember) then instead of giving that flag XY co-ords and a unit ID, the game draws a bunch of sprites on the screen which are associated with that unit ID, placing them in the correct XY co-ordinates and associating the correct uniform code and a bunch of other variables like formation, speed, direction and smoke animations, and so on.

Thus the same LoS calculation is happening for human players and AI generals, taking into account EXACTLY the same issues such as terrain etc, except that when a flag is seen the game responds with different information.

With HITS the human players location calculation is a couple of yards off the ground. With the elevated heli-cam option in play the human players "flag tip" is elevated high in the air (and can fly from side to side) and an LoS calculation is made from this extremely tall flexible general (!), thus most hills, some trees and buildings don't block LoS and the player can see the enemy over the hills and far away. The poor AI however is still looking for a player flag that is only a man's height above ground.

This is why its so much easier to beat the AI with an elevated cam position and so much harder with HITS.

Are all AI flags made aware by the game code if any one particular flag is seen by one AI general, in the way that all human players can physically see the sprites when one player does? I do not know, but I suspect they do not and this suspicion comes from the behaviour of the AI I've witnessed in HITS games where AI units and commanders some distance away seem to ignore fighting going on in locations they probably can't "see". Then again this might be due to other factors like the orders they are operating under or how poorly rated their general is.

This answers your concern, Garnier, about 1000 foot tall sprites. These would be completely irrelvant since I think the sprites are not a part of the LoS computation, rather their appearance is the product of its result.

The T-key is also an interesting issue but I think you might be misunderstanding what the T-key does. The T-key toggles tree graphics (and some other scenery) being rendered on and off on the player's screen. It doesn't do anything else. It doesn't reveal "flags" (aka sprites to a human player) that he would otherwise not see if the trees were rendered. The presence of tree graphics in the game isn't making units invisible to the player any more than it causes <LoS=false> results for the AI. What is important is the terrain type the flag is in, or the terrain type intervening between flags. If we go back to the OOB screen I mentioned at the beginning where you can check a unit's stats and its showing as either visible to the enemy or hidden, that status is what the terrain type is contributing towards.

Now a player with a 200 foot high cam view has less trouble with tree graphics because its easier to see down over them or between them, but they don't hide the sprites, they just make it somewhat harder to see them. I sometimes toggle the T key in order to get at the flag graphic of one of my units I can partially see through the trees so as to more easily give it an order, but toggling the trees off doesn't suddenly reveal a bunch of enemy regiments. They are there all the time and if you sit still and use the Z key to watch a forest with enemy in, you'll see them quite easily. What you won't see is their sprites if <LoS=false>.

And my view is that the AI works under exactly the same conditions.

This is another reason why HITS play is more challenging, because the elevated view down over trees or between them isn't there. I find I spend a good while in HITS games simply sitting still, staring at forests through my field glasses, trying to see suspicious movements. I could hit the T key but I don't, because our group has a house rule that we don't use it, but hitting the T-key does not (in my view) make enemy units magically get rendered that are not already being rendered on my screen by the game.

And after all that, it would be interesting to get the real lowdown on how this all works from Norb himself.
Last edited by Saddletank on Thu May 10, 2012 12:35 am, edited 1 time in total.
HITS & Couriers - a different and realistic way to play SoW MP.
Garnier
Reactions:
Posts: 1258
Joined: Thu May 07, 2009 6:43 pm

Re: Does the AI see what the player sees?

Post by Garnier »

I think you half misunderstood my post.

When I refer to what a human hits player "sees", I mean what he can physically see with his eyes rendered on the screen, which is independent of the game's LOS calculation, but can vary depending on the tree sprites and T mode. The only difference in what humans see when they change camera settings depends on this physical sight of the rendered graphics, and has nothing to do with LOS calculations. I did not say that changing T mode changes what units are rendered.

Obviously LOS calculations only look at the unit's technical location which is where the flag goes.
With the elevated heli-cam option in play the human players "flag tip" is elevated high in the air (and can fly from side to side) and an LoS calculation is made from this extremely tall flexible general (!)
This is not true at all.

Some of your other points are contradicted by what I said in the other thread.
Last edited by Garnier on Thu May 10, 2012 1:02 am, edited 1 time in total.
Play Scourge of War Multiplayer! www.sowmp.com
Also try the singleplayer carryover campaign
Marching Thru Georgia
Reactions:
Posts: 1769
Joined: Mon Mar 29, 2010 9:56 pm

Re: Does the AI see what the player sees?

Post by Marching Thru Georgia »

Actually Saddletank explained what I was trying to say better than I did. There is only one LOS calculation and it is used by both the AI and the player. The AI sees what we see at ground level.
With the elevated heli-cam option in play the human players "flag tip" is elevated high in the air (and can fly from side to side) and an LoS calculation is made from this extremely tall flexible general (!)
This is not true at all.
What do you base this statement upon? It's a perfectly reasonable explanation of how certain units are made visible/invisible to the player as he changes elevation. How else would the game determine the altitude of the players eyes?
I can make this march and I will make Georgia howl.
Garnier
Reactions:
Posts: 1258
Joined: Thu May 07, 2009 6:43 pm

Re: Does the AI see what the player sees?

Post by Garnier »

What do you base this statement upon?
I assumed when he said LOS calculation that he was referring to the game's calculation of line of sight from unit to unit. Meaning it would impact what units were spotted by other units, which is what he said in the rest of that paragraph.
Last edited by Garnier on Thu May 10, 2012 1:48 am, edited 1 time in total.
Play Scourge of War Multiplayer! www.sowmp.com
Also try the singleplayer carryover campaign
Davinci
Reactions:
Posts: 3034
Joined: Wed Jul 02, 2008 12:53 pm

Re: Does the AI see what the player sees?

Post by Davinci »

The flags are a major part of the LOS for the units, but I don’t think that the flag is the only thing used by the games code.

The flags height appears to be hard-coded by design, meaning that if it is changed, it has absolutely no bearing on the games code.

Such As, if the flag is placed at two-feet or at two-hundred-feet the games code will still read it as being at hard-coded height at X,Y coordinates.

But, I was under the impression that the sprites acted as individuals once the flags were in-sight of each other, other-wise all of the units under one-flag would fire at the same enemy soldier.

I would add that the elevated cam-position only true benefit would be that it gives the player the ability to cheat and view the AI ’s movements from above.

EDIT Post

I forgot to add that the reason that the games-code is not affected by the T-Key is the fact that the games code reads the value in the E-Column of the mapsname.csv file.

davinci
Last edited by Davinci on Thu May 10, 2012 5:41 am, edited 1 time in total.
Reason: Adding content.
The only true logic is that, there is no true logic!
Garnier
Reactions:
Posts: 1258
Joined: Thu May 07, 2009 6:43 pm

Re: Does the AI see what the player sees?

Post by Garnier »

I would add that the elevated cam-position only true benefit would be that it gives the player the ability to cheat and view the AI ’s movements from above.
Only in the sense that you can see over the tree sprites. No new units will become spotted if you use different camera settings. LOS works the same regardless of camera.
Play Scourge of War Multiplayer! www.sowmp.com
Also try the singleplayer carryover campaign
Hancock the Superb
Reactions:
Posts: 1436
Joined: Thu Aug 21, 2008 9:06 am

Re: Does the AI see what the player sees?

Post by Hancock the Superb »

Having a raised camera angle gives you two things:

1) The ability to see the enemy from a topographical map point of view. HITS makes it so you have to view the map in a 3D perspective, which is much harder to deal with than a 2D map.

2) The ability to order your units exactly where they need to go, instead of sort of in the direction of where they need to go.

Trees are merely eye-candy, they don't affect LOS other than their .csv value. To tell you the truth, I always get rid of the trees because I can't stand clicking on a unit in a forest and getting the unit behind it, since I can't see the flag properly.

Playing HITS against the AI should actually put the player at a disadvantage, because it is my guess that the AI views the map in a 2D format, whereas the player can only see what is in front of him instead of a printout of 1s and 0s telling him where every enemy is within the line of sight. This makes me hate the AI because it should play as well as me when I have my 200 ft tall general, since it plays in a relatively similar fashion. However, this would make it impossible in HITS, so perhaps the flawed nature is good.
Hancock the Superb
Davinci
Reactions:
Posts: 3034
Joined: Wed Jul 02, 2008 12:53 pm

Re: Does the AI see what the player sees?

Post by Davinci »

I would add that the elevated cam-position only true benefit would be that it gives the player the ability to cheat and view the AI ’s movements from above.
Only in the sense that you can see over the tree sprites. No new units will become spotted if you use different camera settings. LOS works the same regardless of camera.
True, and Agree !

This is why I removed the question mark from the map-icons , if the LOS goes in and out the enemy unit will not be visible on the Jump-Map.

What would have been marked with the question-mark is now not-shown , which adds a bit of mystery to the battlefield!

davinci
The only true logic is that, there is no true logic!
Blaugrana
Reactions:
Posts: 412
Joined: Thu Dec 30, 2010 9:01 pm

Re: Does the AI see what the player sees?

Post by Blaugrana »

Interesting stuff. It would be great to get an official NSD description of how the AI works in SoWG. I'd also be interested to read any basic guides to sprites, LOS, terrain etc in general - any links anyone?

I play mainly (2-yard) HITS and, like you, Hancock, hate the confusion caused by not being able to see properly in trees.
Trees are merely eye-candy, they don't affect LOS other than their .csv value. To tell you the truth, I always get rid of the trees because I can't stand clicking on a unit in a forest and getting the unit behind it, since I can't see the flag properly..
A few games fought in woods have led me to believe that the trees are absoutely not eye-candy, at least for human players. Playing SP, there have been games where I have not been able to see the enemy at all, and not many of my own troops. Switching off the trees has revealed the enemy regiments and allowed me to direct my troops. I think this makes a huge difference.

Edit: I've re-read your OP, Saddletank, and am understanding this a bit more. If I understand your OP correctly:

the game calculates whether a unit is visible or hidden depending on LOS calculations between flags. These take into account terrain and also vegetation.

Independently, the game renders vegetation, which may or may not hide from human view troops who have been deemed by the AI to be visible (based on LOS=true).

So, sometimes, a unit will be deemed to be hidden to me because it is in heavy woods. It will then not be drawn, and even if I toggle off all vegetation, it will still not be shown. It may appear and disappear. I have seen this happen, certainly in TC2M and, I think, in SoW.

On more occasions, I have seen previously invisible troops appear when I've toggled vegetation off (in SP only!). This would suggest the AI has calculated LOS=true but the on-screen vegetation actually makes the troops invisible (or very nearly). There's a scenario that takes place in high corn, for example, which seemed unplayable in HITS. I will try and re-play that and see if it helps me understand this.

If the AI can, in certain situations 'see' a regiment (its strength, position, facing etc) when LOS=true when a human player sees very little due to vegetation getting in the way, it would seem the human is at a disadvantage.
Last edited by Blaugrana on Thu May 10, 2012 1:34 pm, edited 1 time in total.
Garnier
Reactions:
Posts: 1258
Joined: Thu May 07, 2009 6:43 pm

Re: Does the AI see what the player sees?

Post by Garnier »

If the AI can, in certain situations 'see' a regiment (its strength, position, facing etc) when LOS=true when a human player sees very little due to vegetation getting in the way, it would seem the human is at a disadvantage.
Correct.

That was the whole point I was trying to make. The only effect that HITS gives, which is that humans might not physically see a unit because of vegetation or hills in the way, does not apply to the AI at all.

I don't mean to imply that HITS is bad, when I've played SP it's always been HITS, and I enjoy it in MP as well. I just wanted to explain why saying "the AI uses HITS" is not correct.
Play Scourge of War Multiplayer! www.sowmp.com
Also try the singleplayer carryover campaign
Post Reply