[RELEASE] Towbar OXP v1.0

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 466
Joined: Mon Sep 17, 2018 5:01 pm

Re: [RELEASE] Towbar OXP v0.101

Post by Milo »

I can't reproduce your observation with Q-Charger increasing player.ship.speed. I see that velocity is increased with Q-Charger enabled compared to when it is disabled, but player.ship.speed remains the same whether or not I have Q-Charger working.
dybal
---- E L I T E ----
---- E L I T E ----
Posts: 499
Joined: Mon Feb 10, 2020 12:47 pm

Re: [RELEASE] Towbar OXP v0.101

Post by dybal »

Milo wrote: Sat Jul 04, 2020 1:12 am
I can't reproduce your observation with Q-Charger increasing player.ship.speed. I see that velocity is increased with Q-Charger enabled compared to when it is disabled, but player.ship.speed remains the same whether or not I have Q-Charger working.
You are right, my memory has played tricks on me again... :?

I turned on that trace I mentioned:

Source (in a 1s timer):

Code: Select all

    if (this.$fuelCounter % 30 === 0 && !_npcShip)
       log("SolarWind", _ship.displayName+": speed:"+_ship.speed.toFixed(0)+", maxSpeed:"+_ship.maxSpeed.toFixed(0)+", factor:"+(_ship.speed/_ship.maxSpeed).toFixed(2)+", vmagnitude:"+(_ship.velocity.magnitude()).toFixed(0)+", thrust: "+_ship.thrust.toFixed(1)+", maxThrust: "+_ship.maxThrust+", torus:"+_ship.torusEngaged);
Latest.log, cruising:

Code: Select all

23:18:03.545 [SolarWind]: Terrapin: Terrania: speed:251, maxSpeed:410, factor:0.61, vmagnitude:251, thrust: 47.8, maxThrust: 48, torus:false
Latest.log, Q-Charge:

Code: Select all

23:19:32.292 [SolarWind]: Terrapin: Terrania: speed:410, maxSpeed:410, factor:1.00, vmagnitude:808, thrust: 47.8, maxThrust: 48, torus:false
Now I wonder from where my HUD takes the value to display the speed... the number goes to 2x maxSpeed while using Q-Charger
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 466
Joined: Mon Sep 17, 2018 5:01 pm

Re: [RELEASE] Towbar OXP v0.101

Post by Milo »

My suggested fix for the market quantity/capacity issue did not work. I think the correct fix would be to replace several instances of 127 with the market capacity and leave the .quantity as it was. Revised code (goes in $Towbar_Payout, around lines 1297 and 1313):

Code: Select all

				if( q + sq > station.market[cargo.name].capacity ) q = station.market[cargo.name].capacity - sq;
				cr1 = Math.round( q * pr / 10 ); //cargo cost
				station.setMarketQuantity(cargo.name, Math.min(station.market[cargo.name].capacity, station.market[cargo.name].quantity + q));

...

				if( q + sq > station.market[cargo.vname].capacity ) q = station.market[cargo.vname].capacity - sq;
				cr2 = Math.round( q * pr / 10 ); //valuables cost
				station.setMarketQuantity(cargo.vname, Math.min(station.market[cargo.vname].capacity, station.market[cargo.vname].quantity+q));
dybal
---- E L I T E ----
---- E L I T E ----
Posts: 499
Joined: Mon Feb 10, 2020 12:47 pm

Re: [RELEASE] Towbar OXP v0.101

Post by dybal »

This is what I sent to phkb:

In towbar.js:

Code: Select all

