Rusty
  • Rusty
  • 50.25% (Neutral)
  • Private Topic Starter
13 years ago

and thats exactly the reason why i have given up on scripting my own AI.

all i tried was to make a AI use humvee rush tactic. i got it to work but it was such a "slapped together" thing that i gave up really fast.

the chinook thing annoyed my also because the AI always built 2 additional chinooks AUTOMATICALLY yet 1 additional chinook is really all you need.

also i couldnt tell him to sell his command center for a very "pro-like" rush properly..

Originally Posted by: i^love^mixery 



Whilst generals was a quirky game (I like some of the ideas implemented), it seemed glichy overall and the AI left something to be desired - I know on the underlying level the AI are cheating too, but a single hard AI should be really difficult. Tiberium wars brutal AI was extreme (the fact it didn't harvest any tiberium and cheated disappointed me), but I don't think AI need to cheat in order to be better. Cheating says to me 'I'm too lazy to program a decent AI'.

For example, I think the AI could easily be made to micro a lot better than a human being, and made to specialise in specific roles - for example, a rush AI versus a much slower economic roll-over AI, a large oversized army or super-weapon spam (both would make a player poop their pants, because, what AI do they prepare for?).


For example, the stealth general, with a micro-ing AI, had lots of potential to cause havoc by literally and rapidly filling the entire map with invisible traps.

The demo general could easily cause havoc if his bomb trucks didn't queue in a straight line to the destination building (and get stuck behind one another), but instead spread out as a horde or disguised themselves (they should have really invented 'branching' where vehicles can split off onto an arbitary secondary path from the main one based on a pseudo random number).

Or a general who tries to build everywhere. Or a general who works on building such a large and overwhelming rush horde (who can be disabled in-case of low end machines). Or one who builds super-weapons. The exception being the super-weapon general. Who would built 3-5 super weapons. But there'd be no difference in tactics.

Instead all the AI did was built vaguely similar bases with vaguely similar goals (build one super-weapon, send continuous stream of cannon fodder).

I built a buggy pac-man game in micro java in 2 days - the ghost AI had only simple rules (you can never go back the way you came unless it's a 'dead end' or blocked, you cannot head in the same direction as another ghost/cannot share the same space as one, and you must head towards pac-man) but the ghosts were so effective it actually looked like they were teamworking and the game was nearly impossible to complete (I had to slow down the ghosts and even then - they'd block all the exits and head towards me!).
i^love^mixery
13 years ago

Instead all the AI did was built vaguely similar bases with vaguely similar goals (build one super-weapon, send continuous stream of cannon fodder)

Originally Posted by: Rusty 




thats because all they did was copy & paste, simple as that๐Ÿ˜

i totally agree with you that they could have done unique tactics for each general easily if they werent so lazy.

and i too think that a properly programmed AI could beat human players simply because its able to react without latency. on 50k matches the stealth general could indeed fill the entire map with his demo traps faster than any human being.

also its really disappointing that even if you give the computer players $500.000 they will NOT expand their bases once they reach the maximum default size. they will never build more than 4 war factories etc..

yea the AI scripts really totally suck if you take a deeper look at it.

Does map.ini have to be renamed to be the same name as the map? For example, mine is called 'City.map', so would the .ini be renamed to City.ini?

Could you explain to me how the .ini works? I vaguely remember something about .ini files (I am sure I've done something like this before in a deja vu esque feeling but... I don't think I've done AI programming for generals before...).

If I 'recall' correctly, the X and Y co-ordinates are relative to the command center? Angle is obviously which direction it faces when built. Rebuilds, if 0, is infinite rebuilds, correct? Or does that mean it doesn't attempt to rebuild it?

Would it be possible for me to specify numerous supply drops etc next to each other using this?

Originally Posted by: Rusty 



map.ini is the right name.

i think -1 rebuilds = unlimited (i have no idea if thats right)

about the other questions you will have to wait for somebody who knows .ini files better than me๐Ÿ˜
DecliningAtom52
13 years ago
Yes the map file needs to be called map.ini, do not rename it to the name of the map, if you place an object Civillian > Structure > TempBuildingSize in the bottom right of the default (when you open world builder) this is the area and coordinates that things will be built in ( so it is relative to this object ).

The parameters on the build list are ignored by the skirmish ai, the ai will always attempt to rebuild.

If you wanted to create extra supply drops you can create (near) unlimited buildings, so go ahead, if you would prefer me to do this just say.

The top section of the file is fairly self explainitory, the second decides what generals powers the ai selects, the third is the build list.
'As always, Have nice day.' - FPSRussia
Rusty
  • Rusty
  • 50.25% (Neutral)
  • Private Topic Starter
13 years ago

Yes the map file needs to be called map.ini, do not rename it to the name of the map, if you place an object Civillian > Structure > TempBuildingSize in the bottom right of the default (when you open world builder) this is the area and coordinates that things will be built in ( so it is relative to this object ).

The parameters on the build list are ignored by the skirmish ai, the ai will always attempt to rebuild.

If you wanted to create extra supply drops you can create (near) unlimited buildings, so go ahead, if you would prefer me to do this just say.

The top section of the file is fairly self explainitory, the second decides what generals powers the ai selects, the third is the build list.

Originally Posted by: DecliningAtom52 



So for the TempBuildingSize, I place that in the bottom-right of my City map and the AI will place things relative to that, or inside the AI's base or...?
BR-Alexandre
13 years ago

I built a buggy pac-man game in micro java in 2 days - the ghost AI had only simple rules (you can never go back the way you came unless it's a 'dead end' or blocked, you cannot head in the same direction as another ghost/cannot share the same space as one, and you must head towards pac-man) but the ghosts were so effective it actually looked like they were teamworking and the game was nearly impossible to complete (I had to slow down the ghosts and even then - they'd block all the exits and head towards me!).

Originally Posted by: Rusty 



Nice, i always liked playing pac-man, that AI seems intersting

So for the TempBuildingSize, I place that in the bottom-right of my City map and the AI will place things relative to that, or inside the AI's base or...?

rusty wrote:



I don't know much about this one but i think it orients an AI with new coordinates having (0,0) on object's center.

i totally agree with you that they could have done unique tactics for each general easily if they werent so lazy.

and i too think that a properly programmed AI could beat human players simply because its able to react without latency. on 50k matches the stealth general could indeed fill the entire map with his demo traps faster than any human being.

also its really disappointing that even if you give the computer players $500.000 they will NOT expand their bases once they reach the maximum default size. they will never build more than 4 war factories etc..

yea the AI scripts really totally suck if you take a deeper look at it.

i^love^mixery wrote:



yeah they do same stuff all the time but isn't that easy to script the AIs here as each map have its own areas, paths, etc so you just can't make a virtually perfect enemy. With each map being different you also can't make it a micro, and not only because of the terrain, players consider a lot more "data" than we can program a computer to do. check TW3's brutal AI, on all levels, he steamroll you but, unlike generals, micro moving don't works as well as in generals.

For now lets look foward to generals 2 and expect it to be more like its "father" but may have better AI. what this one needs is a tool that tells an AI unit to stay out of range of enemy units, pretty sure i saw one in ZH's china campaing, the one china will liberate a city by taking down GLA statues, each statue you remove trigger one rocket buggy that just fires at you but if any of your units get close to him, he retreats and fire again from distance.

I made scripts for skirmish play, with an almost unbeatable AI as he likes "clicking" all buttons he see. I am too lazy to make a good AI (i admit) but made one different for each general but they do what the TW3 guys do, cheat money plus steamrolling army. Also added my own mark as the lazer general use F117s and target mainly artillery, a tactic i like using. If you want the challege i can upload it here. they mass armies but they still very dumb

For example, the stealth general, with a micro-ing AI, had lots of potential to cause havoc by literally and rapidly filling the entire map with invisible traps.

Rusty wrote:



they'd need money, as they risk 200 for a worker and a bit more in a trap that will probably fail because of its location
"The Only Way To Have Peace is Prepare for War" <---I forgot who said this...
"Lasers make superior weapons!" <--- Townes
"Laser crusader ready for engagement" <--- Laser Crusader Tank
"Tactical lasers online" <--- Avenger Support Venhice
"Storm climbed mountain" <--- Pathfinder Elite Infantry
"Ready for covert mission" <--- Stealth Fighter Tactical Support
i^love^mixery
13 years ago


So for the TempBuildingSize, I place that in the bottom-right of my City map and the AI will place things relative to that, or inside the AI's base or...?

Originally Posted by: Rusty 



as far as i know this thing doesnt do anything except showing you the recommended size for reach base. also you normally place it on top of each player startposition and then adjust the perimeters to it. and you delete it again when you are done with that. its just an orientation..

BR-Alexandre i think your AI scripts would be really interesting for Rusty. go ahead and post them!๐Ÿ‘

it definitely was the best steamroll AI i have ever seen.
Rusty
  • Rusty
  • 50.25% (Neutral)
  • Private Topic Starter
13 years ago


yeah they do same stuff all the time but isn't that easy to script the AIs here as each map have its own areas, paths, etc so you just can't make a virtually perfect enemy. With each map being different you also can't make it a micro, and not only because of the terrain, players consider a lot more "data" than we can program a computer to do. check TW3's brutal AI, on all levels, he steamroll you but, unlike generals, micro moving don't works as well as in generals.

Originally Posted by: BR-Alexandre 



Whilst this might be the case, AIs that don't adapt to their map are non-heuristic (EG non-learning). In the pac-man game I built, because I was so short of time, the map actually consisted of a series of 'parts' (corners, corridors, T-junctions), which meant new levels could be quickly built - but the AI I wrote could still navigate new maps based on just those simple rules.

Conventional pac-man AI uses a series of pre-programmed 'way-points' (with interconnecting lines), using a localised search algorithm to 'plot a course' to the human player. Whilst this algorithm would permit a ghost to find pac-man in short time by 'searching the paths', it meant that no alternate or new levels could be built without additional waypoints. In a sense, I traded efficiency (waypoint searching) for adaptability (simple ruleset to navigate the map). The only point my AI fell down on was the off-screen teleport (as it makes pac-man seems further) - but this would occur on a waypoint system too without more specific rules implemented. An additional rule here and there and it'd probably be able to tackle the teleport.


My point is, it is possible to trade efficiency in an AI to get adaptability. Given generals is technically speaking a '2D' game in terms of movement (maybe a unit can travel up and down a ramp but that's part of the physics - units could in theory still be co-ordinated by X/Y), it would be possible for the AI to figure out how a map works.

In-fact, I would implement the spherical rebound method (basically sonar detection) I was thinking of for light modelling. The AI 'transmits' an expanding circle from it's origin, which, if it finds a gap, it marks a 'point' between the two obstructing points, and repeats another circle from that point, through-out, rebounds until it has an interconnected self-built network towards every player's base.


Sorry, going off on a tangent there. Smart AI can be built, people just have to see it from the AI's perspective.
BR-Alexandre
13 years ago
Here is the AI, you just have to import them to WB. they're hard so put them on easy if you're going to fight them. about AI adaptability, the game standard scripts are made to fight in almost any map, the problem is that you can't make it fight well as there is no "fire from outside enemy range" and situations demand different tactics, units and coordination.

for example, i have a raptor and i see an enemy scorpion coming to my base, but near the scorpion there is a quad cannon

-My options:

--attack the scorpion ignoring the quad (suicide, unless the quad is busy)
--attack the scorpion without being targeted by the quad (micro moving)

-AI options:

--do nothing
--attack the scorpion
--attack the quad (if you have 3 raptors and quad is not promoted...or you planes are...you kill it)

problem: you can't set AI to check if the quad is busy neither set it to attack without getting in quad's range or detect their numbers/veterancy. your options are "attack: yes or no?"

generals is almost 2D game, but you have to consider the air units so....3D   Brutal AI scripts ZH.zip (85kb) downloaded 9 time(s).
"The Only Way To Have Peace is Prepare for War" <---I forgot who said this...
"Lasers make superior weapons!" <--- Townes
"Laser crusader ready for engagement" <--- Laser Crusader Tank
"Tactical lasers online" <--- Avenger Support Venhice
"Storm climbed mountain" <--- Pathfinder Elite Infantry
"Ready for covert mission" <--- Stealth Fighter Tactical Support