Playing with the AI

Need help testing contributed art or code or having trouble getting your newest additions into game compatible format? Confused by changes to data formats? Reading through source and wondering what the developers were thinking when they wrote something? Need "how-to" style guidance for messing with VS internals? This is probably the right forum.
denyasis
Hunter
Hunter
Posts: 75
Joined: Thu Mar 19, 2009 10:31 am

Re: Playing with the AI

Post by denyasis »

wow - sweet! Thanks for the info!

I don't want to get too distracted trying too many things, but its good to know they are out there!
denyasis
Hunter
Hunter
Posts: 75
Joined: Thu Mar 19, 2009 10:31 am

Re: Playing with the AI

Post by denyasis »

Updated the Patch file in Post #1

Just fixed some typo's (I gotta learn to type) and added my note files. There's one in the events and another in teh scripts directories. Essentially they are collections pasted from the Source, Wiki's, etc of the parameters and format of the XML files. As I figure out more, I'll add more.

Next is to play with the Capital ship AI - My general idea is to have the ship attempt to turn toward the target (front guns, most damage) and if that's not possible try to have it perfrom a loop around the target to get to a position where it can then turn toward the target. based on teh speed of weaponry and range, I don't see a huge point writing a large evasion set for them, as the ships are just too large to be able to use it. Heck, the bombers can barely evade as they are bretty big themselves.

Anyone who has piloted a Clysdale/Ox - any ideas? or fought against a Capship for that matter?
Mr. Bane
Merchant
Merchant
Posts: 35
Joined: Fri Feb 13, 2009 6:42 pm

Re: Playing with the AI

Post by Mr. Bane »

In modern warfare Capital Ships stay away from the main fighting. Capital Ships are big targets, easy targets and as Pearl Harbor taught us all it takes is one or two bomb-strapped planes to sink a few.

So Capital Ships, for the most part, should have long range weaponry. The tactic is to destroy the enemy boat before they can reach a range to fire back.The US Navy employs long range missiles or brutally large canons that will literally only fit on a Capital Ship. The Capital Ships also contain most of the tactical minds in an Navy fight.

So here's how I'd simplify it:
If they can, close in only as far as the longest range weapon will apply.

If they come in too close then gain distance until the previous sentence applies.

Fire weapons until the target is dead. Don't move to engage, let the enemy run the gauntlet.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: Playing with the AI

Post by loki1950 »

That pretty much defines the defence situation but one of the targets for cap ships are bases which can mount the same class weapons.Sit back watch a system take over sometime 8) so we still have to define the offensive role and some decision points for it.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
Mr. Bane
Merchant
Merchant
Posts: 35
Joined: Fri Feb 13, 2009 6:42 pm

Re: Playing with the AI

Post by Mr. Bane »

That is the offensive strategy. There is no defensive strategy for real capital ships.

Real capital ships in the Navy consist of Supercarriers, a title given based on the amount of aircraft they can carry and not gun size. These ships would be devastated if they were attacked. Most supercarriers stay in safe or close to safe waters, have an escort of Battlecruisers, and are well aware of their surroundings for 500+ miles. If a ship is aware of an enemy far enough they won't ever need to be defensive.

The other type of, older, capital ship is the Kirov Battleship.

Check out the ordinance:
20 P-700 Granit (SS-N-19 Shipwreck) AShM
14 SS-N-14 Silex ASW cruise missiles (Ushakov only)
12x8 (96) S-300PMU Favorit SA-N-6 Grumble surface-to-air missiles (Ushakov, Lazarev, Nakhimov)
96 S-400 (SA-NX-20 Gargoyle) long-range SAM (Pyotr Velikhy)
192 9K311 Tor (SA-N-9 Gauntlet) point defense SAM
44 OSA-MA (SA-N-4 Gecko) PD SAM
2x RBU-1000 305 mm ASW rocket launchers
2x RBU-12000 (Udav-1) 254 mm ASW rocket launchers
1 twin AK-130 130 mm/L70 dual purpose gun (2x AK-100 100 mm/L60 DP guns in Ushakov)
10 533 mm ASW/ASuW torpedo tubes, Type 53 torpedo or SS-N-15 ASW missile
8x AK-630 hex gatling 30 mm/L60 PD guns (Ushakov, Lazarev)
6x CADS-N-1 Kashtan missile/gun system (Nakhimov, Pyotr Velikhy)
Nasty.
denyasis
Hunter
Hunter
Posts: 75
Joined: Thu Mar 19, 2009 10:31 am