this.$Towbar_Payout = function(ship) { //pay reward for the salvaged ship
    var r = worldScripts.towbar;
    var _pship = player.ship;
 ...
        var cr2 = 0;
        var ccr = 0;
        if( _pship.docked ) {
            var mc = worldScripts["mo-commodity_markets"]; //different buy and sell prices
            if( cargo.t > 0 ) { //can be negative if lost many cargo container durig towing
                var pr = station.market[cargo.name].price;
                if(mc && mc.$priceFactor) {
                    var id = mc.$commodities.indexOf(cargo.name);
                    if( id > -1 ) pr /= mc.$priceFactor[id]; //2-5% less
                }
                if( r.$TowbarDebug && mc ) log("Towbar", "id:"+id+" pr:"+pr+" mcpf:"+mc.$priceFactor);
                var sq = station.market[cargo.name].quantity;
                var maxq = (station.market[cargo.name].capacity != null ? station.market[cargo.name].capacity : 127);
                var q = cargo.t;
                if( q + sq > maxq) q = maxq - sq;
                cr1 = Math.round( q * pr / 10 ); //cargo cost
                if (this.$TowbarDebug) log(this.name, "commodity:"+cargo.name+", cargo_total:"+cargo.t+", capacity:"+maxq+", market_qtt:"+sq+", adjusted:"+q);
                station.setMarketQuantity(cargo.name, Math.min(maxq, sq + q));
                if( !r.$TowbarLimit127t && cargo.t > q ) {
                    log(this.name, (cargo.t-q)+" of "+cargo.name+" above market capacity (sold at half-price)");
                    cr1 += Math.round((cargo.t-q) * pr / 20 ); //half cost
                } else if (cargo.t > q) {
                    log(this.name, (cargo.t-q)+" of "+cargo.name+" above market capacity (discarded)");
                    cargo.t = q; //remains discarded
                }
                cr += cr1;
            }
            if( cargo.v > 0 ) {
                var pr = station.market[cargo.vname].price;
                if(mc && mc.$priceFactor) {
                    var id = mc.$commodities.indexOf(cargo.vname);
                    if( id > -1 ) pr /= mc.$priceFactor[id]; //2-5% less
                }
                var sq = station.market[cargo.vname].quantity;
                var maxq = (station.market[cargo.vname].capacity != null ? station.market[cargo.vname].capacity : 127);
                var q = cargo.v;
                if( q + sq > maxq ) q = maxq - sq;
                cr2 = Math.round( q * pr / 10 ); //valuables cost
                if (this.$TowbarDebug) log(this.name, "commodity:"+cargo.vname+", cargo_total:"+cargo.v+", capacity:"+maxq+", market_qtt:"+sq+", adjusted:"+q);
                station.setMarketQuantity(cargo.vname, Math.min(maxq, sq + q));
                if( !r.$TowbarLimit127t && cargo.v > q ) {
                    log(this.name, (cargo.v-q)+" of "+cargo.vname+" above market capacity (sold at half-price)");
                    cr2 += Math.round((cargo.v-q) * pr / 20 ); //half cost
                } else if (cargo.v > q){
                    log(this.name, (cargo.v-q)+" of "+cargo.vname+" above market capacity (discarded)");
                    cargo.v = q; //remains discarded
                }
                cr += cr2;
            }
            ccr = Math.round((cr1 + cr2)/10)*10; //store cargo credits to deduct from total to get ship value later
...            
Have cashed-in around 50 derelicts with this code, most of them limited-market "stations" like Rock Hermits and DSDs (I was a fugitive at the time)... there were a couple of bugs in the initial code, but I think all of them have been squashed (no surprises in yesterday playing)
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 466
Joined: Mon Sep 17, 2018 5:01 pm

Re: [RELEASE] Towbar OXP v0.101

Post by Milo »

I discovered an unintended consequence of my earlier suggested "fixes" for the commodity names. I inadvertently had some places where .$cargoname or setCargo was using a displayNameForCommodity formatted name instead of a raw cargo.name or cargo.vname (as appropriate). Consequently, I had pods with commodities in them named "Gem-Stones" or "Gold" (capitalized), which didn't match any manifest entries. So, while displayNameForCommodity() should be used for display, anywhere that sets .$cargoname or calls setCargo should use the cargo.name or cargo.vname or (or in one case cl[c].name) properties instead. Note that .t and .name are for cargo measured in tons while .v and .vname are for "valuables" cargo measured in g or kg (and a single Towbar scripted pod can contain some of both). And there's one place in $Towbar_Lose where in the consoleMessage just after the dumpCargo, the cname shouldn't use displayNameForCommodity because it's still set to "cargo" as a generic description for multiple types of cargo being dumped or lost in that clause or the clause below. If this all holds up in testing, I'll share the modified file.

Also, a balance opinion: Towbar gives too many credits. Especially when combined with OXPs like Ship Version that provide ships with expensive equipment, which Towbar then pays you for. A single derelict is worth thousands of credits, and you can just loiter in the space lanes and pick off offenders and fugitives (or clean up after NPC vs NPC battles, although derelicts from those are less common) and drag their ships to the station, or even wait to catch offenders and fugitives in the aegis, hit them until the pilots eject and then cash them in.
dybal
---- E L I T E ----
---- E L I T E ----
Posts: 499
Joined: Mon Feb 10, 2020 12:47 pm

Re: [RELEASE] Towbar OXP v0.101

Post by dybal »

Milo wrote: Sat Jul 11, 2020 11:54 pm
Also, a balance opinion: Towbar gives too many credits. Especially when combined with OXPs like Ship Version that provide ships with expensive equipment, which Towbar then pays you for. A single derelict is worth thousands of credits, and you can just loiter in the space lanes and pick off offenders and fugitives (or clean up after NPC vs NPC battles, although derelicts from those are less common) and drag their ships to the station, or even wait to catch offenders and fugitives in the aegis, hit them until the pilots eject and then cash them in.
True. I think the basic payout based on alloy mass is good, but the equipment payout pays too much for the expensive equipment... part of it is that some equipment is too expensive, and widespread with ShipVersion, ShieldEqualizer being the worst.

I didn't look at this code in detail, but here are my suggestions:

- since NPC equipment isn't damaged, implement a non-linear random function to determine if a equipment is damaged (the higher the TL, the higher the probability of being damaged), and pay a fraction of the normal payout price for the equipment
- implement a non-linear function for the equipment payout (the higher the acquisition price, the lower the payout percentage)
- change ShipVersion logic of awarding gear... in my installation I changed it to perfer to award ShieldCycler if present instead of ShieldEqualizer, and put a random on awarding ShieldEqualizer:

Code: Select all

            if (worldScripts["Shield Cycler"] && Math.random() < 0.6)
                ship.awardEquipment("EQ_SC_SHIELD_CYCLER_STANDARD");
            if( worldScripts["shieldequalizercapacitors"] ) {
                if (ship.equipmentStatus("EQ_SC_SHIELD_CYCLER_INTERNAL") !== "EQUIPMENT_OK")
                    // don't award Shield Equalizer if the ship already has Shield Cycler
                    if (Math.random() < 0.10) ship.awardEquipment("EQ_SHIELD_EQUALIZER");
                if( !small ) {
                    ship.awardEquipment("EQ_FORWARD_SHIELD_CAPACITOR");
                    ship.awardEquipment("EQ_AFT_SHIELD_CAPACITOR");
                }
            }
An iron-ass derelict should pay thousands of credits, but not tens of thousands as can happen now (ShieldEqualizer alone would get 15.000+)... I've got up to 75.000+ Cr from a derelict.
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 466
Joined: Mon Sep 17, 2018 5:01 pm

Re: [RELEASE] Towbar OXP v0.101

Post by Milo »

How about just dividing the current calculated equipment value by five times its natural log? So for example 15000 credits of equipment value becomes 15000/(5*ln(15000)) = 311 credits. It’s still more profitable salvaging than trading with a small cargo hold. I think we should also increase the likelihood of ships exploding when you try to tow them (or hit them with a tug drone) so less derelicts can be salvaged successfully.
dybal
---- E L I T E ----
---- E L I T E ----
Posts: 499
Joined: Mon Feb 10, 2020 12:47 pm

Re: [RELEASE] Towbar OXP v0.101

Post by dybal »

I think a salvage fee of 300 for a 75k equipment is too low... perhaps just dividing by 2*ln? I would prefer that fee around 3k, and making such expensive equipment rare (fiddling with ShipVersion), or reduce the ShieldEqualizer price (its way overpriced, IMHO).

With fee=(Price / (2 * ln(Price)) ):

ShieldEqualizer: 75k -> 3.3k Cr
ShieldCapacitor: 18.75k -> 950 Cr
ShieldBooster: 14.75k -> 770 Cr
Military ShieldBooster: 47.55k -> 2.2k Cr

That Iron-ass NPC would have bring around 8k of equipment salvage fees

I played around with a function-plotting tool to see the curve shape... what about this:

fee = 5*Price / sqrt(Price/2)

ShEq = 1940 Cr
ShCap = 970 Cr
ShBoo = 860 Cr
MShBoo = 1540 Cr

That Iron-ass would bring in 4200 Cr in equipment salvage fees
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6874
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Re: [RELEASE] Towbar OXP v0.101

Post by Disembodied »

This might be a useful guide - from the Wikipedia page on Marine salvage (my emphasis):
There are several factors that would be considered by a court in establishing the amount of the salvor's award. Some of these include the difficulty of the operation, the risk involved to the salvor, the value of the property saved, the degree of danger to which the property was exposed, and the potential environmental impacts. It would be a rare case in which the salvage award would be greater than 50 percent of the value of the property salvaged. More commonly, salvage awards amount to 10 percent to 25 percent of the value of the property.
dybal
---- E L I T E ----
---- E L I T E ----
Posts: 499
Joined: Mon Feb 10, 2020 12:47 pm

Re: [RELEASE] Towbar OXP v0.101

Post by dybal »

Disembodied wrote: Sun Jul 12, 2020 5:33 pm
This might be a useful guide - from the Wikipedia page on Marine salvage (my emphasis):
There are several factors that would be considered by a court in establishing the amount of the salvor's award. Some of these include the difficulty of the operation, the risk involved to the salvor, the value of the property saved, the degree of danger to which the property was exposed, and the potential environmental impacts. It would be a rare case in which the salvage award would be greater than 50 percent of the value of the property salvaged. More commonly, salvage awards amount to 10 percent to 25 percent of the value of the property.
The problem is that too many equipments have inflated prices, and are too common, so the return for salvaging those equipments wreaks game balance... there have been systems in which 30 in-game-days of hunting/salvaging got me 2+M Cr... money turns meaningless.

The formulae:
fee = 5*Price / sqrt(Price/2)

gives good results for prices above 2000 Cr: at 2k, it's 16%, at 5k it's 10%, at 10k its 7%, and at 50k it's around 3%, but bellow the price 2k it gives too much (in %, not in absolute values, which are <300Cr), so perhaps another formulae could be used for the lower prices?
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 466
Joined: Mon Sep 17, 2018 5:01 pm

Re: [RELEASE] Towbar OXP v0.101

Post by Milo »

I'm looking at it compared to other methods of earning credits. From that perspective, 4200 credits is a large profit. Rich industrial markets have computers at an average price of 62.1 cr, and poor agricultural markets have computers at an average price of 101.3. That is a 39.2 price difference. So you would need to trade around 107t of computers to match that 4200 salvage profit. Trading also decreases your service level with each witchspace jump, which eventually leads to maintenance expenses, whereas you can stay in the same system all day long fighting pirates and salvaging their ships without any service level reduction. While there can be other costs associated with salvage, such as repairing damage or replacing missiles, it's quite possible to win battles without taking any damage or using any missiles.

I don't think we should lower prices of OXP equipment or reduce the frequency of NPC ships having them. It's fine for them to have high prices; it gives a reason to earn more credits! The frequency of NPC ships having OXP equipment should be a combat balance consideration first and an economic consideration as a distant second (it's only an economic factor at all because of Towbar).

Since equipment is only part of the salvage value, and the total value is competing with other methods of earning credits, that argues for making Towbar pay even less for equipment. I do not think that salvage should be much more profitable than trading, which is where we are now. Keep in mind that most derelict ships are one military laser shot away from wreckage; they are very heavily damaged. I think this makes it possible to rationalize that the value of the equipment isn't much higher than scrap.

To clarify, my suggested formula of x/(5 * ln(x)) was not using x as price, but using x as the current Towbar-computed value, which is already adjusted. If Towbar today would pay 15k cr for certain equipment, with my proposed change it would instead pay 311 cr for the same equipment.

Note that although Towbar does apply a tax in "safer" systems, I think we should balance this with an assumption of no tax (Anarchy systems).

Having tested my revised formula a bit, I think the payout is good but the cost of tug drones should be reduced to 500 cr. Ideally, I would want to use tug drones for most derelicts while hauling the most valuable ones myself. Several small ships that I salvaged with tug drones paid just over 500 cr.
dybal
---- E L I T E ----
---- E L I T E ----
Posts: 499
Joined: Mon Feb 10, 2020 12:47 pm

Re: [RELEASE] Towbar OXP v0.101

Post by dybal »

Milo wrote: Sun Jul 12, 2020 6:12 pm
I'm looking at it compared to other methods of earning credits. From that perspective, 4200 credits is a large profit. Rich industrial markets have computers at an average price of 62.1 cr, and poor agricultural markets have computers at an average price of 101.3. That is a 39.2 price difference. So you would need to trade around 107t of computers to match that 4200 salvage profit. Trading also decreases your service level with each witchspace jump, which eventually leads to maintenance expenses, whereas you can stay in the same system all day long fighting pirates and salvaging their ships without any service level reduction. While there can be other costs associated with salvage, such as repairing damage or replacing missiles, it's quite possible to win battles without taking any damage or using any missiles.
So you have to have a ship with a big cargo bay to be able to get big profits trading - I think that's how it should be, it's close to reality: scale matters. And IMHO the market capacity of the main stations is too low for free-trading (that is, without contracts - I haven't been there to know how profitable cargo contracts can be) to be really profitable even with a big cargo ship.

Salvaging (as a career) is only really worthwhile in "interesting" systems (unless it's piracy and not salvaging), and there you can't avoid combat and it's not survivable without an Ironass ship, and even then you will have a pretty big repair bill often (missiles don't enter into it, if you are into salvaging you don't use missiles - they seldom leave a derelict behind).

Someone starting at it with a non-Ironass wouldn't get huge profits until they get that Ironass (and soon after that money looses its meaning, as it probably does in every career once you have the right setup and skills - I think most of the fun is in discovering the right setup and developing the skills): if they face the kind of foe that would bring in a huge salvage fee, they would do better running...

And while you can get NPC-created derelicts, they aren't common, and the places you can find them reliably (after quite a bit of searching even so) are dangerous places, where someone that doesn't want combat will have to run a lot (and get those huge repair bills quite often).

To get the Ironass NPC derelict that brings those multiple-K Cr in salvaging fees should be rare (jackpot!) for those that need money - they already aren't that common, but they could be rarer by not awarding expensive equipment that does nothing to the combat balance, specially if there is a cheaper alternative (more on that later)

You don't actually get internal damage at every witchspace jump, it comes in bigger damages every 8 or so jumps - that's something I would like to change, make the damage small, somewhat exponential to the service level (the poorer the greater the damage) and linear to the jump length (in LY, not time) so people in a hurry have to think about it, but happening at _every_ jump, and let the big damage to OXPs.
Milo wrote: Sun Jul 12, 2020 6:12 pm
I don't think we should lower prices of OXP equipment or reduce the frequency of NPC ships having them. It's fine for them to have high prices; it gives a reason to earn more credits!
I do think there are some equipment too overpriced (ShieldEqualizer, ShieldCycler Manual Configurator Advanced), but that's for the OXP's authors to decide... and us to use or not :lol:
Milo wrote: Sun Jul 12, 2020 6:12 pm
The frequency of NPC ships having OXP equipment should be a combat balance consideration first and an economic consideration as a distant second (it's only an economic factor at all because of Towbar).
Most of the OXP equipment we are talking about don't do anything in a NPC ship, their code are worldScripts. The NPCs having them or not doesn't affect combat balance.

ShieldEqualizer and ShieldCapacitors are player only (I tweaked a version into working with NPCs though)
ShieldCycler (with NShields) should work on NPCs, but doesn't most of the time (too many bugs in both, I have tweaked versions to make them work)
ShieldBooster and Naval ShieldBooster work most of the time for NPCs (with NShields, but if I recall correctly there were some bugs affecting it in some cases, but it might have been in the awarding code, not in the setup and damage handling code - though I would like to know the reason for using EQ_* strings different from the player version)

Right now the only thing most of those expensive equipment do in NPCs is make their salvage value go up.

(I would like to update those OXPs with my NPC enabling code - already asked about ShieldCycler maintenance status, have still to ask about ShieldEqualizer+Capacitos and N-Shields, they all have to be updated for it to work - but there is still the problem of removing the old manifests from oolite.org...)
Milo wrote: Sun Jul 12, 2020 6:12 pm
Since equipment is only part of the salvage value, and the total value is competing with other methods of earning credits, that argues for making Towbar pay even less for equipment. I do not think that salvage should be much more profitable than trading, which is where we are now. Keep in mind that most derelict ships are one military laser shot away from wreckage; they are very heavily damaged. I think this makes it possible to rationalize that the value of the equipment isn't much higher than scrap.
I think there is room for balance improvement, but the profitability should be compared on similar levels of gear investment/adequacy + skills: if you want to compare the earnings of a hunter/salvager able to bag those Ironasses NPCs (that come in groups of 4 to 12, and in the more "interesting" hunting grounds the large number is more common) you have to compare to someone with a big trader (400+ TCs: Anaconda, DTT Atlas, DTT Cyclops), not a Cobra Mark III (and I would like bigger market capacity for some commodities in some stations for those big cargo bays to make more of a difference)

Salvaging takes quite a bit of time: you have to move all those derelicts to some station, and it takes around half an hour for each with Towbar only (EscortDeck makes it a bit easier, if you have a big enough ship to have the wide deck). Often the main station is so far away, the way there so dangerous, that it's better to tow to another station and pay the 50% tax even in an Anarchy system.

But I would like to see NPC equipment getting damaged with the same mechanism as player equipment, that would make deciding equipment status for pricing depend on what actually happened to the ship and not a random and our guesses about probabilities.
Milo wrote: Sun Jul 12, 2020 6:12 pm
To clarify, my suggested formula of x/(5 * ln(x)) was not using x as price, but using x as the current Towbar-computed value, which is already adjusted. If Towbar today would pay 15k cr for certain equipment, with my proposed change it would instead pay 311 cr for the same equipment.
We will have to agree on disagreeing...

What I propose to Norby, if he thinks those considerations on game balance have merit, is to factor out the code that calculates the salvaged equipment price into a function, and anyone could write an OXP that overwrites that function (provided that all those Payout alternatives OXPs are marked incompatible with each other), and several pricing policies could be implemented and swapped just by changing the overwriting OXP (In terms of game balance, the player should choose... give him a challenging but manageable default and options to harden or soften it)

Something like this...
In towbar.js:

Code: Select all

this.$Towbar_Payout = function(ship) { //pay reward for the salvaged ship
    var r = worldScripts.towbar;
<...>
        var eq = ship.equipment; //local variable, faster
        var d = "";
        var eqs = 0;
        var hiddeneq = 0;
        var hiddeneqcr = 0;
        var lasthiddeneqcr = 0;
        var lasthiddeneqname = "";
        var maxeq = 5; // 5 equipment line can fit into the main part of the screen
        while( eq[++i] ) {
            if( eq[i] && eq[i].equipmentKey != "EQ_MILITARY_JAMMER") { //skip MASCM due to not fit into one line
                if( r.$TowbarDebug )
                    log("Towbar", ship.displayName+" "+
                        ship.entityPersonality+" "+(i+1)+". "+eq[i].name);
                d = "";
                var cr = this.$Towbar_EqSalvagePrice(eq[i]);   //<======================
                player.credits += cr;
                tc += cr;
                if( cr > 0 ) { // exclude 0 to fit into the screen with ShipVersion OXP
                    if( eqs < maxeq ) {
                        if(cr > 0) msg2 += "\nYou get "+cr+" credits for"
                            +d+" "+eq[i].name+".";
                        eqs++; //listed eqs only
                    } else { //hidden eq
                        hiddeneq++;
                        hiddeneqcr += cr;
                        lasthiddeneqcr = cr;
                        lasthiddeneqname = eq[i].name;
                    }
                }
            }
        }
<...>
}

this.$Towbar_EqSalvagePrice = function(eqInfo) {
    var p = eqInfo.price * 0.04; //max. 40% of the original cost in credits (not in credits*10)
    var rnd = Math.random();
    var cr;
    if( p > 300 ) {
//      rnd = rnd * ( 300 / p ); //costly eqs always damaged - removed, already cheap
        cr = Math.round(Math.max(50, Math.round( p * rnd ))/10)*10; //but at least 50cr
    } else cr = Math.round(Math.max(10, Math.round( p * rnd ))/10)*10; //at least 10cr
//  if( rnd < 0.5 ) d = " the damaged";
    return cr;
}
And suggest to change the equipment awarding in ShipVersion to award ShieldCycler (right now it doesn't, the Shield Cycler you see in NPCs was awarded by N-Shields)...

In shipversion.js:

Code: Select all

this.shipSpawned = function(ship) {  //do not give version numbers to cargo, etc.
<...>
/*** begin dybal ***/
            //if( !small && worldScripts["hardships"] ) {
            if( !small && wsHardShips ) {
/*** end dybal ***/
                ship.awardEquipment("EQ_ADDITIONAL_AFT_ARMOUR");
                if(ship.equipmentStatus("EQ_EEG")!="EQUIPMENT_OK") ship.awardEquipment("EQ_EEG");
                ship.awardEquipment("EQ_ESG"); //requires EEG
            }
            if (worldScripts["Shield Cycler"] && Math.random() < 0.7 && ship.equipmentStatus("EQ_SC_SHIELD_CYCLER_INTERNAL") !== "EQUIPMENT_OK" )
                ship.awardEquipment("EQ_SC_SHIELD_CYCLER_BASIC");
            if( worldScripts["shieldequalizercapacitors"] ) {
                if (ship.equipmentStatus("EQ_SC_SHIELD_CYCLER_INTERNAL") !== "EQUIPMENT_OK")
                    // don't award Shield Equalizer if the ship already has Shield Cycler
                    if (Math.random() < 0.10) ship.awardEquipment("EQ_SHIELD_EQUALIZER");
                if( !small ) {
                    ship.awardEquipment("EQ_FORWARD_SHIELD_CAPACITOR");
                    ship.awardEquipment("EQ_AFT_SHIELD_CAPACITOR");
                }
            }
User avatar
Milo
---- E L I T E ----
---- E L I T E ----
Posts: 466
Joined: Mon Sep 17, 2018 5:01 pm

Re: [RELEASE] Towbar OXP v0.101

Post by Milo »

Salvaging (as a career) is only really worthwhile in "interesting" systems (unless it's piracy and not salvaging), and there you can't avoid combat and it's not survivable without an Ironass ship, and even then you will have a pretty big repair bill often (missiles don't enter into it, if you are into salvaging you don't use missiles - they seldom leave a derelict behind)

And while you can get NPC-created derelicts, they aren't common, and the places you can find them reliably (after quite a bit of searching even so) are dangerous places, where someone that doesn't want combat will have to run a lot (and get those huge repair bills quite often).
Every system has some pirates. The safer systems have plenty of police to fight them, and you can join in at the end with a few hits to make a derelict with minimal risk, then haul it in for salvage.
Someone starting at it with a non-Ironass wouldn't get huge profits until they get that Ironass (and soon after that money looses its meaning, as it probably does in every career once you have the right setup and skills
The problem of money becoming meaningless needs to be addressed with money sinks (repair costs, consumable costs, fuel costs, etc.) and additional expensive things to collect (more ships for your hyperspace hangar [like pokemon, gotta collect them all], more ships for your escort deck, phkb's hermitage, etc.).
You don't actually get internal damage at every witchspace jump, it comes in bigger damages every 8 or so jumps
My point was that it's a cost only for traders, since salvagers don't need to travel. There is an infinite supply of pirates supplied by the repopulator in every system, and infinite police to fight them for you, so you can just wait for your opportunities with very little risk if you want to play that way...
Most of the OXP equipment we are talking about don't do anything in a NPC ship, their code are worldScripts. The NPCs having them or not doesn't affect combat balance.
I'm anticipating a future where most of the improvements you suggested to make equipment work for NPCs are implemented.
Salvaging takes quite a bit of time: you have to move all those derelicts to some station, and it takes around half an hour for each with Towbar only (EscortDeck makes it a bit easier, if you have a big enough ship to have the wide deck). Often the main station is so far away, the way there so dangerous, that it's better to tow to another station and pay the 50% tax even in an Anarchy system.
I haven't experienced this at all, it takes only a few minutes (real-time, not game time) to injector / torus my way to the main station with a derelict, and with telescope I can easily avoid most trouble on the way. Can you identify which of your OXPs are responsible for the danger you see?
But I would like to see NPC equipment getting damaged with the same mechanism as player equipment, that would make deciding equipment status for pricing depend on what actually happened to the ship and not a random and our guesses about probabilities.
This could be done by an OXP. Catch damage to NPC ships with event handler, apply whatever checks are needed to determine if the NPC shield simulation of your choice was bypassed, and then apply a random chance to setEquipmentStatus damaged, taking into account damage_probability from equipmentInfo. I think it's only worth doing that detailed simulation if you also change other things for NPCs based on damaged equipment. The performance overhead of doing this simulation for all entities in the system might be quite high, so perhaps limit it to ships that are being hit by the player only.
We will have to agree on disagreeing...
I disagree! We are working towards the same goal and if we reach different conclusions it probably means that there is some detail one of us sees that the other doesn't yet, which is why we're having this conversation. We obviously can have our own private tweaks, but let's not give up just yet on finding a formula that makes sense to both of us.

You're saying that salvage should be more profitable, and I'm saying it should be less. You're saying that salvage has high risk or time-to-credit ratio, and I'm saying that it has low risk and low time-to-credit ratio (can earn many credits fast). Those differences might be because of the set of OXPs we are using, as well as your additional tweaks to make some of the equipment work for NPCs, raising the danger level and consequently making you to go out of your way more when salvaging. I agree that the reward should be commensurate with the time and effort involved.
I think there is room for balance improvement, but the profitability should be compared on similar levels of gear investment/adequacy + skills: if you want to compare the earnings of a hunter/salvager able to bag those Ironasses NPCs (that come in groups of 4 to 12, and in the more "interesting" hunting grounds the large number is more common) you have to compare to someone with a big trader (400+ TCs: Anaconda, DTT Atlas, DTT Cyclops), not a Cobra Mark III (and I would like bigger market capacity for some commodities in some stations for those big cargo bays to make more of a difference)
I understand why you are looking at it this way, but to give you my perspective, my current ship is a Kirin Sport with 100t cargo capacity, and I'm seeing that I can make far more credits being a salvager than by trading. Once a ship has 80t or 100t capacity, I would expect to be able to earn more profits by trading than other career options, but Towbar currently defies that expectation by being too profitable.

Your suggestions about making trading more profitable by increasing market capacity for the benefit of ~400t cargo capacity ships are interesting but wouldn't change the balance for my case with a cargo ship with only 100t capacity, which is not as affected by market capacity limits.
dybal
---- E L I T E ----
---- E L I T E ----
Posts: 499
Joined: Mon Feb 10, 2020 12:47 pm

Re: [RELEASE] Towbar OXP v0.101

Post by dybal »

Milo wrote: Mon Jul 13, 2020 6:01 pm
Salvaging (as a career) is only really worthwhile in "interesting" systems (unless it's piracy and not salvaging), and there you can't avoid combat and it's not survivable without an Ironass ship, and even then you will have a pretty big repair bill often (missiles don't enter into it, if you are into salvaging you don't use missiles - they seldom leave a derelict behind)

And while you can get NPC-created derelicts, they aren't common, and the places you can find them reliably (after quite a bit of searching even so) are dangerous places, where someone that doesn't want combat will have to run a lot (and get those huge repair bills quite often).
Every system has some pirates. The safer systems have plenty of police to fight them, and you can join in at the end with a few hits to make a derelict with minimal risk, then haul it in for salvage.
True, but the player that chooses that play will pay in time (real time, and boredom, moving around waiting for a low risk opportunity). Mostly, I think that scenario isn't the main-play, but opportunities to be taken when they present themselves.
Milo wrote: Mon Jul 13, 2020 6:01 pm
Someone starting at it with a non-Ironass wouldn't get huge profits until they get that Ironass (and soon after that money looses its meaning, as it probably does in every career once you have the right setup and skills
The problem of money becoming meaningless needs to be addressed with money sinks (repair costs, consumable costs, fuel costs, etc.) and additional expensive things to collect (more ships for your hyperspace hangar [like pokemon, gotta collect them all], more ships for your escort deck, phkb's hermitage, etc.).
Yep! I was very happy when I discovered HyperSpaceHangar and started my collection!

And I'm "storing" Hermitage for when I get bored with my current play...
Milo wrote: Mon Jul 13, 2020 6:01 pm
You don't actually get internal damage at every witchspace jump, it comes in bigger damages every 8 or so jumps
My point was that it's a cost only for traders, since salvagers don't need to travel. There is an infinite supply of pirates supplied by the repopulator in every system, and infinite police to fight them for you, so you can just wait for your opportunities with very little risk if you want to play that way...
True, but at a cost of his time if low-risk, or repair bills if not...

And in safe systems it will be sparse pickings, and in not-so-safe (the "interesting") systems he will have to tag along police all the time to have low risk opportunities, because the regions where those conflicts occur have recurrent pirate gangs to pounce on him when he gets away from the 25 vipers.
Milo wrote: Mon Jul 13, 2020 6:01 pm
Most of the OXP equipment we are talking about don't do anything in a NPC ship, their code are worldScripts. The NPCs having them or not doesn't affect combat balance.
I'm anticipating a future where most of the improvements you suggested to make equipment work for NPCs are implemented.
I hope so. I'm getting close to be confident of having ironed out most of the bugs, so perhaps I will upload those modified OXPs to a file sharing and post a link for people willing to test them (I tested them a lot, but a single-tester is always biased by his game style and machine).
Milo wrote: Mon Jul 13, 2020 6:01 pm
Salvaging takes quite a bit of time: you have to move all those derelicts to some station, and it takes around half an hour for each with Towbar only (EscortDeck makes it a bit easier, if you have a big enough ship to have the wide deck). Often the main station is so far away, the way there so dangerous, that it's better to tow to another station and pay the 50% tax even in an Anarchy system.
I haven't experienced this at all, it takes only a few minutes (real-time, not game time) to injector / torus my way to the main station with a derelict, and with telescope I can easily avoid most trouble on the way. Can you identify which of your OXPs are responsible for the danger you see?
SpaceCrowds, if you Torus, and DeepSpace Pirates, to a lesser extent, if you don't.

I'm usually "interrupted" several times even in a 500km journey... yesterday, in a 300km stretch in Retila (G1), between the Kiota Manufacturing and Research Stations (no Kyota relocator, just Wildships), I was decanted 4 times from Torus by gangs of 6 to 12 pirates - it took 1 real-time hour to travel the 2900k from the Jaguar Co Base to the Kiota Research Station

And in the really interesting systems, there're enough populator pirates in the main lanes to make life interesting (my versions of SpaceCrowds and DeepSpacePirates log it when they spawn and remove things, so I can verify if they were responsible)
Milo wrote: Mon Jul 13, 2020 6:01 pm
We will have to agree on disagreeing...
I disagree! We are working towards the same goal and if we reach different conclusions it probably means that there is some detail one of us sees that the other doesn't yet, which is why we're having this conversation. We obviously can have our own private tweaks, but let's not give up just yet on finding a formula that makes sense to both of us.

You're saying that salvage should be more profitable, and I'm saying it should be less. You're saying that salvage has high risk or time-to-credit ratio, and I'm saying that it has low risk and low time-to-credit ratio (can earn many credits fast). Those differences might be because of the set of OXPs we are using, as well as your additional tweaks to make some of the equipment work for NPCs, raising the danger level and consequently making you to go out of your way more when salvaging. I agree that the reward should be commensurate with the time and effort involved.
I agree right now the inbalance is too great, we disagree in how much medicine the patient should take :lol:

The salvaging payoff now is too great, but I think what you are proposing is too low, perhaps because I'm taking for granted some changes in ShipVersion in this scenario, to make ShieldEqualizer much rarer, awarding more ShieldCycler (the Basic version is cheap), so not only the salvaging fee for the ironass NPC will drop a lot (from 20~70k to 3~7k, I guess), but the percentage of derelicts with those big values will drop a lot too... the average payoff would be much lower than now, with an occasional jackpot to enliven things up.

I'm not against fees so low for high end salvaged equipment, but that should be the lower range (even if the more probable part of the range) of the fees, i.e., not all times a piece of high-end equip is salvaged it necessarily gets that low a fee. The current implementation by Norby does a random between 0 and 40% of full value, with a bottom price of 50Cr or 10Cr depending on the full value of the item, but the probabilities are uniform, we should find a way to skew it to a probability curve more like 1/x than a constant p

But all that's a guess, which is why I'm proposing something "pluggable", to make it easier to try several approaches and judge the consequences
Milo wrote: Mon Jul 13, 2020 6:01 pm
I think there is room for balance improvement, but the profitability should be compared on similar levels of gear investment/adequacy + skills: if you want to compare the earnings of a hunter/salvager able to bag those Ironasses NPCs (that come in groups of 4 to 12, and in the more "interesting" hunting grounds the large number is more common) you have to compare to someone with a big trader (400+ TCs: Anaconda, DTT Atlas, DTT Cyclops), not a Cobra Mark III (and I would like bigger market capacity for some commodities in some stations for those big cargo bays to make more of a difference)
I understand why you are looking at it this way, but to give you my perspective, my current ship is a Kirin Sport with 100t cargo capacity, and I'm seeing that I can make far more credits being a salvager than by trading. Once a ship has 80t or 100t capacity, I would expect to be able to earn more profits by trading than other career options, but Towbar currently defies that expectation by being too profitable.

Your suggestions about making trading more profitable by increasing market capacity for the benefit of ~400t cargo capacity ships are interesting but wouldn't change the balance for my case with a cargo ship with only 100t capacity, which is not as affected by market capacity limits.
I don't disagree with you, right now you sure can make more credits by salvaging than any other career I tried but one. I'm now around something like 1200 salvaged ships and most of the $ came from ShieldEqualizer, and ShieldCapacitors, with Military Laser and Military Shield Enhancement a distant second - they pay almost as much but are much rarer (I've got snapshots of the Payout screen for most of those 1200 ships, so it's not just a feeling), which is the reason for my guess that dealing with them and their price range will drop the payoff dramatically.

But I feel 100 TCs is still too low a cargo hold to compete, that would be around 6k for milk-run round-trip, or around 6~10 low-end, 2~3 medium-end or a single high-end pirate derelict in my proposed fee schedule.

I think the solution would be to find ways to make some kinds of trading more profitable (and the game more interesting, I find trading as it is boring):

- higher market capacity for some medium to large margin commodities in some systems (up to the player to figure out the pattern) for the large holds;
- reward the risk for the medium range cargo bays: they should be profitable in ships fast enough / strong enough to fight their way in risky routes, like your Kirin, and that could be done by higher prices and buying capacity in buy-markets and higher availability and lower prices in sell-markets for dangerous systems (today the patterns I see are based on economy only, I didn't check the code; buy or sell could be based on economy, prices/capacity/availability on economy/population/traffic, and trader traffic should be related to risk) and/or cargo contracts (which might already be done, I don't know), but both should take time to be high profit: to work the pattern out in the first case or construct reputation in the second.

But that side of the equation should be in another topic... since this is Towbar, talking about salvaging here should be OK, but trading is topic hijacking :lol:
dybal
---- E L I T E ----
---- E L I T E ----
Posts: 499
Joined: Mon Feb 10, 2020 12:47 pm

[RELEASE] Towbar OXP v0.104

Post by dybal »

Version 0.104 is available on the Expansion Manager and here.

Changes:
  • used commodity name instead of commodity display name as cargo identification in cargo pods re-spawned when you scooped more than your available cargo space can hold (with display name as identification, the cargo couldn't be put into the player's ship manifest when the cargo pod was scooped later);
  • adjusted Laser Reductor to take into account the damage rate defined for the current weapon (because of high powered lasers other than Military Laser);
  • debug code to spawn derelicts just out the station when launching now spawn near the station where the player's ship is docked instead of the main station;
  • tweaked code that awards/remove EQ_DTADER to reduce the number of times it's added/removed while targeted;
  • upped Oolite minimum version to 1.81, removed code for older versions;
  • fixed bug that used commodity display name instead of name in lost-in-transit cargo pods;
  • fixed bug that removed rotation when reducing yaw and pitch while towing (affected ILS rotation-sync);
  • fixed bug in salvaged ship payout when the ship's cargo is beyond the local market capacity;
  • re-factored salvaged equipment pricing into a function, to make it easier to overwrite the pricing policy through other OXPs;
  • included port and starboard weapons (if any) in the salvaged ship payout; (yep, I have seen them in salvaged NPCs);
  • reduced payout for salvaged ship's equipment and weapons for better game balance;
  • some de-referencing for performance.
The salvaged equipment/weapons code was re-factored into the function: (in towbar.js, or worldScripts.towbar)

Code: Select all

this.$Towbar_EqSalvagePrice = function(eqInfo) {
    var p = eqInfo.price / 10; // credits (not in credits*10)
    var rnd = Math.random();
    var cr = 0;
    if (p > 20000)
        cr = Math.max(250, Math.round(p*(rnd*0.07))); //but at least 250cr
    else if (p > 10000)
        cr = Math.max(100, Math.round(p*(rnd*0.10))); //but at least 100cr
    else if (p > 300)
        cr = Math.max(50, Math.round(p*(0.1+rnd*0.15))); //but at least 50cr
    else if (p > 10)
        cr = Math.max(10, Math.round(p*(0.1+rnd*0.15))); //at least 10cr
    cr = Math.round(cr/10)*10;
    if (this.$TowbarDebug) log(this.name, "Original payout policy:"+eqInfo.equipmentKey+", price:"+p+", payout:"+cr+"("+(100*cr/p).toFixed(1)+"%), random:"+rnd.toFixed(4));
    return cr;
}
This policy pays from 10% to 25% for low-priced equipments, from 1% (due to the minimum of 100 Cr) to 10% for high priced equipments, and from around 1% (due to the 250Cr minimum) to 7% for the money-sinks. This is the "easy" version of the pricing policies: it will reduce the payout for iron-assed NPCs from the 20~50k to around 4~8k.

I already have a TowbarPayout OXP (the one I use in my gaming, I will publish it soon) with what I think as a "medium" pricing policy that would pay around 3k at most for the equipments of a NPC with naval energy unit, shield booster, military shield enhancement, shield equalizer and capacitors, Q-charge, military lasers forward and aft.

EDIT to spell out the new "default" salvaged equipment pricing policy
Last edited by dybal on Sun Aug 30, 2020 4:59 pm, edited 1 time in total.
Post Reply