Suggestion - OXP for Pirate AI

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
BobSongs
Competent
Competent
Posts: 39
Joined: Tue Jan 31, 2006 8:34 am
Location: Montreal, Canada

Suggestion - OXP for Pirate AI

Post by BobSongs »

Mobs mobs MOBS! Trash mobs! Champions! No matter what game we play, we're always being beaten down, pestered, attacked, challenged, threatened... and we LOVE it! But how often have we found ourselves secretly bored with mob attack styles? Am I right? They show up. They fight because they're numerous. We pick them off one by one. And, of course... and predictably... the last pirate is still desperately trying to kill us when we've toasted all of his buddies. Maybe a bit too predictable?

So I have a suggestion for an OXP. The idea is: giving pirates a more extensive AI. I've scribbled down a few random ideas.

Sneakiness
Enemy ships that keep their guns cool and try to seem friendly! "We're all friends!" They cozy up to us like any merchant ships that share our fear of pirate attacks. They don't threaten at a great distance, because that might alert the player that trouble is coming. After all, pirates want to make a fast dollar too. Advance warning of their nefarious intentions might encourage their prey to turn tail and out-run them. Bad for business, you know. Tut tut.

Please note... these are suggestions to increase the randomness of pirate strategies. The pirate strategies would be very unpredictable.

Randomness
Nothing's more dull than mobs with a pre-determined set of responses: "attack blindly", "attack beyond all reason or hope of winning", etc. Something that I enjoyed about Elite on the Commodor64 was the intelligent pirate responses. I'd occasionally find myself attacked by, say, six pirates. After destroying two ships, the remaining four would break off and scatter. I'd wait. Nothing. Hmm. Increase speed and continue to the Coriolis station... and bam! Those cowardly pirates would come right back having regrouped! Destroy one more ship and the remaining ships leave for good. It "felt" like they calculated that their losses just weren't worth it. Pirates that don't have pimped-out ships are only brave in numbers. But the number need not go down considerably before they realize they're up against an unbeatable foe.

Betrayal - A Fun and Rare Occurrence
We know pirates are cowardly bullies. But why are all pirates so darn faithful to each other? We see them betray one another in movies or TV shows, etc. Why not in the Ooniverse? How I see it playing out: A large number of ships are bearing down on me. Suddenly a comm from one of the ships: "We're sick of you, Captain [insert cool pirate captain name here]! We've been eating hotdogs and beans since you took over! We're DONE with you!". Hope fills my heart! This is followed by another communication from the lead ship: "C'mon boys! Side with me against that traitorous first mate of mine and I'll give you all 20% extra from this kill! Are you with me?!" Then all hell breaks loose! Pirates are shooting at one another as they form two teams: both attempting to shoot each other down while getting in some shots at the player. But more frequently than this, of course:

Competition
Pirates come in all shapes and sizes. Some are solo rogues (like the player might decide to be). Others work in groups of two or three. There are also pirate teams that span systems! But booty is hard to come by, hard earned -- making the competition fierce!

Our ship appears in a very dangerous system. From our left comes a solo privateer hoping to make a fast kill. To our right comes a group of around 3 fast flyers. But they've noticed the privateer. Options now could include a message from the privateer to us: "Help me fight those guys off and I'll leave you alone when we're done!" So you both engage the group of 3. Once the last of those ships is broken up, the privateer could:

1. Go back on his word and start firing on us
2. Keep his word, disarm his weapons and let us go.
3. Half-and-half: he goes about scooping up any drifting cargo pods; but once he's done, he trains his guns on us again. However, his scoop time gives us a head start toward the space station.

Privateers?
Why not have rogue pirates that work alone, as WE work alone when we're playing? Not all pirates dread easy defeat when they're fully outfitted, right? I recall a time in Elite on Commodor64 when a ship drifted past me as if he was just some hard working soul. The ol' "two ships passing in the night." It made no aggressive moves. I hit F2 to watch it continue peacefully drift away from me. Suddenly it turned and shot my tail feathers! Honestly? I truly enjoyed the unpredictable nature of Elite's pirate ships.

Now I'll admit...
It's been a few years since I've played this game (Oolite). This latest version has inspired me to try it again. And I'm not sure just how much AI Oolite pirates have. It is quite possible that more than half of what I've suggested is in the game already, in some shape or form.