Re: Playing with the AI

Post by denyasis »

Mr. Bane wrote:In modern warfare Capital Ships stay away from the main fighting. Capital Ships are big targets, easy targets and as Pearl Harbor taught us all it takes is one or two bomb-strapped planes to sink a few.
Im my infinite Imagination - Something like that would be awesome. Actually Holy Grail-esque.
With More Modern Naval Combat (even WWII) - and I'm certianly no expert, the range made sense. Fighters were/are very dangerous due to their speed and manueverability. In WWII it made sense to stay at extreme range and send bombers (less risk to the fleet, avoid detection, etc). It also made sense for the defending fleet to use the best anti-bomber weapon they had - fighters. Hence the Famous Naval Dogfights we've all heard about.

But... - I've played and seen tons of Space sims and None have that level of Damage Emulation (Actually there might be one Indie Tactical capship title - but its name escapes me ATM or if it even does that). Every Space Sim uses the RPG styled Hit-points (Semantics aside). Run out of Hit (hull/armour/sheild) points and the ship goes boom.

To counter the HP advantage that a CapShip might have, Bombers have Ridiculously overpowered, but specialized Weapons (Think of the Super Slow Torpedos and Space Bombs from the X-wing/Tie-Fighter Series).

Add in the fact that we have instant hit Weapons (Beams) at various ranges and you see the problem.

With the bombers potency reduced by the Cap Ships effective PD beams, it makes more sense for the cap ship to close distance to bring more guns to bear. The Fighter/Bomber Dynamic is not as prevailant as in a Naval situation, because its lethality is less.
-----
This means we are looking at more Pre-Flight naval combat, where the Objective is to position yourself to bring the most guns to bear to the enemy's fewest.

I'm not 100% sure if that combat model is intended, but it is what exists. That said, there is a "Rebalance" section on the Wiki. Athough, it looks deprecated and I'm not sure of the Status of it - It might be something worth looking into if you have spare time :-)

Actually I want to test that now--- I need to find a Working Confed and Area Battleship --- One sec.....
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: Playing with the AI

Post by loki1950 »

have you been using the mission files to set up test situations since they are XML you should be ok setting them up as two flightgroups and sitting back and watching the fun ;)

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
denyasis
Hunter
Hunter
Posts: 75
Joined: Thu Mar 19, 2009 10:31 am

Re: Playing with the AI

Post by denyasis »

Actually - Just did that :-) Pretty Results :)

8 Goddards, 4 Pacifiers, 20 Doteskvy's (whatev), an Archimdes and 3 Kahan
vs
12 Areus, 20 Artisons, A Leonidas, and 3 Agasicles
---Stale mate - Leonidas got blown up though - Goddards turrets are deadly :-)

There's a kink in teh Mission files. While you assign the ships faction in the Mission file, somewhere, the ships factions are already hardcoded - so You can't say make an Arean Mule - No ship loads.

Interesting Note - The Battle was cool for the first 4 minutes, then the Cap Ships got distracted. I mean they started chasing Fighters and eventually everyone Spec'd their own Separate Ways...

This leads to me VegaPriorities.csv. I ASSUME it determines who targets what in a battle - But I can't make heads or tails of it (looks like the lower the number the more important it is?). I'll have to experiment and peruse the Source files a bit....
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: Playing with the AI

Post by loki1950 »

that does sound logical but then when has logic been followed by people in combat as it in itself is illogical :shock:

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
denyasis
Hunter
Hunter
Posts: 75
Joined: Thu Mar 19, 2009 10:31 am

Re: Playing with the AI

Post by denyasis »

yeah - I Think I'll have too look in teh source and try to find reference for it - If it works by the Golf Scroing Method - Caps ships should pretty much go at eachother and the Bomber's should go after the Cap ships as its written. Instead The goddards are killing the Artisons and the Cap ships are Specing off...

I'll replace the Goddards with Pacifier's to even it out and remove the possibilitiy of The Goddards' Turrets being Over Kill. I'll write my own test Priorities and See if I can Force the Ships to fight by excluding everything else - Then slowly add elements in :-)

