Oolite Bulletins

For information and discussion about Oolite.
It is currently Fri Mar 22, 2019 6:15 am

All times are UTC




Post new topic  Reply to topic  [ 60 posts ]  Go to page Previous 1 2 3 4 Next
Author Message
PostPosted: Sun Mar 03, 2013 3:52 am 
Offline
Dangerous
Dangerous
User avatar

Joined: Mon Apr 30, 2012 9:33 pm
Posts: 84
Location: In your cargo bay, eating your chips.
Ok folks, I am now officially happy with the In System Trader!

We now have an optional bit of equipment:
The Autonomous Market Watch Unit, or A.M.W. Unit
Listing at 500 cr. at all good TL9+ Shipyards

Brought to you by Tripsa Tel-com.

The Unit will inform you when a commodity's amount or price has changed in the local system Market!

see OP for details!

_________________
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.


Top
   
PostPosted: Sun Mar 03, 2013 9:55 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2549
Location: Finland
Ok. Tested this quite a bit tonight. Got to the point where rats got seriously itchy. I was a bit amused that my Commander with 18 kills under belt and flying an Adder required 10 pirates to stop from making some in-system trading :D. Maybe some scaling of the number of foes would be in order? Anyway, I had no trouble injecting my way through and off I was to a nearby Kiota station to get some radioactives (BlOomberg and extra stations makes a nice moneymaking machine :wink:). When I got back, police had done it's job and there were tons of cargo canisters to loot. Docked, sold my cargo, fueled and off I go to get more radioactives and there's 10 new pirates waiting again! Injected through... and so on :(. I think this pirate part of this oxp needs some serious work to make it usable.

I really like the changing markets part (including the equipment). The friends part and the comms messages give some nice color as long as they don't get too repetitive and frequent (it happens easily, if the texts are too few and too 'special' and always trigger at the same point). The pirate part in my opinion does not work as visioned. Some randomization / scaling would be in order. And something needs to be done about that furball triggering every time I launch, it does not feel right. Ambush somewhere else? Maybe some special pirates?

Hope this helps to develop this oxp further, I see great potential in it. :D


Top
   
PostPosted: Mon Mar 04, 2013 12:33 am 
Offline
Dangerous
Dangerous
User avatar

Joined: Mon Apr 30, 2012 9:33 pm
Posts: 84
Location: In your cargo bay, eating your chips.
Quote:
Ok. Tested this quite a bit tonight. Got to the point where rats got seriously itchy. I was a bit amused that my Commander with 18 kills under belt and flying an Adder required 10 pirates to stop from making some in-system trading :D. Maybe some scaling of the number of foes would be in order? Anyway, I had no trouble injecting my way through and off I was to a nearby Kiota station to get some radioactives (BlOomberg and extra stations makes a nice moneymaking machine :wink:). When I got back, police had done it's job and there were tons of cargo canisters to loot. Docked, sold my cargo, fueled and off I go to get more radioactives and there's 10 new pirates waiting again! Injected through... and so on :(. I think this pirate part of this oxp needs some serious work to make it usable.

I really like the changing markets part (including the equipment). The friends part and the comms messages give some nice color as long as they don't get too repetitive and frequent (it happens easily, if the texts are too few and too 'special' and always trigger at the same point). The pirate part in my opinion does not work as visioned. Some randomization / scaling would be in order. And something needs to be done about that furball triggering every time I launch, it does not feel right. Ambush somewhere else? Maybe some special pirates?

Hope this helps to develop this oxp further, I see great potential in it. :D
I blame you for my lack of a social life, Spara. Just kidding!

1.35 has changed the way the pirates work, you get them less often and now instead of furballing the station they harass the spacelanes. This will effectively increase the wait time for Market changes as well as make those trips to other stations in the space lanes that much more hazardous.

I've also reduced the chances of a Station greeting and made the greetings a bit more random in nature.

Fixed as well is a bug that could change prices on you WHILE docked.

_________________
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.


Top
   
PostPosted: Mon Mar 04, 2013 6:32 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2549
Location: Finland
Quote:
I blame you for my lack of a social life, Spara. Just kidding!
What? You still have some? :lol:
Quote:
Fixed as well is a bug that could change prices on you WHILE docked.
I can see that you have gone through some effort to prevent the prices from changing while docked, but can't really see the reason for it. Except maybe some caution not to break other oxps. If you let the prices change while not in the market screen, it probably should not cause any trouble. It would make sense that the prices might change while fueling or doing something that passes the time.

Looking forward to test the latest version later today. Keep up the good work.


Top
   
PostPosted: Mon Mar 04, 2013 2:39 pm 
Offline
Dangerous
Dangerous
User avatar

Joined: Mon Apr 30, 2012 9:33 pm
Posts: 84
Location: In your cargo bay, eating your chips.
Quote:
]I can see that you have gone through some effort to prevent the prices from changing while docked, but can't really see the reason for it. Except maybe some caution not to break other oxps. If you let the prices change while not in the market screen, it probably should not cause any trouble. It would make sense that the prices might change while fueling or doing something that passes the time.

Looking forward to test the latest version later today. Keep up the good work.
That's exactly it actually, Want to keep this OXP 'friendly' to other OXPs, that and I want to avoid at all costs any changes which might have a player thinking they will pay one price while quite another gets deducted.

I could have it check for the Screen yes, but what if a change happened 'just as' the screen changed...
This actually happened to me when testing , Furs jumped about 20CR / TC , costing me much more than what was on the screen.

better IMHO to lock in a price set once docked until undocked.

_________________
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.


Top
   
PostPosted: Mon Mar 04, 2013 2:48 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2549
Location: Finland
Quote:
Quote:
]I can see that you have gone through some effort to prevent the prices from changing while docked, but can't really see the reason for it. Except maybe some caution not to break other oxps. If you let the prices change while not in the market screen, it probably should not cause any trouble. It would make sense that the prices might change while fueling or doing something that passes the time.

