Author Topic: AI - revisited  (Read 16482 times)

0 Members and 1 Guest are viewing this topic.

Offline Centrixo

a more suicidal ai and a ai that can survive longer than the average 1 minute life time.

these 2 at the very least would be good.
Would you like to have a piece of duct tape shoved up your arse? - 'Duct Tape man', Derelict.

"You never know what your going to find until you take a look" - Snipes, Fs2.

Terwin Castronenves:"Centrixo, your car is slow, bye bye" *zoom*.
Centrixo:*sigh!* Damn!.

 

Offline ares

  • 23
Hmm, after finally being able to compile and play my very own compiled version (YEAY!), I can see where you are coming from. I played it on the standard setting before, not big effort there. However, on the harder levels, they come at you like kamikazes, guns blazing. And I, still thinking bumping into them won't hurt, get taken out with this suicide attack. Damn. They are good at playing chicken though.

 
Chicken is fun to play when you have superior firepower (i.e. more powerful missiles, or just more missiles and stronger guns).

    |[===---(-         
    ||
 =(||==)_
    ||_____|
 =(||==)
    ||                   
    |[===---(-                             

"Take my love. Take my land. Take me where I cannot stand. I don't care, I'm still free. You can't take the sky from me. Take me out to the black, tell them I ain't comin' back. Burn the land boil the sea, you can't take the sky from me. There's no place I can be since I've found Serenity. But you can't take the sky from me." - Ballad of Serenity

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Guess what would IMO be much more realistic for capship AI and would improve some things a lot?

Make the cap ships move so that when they change direction, they begin the turn slowly, then gain angular velocity until they reach their maximum turn rate, then slow down the turn until they point to the direction they want to go.

That would be way more realistic than the way they currently turn. Currently they reach full turn rate immediately from the start of the turn and when they stop the turn they seem to suddenly throw their angular momentum to the same place that inertia in FreeSpace games in general is. It has always buggered me the most in these games.

It is, by the way, one of the reasons why the Colossus behaves like a baseball bat. Even though its CoG is set a bit behing, it wouldn't look so ridiculous if it actually behaved like it actually would. Of course it would need additional programming to make sure that the ship didn't overshoots it's desired direction, which would cause oscillation if the AI would continuously overshoot it's target.


Funny thing is that if a player controls a capital ship, they automatically do behave like this. Which means that it is indeed AI-specific.

The AI would need to consider howe long does it take to get the ship into maximum allowed turn rate. It could, for example, demand a 10 degree turn to accelerate the rotation to maximum. That would mean that the AI should first calculate how much it needs to turn the ship (in degrees), and then define how it should turn the ship to that direction.

If the angle of turn is exactly 20 degrees, the ship would start turning to desired direction, accelerate the turning speed until it reached the halfway and maximum turning speed, and immediately start decreasing the angular velocity so that the ship would in the end point at the desired direction.

If the angle is less than 20 degrees, the ship AI would accelerate the rotation until hitting the half way to the turn, and then slow down the turn for the rest of it.

If the angle is more than 20 degrees, the ship would reach maximum angular velocity, retain it until being 10 degrees from the desired direction and start slowing down the turning in order to avoid overshooting the target vector.

Please tell if this wish is too far-fetched. ;)


Another thing that might make the AI fighters and bombers look like they are controlled by human pilots: Do they ever use anything but pitch and yaw axes? I don't remember them using roll control very excessively.

Also, adding some small, random flight patch changes and corrections when flying from point A to point B would increase the humanity factor in the AI a lot. Some small, random weaving would be more believable than picking a direction and then flying toward the waypoint without even touching the controls.


And of course... Make them avoid collisions better. I think we all know the horrible feeling of pressing C-3-7 and being rammed by all your wingmen. Especially if you're flying at low speed and you turn around...
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Good points about the weaving and bobbing. It's amazing what a little non-immediately-understandable behavior can do, Valve has a bit of that going on with the new Counter-Strike: Source bots. (or whoever coded them). It's quite amazing actually, when you're used to watching bots perform several obviously preprogrammed maneuvers. Even Halo's AI doesn't come close to mimicing human players.

The bots still suck, granted, at least on the level that they were set on. But for quite awhile, I was absolutely convinced that I was playing with human players, even in spec mode, just because the bots would randomly change the speed that they looked in different directions, would sometimes make random movements that didn't grant them any tactical advantage at all. Really made you think that there was some bored geek behind the controls, waiting for an enemy to pop out so he could shoot 'em.
-C

 
Even Halo's AI doesn't come close to mimicing human players.

I think it does. The elites run around the player character, dodging (for the most part), charging, and meleeing when you're close enough. Grunts will run away from the character if he kills an elite, but if it runs into a large pack of grunts or a jackal or an elite, it'll start to try to kill you again. Plus, they all dive to avoid grenades (however, not to much success). Jackals also will duck behind their shield if they hear gunfire, and if they see your character, they'll turn and point you out to his allies. The USMC does the same thing. There's one downside, if you don't play Heroic or Legendary, they aren't that smart. However, that's a good developer technique to get new players playing their game.

    |[===---(-         
    ||
 =(||==)_
    ||_____|
 =(||==)
    ||                   
    |[===---(-                             

"Take my love. Take my land. Take me where I cannot stand. I don't care, I'm still free. You can't take the sky from me. Take me out to the black, tell them I ain't comin' back. Burn the land boil the sea, you can't take the sky from me. There's no place I can be since I've found Serenity. But you can't take the sky from me." - Ballad of Serenity

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Most of what you listed is actually part of the problem. By now I think that most people who are familiar with FPSes realize that there's a certain limit of control that the player has over their avatar in the gaming world; pointing and cowering may be realistic, but it's not anything you can really map to a keystroke. So even though it may be realistic, in-character, and in line with what would happen in the theoretical game world, it also limits the AI, at the same time, to a character in the game world. And at the same time, the movement is almost too intentional, too composed, and notices things that it wouldn't notice if it were a human player.

Although, Halo might've been a bad example to use - since you automatically know that anything but another Spartan is AI, and it's pretty much ingrained constantly as you play through the game and online. I don't know about Halo 2; I've never played it enough to be able to really compare SP and MP.

Don't get me wrong, Halo's AI is one of the most fun AIs to play with, but it just doesn't have the imperfection, clumsiness, and illogical behavior of a human player. :p

In Freespace, there is a certain advantage in that the AI is pretty much inherently constrained to the same kind of movement as a player. A Mara can't exactly pick its nose, no matter who it's controlled by. But things like a fighter twitching when it's bored, maybe doing some spins, doing stupid yet unpredictable things in combat would make it seem more human.
-C

 
I like F.E.AR.'s AI. They move with military precision, but, when scared, start to retreat awkwardly. In the SP Demo, when you fire your weapon, won't come stupidly through the door to the room he's in, no, he dives out the window, into cover (but unforunately for him, right in front of a fire extinguisher ;7). You can tell when you've got the upper hand, because they'll start to call in reinforcements. If you've kinda lost that hand, they'll start to flank you, or coordinate a very deadly assault against you. If you throw a proxy mine, they'll stay away from it. If you throw a grenade, they'll dive under cover to avoid the blast. Heck, if you start firing at them, they won't make like a deer and stand there, they'll dive behind the nearest form of cover, then peek out with their weapon and blast you to bits...

    |[===---(-         
    ||
 =(||==)_
    ||_____|
 =(||==)
    ||                   
    |[===---(-                             

"Take my love. Take my land. Take me where I cannot stand. I don't care, I'm still free. You can't take the sky from me. Take me out to the black, tell them I ain't comin' back. Burn the land boil the sea, you can't take the sky from me. There's no place I can be since I've found Serenity. But you can't take the sky from me." - Ballad of Serenity

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
keep in mind if you are going to do a rewrite, you need to modularize your code, in such a way that your code doesn't get into the old code, and original behavior is maintained when not using your AI, backwards compatibility is something we stick to with a disturbing degree of fanaticism.

i'd personally recommend some sort of function pointer table, perhaps with major and minor versions, so you freeze your code at what ever state it is in at a release so anyone who makes a campaign based on that release won't have to worry about the AI suddenly getting really good at taking out subsystems  in the final mission, or taking advantage of turret blind spots ect...ect... years after there release.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Kaine

  • 27
keep in mind if you are going to do a rewrite, you need to modularize your code, in such a way that your code doesn't get into the old code, and original behavior is maintained when not using your AI, backwards compatibility is something we stick to with a disturbing degree of fanaticism.

i'd personally recommend some sort of function pointer table, perhaps with major and minor versions, so you freeze your code at what ever state it is in at a release so anyone who makes a campaign based on that release won't have to worry about the AI suddenly getting really good at taking out subsystems  in the final mission, or taking advantage of turret blind spots ect...ect... years after there release.

this is exactly why i suggested modularizing the code and having a launcher flag to turn it on and off, possibly even a flag in the mod ini to use a particular AI version, or even a FRED flag to use advanced AI or retail AI. but it has to be able to be turned on or off. Karajorama effectively flamed me for suggesting it before and it made me sad :<

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
I think a fred flag would work better, being able to set AI level on a per ship basis would be great, though it would probly be best to have the AI version set in the AI table, or at least the default AI version.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Bob-san

  • Wishes he was cool
  • 210
  • It's 5 minutes to midnight.
I have some statistics for you. I made a mission over the weekend...

"Colossus Assult"
1 GTVA Colossus, Hostile
24 Myrmidon, 24 Perseus, 12 Herc MkII, 12 Ursa, 12 Medusa, 12 Artemis D.H., Friendly

In 6 hours 11 minutes 30 seconds (between start and last death)

98.9583% die (95 of 96 fighters)
52.631% die from collision damage alone
28.421% die from GTVA Colossus's defences
16.842% die from battle damage and collisions
2.105% die from flying into Alpha 1's line of fire

Here is how it was organized...
Alpha, Beta, Gamma - Herc MkII (4/wing, all else 6/wing)
Delta, Epsilon, Zeta, Eta - Myrmidon
Theta, Iota, Kappa, Lambda - Perseus
Mu, Nu - Ursa
Xi, Omnicron - Medusa
Pi, Rho - Artemis D.H.

83.3% support ships die (6 of 7 support ships)
100% of those said support ships die from collisions.

Only the last transport survived after I told it to leave when there were no other ships but myself, the Colossus, and Support Ship 7.
NGTM-1R: Currently considering spending the rest of the day in bed cuddling.
GTSVA: With who...?
Nuke: chewbacca?
Bob-san: The Rancor.

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • FLAMES OF WAR
And then tehy say Colossus sucks!
Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

 

Offline ares

  • 23
Actually, about the FEAR AI:

I read an article of the guy behind it (on www.jorkin.com) and he said that there was actually no flanking and so on programmed. Also, calling for reinforcements didn't do anything, just a sound that was played when there was only one guy left in a squad. They thought you'd run into more NPCs later in the level anyway, so it'll look like they are the reinforcements ;)

About the flanking: Sometimes the closest valid cover point would be next to you, so the AI wants to advance to that cover. However, it also knows to keep out of your line of fire, so it finds a safe way there, which looks like flanking. Actually its not. Clever, eh?

About modularization:

Of course. Actually, did you know the linux kernel uses function pointers in structs to simulate something like polymorphism in C? They use it to abstract filesystem interfaces and such. Sounds like the perfect solution for this. Even though I would be against a pollution of the symbol table in the executable. Maybe something like dlopen() (http://www.opengroup.org/onlinepubs/009695399/functions/dlopen.html) exists in windows as well, so we can load AI implementation libraries (specified in tables?) dynamically. Then, the AI can have its own release cycle and you can say "I want AI version x.y for my mission".

[EDIT]: Ah, apparently libtool (from GNU, like autotools) has a special library for this, which is cross platform. Don't know if its an OK dependency. What license does the SCP use? GPL?
http://www.gnu.org/software/libtool/libtool.html
http://www.gnu.org/software/libtool/manual.html#Using-libltdl
« Last Edit: January 09, 2007, 09:37:09 am by ares »

 

Offline Unknown Target

  • Get off my lawn!
  • 212
  • Push.Pull?

About the flanking: Sometimes the closest valid cover point would be next to you, so the AI wants to advance to that cover. However, it also knows to keep out of your line of fire, so it finds a safe way there, which looks like flanking. Actually its not. Clever, eh?



Just a small note...

Stuff like that is what makes AI really good IMO. You give it a few basic objectives and how to do them, which it can then adapt to a greater goal. It makes it seem more human than having scripted "move from here to try and get around the player, when  X>2" or whatever. :)

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
the license is at the top of every source file.

I've thought haveing the ability to load external DLLs would be cool for some time now, not just for AI, but graphics too, I like the idea, but I'm not high enough on the totem poll to make that sort of decision.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline ares

  • 23
Yes, quite true. Its called emergent behavior:
http://en.wikipedia.org/wiki/Emergence#Emergent_properties

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
this is exactly why i suggested modularizing the code and having a launcher flag to turn it on and off, possibly even a flag in the mod ini to use a particular AI version, or even a FRED flag to use advanced AI or retail AI. but it has to be able to be turned on or off. Karajorama effectively flamed me for suggesting it before and it made me sad :<

Table flags are fine I never argued against that. FRED specifiable (especially on a per ship rather than per mission/ship class)

I'm sorry if you took it as a personal flame because it wasn't intended that way. I was merely trying to get across how bad an idea it actually is to do this as a launcher flag. If you're not an SCP coder I certainly don't expect you to have grasped why it's so bad so I wasn't having a go at you.

Launcher flags for AI settings are a really dreadful. Here's the reason. Suppose I make a mission. I want it played with a certain kind of AI and I design it for that. I spend hours playtesting the balance for every skill level. I get it just perfect. I release the mod with a readme that sets up the AI flags the way I want.

Someone downloads the mod, ignores the readme (as 90% of users do) and then goes on the forums to give me a load of "You suck! The enemy are too hard". Or someone downloads my mod and likes it but when they go to replay it, it's suddenly become too hard because they've changed the flags when setting up another mod.

Launcher flags should set up things like graphics and troubleshooting and things like that. They shouldn't have an appreciable effect on gameplay. You'll notice that as the engine matures the flags which do (TBP and WCS options for instance) will slowly be phased out of the launcher and replaced with table flags. If you look closely you'll notice that there is no "Toggle features for Beyond the Red Line" option in the launcher because we started a lot later than WCS or TBP and features we wanted were better integrated into the tables because the coders learnt that putting things like that in the launcher was a big mistake.

In addition by specifying them in the launcher it means that you have much less control as a mission designer. Either a feature is on or it's off. If it's in a table/FRED you can have all kinds of options. I'd love to see an AI Editor in FRED where you can specify exactly how each ship acts. :)

Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
when I read that I thought you worded it harsher than you probably intended.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Yeah. When I re-read it I could see why Kaine thought it a personal insult. As I said the idea is stupid but I can't blame him for not knowing why.

It's not that Kaine is a moron for suggesting it. Just that we'd be morons if we did it that way as we should know better by now :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]