Page 1 of 2

Offender_traders.oxp now available

Posted: Wed Apr 20, 2011 8:41 am
by Commander McLane
A small alteration to the game mechanics, following a suggestion made by El Viejo:

Introduction

This OXP gives bounties to some of the normal trade ships in Oolite.

Overview

In unaltered Oolite traders added by the system populator are always clean. The player, however, gets marked as offender or fugitive for instance for hauling illicit commodities, or committing small violations.

On the other hand, quite a few traders do have illicit goods in their holds. Have they all scooped these goods, or bought them somewhere else than in the main station? Unlikely. This OXP attaches random bounties between 1 and 55 credits to some traders (currently 12% of all ordinary traders). It does nothing to non-traders, and it does nothing if the trader already has a bounty. Moray Medical Boats are excluded, because they're expected to legally carry narcotics.

The OXP does not change the cargo of ships with bounties. So they are not more likely to carry illicit commodities than without the OXP. It only attaches a random bounty to them and leaves it to the player's imagination how each single ship could have obtained its bounty.

Minimum Requirements

Offender_traders.oxp requires at least Oolite 1.74.

Download Location

This OXP is available for download via the [EliteWiki] Elite Wiki.

Enjoy! :D

Re: Offender_traders.oxp now available

Posted: Wed Apr 20, 2011 8:46 am
by Cody
Thanks McLane... I'll enjoy adding this to my game.

Re: Offender_traders.oxp now available

Posted: Wed Apr 20, 2011 11:58 am
by Mauiby de Fug
Ooh, excellent! I hadn't realised this wasn't done in-game. A simple tweak for added immersion! Thanks!

Re: Offender_traders.oxp now available

Posted: Wed Apr 20, 2011 1:49 pm
by Svengali
Oh, yes, fine. Cannon fodder and 'cheap' cargo*.

Better exclude ships with custom scripts.-)

**mumbles something about whitewashed cheating*

Re: Offender_traders.oxp now available

Posted: Wed Apr 20, 2011 1:56 pm
by Cody
I don't see it as that, Svengali... I have no need of cannon fodder, or cheap cargo. It's purely for immersion purposes, in my game.
Granted, some players may cash-in, I suppose, but 'whitewashed cheating'? Surely not.

Re: Offender_traders.oxp now available

Posted: Wed Apr 20, 2011 2:13 pm
by Commander McLane
Svengali wrote:
Oh, yes, fine. Cannon fodder and 'cheap' cargo*.
I am a little worried about easy bounties, too. I think I may tinker with this aspect. Perhaps the bounty should usually be in the range of 1-15 credits, with only rare fugitives (51-55), and only ships with larger cargo space being eligible for higher bounties? Currently it's just a random value from 1-55 which makes for a higher average.
Svengali wrote:
Better exclude ships with custom scripts.-)
Fair point. Seems a good way of excluding special OXP ships.

*****

I was toying with the idea of giving traders with bounties contraband as cargo, but decided against it. The biggest reason is that it would make things to complicated. Populator-added ships don't have cargo at all before they're killed. I would have to amend all ship scripts again, and add some cargopods in the shipDied-handler, depending on bounty. I don't want to go this way with every OXP. Also, I don't want additional cargo, but rather to determine a general chance for the spawned cargo to be one of the illicit commodities. And I want it on-the-fly, without creating shipdata. I think that's way to ambitious for a small adding-to-immersion OXP.

Therefore the cargo created for offender traders is still purely random. I think that's fine and doesn't break immersion. After all they will have illicit goods sometimes, and if they don't, you can easily explain that the cargo got destroyed in the explosion. After all, it's always only a fraction of the ship's total cargo which survives the blast.

All this OXP wants is give an option for the player who is wondering why he is the only one ever becoming offender after launching from a main station with illicit commodities aboard.

Re: Offender_traders.oxp now available

Posted: Wed Apr 20, 2011 2:26 pm
by Commander McLane
Okay, proposed new bounty calculation:

Code: Select all

this.shipSpawned = function(ship)
{
    if((ship.primaryRole === "trader" || ship.primaryRole === "sunskim_trader") && ship.script.name === "oolite-default-ship-script" && ship.name !== "Moray Medical Boat" && ship.bounty === 0 && Math.random() < 0.12)
    {
        ship.bounty = Math.ceil(Math.random() * 12);
        if(PS.target.cargoSpaceCapacity > 75 && Math.random() < 0.2)
        {
            ship.bounty += 43;
        }
    }
}
So ships with custom scripts are excluded. The bounty is limited to 1-12. Only for 20% of the ships with more than 75 tons capacity it will be from 44-55.

Does that sound more reasonable?

Re: Offender_traders.oxp now available

Posted: Wed Apr 20, 2011 3:27 pm
by Zireael
Commander McLane wrote:
Okay, proposed new bounty calculation:

Code: Select all