Then I'm going to bed - Vacation ends aat 11Pm tommorrow - Need to re teach myself 3rd shift - bah!
denyasis
Hunter
Hunter
Posts: 75
Joined: Thu Mar 19, 2009 10:31 am

Re: Playing with the AI

Post by denyasis »

Well Vega Priorities does do something - Seeing the Capship level to "1" with regaurds to eachother made them go after eachother - Note - the Leonidas has some great forward weapons - ripped through all three Kahans with out blinkning. Archy was able to Spec in/out of range (actually smart), but definitely didn't have the fire power to do it... I'll have to play with the Priorities a little more once I finish more Event XML's - Might help with fine tuning some of the behavior
denyasis
Hunter
Hunter
Posts: 75
Joined: Thu Mar 19, 2009 10:31 am

Re: Playing with the AI

Post by denyasis »

Quick update - Added a starter version of the CapShip Events (its called Macho). The manuevering is very simple, so it just should need some basic fine tuning.

Initial Tests show the cap ships closing distance, chasing eachother, trying to get on eachothers weaksides while firing their main guns. Its actually kinda cool. I'm trying to find a strong balance so the Aera/Confed forces are pretty much equal in terms of lethality, but the Aeran cap ships are super deadly. The Agisicles (I know I can't spell - their corvette that looks like a formula 1 race car) is really making use of the new manuevers. It pretty much eats Kahans and Tesla's like there is no tomorrow :D
Mr. Bane
Merchant
Merchant
Posts: 35
Joined: Fri Feb 13, 2009 6:42 pm

Re: Playing with the AI

Post by Mr. Bane »

Few things to remember when trying to convert contemporary Naval Warfare with Space Warfare.

1. Armor on CNW (Contemporary Naval Warfare) is limited due to the fact that a sinking boat does no one good. Displacement is a real problem. In space this doesn't happen. Armor also happens to be getting a renewed focus in the USNavy. Being able to survive a fight is a big big thing. Ships aren't cheap at ALL.

2. There are 3 directions to move in space, not 2 like for CNW. Contemporary Submarine Warfare is a tedious thing that largely involves very smart men at the targeting helm and a few guesses. SW is very similar to this except you're going a lot faster. The bigger the boat the larger the signature, the larger the signature the easier it is to figure out where to fire that next missile or belt fed mass driver. Small ships will rule the space age. Especially if they can turn on heel like Babylon 5.

In Space Warfare we would see three class of combatants:

Escorts (Fighters)
Cruisers (Corvetts)
Capital Ships (Battleships)

Escorts fire on Capital Ships. 1 Capital Ship vs 10 Escorts means a dead Capital Ship. They simply can't hit those small moving signatures fast enough.

Cruisers fire on Escorts. They get completely blasted by a Capital Ship because they're easy to hit and they can't fire enough to take down a Capital Ship in a showdown.

Capital Ships fire on Capital Ships. It's really going to come down to whoever hits first and whom has the largest amount of escorts and cruisers.


Anyways! I'm digressing here. I can always offer my advice in tactics play, but I think I need a better computer before I start doing my own testing.
CPU: 1.6Ghz
RAM: 2Gb
Video Card: 128mb crap onboard.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: Playing with the AI

Post by loki1950 »

Code: Select all

CPU: 1.6Ghz
RAM: 2Gb
Video Card: 128mb crap onboard.
Not that bad i played and tested just about everything on my previous box it's just the video that is problematic and since you are running Ubuntu there is way less system overhead :wink: Try a few of the test missions in windowed mode and see what actually happens don't assume it won't work.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
denyasis
Hunter
Hunter
Posts: 75
Joined: Thu Mar 19, 2009 10:31 am

Re: Playing with the AI

Post by denyasis »

Mr. Bane wrote:Few things to remember when trying to convert contemporary Naval Warfare with Space Warfare.

Contemporary Submarine Warfare is a tedious thing that largely involves very smart men at the targeting helm and a few guesses. SW is very similar to this except you're going a lot faster.
That's the tricky part - We don't want Combat in VS to be boring - Hence we treat the fighters like it is WWII and the capships like its 1880. Otherwise we'de be looking a combat occuring Across an entire Star system using Guided SPEC missiles and Area Effect weapons. It sounds cool, but waiting 10 min for your missle to hit (and all you see is maybe the text msg in teh corner saying its dead), won't really wow too many players I think.