Looking forward to test the latest version later today. Keep up the good work.
That's exactly it actually, Want to keep this OXP 'friendly' to other OXPs, that and I want to avoid at all costs any changes which might have a player thinking they will pay one price while quite another gets deducted.

I could have it check for the Screen yes, but what if a change happened 'just as' the screen changed...
This actually happened to me when testing , Furs jumped about 20CR / TC , costing me much more than what was on the screen.

better IMHO to lock in a price set once docked until undocked.
Fair enough. Better play it safe. I have now tested this newest version for a bit and it feels much better. Markets feel more alive and I get occasional messages from friends (did not know I had any :D). Haven't encountered any pirates (except ds ones) yet though.


Top
   
PostPosted: Mon Mar 04, 2013 5:21 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Mon Apr 06, 2009 12:20 pm
Posts: 6310
Location: Aboard the Pitviper S.E. "Blackwidow"
Quote:
I get occasional messages from friends (did not know I had any :D).
Those would be Facebook-type "friends" then.. you know, the kind that wouldn't actually bother to attend your funeral.. :wink: :lol:

_________________
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied


Top
   
PostPosted: Wed Mar 06, 2013 2:03 am 
Offline
Dangerous
Dangerous
User avatar

Joined: Mon Apr 30, 2012 9:33 pm
Posts: 84
Location: In your cargo bay, eating your chips.
Well after much testing and revision I'd like to submit In System Trader for inclusion in the wiki OXPList,
Classified: mechanics OXP

-Overview-

In System Trader 1.4
By Dr.Tripsa 2013
Licence: CC BY 3.0
Requires Oolite version 1.77

-Description-

Introduces a "living market" to systems with rewards and risks for in system trading.

Periodically individual Commodities are "refreshed" at the Main Station and other stations using the system market. The prices and amounts available are intentionally in the normal range for any given system economy. The rate of refresh depends heavily on the number of traders in system at the time. More active traders means a faster refresh and vice-versa. In keeping the spirit of the game, black market goods such as Narcotics, Firearms and Slaves are not refreshed.

Introduces an In System Reputation.

Trade at various stations in system, be that cargo trade, passenger trade (such as in In System Taxi) or otherwise will slowly increase the players reputation in the system resulting in better parcel contracts from friends of friends. Additionally a well known player will be greeted periodically by the systems traffic control (on entering Station Aegis). A players reputation proceeds them in other systems as well, at least for a while. In the Ooniverse friendships can be short lived and absence makes the heart forget...

