Page 1 of 1

Is racketeering AI possible in 1.79?

Posted: Tue Jan 21, 2014 7:44 am
by Keeper
Looking at the 1.79 Priority AI documentation, I see how ships can have empty escort slots for "wandering escorts" who join the ship mid-flight.

Can this be made to happen to the player as well?

I'm thinking of two OXP possibilities if so:

1. A private security firm for which the player buys a renewable licence. A Clean player with such licence may be joined by ships from this security firm if they happen to run across the player in the safer systems.

2. A sort of pirate mafia. In the tougher systems, a gang goes around pirating. But, if the player pays "protection money" regularly, this gang will act as escorts for the player (idea being that the gang gets just as much -- or more -- money from the extortion as they would from selling your cargo). (Or maybe two levels -- one level, they leave the player alone; another level, for Offender or Fugitive players, they escort and even help fend off police for the player.)

The security firm idea could extend to having them patrolling around certain OXP stations, chasing off ships with bad reputations (including players of course). It does seem possible now to have ships patrol in the vicinity of OXP stations, if they are "grouped" with the station somehow, though I don't see how that grouping is done yet.

Re: Is racketeering AI possible in 1.79?

Posted: Tue Jan 21, 2014 5:17 pm
by cim
Mostly that's possible. The main difficulty however is with "escorting" the player - the player ship doesn't set escort positions which are needed to keep the escorts in the right non-combat formation, won't send escort commands (e.g. ship.requestHelpFromGroup()), has maxEscorts permanently at zero, and has a scan class of CLASS_PLAYER so the matching-scan-class rule will stop it gaining escorts. It might be possible to fake escort behaviour nevertheless, but not straightforwardly.

You can patrol around a station without being grouped with it - just write a waypoint generator which has some waypoints near the station's position and set the AI to patrol its waypoints. But to add the ships (so you could use an unmodified waypointsStationPatrol) to the station's group, just do station.group.addShip(ship) for each ship. Have a look at the this._addPoliceStationPatrol function in oolite-populator.js, which adds a police patrol near the main station, adds them to the station group, and sets them off with a patrolling AI.

Re: Is racketeering AI possible in 1.79?

Posted: Fri Jan 24, 2014 6:18 am
by Keeper
Hmm... Thargoid's old "Hired Guns" OXP might be adaptable. Instead of only spawning ships when the player buys a one-time contract, and instead of ships following the player from one system to another, perhaps the "Family" ships could spawn always when the player enters a certain dangerous system, but if the player previously (or recently enough) bought Protection Money, then the ships escort the player in the same way the Hired Guns did (only with less/no regard for the legality of what the player does). If the player had not bought Protection Money, however... zap zap zap.

Of course, that old OXP doesn't use any of the new javascript AI features. But maybe this whole racketeering idea doesn't actually need the new features after all.

Re: Is racketeering AI possible in 1.79?

Posted: Fri Jan 24, 2014 7:29 am
by Thargoid
Umm, that "old" OXP is designed for what is currently released, and as none of the JS-AI stuff is finalised and included in the core game yet (it's only in the beta-trunk) then it won't be in a released OXP, no. But given the timescales involved in the 1.79 release, I would think by the time it is released, an OXZ version which does may well be around.

Something along those lines was considered "eons ago" :roll: when I wrote the OXP, and I decided (after listening to comments and feedback) that such a persistent escorting would be very unbalancing for the game, hence why they are one-off journeys and quite expensive for that. But the concept is certainly do-able, as long as consideration is made for balance and also for the license of the OXP.

Re: Is racketeering AI possible in 1.79?

Posted: Sat Jan 25, 2014 4:47 am
by Keeper
Hmm, I dunno about unbalancing. If one doesn't pay the mob boss Protection Money, those ships attack the player. If the player buys the exorbitant Protection Money, he loses a lot of profits -- probably more than one could expect to lose in dumped cargo from the attacks, but at least the chance of dying is lessened.

I only meant "old" in that it was made a few years ago. Of course it still uses the current AI system, as you say.