And I'll admit this is just a suggestion. I have no idea if these mod ideas would take years or minutes to code. So the first thing I'd enjoy reading is what sort of challenge(s) these ideas would pose. Does this pique anyone's interest?

Note: I have installed an OXP called Skilled NPCs. While this gives pirates a fiercer attack pattern, and that's fun indeed, this suggestion is more for adding randomness to pirate attacks and behaviour.
Last edited by BobSongs on Thu Apr 16, 2015 10:56 pm, edited 1 time in total.
Eschew obfuscation.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Suggestion - OXP for Pirate AI

Post by Cody »

BobSongs wrote:
And I'm not sure just how much AI Oolite pirates have. It is quite possible that more than half of what I've suggested is in some shape or form already in play.
The pirate AI in Oolite has improved markedly, and some of what you suggest may already be implemented - the guv'nor, cim, would know the details.
Have you seen the roles page of the Wiki? There's some stuff in the pirate section which may be of interest.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
BobSongs
Competent
Competent
Posts: 39
Joined: Tue Jan 31, 2006 8:34 am
Location: Montreal, Canada

Re: Suggestion - OXP for Pirate AI

Post by BobSongs »

Cody wrote:
BobSongs wrote:
And I'm not sure just how much AI Oolite pirates have. It is quite possible that more than half of what I've suggested is in some shape or form already in play.
The pirate AI in Oolite has improved markedly, and some of what you suggest may already be implemented - the guv'nor, cim, would know the details.
Have you seen the roles page of the Wiki? There's some stuff in the pirate section which may be of interest.
Ah! Thanks for the response. :D

I will give the pirate section a look-see. I know that making money to pimp the ship is important. Y'know, getting to the "Elite" status and all. But achievements aside, I look back fondly at the AI that was somehow wedged into the Commodor64 version of Elite. I chuckle as I think back at simple the game was in terms of graphics: wireframe mesh objects, a space station that would begin rotating in real time once the approach was such that the computer didn't have to generate the station, causing the rotation to speed up (and my ship to blow up). But with all that... I spent hours at it because the pirates felt... unusually real.
Eschew obfuscation.
Layne
---- E L I T E ----
---- E L I T E ----
Posts: 355
Joined: Sat Mar 28, 2015 11:14 pm

Re: Suggestion - OXP for Pirate AI

Post by Layne »

BobSongs wrote:
Privateers?
Why not have rogue pirates that work alone, as WE work alone when we're playing?

Slight pedantry, a privateer was a pirate who operated semi-legally under the sponsorship of a government, not a 'solo pirate'. Privateers in Oolite would be pirates who get a license to prey on ships belonging to an enemy of the government. In exchange the government turns a blind eye to their activities and takes a cut of the profits. Handy way for poorer governments to get larger navies then they can otherwise afford.

I very much like some of your ideas for enhanced pirate behavior. I'm always puzzled when I've just splashed three pirates and the one survivor insists on fighting to the death. Really, if they were smart, they'd either flee at that point or offer to split the salvage with me and call it even. Your idea also brings up the thought of uber-bands of pirates, perhaps huge fleets under the loose control of a local 'pirate king' or other charismatic leader. If you destroy too many of his raiders, you make yourself a target for revenge attacks?
Reports of my death have been greatly underestimated.
User avatar
BobSongs
Competent
Competent
Posts: 39
Joined: Tue Jan 31, 2006 8:34 am
Location: Montreal, Canada

Re: Suggestion - OXP for Pirate AI

Post by BobSongs »

Layne wrote:
BobSongs wrote:
Privateers?
Why not have rogue pirates that work alone, as WE work alone when we're playing?
Slight pedantry, a privateer was a pirate who operated semi-legally under the sponsorship of a government, not a 'solo pirate'. Privateers in Oolite would be pirates who get a license to prey on ships belonging to an enemy of the government. In exchange the government turns a blind eye to their activities and takes a cut of the profits. Handy way for poorer governments to get larger navies then they can otherwise afford.
I stand corrected! And happily so! I should have looked up the definition before using the word.
Layne wrote:
I very much like some of your ideas for enhanced pirate behavior. I'm always puzzled when I've just splashed three pirates and the one survivor insists on fighting to the death. Really, if they were smart, they'd either flee at that point or offer to split the salvage with me and call it even. Your idea also brings up the thought of uber-bands of pirates, perhaps huge fleets under the loose control of a local 'pirate king' or other charismatic leader. If you destroy too many of his raiders, you make yourself a target for revenge attacks?
Oh, delightful! Truly a delightful idea. Pirates should, in my humble opinion, be incredibly creative while possibly bringing in some level of stupidity. But if they've survived this far in their horrible thieving life-style, why is it that they seem to have no brains?