A reputation can be a bad thing as well, as the player becomes more well known so will their trade habits and routes. Opportunist pirates, or just a random trader the player may have rubbed the wrong way, may lay in wait along a players common routes in system to collect booty... or exact revenge for a perceived slight.

Introduces a new equipment.

The Tripsa Tel-com Autonomous Market Watch Unit, or AMW for short, will alert the player when a Commodity undergoes a change in the system. It will identify the commodity and direct the player to check the Market Datascreen (f8). This device is also movable between craft.
Price: 500cr
Availability: TL 9+ systems shipyards

-Compatibility-

Extensions which change or add Commodities, such as New Cargoes, will see only the base commodity types refreshed by this OXP.

Other OXPs which modify system markets, such as BlOomberg Markets will probably conflict with this OXP.

-Discussion-

The main BB thread is here - > http://www.aegidian.org/bb/viewtopic.php?f=4&t=13702

-Download-

Available here : http://dl.dropbox.com/u/9855374/In_Syst ... .4.oxp.zip

(others wishing to mirror may do so and those mirrors may be listed here as well)

_________________
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.


Top
   
PostPosted: Wed Mar 06, 2013 12:22 pm 
Offline
Intergalactic Spam Assassin
Intergalactic Spam Assassin
User avatar

Joined: Thu Dec 14, 2006 9:08 am
Posts: 9520
Location: a Hacker Outpost in a moderately remote area
You can PM maik for getting a Wiki account and create/edit the relevant pages yourself.

_________________
The Story — The Career — The OXPs


Top
   
PostPosted: Wed Mar 06, 2013 7:32 pm 
Offline
Dangerous
Dangerous
User avatar

Joined: Mon Apr 30, 2012 9:33 pm
Posts: 84
Location: In your cargo bay, eating your chips.
Thank you Commander McLane, I wasn't aware of the procedure to do it :)

_________________
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.


Top
   
PostPosted: Sat Nov 14, 2015 10:13 pm 
Offline
Average
Average
User avatar

Joined: Thu Nov 12, 2015 5:44 pm
Posts: 15
I'm pretty new to this, but here is the code that I've modified to make this work with 1.82. Anyone familiar with the market properties, I'd be glad of any comments or corrections. I didn't come up with a way to bring in both peak_import and peak_export. I created a multiplier based on peak_import.
example: price_economic = .5 and quantity_economic of .5
- Best Import will have price multiplier of 1.5 and quantity multiplier of 0.5
- Worst Import will have price multiplier of 0.5 and quantity multiplier of 1.5
- economy in the middle would have a price multipler of 1.125 and quantity multipler of .875
there are 8 possible choices ranging from -1 to 1 to multiply the price_economic and quantity_economic values by depending on distance from peak_import economy.

My assumption here is that a economy that is peak import will be the worst export.
Code:
var ChoiceName = CommNames[i];
var ChoiceCom = CommList[i];
var workingStation = system.mainStation;
// Create a multiplier based on commodities price_random property
var pmax = 1 + Number(workingStation.market[ChoiceCom].price_random);
var pmin = 1 - Number(workingStation.market[ChoiceCom].price_random);
var prand = Math.random() * (pmax - pmin) + pmin;
// Create a multiplier based on commodities quantity_random property
var qmax = 1 + Number(workingStation.market[ChoiceCom].quantity_random);
var qmin = 1 - Number(workingStation.market[ChoiceCom].quantity_random);
var qrand = Math.random() * (qmax - qmin) + qmin;
// Create a multiplier based on the commodities price_economic  and quantity_economic properties
//   - This also takes into account the peak_import property
var ecomult = [-1,-.75,-.5,-.25,.25,.5,.75,1];
var imp =  (7 - Math.abs(system.economy - Number(workingStation.market[ChoiceCom].peak_import)));  // 0 - 7 (7 = best import economy)
var peco =  1 + (workingStation.market[ChoiceCom].price_economic * ecomult[imp]);
var qeco = 1 - (Number(workingStation.market[ChoiceCom].quantity_economic) * ecomult[imp]);
// Compute new price
var myprice = Math.floor((Number(workingStation.market[ChoiceCom].price_average)) * peco * prand);
// Set new price
workingStation.setMarketPrice(ChoiceCom,myprice);
// Compute new quantity
var myqty = workingStation.market[ChoiceCom].quantity_average * qeco * qrand;
// Set new quantity
workingStation.setMarketQuantity(ChoiceCom, myqty);
Neal.