Ps- Here you go
aitestor.mission
This is an XML mission file I use to create tests for the AI. Linux right? Stick this in your mission directory and you should be able to load it as a command line arguement when you run VS (been a while for me for NIX's). Its preset to a larger scale battle between Confed and Aera Cap Ship types (Aera usually own)
You do not have the required permissions to view the files attached to this post.
Mr. Bane
Merchant
Merchant
Posts: 35
Joined: Fri Feb 13, 2009 6:42 pm

Re: Playing with the AI

Post by Mr. Bane »

but waiting 10 min for your missle to hit (and all you see is maybe the text msg in teh corner saying its dead), won't really wow too many players I think.
And I agree completely with this statement. I thought a little perspective might help though :D

It's been a while since I've played VS, going to boot it up tonight (Thanks Loki!), but remind me, do large ships have area based armor? For instance I can see a Kirov-class Battleship wading into the midst of a firefight if it had full frontal armor.
denyasis
Hunter
Hunter
Posts: 75
Joined: Thu Mar 19, 2009 10:31 am

Re: Playing with the AI

Post by denyasis »

20 second update - Still working on project. We got a PS2 as gift a little while ago, and having never owned a console, I decided to introduce myself to some of the classic games. I'm currently discovering FF VII for the first time (Don't spoil it! - I really have no clue what happens!!) and have been a little distracted from VS for the last few weeks - sorry

That aside, I've run into a problem with my testing and I can't figure it out. I mentioned earlier that cap ships would randomly spec away. Well, truth be told, this happenes everytime, in every test. Even in my first tests with just bombers attacking a cruiser.

This is a bigger problem when testing capships due to their weapon abilities. Making 2 large fleets of Capships would garuntee fights, but with ships spec'ing away randomly (at at random times during combat), consistent results don't happen.

Is there a way to turn off Spec? Perhaps in the config file?
Alternatively - is there a way to script the ships in the mission file to not spec out or perhaps force them to attack (manually set targets)?
--More alternatively - Can anyone think of any cap Capship vs. Something scenarios? Station perhaps? Which one (well armed is a pre-requisite)?
The mission file is still kinda foreign to me, sorry.
denyasis
Hunter
Hunter
Posts: 75
Joined: Thu Mar 19, 2009 10:31 am

Re: Playing with the AI

Post by denyasis »

ok, I've figured out a simple testing method for the Cap ships;

Essentially I'm taking a fleet of Cap ships and setting them loose on a Base. I'm still tring to figure out a good balance to get repeatble results (mostly figuring out what fleet/base combo to use).

