SSAI tidbits

SSAI tidbits

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderator: Moderators

User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

SSAI tidbits

Post by AF »

Well for making long posts in the AI thread before the forums went boom I would copy over things I saw as relevant into MSWord aswell as soem of my posts themselves.

Here're soem random parts of the SSAI thread, I dont knwo who posted them though I know I posted the last one
Maybe i misunderstood what you meant but wouldn't that make things like a commander start inside the water in a map like Gods-of-War possible!? Or generaly start the game away from the designated place (which usually has some metal patches)!?


So the AI wouldn't update the threat area on a place where the radars are showing a mass of enemies but it is not under LoS...?


You could have a seperate value-map for Subsurface, Surface, and Air.
Thus only Subsurface or Surface (sea) or Air units would care about high values, ect...



Annother VERY important thing is:
CAN I WALK/FLY/HOVER/FLOAT THERE?

Will this factory/building/whatever be blocked if I build it at location X?
(that is to say on a metal map, the AI builds a factory on a high place, as you said and then discovers that its land units can't get off the mountain/high area)

The AI BEFORE building any factory should check to see if the units made there can exit from it properly.

Ditto for unit groups. They must check if they CAN GET to their selected target before marching.



The threat map would still apply under water obviously and due to what i said above it would mean a 3d threat map so air threats and underwater threats could be applied. I think the AI should determine whether a target location is underwater or not.
If it is underwater it should narrow the unit choice down to amphibious units ships subs and any aircraft that can see/fire at underwater objects.
This could be done by checking if the Z co-ordinates are bigger or smaller than the water levels. Then a check would be made to see if it's possible to make a path for units to follow that would let them reach the target, this would be to stop things such as, AI builds a huge naval fleet and sends it towards a small puddle inland to destroy a tidal generator even though it can never reach it. Next the type of units expected underwater or known to be at that location are taken into account and the unit types most effective at destroying them and are able to attack in that environment are selected and built so that the overall attack force is at least the same size as the opponent in terms of the expected and needed values of threat levels for the units in the attacking force.
And A huge post of mine concerning SSAI and my greatly ambitious Adaptive AI which funnily enough turned into a flmae over wether it was feasable or not
Anyways, I thought I might as well try to explain how I think my ideas would work with SSAI and how they could be put in. The result of which I expect would be an AI that adapted to your actions and tactics and attempted to use these adaptations against you, by using basic learning to discover how to beat you.


AI map overlays

So we have the terrain map and the Metal map, and if this energy web feature is to be considered that can be the 3rd, on top of that I add the Strategic and Threat map.
Strategic map being an overlay of how valuable that part of the map is, thus flat land with lots of metal that├óÔé¼Ôäós high up would have a high value, as would the base the AI has built and any places that the other AI├óÔé¼Ôäós or humans tend to use to send troops to attack or defend.
The Threat map being an overlay changing in value depending on the enemy unit. A krogoth will make the overlay in its area rise considerably more than a peewee or any other unit for example. Where the krogoth steps the level will rise by a small amount and will fade off with time. The AI will attack units based on where they are on the overlay, a unit in a high level area is targeted first and a unit in a low level area second. When AI units are inactive, they will attempt to group and attack areas of high level threat. For example a group of newly built planes will group together and head off to a high level area looking for targets, a nuclear silo will bombard very high level areas blindly in hopes of hitting something. Such a very high level area would be a known rallying point of units from factories or a base that keeps being rebuilt or repaired/defended. The buildings and moving units would as such create high levels of threat.
The overlays only cover what the AI has explored so there is no need for omniscience, and can only update the overlay based on what it is supposed to see and not what is actually there, therefore no all seeing eye that cheats.

Because spring is a 3d engine and there are X, Y and Z co-ordinates, the height must be taken into account. To do so however could create lag, so I suggest the overlays are composed of single pixels/zones that take up the equivalent size of a metal storage building, with values for units as well.


Initial Game Play for AI

Set up initial overlays
Build factories and initial resources (definable by modder)
Build cheap units with the biggest los to explore
Exploring units follow any enemies sighted
Exploring units move towards areas of high strategic value and then move outwards
Defences are built over strategic positions, with higher density in areas of threat.


Construction of buildings

Buildings are to be split into two categories:
Those that produce power or neither repair attack or build units, and those that build units attack or repair such as factories and air repair pad and other defences.
Defences factories and repair buildings are to be built in areas of high level areas of the strategic overlay and areas of high threat within a radius of another building
Resources are to be placed on strategic ground with low threat levels preferably near levels of high metallic resources.

Buildings of the first type are to maintain a common distance from each over which in itself will lend itself towards a grid layout within a space that is easy to pass loose formations of units through quickly with little trouble. I would say this distance should be about the same as that required to move 1.5 sumos through a gap

Buildings of the second type take a distance equivalent to its width and no more.


Construction Units

1 third of all construction units are to be randomly set to guard a factory.
When energy is being overproduced, inactive construction units are to repair nearby units automatically
1 third of all construction units is also to go towards resourcing operations.
Every Factory that can produce a construction unit must produce at least 1.


Assessment of Threat level in an area and for a unit/building

In assessing the threat level of a unit, the:
Overall health
Maximum health
Hit Point modifier
Number of Weapons
Overall Damage caused by all weapons fired at a target at once
Mean rate of weapons fire
Mean Range of Weapons fire
Strategic Value of its position
Metal and Energy produced

When all these values are processed a final value is given which is that unit├óÔé¼Ôäós threat value
The amount by which a unit raises the threat level of its surroundings is 5% of it├óÔé¼Ôäós over all threat value. When an area of high threat is devoid of units it starts to decline to neutral ground with a half-life of ten minutes.


Assessment of strategic value for a unit/building

The strategic value of a unit or building is based on:
It├óÔé¼Ôäós cost to build
Its hit points
How much of a resource it produces
The value of the ground it stands on

Assessment of strategic value for an area

A strategic area is flat, high up, and has lots of metal resources, the ideal place to build an attack base or resourcing operation. Therefore in considering the strategic value of an area, you must take into consideration:
Terrain elevation
Terrain flatness
Metal Concentration

Once processed the strategic values of any building is added to gain an overall strategic value for a specific point.


Updating the overlays

This is done every 2 seconds, during which the position of each unit is noted and minor unit behaviours such as construction units repairing when surplus energy is present are processed during this period as well.


RADAR, SONAR and jammers

Radar and sonar are to be positioned to give cover of both high level areas of the strategic and threat overlay, with strategic areas taking precedence. Radar and sonar are to be built nearby existing buildings. Jammers are to be used on strategic areas unless part of an attack fleet.


Summary of basic model

This should give an AI that builds an orderly base in a strategic position, with effective handling of construction and support for defensive and offensive strikes, and the effective acquisition of resources.
Note: I have deliberately left out defence and attack as well as selecting what units to attack with and what needs to be built etc



Attacking and defending: Adaptive AI


Construction of new units

When a new unit is available to be built whether it be by a new factory or construction unit, it is to be built several times to be field tested. This would apply to initial start-up with the first factories being built. These units are then to attack the enemy. The AI is to make note of the unit types encountered and what types of units where most effective at destroying it. Also the overall ratio of how many of this unit type are to be expected is noted. This is used to influence build queues. So if your enemy produces unit type A and the AI finds unit type B kills A off easily then the AI will continuously increase the percentage of unit type B in its attack waves until unit type A isn├óÔé¼Ôäót built anymore. If a unit is ineffective at destroying the enemy or is too easily destroyed then it will not be built as often. As a unit type scores more kills the strategic value of that unit type is increased, and the value of a unit├óÔé¼Ôäós type is added to the units existing strategic value. Likewise if you built mavericks to destroy the AI and they where effective then the threat level of that unit type would rise and as a result so would those of the mavericks attacking. When deciding what takes precedence in a build queue the threat value of the unit type trying to counter is taken into account
For example more maverick counterparts would be built than peewee counterparts. The same would be true for buildings; the AI would note what unit type is the most effective against that defence or building and build accordingly.


Variety of attack

Attacks must consist of more than one component, of which there are Ground Sea and air.



Mines

Mines are to be laid in areas of low strategic importance but of high threat level. Mines are also subject to the rules of build queues and unit types mentioned above



Default Attack points

The AI is to send units to attack areas of high strategic value with low threat targets taking precedence with a 10% chance of it being a very high level threat to give a sense of randomness.
The energy web should also be taken into account but there isn├óÔé¼Ôäót enough information in my opinion to decide upon how it will affect it.



Use of overlay to make seemingly intelligent tactical moves

The AI is to go about devaluing strategic areas in the midst of an enemy base, the effects of witch will appear deliberate and possibly intelligent to the onlooker.
The AI should also manipulate the threat overlay to its advantage by using it as a guide to distract the enemy and draw it away from strategic ground.



Custom Tactics

A modder could program in custom tactics using vague rules and directions and unit types, and each tactic would be rated in the same way as unit types on its effectiveness against the enemy.
User avatar
[K.B.] Napalm Cobra
Posts: 1222
Joined: 16 Aug 2004, 06:15

Post by [K.B.] Napalm Cobra »

How about we ask politly if the SY's will kindly release the info required to develop AI's, even if it is just to the more active members, ie 100+.

And it might actually shut you up a bit for once. :P

Oh yeah and SJ, can AI's call other AI's?
User avatar
Triaxx2
Posts: 422
Joined: 29 Aug 2004, 22:24

Post by Triaxx2 »

I'd sponsor a full release for those interested. I don't have a hundred posts though I did before the purge. I'm focused entirely on doing the AI now, so my count won't rise that fast.

It would be good if the AI's can call each other, then you could get them to co-ordinate attacks.

*begins working on communication agent for his AI*
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

lol it was only an hour before I signed on the net before that I added such an Agent to TAI.

Triaxx2, if they do do such a thign and you dont get it I'd give you it anyways, I'm not sure I'd want to continue if I didnt have you there aswell
User avatar
[K.B.] Napalm Cobra
Posts: 1222
Joined: 16 Aug 2004, 06:15

Post by [K.B.] Napalm Cobra »

Triaxx2, if they do do such a thign and you dont get it I'd give you it anyways, I'm not sure I'd want to continue if I didnt have you there aswell
And now neither of you will get it. :lol:
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

lol, but simply saying all over 100 isnt fair, triaxx2 has contributed far more than most 100+ posters in terms of AI on these forums
User avatar
Triaxx2
Posts: 422
Joined: 29 Aug 2004, 22:24

Post by Triaxx2 »

Thank you very much. If it all came down to it, I'd simply appeal to the YS team to get a hold of it. I'm not above going around the chain of command.
User avatar
[K.B.] Napalm Cobra
Posts: 1222
Joined: 16 Aug 2004, 06:15

Post by [K.B.] Napalm Cobra »

Wait are you guys talking about actually getting spring?

Cause all I want is the info required to write AI's, well that's not entirely true, I would love to get spring, but it'd be nice just to code for now.
User avatar
Triaxx2
Posts: 422
Joined: 29 Aug 2004, 22:24

Post by Triaxx2 »

Just enough to start on an AI. I can code, but only if I've got something to work off of.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I'll have to brush up on my coding skills which I've been meaning todo for a while, but otherwise a long day of deep thought and I should have a basic skirmish in my mind to implement given the tools necessary. Though if we ever implemented an AI I'm sure we'd want to see it working for at least testing purposes, but I'm sure giving spring to us few for testing purposes would be an outrage to those of you who have been waiting and I would not feel happy with such inequality and the tension caused by it being directed at em and the rest would be unnerving. Nor do I think the SY's would trust me or Triaxx2 or you with the engine before it was publicly released.
User avatar
Triaxx2
Posts: 422
Joined: 29 Aug 2004, 22:24

Post by Triaxx2 »

Even if we had the entire engine, it wouldn't help us, because the AI has to be added into an uncompiled engine code, or at least based off of it. And besides, I'm too lazy to go to all the trouble of compiling it.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

In most modern IDE's all you do is open the project and press a compile and run button. So even the laziest of couch potatoes can compile with ease
User avatar
Triaxx2
Posts: 422
Joined: 29 Aug 2004, 22:24

Post by Triaxx2 »

Im still too lazy.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Shame on you, we'll just ahve to kick you into shape and you'll be running about in no time. hhhmmmmm I wonder if I could automate the process
User avatar
Triaxx2
Posts: 422
Joined: 29 Aug 2004, 22:24

Post by Triaxx2 »

Plus I'm still playing TA, so I can't be bothered to do anything with Spring until I can skirmish. Which means finishing the AI, which would give me too much to think about to bother with compiling Spring, though for playtesting, we'd need a finished version.

AF, any idea how to get the Matrices coded? I can probably do the Agents, but I've no idea how to do a Matrix.
jouninkomiko
Posts: 436
Joined: 26 Aug 2004, 08:11

Post by jouninkomiko »

the code compiles in VS with no modification
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I think we meant after we had modified it if we ever where given it for AI pruposes as discussed above. Altho if it didnt compile without modifications I would be verry curious as to how you got those screenshots.

The Matrixes would be a matter of splitting the map into sectors and subsectors, then gathering information about that sector and
applying an algorithm to it resulting in a single value, threat being an example.
User avatar
Triaxx2
Posts: 422
Joined: 29 Aug 2004, 22:24

Post by Triaxx2 »

Okay, you do that. I'll start fiddling with Agents. *cracks knuckles, and charges off, without really being sure what he's going to do*
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Triaxx2 why dont we both incorporate a set fo generalised agents or agents that both aour systems use, then you can add extensions to them to fit in with the 3 extra overlays and then both of us can deal with the extra agents we've both proposed respectively
User avatar
Triaxx2
Posts: 422
Joined: 29 Aug 2004, 22:24

Post by Triaxx2 »

Sounds good to me.
Post Reply

Return to “General Discussion”