Apoch and the A.I.
Moderator: Moderators for English X Forum
-
- Posts: 121
- Joined: Sun, 14. Mar 10, 13:14
Apoch and the A.I.
This is definitely worth reading.
Crash Course in AI for 3D Space Combat Games by Apoch from EGOSOFT
Have a nice day!
A.Persyn
Crash Course in AI for 3D Space Combat Games by Apoch from EGOSOFT
Have a nice day!
A.Persyn
-
- Posts: 2575
- Joined: Sat, 28. Mar 09, 16:03
Just as the old A.I. was nicknamed "Betty", we should nickname the new A.I. "Apoch".
If it works perfectly we can all thank Apoch for being so clever,
and if it crashes us into the nearest asteroid, I guess we'll all be cursing ... Apoch.
Anyone else want to agree the new A.I. be called "Apoch"?
EDIT - yes the link is an interesting read, but way way way over my head ... sorry
If it works perfectly we can all thank Apoch for being so clever,
and if it crashes us into the nearest asteroid, I guess we'll all be cursing ... Apoch.
Anyone else want to agree the new A.I. be called "Apoch"?
EDIT - yes the link is an interesting read, but way way way over my head ... sorry

Formerly "Alien Tech Inc."
-
- Posts: 13
- Joined: Wed, 13. Jul 11, 22:53
-
- Posts: 238
- Joined: Sat, 8. Sep 07, 20:56
That gets a lol from me also 
The post is just a very basic hint on which things should be considered most in a 3 dimensional, or even 2 dimensional nearing of two objects, considering needed calculation ressources versus available computation power overall on a given system. The only real hint about his work are cartesian volumes, but that would be more or less familiar to those of the modders which have tinkered around with weapons and ships. MARS and CODEA for example.
As long as he hasn't realised the main problem of linear calculation in TC, instead of the of logarithmical nearing, missiles and ships will always end on the tail of the oppponent as long as they aren't using an angle turning the nearing vector near a linear progression. As long as we don't get to see the calculation itself, the guesses on what this would mean for Rebirth are pure speculation. So i'd call the AI Bepoch without having seen it so far
It may be smart, it may be like the one in TC. That depends on his formulae.

The post is just a very basic hint on which things should be considered most in a 3 dimensional, or even 2 dimensional nearing of two objects, considering needed calculation ressources versus available computation power overall on a given system. The only real hint about his work are cartesian volumes, but that would be more or less familiar to those of the modders which have tinkered around with weapons and ships. MARS and CODEA for example.
As long as he hasn't realised the main problem of linear calculation in TC, instead of the of logarithmical nearing, missiles and ships will always end on the tail of the oppponent as long as they aren't using an angle turning the nearing vector near a linear progression. As long as we don't get to see the calculation itself, the guesses on what this would mean for Rebirth are pure speculation. So i'd call the AI Bepoch without having seen it so far