Its a very limited test (do the Capships manuever the way I want), but it is informative:
The Cap ships will close to a "respectable range" and then strafe/circle the base keeping main guns on it (the hawking does this very well)
Cap ships can still be "distracted" by fighters/ bombers and will chase after them instead of going for the starbase launching them (that's gonna be hard to fix, suggestions welcome)

Once I figure out a good Fleet vs Base scenario, I can test the old vs New ai for effectiveness.
After that, I'll try to test fleet vs fleet with each using a different AI. It looks like you can specify an AI Python script in the mission file. In the python script you can point directly to an XML AI script (ie Sitting Duck), so I should be able to point the fleet's AI's to different XML files and see what happens (I hope).

Nice thing is, I'll probably have to do teh same thing for the future Fighter scripts, so that bridge will be crossed eventually :-)

So.....:

Any good cap ship vs base ideas?
Tried 8xHawkings vs Arean Military base. The base just lasts too long (after 15 min I quit). Is there a more powerful confed ship (or ship combo) that isn't so big it can't manuever? Or a weaker enemy base?
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: Playing with the AI

Post by TBeholder »

Mr. Bane wrote:In modern warfare Capital Ships stay away from the main fighting. Capital Ships are big targets, easy targets and as Pearl Harbor taught us all it takes is one or two bomb-strapped planes to sink a few.
Well, some it taught instead that a good point defence or timely target detection isn't a luxury but a vital necessity... what with all those weapons control systems and radars. As to "staying away", it's still at a range of capital ships' main weapons, it just changed from big guns to either missiles or planes.
Mr. Bane wrote: So Capital Ships, for the most part, should have long range weaponry.
The tactic is to destroy the enemy boat before they can reach a range to fire back.
I'd rather put it another way around: long range weaponry is big and thus carried by something big. Also, given that stationary forts may have much more mass to play with (in the space it also adds heat capacity), one needs a big ship to carry guns that that would affect them.
Mr. Bane wrote: how I'd simplify it:
If they can, close in only as far as the longest range weapon will apply.
If they come in too close then gain distance until the previous sentence applies.
Fire weapons until the target is dead. Don't move to engage, let the enemy run the gauntlet.
Of course, except they're unlikely to be able to run away from boats, so they must be well able to deal with such threats anyway.
Mr. Bane wrote:That is the offensive strategy. There is no defensive strategy for real capital ships.
"Just float somewhere around and shoot at any approaching enemy" seems to be good enough. :)
Mr. Bane wrote: These ships would be devastated if they were attacked. Most supercarriers stay in safe or close to safe waters, have an escort of Battlecruisers, and are well aware of their surroundings for 500+ miles.
But that's just ol' good specialization: it's better to have two things good in their roles than one half-assed hybrid. I.e. what we see is not that a mobile airbase is a crown of all the creation, but that really useable unit is a whole "supercarriers + escort" group. At sea, "capship + anti-submarine escort" is a sensible idea, but in space, well... And as far as protection against ships and missiles goes, they have to cover a sphere instead of a circle.
Mr. Bane wrote:The other type of, older, capital ship is the Kirov Battleship.
Check out the ordinance:
Yeah, a fully functional battleship needs a full set of weaponry, including lots of defensive systems. But isn't it the same in a group, just spread between specialist classes?
Mr. Bane wrote: 2. There are 3 directions to move in space, not 2 like for CNW. Contemporary Submarine Warfare is a tedious thing that largely involves very smart men at the targeting helm and a few guesses. SW is very similar to this except you're going a lot faster.
The bigger the boat the larger the signature, the larger the signature the easier it is to figure out where to fire that next missile or belt fed mass driver. Small ships will rule the space age. Especially if they can turn on heel like Babylon 5.
With submarines, detection is a problem. But in space anything worthy of shooting at is sort of glaring. Fire one thruster, get a gorgeous plasma tail. Then it's up to radar trying to identify targets in time and ECM vs. target lock. Once it's detected and trackable, it can be shot. Then it's dodging (while jamming guided kinetic weapons) and armor. Some space weapons works at or near lightspeed and thus aren't well dodgeable, so the ship's armor must hold at least most of these. It may be a "boat", but it should not be shredded by any glancing laser shot or irradiated through, so it needs at least few tons of armor per square meter to survive even things available right now.
As to the maneuerability, it depends on the choice of [FTL] drive and/or inertial compensator's properties, of course.
But still, as far as one can minimize a fighter to a long-range missile, the thruster with an absolute minimum of load wins a race, so armor and CIWS are more important than mobility... And for long-range radars, size matters too.
Mr. Bane wrote: Escorts fire on Capital Ships. 1 Capital Ship vs 10 Escorts means a dead Capital Ship. They simply can't hit those small moving signatures fast enough.
Why? It only needs to carry a few more laser turrets and guided missiles.
denyasis wrote:Cap ships can still be "distracted" by fighters/ bombers and will chase after them instead of going for the starbase launching them (that's gonna be hard to fix, suggestions welcome)
With which AI priorities? If they are still distracted even despite a great difference, maybe the function that interpretes them must be sharpened a bit.
If you want to freeze them, you can set them orbital parameters in data/sectors/special/modelview or where you test them. I tried to hang a Clyde like a base - it hangs still, it trades, only it's called "Natural phenomenon" in mission texts. But then they won't be able to choose a distance.
denyasis wrote: Tried 8xHawkings vs Arean Military base. The base just lasts too long (after 15 min I quit). Is there a more powerful confed ship (or ship combo) that isn't so big it can't manuever? Or a weaker enemy base?
Archimedes? Leonidas? Human Starfortress?
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
denyasis
Hunter
Hunter
Posts: 75
Joined: Thu Mar 19, 2009 10:31 am

Re: Playing with the AI

Post by denyasis »

hello;
With which AI priorities?
Standard SVN. As I mentioned before, I can't find any concrete documentation about that file (wiki is still down), so the last few times I've altered it, I'm really doing it blind. I think the LOWER the value, the HIGHER priority the target is and the range of values is 0-31. I'm not sure how a target is selected and what the exact effect of these values has on the selection process (I figure its in the cpp somewhere...).
So, because I can't predict what the exact effect of changing the file is, I'm using the Standard SVN version as much as possible in my testing assuming it was balanced and thought out by a person who knew more about the target selection mechanisms than I.
If you want to freeze them, you can set them orbital parameters in data/sectors/special/modelview or where you test them.
I'm interested in how you do that. I currently run my test in the stage sector, but i'm thininking of switching to a blank sector to see if it affects my SPEC problem. I don't want to totally freeze my ships, just make it so they don't randomly SPEC away. Even when I change the priorities, they still will spec away randomly and I have no clue why.
Archimedes? Leonidas? Human Starfortress?
Good idea! Just Tried it - Aparently the confed starfortress is akin to the Deathstar :shock: . In 3 minutes it ate 1 anadiximus and 3 leonidases (aeran fleet was 8x leonidas and 4x anadix whatev).
I scaled it down to human Fighter barracks vs 4 Leonidas and 4x Anadaximus. 3 of the Anadaximus SPEC away every time in the begining. The 4th will SPEC away a few minutes into the battle.
-The remaining cap ships, well, tend to hold their positions and fire lasers in every direction (trying to hit defense fighters... sigh)

-So I altered the Priorities file... Chaninging every Turret and cap ship to attack that base. The barracks gets nuked after about 5 minutes...

Still not totally happy with the cap ship combat. They tend to hold their positions between 10-70K out just rotating about an axis while firing thier turrets. I guess it makes tactical sense, but its not very exciting... I'll have to compare the new script to the original AI script in action and see if the new one really makes a difference. If not, back to the drawing board :D
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: Playing with the AI

Post by TBeholder »

denyasis wrote:I think the LOWER the value, the HIGHER priority the target is and the range of values is 0-31. I'm not sure how a target is selected and what the exact effect of these values has on the selection process (I figure its in the cpp somewhere...).
Seems so. I didn't found all relevant parts yet, but Looks like priorities are sorted out in getPhysicsPriority (src/cmd/unit_util_generic.cpp). Here VS parses variables in config, physics/priorities section and uses default values:
top=1, high=2, mediumhigh=4, medium=8, mediumlow=16, low=32; notvisible_combat_high=10, notvisible_combat_medium=20, notvisible_combat_low=40; no_enemies=64, inert=64;
playerthreat_distance_factor=2, threat_distance_factor=1
dynamic_throttle.enable=true, dynamic_throttle.mindistancefactor=0.25, dynamic_throttle.maxdistancefactor=4, dynamic_throttle.targetfps=30;
there's several formulae, threat factors are used together with simulation atom, dynamic throttle factors and weapons' ranges, apparently to decide whether a target is in position to kick the current unit's ass, or about to be in position, or it should look for more pressing issues.
So, indeed fighters and interceptors are left to the turrets, capships themselves has low priorities on them (30-31) and rather high (5, 2) on bases, but this still can be pushed slightly further.
denyasis wrote: assuming it was balanced and thought out by a person who knew more about the target selection mechanisms than I.
...and contains legacy or reserved lines like AERO and TROOP on purpose. Sure. ;)
denyasis wrote:
If you want to freeze them, you can set them orbital parameters in data/sectors/special/modelview or where you test them.
I'm interested in how you do that.
Just so. Here's Modelview.system with