Top
   
PostPosted: Sun Feb 07, 2016 1:02 pm 
Offline
Deadly
Deadly

Joined: Tue Nov 10, 2015 1:59 pm
Posts: 175
I have picked up Neal's idea to bring In System Trader OXP up to date. I'm nearly finished, only some testing, license questions and trying to get in touch with Dr.Tripsa are left.


Top
   
PostPosted: Mon Feb 08, 2016 3:34 pm 
Offline
Deadly
Deadly

Joined: Tue Nov 10, 2015 1:59 pm
Posts: 175
JSON makes trouble. JSON.stringify works. JSON.parse doesn't. I saved the following missionVariable in the savegame:
Code:
<key>mission_IN_SYSTEM_TRADER_REP</key>
<string>{"Lave":{"reputation":1,"parcelRepCounter":1,"departure":180058019114.25272},"Reorte":{"reputation":0,"parcelRepCounter":0,"departure":180058088877.65167},"Quator":{"reputation":0,"parcelRepCounter":0,"departure":180058125770.58093},"Ra":{"reputation":1,"parcelRepCounter":1,"departure":180058129472.5497},"Relaes":{"reputation":3,"parcelRepCounter":3,"departure":180058171775.23315},"Zasoer":{"reputation":2,"parcelRepCounter":2,"departure":180058188773.99908}}</string>
For better readability:
Code:
<key>mission_IN_SYSTEM_TRADER_REP</key>
<string>
{
	"Lave":{
		"reputation":1,
		"parcelRepCounter":1,
		"departure":180058019114.25272
	},
	"Reorte":{
		"reputation":0,
		"parcelRepCounter":0,
		"departure":180058088877.65167
	},
	"Quator":{
		"reputation":0,
		"parcelRepCounter":0,
		"departure":180058125770.58093
	},
	"Ra":{
		"reputation":1,
		"parcelRepCounter":1,
		"departure":180058129472.5497
	},
	"Relaes":{
		"reputation":3,
		"parcelRepCounter":3,
		"departure":180058171775.23315
	},
	"Zasoer":{
		"reputation":2,
		"parcelRepCounter":2,
		"departure":180058188773.99908
	}
}</string>
But the following algorithm:
Code:
	var s = "";
	for (var a in this.IN_SYSTEM_TRADER_REP) {
		s += "''" + a + "'' :\n";
		for (var b in a) {
			s +=" ''" + b + "'' : " + a.b + "\n";
		}
	}
	log(s);
yields this output:
Quote:
''Lave'' :
''0'' : undefined
''1'' : undefined
''2'' : undefined
''3'' : undefined
''getOneToken'' : undefined
''substituteEscapeCodes'' : undefined
''Reorte'' :
''0'' : undefined
''1'' : undefined
''2'' : undefined
''3'' : undefined
''4'' : undefined
''5'' : undefined
''getOneToken'' : undefined
''substituteEscapeCodes'' : undefined
''Quator'' :
''0'' : undefined
''1'' : undefined
''2'' : undefined
''3'' : undefined
''4'' : undefined
''5'' : undefined
''getOneToken'' : undefined
''substituteEscapeCodes'' : undefined
''Ra'' :
''0'' : undefined
''1'' : undefined
''getOneToken'' : undefined
''substituteEscapeCodes'' : undefined
''Relaes'' :
''0'' : undefined
''1'' : undefined
''2'' : undefined
''3'' : undefined
''4'' : undefined
''5'' : undefined
''getOneToken'' : undefined
''substituteEscapeCodes'' : undefined
''Zasoer'' :
''0'' : undefined
''1'' : undefined
''2'' : undefined
''3'' : undefined
''4'' : undefined
''5'' : undefined
''getOneToken'' : undefined
''substituteEscapeCodes'' : undefined
Anyone any idea why? I already searched for a JSON bug or troubleshooting that contains something looking like this. Didn't find anything but I continue to look.