-
- Posts: 13244
- Joined: Fri, 13. Jan 06, 16:39
Simplifying the problem (like breaking down space around "it" into 8 sections) is practically a requirement because as he said, no player is going to notice whether the fighters fly a mathematically ideal course or not.
So while it's theoretically possible to "do it properly", you're always Doing It Wrong by attempting.
MARS targets, for example, move in 1.5D space, not 3D space so every target only has 1 1/2 movement vectors.
One vector is the closing speed of the target, defined by direction and value. Simple.
But the space that I use is... warped. The second movement vector of any target is aligned with the surface of a sphere around the MARS ship... in an undefined direction so it's actually only half of a vector.
That way I can express the target movement as far as it concerns a turret script with 1 1/2 vectors instead of 3 or actually only 2 scalars because the one real vector's direction is always the same. (for values of "same")
A turret script only cares whether the target coming closer or not... and how much lateral movement it has. In what exact direction it is moving is of no interest.
That lets me not define but evaluate the movement of a target relative to "my" ship with 2 numbers. No trigonometry involved. None.
It's the only reason why it can work. "Real" 3D math would be out of the question.
Once you wrap your head around a spherical 1.5D space it really is obvious...
This particular approach may not be useful for a dogfighting AI but the principle of simplifying the problem down to a manageable number of variables is the same.
So while it's theoretically possible to "do it properly", you're always Doing It Wrong by attempting.
MARS targets, for example, move in 1.5D space, not 3D space so every target only has 1 1/2 movement vectors.
One vector is the closing speed of the target, defined by direction and value. Simple.
But the space that I use is... warped. The second movement vector of any target is aligned with the surface of a sphere around the MARS ship... in an undefined direction so it's actually only half of a vector.
That way I can express the target movement as far as it concerns a turret script with 1 1/2 vectors instead of 3 or actually only 2 scalars because the one real vector's direction is always the same. (for values of "same")
A turret script only cares whether the target coming closer or not... and how much lateral movement it has. In what exact direction it is moving is of no interest.
That lets me not define but evaluate the movement of a target relative to "my" ship with 2 numbers. No trigonometry involved. None.
It's the only reason why it can work. "Real" 3D math would be out of the question.
Once you wrap your head around a spherical 1.5D space it really is obvious...
This particular approach may not be useful for a dogfighting AI but the principle of simplifying the problem down to a manageable number of variables is the same.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
-
- Posts: 6190
- Joined: Sun, 3. Sep 06, 02:31
-
- Posts: 523
- Joined: Wed, 6. Nov 02, 20:31
Good reading... Specially the zone division around targets with variable surface properties which hints directly the AI on XRB may be tanking into account facings and valuable Hardpoints (Which is a must).
What I'm worried about was that he doesn't explicitely inject "tactical thought" at specific steps into the maneuvering AI... Sometimes the decission to do something is not related to what's advantageous to you, but to what's advantageous to your team... But at least he hints:
He also doesn't specifically say anything regarding what takes away most of the AI Processing time on that "OODA" loop... Which is evaluating what can be an obstacle you need to avoid while pursuing your target and ultimately when you have to decide your target is not worthy. How a given flying AI deals with obstacles between it and the current target is one of the most definining and easily perceived "perks" for players. The "bouncing AI" we got on past X's was one of this examples of "signature" features on how this critical aspect is programmed and easily perceived.
Another important issue I also missed is what his ideas are about AI grades... This is specially important on games, as a very immersive experience comes from players that are learning their way through a given game... On a recreational game you are not interested into creating the Ultimate AI, instead you are interested in giving the player a challenge. To deal with the different levels of player expertise is critical to create a "Ladder" of AI difficulty levels you can swap to offer a varied experience to your players. It's quite common to always see the same AI over a whole game which really becomes a problem when you want it to be accessible to a big playerbase.
"Nice looking" interception routes are easy to do, you just need to change which point of the space you are tracking... Something similar as with leading shots... Don't track the current possition of your enemy... Track the proyected one. A common pitfall, although, is proyecting your enemy possition using CURRENT speed and CURRENT facing... This works k for short flight times as in the case of shots but on "navigational" trackings (when estimated flight time is higher than the average needed for your target to perform a full 180º turn) you actually have to use the proyected course over 2 points in time so you are naturally "averaging out" small "instant" course variations.
The above works nicely for giving "realistic" missile trackings, the main difference with a ship is that you generally
are not interested in ramming your target so you have to swap to current possition tracking when your ship reaches weapon fire range.
What I'm worried about was that he doesn't explicitely inject "tactical thought" at specific steps into the maneuvering AI... Sometimes the decission to do something is not related to what's advantageous to you, but to what's advantageous to your team... But at least he hints:
Which means he also likes to have an AI that actually communicates intentions between each other... I would love to see on an X game a dogfighting AI able to perform correctly at the flight element level with ships flying in defensive mode while waiting for their wingmen to finish off their pursuers.Don't forget to add a layer of AI that can communicate between ships
He also doesn't specifically say anything regarding what takes away most of the AI Processing time on that "OODA" loop... Which is evaluating what can be an obstacle you need to avoid while pursuing your target and ultimately when you have to decide your target is not worthy. How a given flying AI deals with obstacles between it and the current target is one of the most definining and easily perceived "perks" for players. The "bouncing AI" we got on past X's was one of this examples of "signature" features on how this critical aspect is programmed and easily perceived.
Another important issue I also missed is what his ideas are about AI grades... This is specially important on games, as a very immersive experience comes from players that are learning their way through a given game... On a recreational game you are not interested into creating the Ultimate AI, instead you are interested in giving the player a challenge. To deal with the different levels of player expertise is critical to create a "Ladder" of AI difficulty levels you can swap to offer a varied experience to your players. It's quite common to always see the same AI over a whole game which really becomes a problem when you want it to be accessible to a big playerbase.
You don't really need complex trayectory analysis to make your "flying" things to look like they are doing it in a nice way.As long as he hasn't realised the main problem of linear calculation in TC, instead of the of logarithmical nearing, missiles and ships will always end on the tail of the oppponent as long as they aren't using an angle turning the nearing vector near a linear progression.
"Nice looking" interception routes are easy to do, you just need to change which point of the space you are tracking... Something similar as with leading shots... Don't track the current possition of your enemy... Track the proyected one. A common pitfall, although, is proyecting your enemy possition using CURRENT speed and CURRENT facing... This works k for short flight times as in the case of shots but on "navigational" trackings (when estimated flight time is higher than the average needed for your target to perform a full 180º turn) you actually have to use the proyected course over 2 points in time so you are naturally "averaging out" small "instant" course variations.
The above works nicely for giving "realistic" missile trackings, the main difference with a ship is that you generally