Code: Select all

<Unit name="A Base" file="MiningBase" ri="2059833" rj="-400" rk="0" si="0" sj="-400" sk="2059833" faction="confed"  year="1118260" day="20700" />
So if you write instead

Code: Select all

<Unit name="Caravan" file="Clydesdale" ri="2059833" rj="-400" rk="0" si="0" sj="-400" sk="2059833" faction="merchant"  year="1118260" day="20700" />
...it will be merchants' Clyde at the same place. And so on.
denyasis wrote: I don't want to totally freeze my ships, just make it so they don't randomly SPEC away. Even when I change the priorities, they still will spec away randomly and I have no clue why.
I didn't tested yet, but looking at src/cmd/ai/aggressive.cpp there are vars: unit/aggressivity=2, AI/how_far_to_stop_navigating=100 (try this just in case), AI/afterburn_to_no_enemies=true, AI/safetyspacing=2500, AI/randomspacingfactor=4, AI/warp_to_no_enemies=true, AI/min_time_to_auto=25 (maybe it tries a correction and misses and if it's > 25 sec it engages autopilot?), AI/force_jump_after_time=120 (if they try to reach jump points), AI/warp_to_enemies=true;
denyasis wrote: Still not totally happy with the cap ship combat. They tend to hold their positions between 10-70K out just rotating about an axis while firing thier turrets. I guess it makes tactical sense, but its not very exciting...
Well, what else could they do?..
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
denyasis
Hunter
Hunter
Posts: 75
Joined: Thu Mar 19, 2009 10:31 am