If I may?
The original Elite was inspiring because of its pirate AI. I truly never knew what to expect. And though the game looked like utter crap (wireframes on a Commodor64 -- yeeeesh), it had such a realism to it that I truly felt I had spent time in space against intelligent enemies.

I tested more modern "space" games as time went by. The part I found the most tiring and tedious was the enemy AI. Oh, the new game's missions and rewards and so on and so forth were fun, to say the least. But the enemies were far more stupid--tenacious beyond all reason. Long before the game was designed to "end", I quit it.

To be honest...
I have no idea how much coding or math or algorithms are required for some awesome Pirate AI. Truly, I don't. I could be asking for the moon or a cup of tea. However, after a fight against 6 or so pirates, it would be truly enjoyable having experienced something that had an element of randomness to it that made this battle feel unique.
Eschew obfuscation.
Layne
---- E L I T E ----
---- E L I T E ----
Posts: 355
Joined: Sat Mar 28, 2015 11:14 pm

Re: Suggestion - OXP for Pirate AI

Post by Layne »

BobSongs wrote:
The original Elite was inspiring because of its pirate AI. I truly never knew what to expect. And though the game looked like utter crap (wireframes on a Commodor64 -- yeeeesh), it had such a realism to it that I truly felt I had spent time in space against intelligent enemies.

Theater of the mind, or something like that-- games like Elite give a framework and our imagination does the rest. If a game is good, we fill in the details that graphics can't achieve. Even Oolite, as nice as it can look with the proper oxps (and there are some fantastic ones for eye-candy) still requires a suspension of disbelief on the part of the player.

Actually, now that I think about it, actual privateers would be a fun twist to pirates. You're under attack, and the police show up, and you're thinking, 'hooray, the cavalry,' only to have them shrug and pass by with a message to the pirates to keep up the good work! It seems you've got a bounty on your head and the local pirates work as thugs for the police!