Last edited by ragamer on Sat, 15. Oct 11, 21:56, edited 1 time in total.
-
- Posts: 13244
- Joined: Fri, 13. Jan 06, 16:39
LOL! A complicated one, perhaps. =PKloHunt3r wrote:Wow Gazz, was that a compliment?
But considering he's getting paid for this, he shouldn't need it. =P
He shot down the OP's original concept which was getting lost in pointless detail. You just can't do that in a realtime game.
I was merely giving another example of how a completely different goal would require a completely different kind of simplification of "true 3D" - but a simplification nonetheless.
Actually, he did.ragamer wrote:What I'm worried about was that he doesn't explicitely inject "tactical thought" at specific steps into the maneuvering AI...
He talks about evaluating actions, both offensive and defensive.
Evading a Typhoon missile might have a perceived value of 100, attacking the enemy's missile launcher a value of only 50 because the fighter is too far from it to seriously threaten it.
Closer in, the fighter might value taking out the launcher at 150 to take out the long term threat instead.
Getting there could just be part of the assigned "difficulty" of the task.
With his 8 segment approach, a fighter can be 0-3 segments away from a potential target.
And a number of 0-3 can easily be figured into the value of such an action...
If you divide tactics and maneuvering into different layers, you get something very simplistic like the ES turret script.
They pick a target, then try to do something about it with the lasers they have.
Often it's a better idea to pick the target based on what lasers you do have available.
Ideally, you combine the two steps and rate the available courses of action.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
-
- Posts: 523
- Joined: Wed, 6. Nov 02, 20:31
A rank system is nice for taking personal decissions because it makes very easy to "randomize" in lesser ammounts to add some unpredicatability... but the point of reference is always the ship performing the action...He talks about evaluating actions, both offensive and defensive.
...That's not a tactical AI.
A tactical AI is the one I think he is hinting on "ships communicating each other".
Taking your MARS script as an example... The "Tactical AI" is the one that decides to not track the same target from multiple turrets because "someone else is already taking care of it and it has enough FP to deal with it". In the case of your turret script that portion is akin to a Fire Control Officer on a Warship.
In your case you have a natural way to associate your different tactical elements (ie turrets on the same ship)... What most Dogfighting games lack are that same "natural way" to associate the different flying elements to be able to coordinate them...
...Put in X terms, what we lack is a Wing "Flight Control" Layer... Were inidividual elements (this case the ships) decissions are overriden by the "Tactical Officer" for the sake of better overall team performance.
I hope I was clearer this time on what I was refering to by "Tactical AI".
-
- Posts: 13244
- Joined: Fri, 13. Jan 06, 16:39
What you're talking about is more of a wing commander layer.
That is near impossible to factor into the individual fight script of a fighter because fighters may have to be assigned to very diverse tasks.
In some very simplistic cases it's possible, though.
The MARS goblins do have a "wolf pack" behaviour not because I scripted any communication but because they are built that way.
Sounds silly, I know, but that's individual tactics masquerading as group tactics.
Any sufficiently advanced illusion is indistinguishable from a feature. =P
That is near impossible to factor into the individual fight script of a fighter because fighters may have to be assigned to very diverse tasks.
In some very simplistic cases it's possible, though.
The MARS goblins do have a "wolf pack" behaviour not because I scripted any communication but because they are built that way.
Sounds silly, I know, but that's individual tactics masquerading as group tactics.
Any sufficiently advanced illusion is indistinguishable from a feature. =P
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
-
- Posts: 6190
- Joined: Sun, 3. Sep 06, 02:31
So you're saying the whole "one Goblin draws fire while the other Goblins shoot" is just the result of chaos theory?
...or to take it further almost all of your AI scripts run on multiple individuals operating completely independently and "accidentally" adding up to a collaborative effort?
...or to take it further almost all of your AI scripts run on multiple individuals operating completely independently and "accidentally" adding up to a collaborative effort?
Admitting you have a problem is the first step in figuring out how to make it worse.
-
- Posts: 523
- Joined: Wed, 6. Nov 02, 20:31
OFC, in that we agree and I think Apoch is perfectly aware of it... Doesn't matter how complex you want to make your AI if it's not perceived by the player it's a waste of resources...Any sufficiently advanced illusion is indistinguishable from a feature. =P
...If you find a simple way to create the same effect, that's the way on a game, period.
I don't agree there... For example, on a ranking system using a simple formula:That is near impossible to factor into the individual fight script of a fighter because fighters may have to be assigned to very diverse tasks.
Code: Select all
[Target OV] > [DV] -> Initiate Attack Routine on [Target]
[Target OV] <= [DV] -> Initiate Evasive Routine
[DV] is calculated by adding any data that makes your ship more effective if it avoids damage on itself.
That's a basic "Ranking System"... Well, you can make it "tactical" if:
Code: Select all
Loop over Friendly Ships:
"[Friendly] engaging [target]?"
Yes:
"[Friendly DV] < [DV]" -> [Target OV] = [Target OV] x 0.5
End Loop
You can improve this way to think as a wing if, instead of a scalar magnitude, you transform [OV] into a matrix of "targets engaged" by your wing from the PoV of EACH element of your wing and then you assign the ships with lower [DV] to the targets with higher [OV].
This way you will create a Wing of fighters that tries to do what a Human team would... To inflict maximum damage while receiving minimum casualties.
-
- Posts: 1884
- Joined: Sat, 26. Nov 05, 17:54
There is one point I disapprove
Nice read anyway, once youtake your time to understand all he says.
It has already be proven many times that violence is often A solution (note the A and not THE as I do not to appear as a typical brute).Apoch wrote: Brute force is always the wrong answer. Always
Nice read anyway, once youtake your time to understand all he says.
SCUM : They may exceed you in number, but not in value.
-
- Posts: 13244
- Joined: Fri, 13. Jan 06, 16:39
Nothing so lofty. =PKloHunt3r wrote:So you're saying the whole "one Goblin draws fire while the other Goblins shoot" is just the result of chaos theory?
Every individual drone knows if the target is chasing "it" or not.
If so, it starts zig-zagging, presenting a very difficult target, and leading the target ship back to it's mothership - into range of the really big guns.
Other drones "working" that target use this sudden inattention (to themselves) to shoot it in the back.
When the target is drawing fire and turns on another drone... tag, you're it!
It looks as if they are working together but it's always the same script, regardless if one or more drones are assigned to the ship. No kind of communication ever happens. There is no "teamwork code".
Last edited by Gazz on Sun, 16. Oct 11, 01:40, edited 1 time in total.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
-
- Posts: 3712
- Joined: Thu, 9. Jan 03, 19:47
If you want proper AI then go find the files from Homeworld games. Even the source code is available for dissecting. Homeworld is one if not thee best 3d tactical games with good AI out there. Turned better by modders which also can study. The cap ships alone could do with some of its AI as well for the x games.
-
- Posts: 793
- Joined: Wed, 6. Nov 02, 20:31
-
- Posts: 447
- Joined: Fri, 10. Jul 09, 13:03
-
- Posts: 1463
- Joined: Sun, 22. Jun 08, 01:25
It's also how just about every team multiplayer game ever works.Gazz wrote:Sounds silly, I know, but that's individual tactics masquerading as group tactics.
Any sufficiently advanced illusion is indistinguishable from a feature. =P
Everyone on the server has the same objective and starts in the same place, any percieved 'teamwork' is just everyone trying to achieve the objective in the way they are best able to. So the guy in a tank drives around and blows stuff up, the guy with the silenced pistol sneaks around shooting people in the back, the guy with the chopper flies around raining missiles down on people, and what you get is the perception of combined arms, but it's actually everyone just doing what they think is best.
Honestly I find actual cooperation to be more artificial than people just happening to end up at the same place at the same time. Because actual cooperation is something that exists only in the realm of extremely well trained militaries and choreographed dance numbers.
Programming AI explicitly to work together would require making it actually a good deal more intelligent than most people, basically, so it's not really surprising that nobody does.
-
- Posts: 523
- Joined: Wed, 6. Nov 02, 20:31
Mmmm... Have you played some Coop games? Not just stupid deadmatch ones?Honestly I find actual cooperation to be more artificial than people just happening to end up at the same place at the same time. Because actual cooperation is something that exists only in the realm of extremely well trained militaries and choreographed dance numbers.
But even on multiplayer games, even with random ppl, you do basic things as to follow another guy and tag together when you see him firing at someone or been fired at...
...Then you also pay attention to FF (and when it's off to simply pay attention to NOT block your friendlies LoF).
All of the above are natural things to do for a gamer... Maybe you haven't thought on it but... Most AIs simply fail at this basic steps.
One day, you will find a challenging game with a Coop mode (Or even rarer, a MMO with challenging content) and you will see how developing team tactics is not something reserved for a few hardcore gamers... It's a natural way to progress... And quite immersive and fun also.
-
- Posts: 338
- Joined: Thu, 16. Oct 08, 08:45
great read
What he was talking about the Tick speed of the AI.. it would be great to see something like that implemented for the Privateers in the XRM mod.. if it got ported to XR
Privateers are designed to simulate other "player characters" in the universe, and as such usually fly ships that are better kited out, and operate their own missions (such as trading or station building)
It would be nice to see "players" like this have a higher pooling rate, and as such, be more skilled than any random schmook
What he was talking about the Tick speed of the AI.. it would be great to see something like that implemented for the Privateers in the XRM mod.. if it got ported to XR
Privateers are designed to simulate other "player characters" in the universe, and as such usually fly ships that are better kited out, and operate their own missions (such as trading or station building)
It would be nice to see "players" like this have a higher pooling rate, and as such, be more skilled than any random schmook
Jovianmoon wrote:Are we ready to collide with that asteroid?apricotslice wrote:...auto-pillok...
Yes sir! Engaging auto-pillock!