Re: Playing with the AI

Post by denyasis »

Good point!

Thanks for the pointers to the cpp files. :D My days off are comming up, so I'll have some time to take a look at them. Unfortunately, I don't know any CPP, (I assume If I change something, I'll have to recompile the binary... umm do ppl have much sucess on windows? - I forsee it being overly difficult as it is well, windows), but the AI/warp_to_no_enemies might be what I want to disable the random SPEC'ing away. Is it possible to just list that arguement in the config file (I know, its a long shot, but hey, I gotta ask)?

Especially many thanks for finding the Priorities parsing in generic.cpp (would have never thought to look in there)!! I wonder what the notvisible values refer too, hrmm.

I know the decision to fight and aim/shooting (for lack of a better term) are in the CPP. I don't have a desire to change them, but understaning them might help make it easier to write xml scripts that integrate/match with the cpp AI better (like getting civillian ships to flee)

Thanks!
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: Playing with the AI

Post by TBeholder »

denyasis wrote: Unfortunately, I don't know any CPP, (I assume If I change something, I'll have to recompile the binary... umm do ppl have much sucess on windows? - I forsee it being overly difficult as it is well, windows)
As far as i understand, if you got IDE that eats VS project files, you just use them, if you'll use something else, you're alone in the dark. GCC is helped by shell scripts instead, so looks like there's no easy standard way.
Anyway, there's a lot to dig. As a comment in vegastrike/src/cmd/ai/ikarus.cpp line 58 tells us, "///you should certainly edit this!!". :) Ah, nice... in AI (vegastrike/src/cmd/ai/aggressive.cpp) it tries to use file "VegaPersonalities.csv", non-existent even as a stub. There's files like fighter.scared.xml or fighter.ace.xml in data/ai/events - but they aren't used anywhere at all, even in tests missions. It's one big, old, sticky, undocumented mess that all works on assumptions buried deep in the code. :(
denyasis wrote: but the AI/warp_to_no_enemies might be what I want to disable the random SPEC'ing away. Is it possible to just list that arguement in the config file (I know, its a long shot, but hey, I gotta ask)?
Yeah, in config AI section is just above physics, it's where "too_close_for_warp_tactic" and suchlike parameters are placed, just add variables you need to tweak if they are still implicit. As to physics/priorities/ - what i meant is a section in a section, just like existing

Code: Select all

<section name="graphics">
    ...
    <section name="hud">
        ...
        <var name="draw_weapon_sprite" value="false"/>
        ...
    </section>
    ...
</section>
So, if you want to add these, create subsection in physics:

Code: Select all

<section name="physics">
    ...
    <section name="priorities">
        ...
        <!-- default value; of course, you don't need this line unless you want something else -->
        <var name="dynamic_throttle.maxdistancefactor" value="4"/>
        ...
    </section>
    ...
</section>
denyasis wrote: I know the decision to fight and aim/shooting (for lack of a better term) are in the CPP. I don't have a desire to change them, but understaning them might help make it easier to write xml scripts that integrate/match with the cpp AI better (like getting civillian ships to flee)
While the choice is hardcoded, the basic conditions like hull integrity and distance are in data/ai/events, so it looks like this should involve a script somewhere there. Maybe if you copy fighter.scared.xml to civilian.scared.xml, simplify it for less maneuerable ships and slap on civilians, this would be enough.
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: Playing with the AI

Post by pheonixstorm »

This has so much promise.. why did it end???
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
safemode
Developer
Developer
Posts: 2150
Joined: Mon Apr 23, 2007 1:17 am
Location: Pennsylvania
Contact:

Re: Playing with the AI

Post by safemode »

non-VS life claims many. It's the leading cause of premature idea failure.
Ed Sweetman endorses this message.
Post Reply