In terms of coding, perhaps what's needed is a morale stat. Pirates in a group all get a bonus for 'bravery'. Each ship destroyed knocks points from that score, and random 'fight or flight' checks are done every so often to see who stays. Destroy the leader and that's a bad knock to morale (or, if the leader was unpopular, a chance for another pirate to say, 'I never liked that guy! I'm in charge now! Follow me and attack!') and increases the chances of others fleeing. Other variables like ship damage, proximity of police or other reinforcements, etc, would all tweak the morale up or down. Maybe even add things like pirates attacking each other for cowardice. One pirate breaks and tries to flee, and the others turn on him. There should always be a slight random element to their decisions to make it seem more like there's a real person in that fighter. Like you, I'm not a programmer and can't say what's possible in the system, though...
Reports of my death have been greatly underestimated.
User avatar
BobSongs
Competent
Competent
Posts: 39
Joined: Tue Jan 31, 2006 8:34 am
Location: Montreal, Canada

Re: Suggestion - OXP for Pirate AI

Post by BobSongs »

Layne wrote:
BobSongs wrote:
The original Elite was inspiring because of its pirate AI. I truly never knew what to expect. And though the game looked like utter crap (wireframes on a Commodor64 -- yeeeesh), it had such a realism to it that I truly felt I had spent time in space against intelligent enemies.
Theater of the mind, or something like that-- games like Elite give a framework and our imagination does the rest. If a game is good, we fill in the details that graphics can't achieve. Even Oolite, as nice as it can look with the proper oxps (and there are some fantastic ones for eye-candy) still requires a suspension of disbelief on the part of the player.
How you so aptly put it. I was describing to my son what it was like to play: how I envisioned myself in the station negotiating with criminal gangs to have crates of weapons sent to my ships holds. Then, after a sleep in a fine station hotel I held a clandestine meeting with a slave trader. It would take some negotiation to get him to agree to let me haul his slaves, but in the end we'd work out a deal. All this... from a menu (F8) that kinda looks like a list of food at McDonald's! Yes: "theatre of the mind" is a brilliant way of phrasing it.
Layne wrote:
Actually, now that I think about it, actual privateers would be a fun twist to pirates. You're under attack, and the police show up, and you're thinking, 'hooray, the cavalry,' only to have them shrug and pass by with a message to the pirates to keep up the good work! It seems you've got a bounty on your head and the local pirates work as thugs for the police!
Oh YES! Toss another log on the fire! That's the thinking! Can you see it? a "Pirate OXP" that contains so many different scenarios -- some more elaborate, complete with dialogue while others are simpler -- that truly enhances the "theatre of the mind." Privateers, solo aggressors, passive police (love that idea), and so forth. Bring them on.
Layne wrote:
In terms of coding, perhaps what's needed is a morale stat. Pirates in a group all get a bonus for 'bravery'. Each ship destroyed knocks points from that score, and random 'fight or flight' checks are done every so often to see who stays. Destroy the leader and that's a bad knock to morale (or, if the leader was unpopular, a chance for another pirate to say, 'I never liked that guy! I'm in charge now! Follow me and attack!') and increases the chances of others fleeing. Other variables like ship damage, proximity of police or other reinforcements, etc, would all tweak the morale up or down. Maybe even add things like pirates attacking each other for cowardice. One pirate breaks and tries to flee, and the others turn on him. There should always be a slight random element to their decisions to make it seem more like there's a real person in that fighter. Like you, I'm not a programmer and can't say what's possible in the system, though...
These elements would definitely help to regulate how our pirates would respond. I play an MMO called Guild Wars 2. While the mob AI is kinda limited, I've noticed something interesting. If I enter a Level 80 zone and I'm only Level 40, I just have to enter the furthest reach of a mob's sense of smell, so to speak, and it comes charging to kill me. And yet, enter the same zone at level 80 and I can approach quite close to it before it responds. I guess I'm saying: even pirates must have SOME sort of sensors, no? Something they'd use to find out just how pimped my ship is? A single Krait against my military lasers, powerful shielding... it should think twice. However, if it has its buddies along with it, it might be more courageous.

Another thought. Pirate sensors. Does a pirate currently have more determination depending on my cargo? I mean, if I'm hauling 35 tons of food for a slim local profit versus 35 full cargo containers of gems... or top-price computer equipment -- it would give a whole new sense of realism if a pirate comm'ed us to say: "Bah, you've only got garbage in your cargo bays. You should haul something of value!" Again, this would be just one of a number of random responses, and never a constant. Some pirates would gladly tear my ship to shreds for some near-worthless cargo. The idea is: pirate response to one's haul would be a breath of fresh air.

One last word: I do wish to make something perfectly clear, as I'm sure many folks say when they suggest an OXP. This game is fun. I am very pleased that it is out. It is open-sourced, it's loved and maintained, it is OXP'ed beyond my expectations with some brilliant ideas, some of which appear to have been adopted into the game since the old 1.5 or so days. Kudos to all who shed blood, sweat and tears to make Oolite what it is.

This OXP request is not a statement to the opposite, but rather: a twist of lemon to an already delightful drink.
Eschew obfuscation.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Suggestion - OXP for Pirate AI

Post by Smivs »

BobSongs wrote:
...even pirates must have SOME sort of sensors, no? Something they'd use to find out just how pimped my ship is? A single Krait against my military lasers, powerful shielding... it should think twice. However, if it has its buddies along with it, it might be more courageous.

Another thought. Pirate sensors. Does a pirate currently have more determination depending on my cargo? I mean, if I'm hauling 35 tons of food for a slim local profit versus 35 full cargo containers of gems... or top-price computer equipment -- it would give a whole new sense of realism if a pirate comm'ed us to say: "Bah, you've only got garbage in your cargo bays. You should haul something of value!" Again, this would be just one of a number of random responses, and never a constant. Some pirates would gladly tear my ship to shreds for some near-worthless cargo. The idea is: pirate response to one's haul would be a breath of fresh air.
Well, they've got the same sensors that you have, and you can't tell how well equiped other ships are, or what cargo they are carrying, so they can't either. It's a nice idea, but one that rather un-balances the game in favour of the NPCs. I'd always like to see more realistic AIs, but giving superior not-available-to-player equipment to NPCs is a different matter and is something that I'd normally try to avoid.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Suggestion - OXP for Pirate AI

Post by cim »

Some of this is already there in Oolite 1.80 - the rest definitely sounds interesting for an OXP.

The pirates (and all other groups, for that matter) do currently do odds calculations in the fights - if you kill most of them the rest may try to run - and these are based on the ships involved rather than just a headcount. If you aren't looking, you may never notice the small pirate group quietly sneaking out of sensor range without attacking. Before combat starts the calculation is just done based on the ship itself; after combat starts the ship's equipment and pilot's skill is also considered. (If the player has a high combat ranking, they may sometimes be considered famous enough that everyone knows their ship is dangerous and calculates the odds accordingly even before the fight starts)

Destroying the leader of a pirate group does affect their behaviour - but again it may not be noticeable to the player in the middle of a dogfight where everyone's immediate priority is "try not to die" that this has taken place. Some groups will appoint a new leader if they survive the fight; others will end up rather disorganised and just flee back to the nearest safe harbour.

(A problem is that a player with military lasers can probably destroy all the fleeing pirates before they get out of sensor range - or at least all of them but one Krait with injectors - so they never do get to see them regroup, recharge their shields, and depending on their losses either decide to call it a day and return to base or ready for an attack on the next trader)

The largest pirate groups send off heavily armed and shielded Asps or Fer-de-lances out of the way of the group. Their job is mainly to intercept police patrols and bounty hunter packs: they aren't trying to win the fight, though they have the firepower to do a bit of damage - but with their injectors and hit-and-run tactics they'll sometimes delay the patrol long enough that it only reaches the scene of the crime after all the cargo has been scooped.
(These ships won't usually attack the player, unless the player has been doing a lot of bounty hunting locally, but they will intervene in any existing fight where pirates are being attacked)

The Comms Pack A OXP makes some of this more obvious by switching a lot of the in-group communications around target selection, individual and group retreats, and so on to public comms channels.
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6885
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Re: Suggestion - OXP for Pirate AI

Post by Disembodied »

BobSongs wrote:
Pirates should, in my humble opinion, be incredibly creative while possibly bringing in some level of stupidity. But if they've survived this far in their horrible thieving life-style, why is it that they seem to have no brains?
Because crime of any sort is a last-ditch occupation for the terminally hopeless, usually. There are, for example, a tiny number of highly skilled thieves and cat-burglars: most burglaries, though, are carried out by people whose skill set extends about as far as heaving a brick. Should there be some superstar pirates? Yes - and I think the game can provide them, now and again: but most of them are only in the job because they can't do anything else, either through lack of opportunity, or lack of talent, or both. A pirate's principal job is to scare cargo out of defenceless merchants, and not to actually take part in protracted mortal combat if they can possibly help it.

There has to be a balance struck between realism and fun, too: many people complained that 1.80's improved AI, with its more cautious approach to combat odds, made the game too hard: players were either swarmed by gangs, or unable to come to grips with one or two ships that they could have coped with. Hostile NPCs should be there to provide players with a satisfying challenge - sometimes the player should have to run away, definitely, but if all, or even most, pirates are well-armed and intelligent then the player wouldn't stand much of a chance as either a merchant or as a bounty hunter.
Layne
---- E L I T E ----
---- E L I T E ----
Posts: 355
Joined: Sat Mar 28, 2015 11:14 pm

Re: Suggestion - OXP for Pirate AI

Post by Layne »

Smivs wrote:
Well, they've got the same sensors that you have, and you can't tell how well equiped other ships are, or what cargo they are carrying, so they can't either. It's a nice idea, but one that rather un-balances the game in favour of the NPCs. I'd always like to see more realistic AIs, but giving superior not-available-to-player equipment to NPCs is a different matter and is something that I'd normally try to avoid.
Depends on how the mechanic is couched. We already have pirates/assassins who know your ship and will intercept based on certain passengers or parcel runs ('You should never have dealt with Blank McBlanky!'), so having bribed a station master or cargo loader to get a detailed manifest wouldn't be a stretch to add. Pirates can 'know' you bought gems and platinum at the last dock-- they don't have to scan you, they just have to know your ship and follow your wormhole.
Reports of my death have been greatly underestimated.
Post Reply