this.shipSpawned = function(ship)
{
    if((ship.primaryRole === "trader" || ship.primaryRole === "sunskim_trader") && ship.script.name === "oolite-default-ship-script" && ship.name !== "Moray Medical Boat" && ship.bounty === 0 && Math.random() < 0.12)
    {
        ship.bounty = Math.ceil(Math.random() * 12);
        if(PS.target.cargoSpaceCapacity > 75 && Math.random() < 0.2)
        {
            ship.bounty += 43;
        }
    }
}
So ships with custom scripts are excluded. The bounty is limited to 1-12. Only for 20% of the ships with more than 75 tons capacity it will be from 44-55.

Does that sound more reasonable?
Yes, it does. Still, I find the idea great.

Re: Offender_traders.oxp now available

Posted: Wed Apr 20, 2011 3:37 pm
by Svengali
Commander McLane wrote:
Does that sound more reasonable?
Yep! Muchas gracias .-)

Re: Offender_traders.oxp now available

Posted: Wed Apr 20, 2011 4:54 pm
by The Black Albatross
Maybe make high-bounty ships more likely to have escorts (or vice versa)?

Re: Offender_traders.oxp now available

Posted: Wed Apr 20, 2011 5:05 pm
by Eric Walch
Commander McLane wrote:
Moray Medical Boats are excluded, because they're expected to legally carry narcotics.
Actually has every ship with the string "Medical" in the ship name has narcotics on board. Assuming they all carry it legally, you should probably include them all by changing

Code: Select all

ship.name !== "Moray Medical Boat"
into

Code: Select all

ship.name.search("Medical") === -1

Re: Offender_traders.oxp now available

Posted: Wed Apr 20, 2011 6:23 pm
by Cmdr Wyvern
If a trader captian was stupid enough to load contraband, then he deserves an offender tag.
But not all offender tags are earned by hauling illegal cargo - it's just as easy to be branded an offender or worse by accidently shooting a Viper. No such thing as friendly fire in the eyes of Johnny Law...

Re: Offender_traders.oxp now available

Posted: Wed Apr 20, 2011 7:54 pm
by Commander McLane
Eric Walch wrote:
Commander McLane wrote:
Moray Medical Boats are excluded, because they're expected to legally carry narcotics.
Actually has every ship with the string "Medical" in the ship name has narcotics on board. Assuming they all carry it legally, you should probably include them all by changing

Code: Select all

ship.name !== "Moray Medical Boat"
into

Code: Select all

ship.name.search("Medical") === -1
Are there more ships with 'Medical' in their name? The only medical ship I can remember off the top of my head is Amen Brick's 'Hospitalship', which ironically doesn't have 'Medical' in its name.

Anyway, as it's an easy code change, it's done (and I corrected the bug from c&p'ing from the console, in case anybody noticed). Version 1.1 will be up soon.

Re: Offender_traders.oxp now available

Posted: Wed Apr 20, 2011 8:04 pm
by Commander McLane
Commander McLane wrote:
Version 1.1 will be up soon.
[EliteWiki] Done.

Re: Offender_traders.oxp now available

Posted: Thu Apr 21, 2011 2:55 am
by Switeck
An idea to consider... sunskim_trader ships are probably MORE likely to be offenders or fugitives. Most are certainly trying to get clean "off the radar" without causing a disruption by avoiding fights with bounty hunters and police ships. I'm assuming all but the most foolish have some smarts to them -- a trader with a fugitive rating going straight down the middle of the space lane to the main station is just BEGGING someone to attack them, not even having protection from "fellow pirates". (no honor among thieves! :lol: )
So only minor offenders and really dumb(tm) offender traders are likely to do that.
For them, you could change their offender calculation to something like this:
ship.bounty = Math.ceil(Math.random() * Math.random() * 55);
In theory, a bounty of 55 would still be possible, but it will be very unlikely...as Math.random() would have to be ~0.991-1 two times in a row. There's quite a few math tricks to generate "weighted curve" results. 8)

We can assume these offender traders have already done at least 1 jump, so even the sunskim_trader ships have a lower max bounty than run-of-the-mill pirates. But if you want, you could raise their bounty and use a double Math.random() for them as well.

Since the detection rate (via scanForOffenders in AI.plist) and "lawlessness" of systems also depends on the system's government type, it might be possible to increase/decrease the bounties based on that...and even have a higher proportion of sunskim_trader ships have a bounty in Corporate States -- and far fewer regular traders with a bounty...at least not for long. :twisted: In Anarchy systems they just don't care, because what few bounty hunters and police ships are around only attack if you're attacking other ships. Random Hits Space Bar bounty hunters might be an exception to that though...but it's usually not situated directly on the main space lane.

In my Switeck Mod OXP, the AI profiles for enteringPirateAI.plist, enteringTraderAI.plist, pirateAI.plist, and route1traderAI.plist try to change over to more appropriate AI types based on their bounty values. Check hold (checkForFullHold) doesn't work very well on newly spawned ships, so I didn't use that as well.