Edit: From the looks of it, JSON doesn't like nested objects. I'm still researching it.

Edit2: In the end, it looks like JSON does work the way it should. My algorithm seems to somehow create the error.

Edit3: Strings....*shakes his head*...strings.
''0'' : undefined
''1'' : undefined
''2'' : undefined
''3'' : undefined
''4'' : undefined
''5'' : undefined
are values of the string ''Zasoer''
for (var b in a) works off every position of the string (name) of a instead of the objects behind it...Give me back those precious hours of my life!

This works out far better:
Code:
var s = ""; 
for (var a in this.IN_SYSTEM_TRADER_REP) {
	s += "''" + a + "'' :\n";
	for (var b in this.IN_SYSTEM_TRADER_REP[a]) {
		s +=" ''" + b + "'' : " + this.IN_SYSTEM_TRADER_REP[a][b] + "\n";
	}
}


Last edited by ocz on Tue Feb 09, 2016 12:19 am, edited 1 time in total.

Top
   
PostPosted: Mon Feb 08, 2016 9:50 pm 
Offline
Deadly
Deadly

Joined: Tue Nov 10, 2015 1:59 pm
Posts: 175
Here it is, for testing purpose, but it should be done so far:In_System_Trader_1.5.oxz

Please leave comments.

Edit: Sorry, I'm late for the specifications, but I'm pretty occupied right now, therefore I have no time to post a thorough report of changes. Here's the version log of 1.5 though:

1.5 2015/02/08
  • OXP hijacked by ocz (at least for version 1.5)
  • License changes form "cc by 3.0" to "cc by-nc-sa 4.0"
  • Fixed for new commodity markets since oolite ver. 1.81 (pre 1.81 backward compatibility is broken now. Can be restored if demanded in http://www.aegidian.org/bb/viewtopic.php?f=4&t=13702 )
  • Deepened reputation system by saving reputation per system and recalculating it when returning in dependence on absence time.
  • Bonus increase in parcel reputation now is also bound to the systems.
  • Commodity cycling happens for all stations in the system on base of their own market properties. (Same commodity, same time.)
  • Fixed ambush pirate fleets attack behaviour. Before they stayed inactive, now they should attack.
  • The ambush pirate fleets now appear somewhere in front of the player, at the edge of the scanner range.
  • The ambush pirate fleets sizes are now also dependant on the worth of the player's ship. A Transporter shouldn't have to face 16 ships.
  • New version log as object. (I know I'm being a kid here, but I wanted to test this new idea.)


Last edited by ocz on Fri Feb 12, 2016 9:40 pm, edited 1 time in total.

Top
   
PostPosted: Mon Feb 08, 2016 10:01 pm 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 2251
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Quote:
Anyone any idea why?
I suspect it's because you need to run JSON.stringify on the sub-elements of the dictionary. JSON doesn't recurse down an object tree.

So, instead of just this:
Code:
	missionVariables.IN_SYSTEM_TRADER_REP = JSON.stringify(this.IN_SYSTEM_TRADER_REP);
Do this:
Code:
    var hold = {};
    for (var a in this.IN_SYSTEM_TRADER_REP) {
        hold[a] = JSON.stringify(this.IN_SYSTEM_TRADER_REP[a]);
    }
    missionVariables.IN_SYSTEM_TRADER_REP_store = JSON.stringify(hold);
Then in the startUpComplete routine, to restore your data do something like this:
Code:
    var hold = JSON.parse(missionVariables.IN_SYSTEM_TRADER_REP_store);
    for (var a in hold) {
        this.IN_SYSTEM_TRADER_REP[a] = JSON.parse(hold[a]);
    }
    
Very untested code, though!

_________________
My OXP's
YouTube: Oolite Teaser Trailer


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 60 posts ]  Go to page Previous 1 2 3 4 Next

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited