[Release] Market Observer

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

Moderators: another_commander, winston

User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2676
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: [Release] marketObserver 2.3.2

Post by spara »

A new version (3.0.1) for Oolite trunk (1.81), that is compatible with the new Commodity Markets OXP (2.0) is up.

Image

Download: https://app.box.com/s/fr1aodztyo73lzz969pw
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2676
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: [Release] marketObserver 2.3.2

Post by spara »

New version (3.0.2) for Oolite 1.81 (trunk).

* Advertisement handling simplified tremendously by using drawCustomImage.
* Removed simple text-only ads. Ads on-screen are so tiny that you usually can't read small text.
* Ads are now fully random. Previously they were random preselected pairs.

Download: https://app.box.com/s/23dk21l3ugg6vl6ig2xobsvsouw6emn7
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2676
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: [Release] marketObserver 2.3.2

Post by spara »

A new version (3.1) for 1.82 is available from the manager.

The old version (2.x) was bloated with features and this new version makes a much needed downgrade of features and streamlining of code and functionality. In other words, it's better :mrgreen: .

Features:
* Average of observed system prices.
* Percentage difference of current system prices when compared with average observed prices. Gives a quick overview what's cheap and what's expensive at the main market.
* Purchase log. Helps to decide whether to sell or not.
* Market HUD. Polluted with ADs recycled from YAH. Nice quick key guide courtesy of Wildeblood. Just for flavor.
* Trader's rating. Concentrate on basic trading and earn ranks. Just for flavor.

Image
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2676
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: [Release] marketObserver 2.3.2

Post by spara »

A new version is up (3.2).

Norby kindly pointed a couple of quirks in the OXP and I just could not stop there :D . There are a couple of minor issues left that annoy me, but those will probably go unnoted.

* Ads are now included in their original resolution and are scaled by the game. Earlier I had prescaled them. As a result they are now more readable as the internal scaling is so good.
* Over a hundred new ads scavenged from the YAH thread. These were meant for sets that were never released. There are now 379 different ads included.
* Percentage difference now compares the average to the station price when docked and to the system price when in-flight. Feels quite intuitive and gives a nice and quick overview of what's cheap and what's expensive.
* Zero prices are interpreted to mean zero market on that commodity and for those percentage difference is written as - %.
* When first installed, average price is initialized with average from commodity definition. After that the average fluctuates depending on visited systems to better reflect game economy around the player. Average is updated with a new price by weighting the old average by 100. This change should considerably help new users get started with trading.

Image
User avatar
Norby
---- E L I T E ----
---- E L I T E ----
Posts: 2577
Joined: Mon May 20, 2013 9:53 pm
Location: Budapest, Hungary (Mainly Agricultural Democracy, TL10)
Contact:

Re: [Release] marketObserver 2.3.2

Post by Norby »

spara wrote:
they are now more readable
Thank you! I like the humor in ads so I often press F8 more times than needed just to read more. :)

About scaling here is a new readable in-game shot on HD screen:
Image
User avatar
Obsidian
Competent
Competent
Posts: 40
Joined: Fri Oct 09, 2009 1:30 am
Location: Sometimes I think it's THAT side of Riedquat

Re: [Release] marketObserver 2.3.2

Post by Obsidian »

I perhaps made a mistake thinking the problem was with [wiki]DisplayReputation[/wiki], but it might be with [wiki]MarketObserver[/wiki]
Obsidian wrote:
Hey, I recently completed a really huge cargo contract for gold. I go from 240,000 or so creds up to 420,000, but my Trader rep goes from Magnate(better than 300,000 profit) to -(that's MINUS!!!)500,000 profit and the discrepancy is bothering me. I lost part of the gold consignment to damage en route, but bought up gold at stations and rock hermits to make up the difference(and a heavy dose of actual piracy, yes I'll admit it :oops:); this would eat into profits, sure, but I can't wind up with -500,000 trade profit while my actual balance increases from 240,000 to 420,000. I'm perplexed.

1.) What's gone wrong?

2.) What do I edit to fix it? (my trader reputation... don't maintain the old saves to go back before my payday)
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6311
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: [Release] marketObserver 2.3.2

Post by Diziet Sma »

spara wrote:
* Over a hundred new ads scavenged from the YAH thread. These were meant for sets that were never released.
To me, that sounds like enough to release a couple of new ad packs..
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
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2676
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: [Release] marketObserver 2.3.2

Post by spara »

Obsidian wrote:
I perhaps made a mistake thinking the problem was with [wiki]DisplayReputation[/wiki], but it might be with [wiki]MarketObserver[/wiki]
Obsidian wrote:
Hey, I recently completed a really huge cargo contract for gold. I go from 240,000 or so creds up to 420,000, but my Trader rep goes from Magnate(better than 300,000 profit) to -(that's MINUS!!!)500,000 profit and the discrepancy is bothering me. I lost part of the gold consignment to damage en route, but bought up gold at stations and rock hermits to make up the difference(and a heavy dose of actual piracy, yes I'll admit it :oops:); this would eat into profits, sure, but I can't wind up with -500,000 trade profit while my actual balance increases from 240,000 to 420,000. I'm perplexed.

1.) What's gone wrong?

2.) What do I edit to fix it? (my trader reputation... don't maintain the old saves to go back before my payday)
Nice catch and great report :D . Here's what happens. You take the contract and the game adds the goods to your cargo hold. These are not noted by the Galactic Traders Association (GTA) as it's not trading. Then some cargo is lost and new is bought. Now that is noted as it is trading as it's a standard buy action from a market. Then you deliver the contract and the game subtracts the contract amount of cargo from the hold. That is not trading, so from GTAs point of view you just have lost the goods you earlier bought.

So it kind of works as it should in this situation, but it's a bit harsh. The main problem naturally is the fact that contract goods are not separated from the ordinary goods. It's a bit complicated case to solve satisfactory. I'll need to do some thinking and testing, but I'll cook something up. In the meanwhile the key in the save file is mission_marketObserverProfit and the threshold value for Magnate is 2500000 decicredits.
Diziet Sma wrote:
spara wrote:
* Over a hundred new ads scavenged from the YAH thread. These were meant for sets that were never released.
To me, that sounds like enough to release a couple of new ad packs..
From the thread discussion, it seems that DaddyHoggy had already compiled sets H and I to a nearly releasable state. I sent him a private message, but my hopes are not very high as he has not logged in for about two years. It's a bit sad as there were many dead links in the thread on top of those I managed to salvage. If someone has any of those lost ads, I'll be happy to put them in.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2676
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: [Release] marketObserver 2.3.2

Post by spara »

A new version (3.3) with quite a few changes. Please report any oddities. It would be a miracle if I have not broken anything.

* market hud tweaked to show trader's rating. Trader's rating removed from manifest.
* in-flight view correctly shows percentages when viewing a secondary market
* purchase log is checked for missing cargo at every docking. missing cargo means write-off that affects trader's rating.
* replacing contracted goods is ignored from buy log and trader's rating.

Image

(Funny how much time a simple screenie takes when scumming for a nice pair of ads :lol:)
User avatar
Obsidian
Competent
Competent
Posts: 40
Joined: Fri Oct 09, 2009 1:30 am
Location: Sometimes I think it's THAT side of Riedquat

Re: [Release] marketObserver 2.3.2

Post by Obsidian »

spara wrote:
Nice catch and great report :D . Here's what happens. You take the contract and the game adds the goods to your cargo hold. These are not noted by the Galactic Traders Association (GTA) as it's not trading. Then some cargo is lost and new is bought. Now that is noted as it is trading as it's a standard buy action from a market. Then you deliver the contract and the game subtracts the contract amount of cargo from the hold. That is not trading, so from GTAs point of view you just have lost the goods you earlier bought.

So it kind of works as it should in this situation, but it's a bit harsh. The main problem naturally is the fact that contract goods are not separated from the ordinary goods. It's a bit complicated case to solve satisfactory. I'll need to do some thinking and testing, but I'll cook something up. In the meanwhile the key in the save file is mission_marketObserverProfit and the threshold value for Magnate is 2500000 decicredits.
Thank you, spara. I'm still not seeing how I get to -500,000 creds-trading when the contract payoff, which doesn't count as trading profit, was still insufficient to make up the difference/loss, which would have been -800,000 swing... in order to lose that much, I would have needed to buy that much and I never had that much cash. Pretty sure I spent less than 100,000 creds while replenishing the gold consignment; I figure I lost one TC worth of gold(had it been more, I doubt I'd have met the contract deadline picking up ~8kg gold per stop), so 500kg at 42c(worst case gold buys) means 21000 in the red---in order to lose 800000, I'd have needed 39 TC of gold in the hold to be destroyed and all of it needing replacement... that's far from what happened. The initial consignment was a little more than 2500kg; replacing all of it max price would only have set me back around 100,000 creds (which does seem about right). Sorry to go on at length when you've provided a solution that'll work for me; I'm hoping it helps rather than annoys. :)

Anyway, time to break out the calculator and guesstimate things more accurately so I'm not padding my Trader stats. Thanks again.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4646
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: [Release] marketObserver 2.3.2

Post by phkb »

Got this in my session this morning, although given 3.3 is out it may not be applicable anymore...

Code: Select all

07:16:03.101 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (market_observer3 3.2): TypeError: this.$buyLog[commodity][0] is undefined
07:16:03.101 [script.javaScript.exception.unexpectedType]:       C:\Oolite-Trunk/oolite.app/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/oolite.oxp.spara.market_observer.oxz/Scripts/market_observer.js, line 83.
07:16:08.022 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (market_observer3 3.2): TypeError: this.$buyLog[i][0] is undefined
07:16:08.022 [script.javaScript.exception.unexpectedType]:       C:\Oolite-Trunk/oolite.app/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/oolite.oxp.spara.market_observer.oxz/Scripts/market_observer.js, line 272.
I'll download the latest version and report back here if the problem continues.

Edit: Yep, still getting errors:

Code: Select all

13:37:05.400 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (market_observer3 3.3): TypeError: this.$buyLog[commodity][0] is undefined
13:37:05.400 [script.javaScript.exception.unexpectedType]:       C:\Oolite-Trunk/oolite.app/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/oolite.oxp.spara.market_observer.oxz/Scripts/market_observer.js, line 140.
13:35:42.211 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (market_observer3 3.3): TypeError: this.$buyLog[i][0] is undefined
13:35:42.211 [script.javaScript.exception.unexpectedType]:       C:\Oolite-Trunk/oolite.app/GNUstep/Library/ApplicationSupport/Oolite/ManagedAddOns/oolite.oxp.spara.market_observer.oxz/Scripts/market_observer.js, line 352.
User avatar
SteveKing
---- E L I T E ----
---- E L I T E ----
Posts: 258
Joined: Tue Apr 15, 2014 9:09 am
Location: DownUnder (W Aus)

Re: [Release] marketObserver 2.3.2

Post by SteveKing »

spara wrote:
(Funny how much time a simple screenie takes when scumming for a nice pair of ads )
Were you fishing for someone to say... 'Mmm, nice pair... of ads' :mrgreen:

I do like this immersive oxp. Not that I have a lot of oxp/oxz's loaded; so are there commodities that can be listed as 'lm' other than Slaves, Narcs and Firearms under other oxp's, or is it that 'lm' status is removed in some circumstances?
SteveKing
(not quite the author)
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2286
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: [Release] marketObserver 2.3.2

Post by Wildeblood »

SteveKing wrote:
I do like this immersive oxp. Not that I have a lot of oxp/oxz's loaded; so are there commodities that can be listed as 'lm' other than Slaves, Narcs and Firearms under other oxp's, or is it that 'lm' status is removed in some circumstances?
In Oolite 1.82, OXPs can freely mess with both the import and export legality of any commodity.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2676
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: [Release] marketObserver 2.3.2

Post by spara »

phkb wrote:
Got this in my session this morning...
Thanks for the report. Version 3.3.1 should fix that problem. If the problem does not outright go away, a one time buy/sell transaction on the commodity causing the problem should sort it out.
User avatar
Day
---- E L I T E ----
---- E L I T E ----
Posts: 545
Joined: Tue Mar 03, 2015 11:35 am
Location: Paris

Re: [Release] marketObserver 2.3.2

Post by Day »

Hi Spara,

I like a lot this oxp and use it to trade. I realized this morning that what I needed was percentage diff for gems, gold and platinum, and value diffs for everything else.

Explanation:
- I'm not in lack of money, so I can buy any gem/gold/platinum, and then percentage diff is what matters,
- I'm in lack of space (78t available), so I want to stock tons of matter with the maximum price difference to its average value.

For example, it's a winning strategy for me, when my ship is full, to sell computers at -5 credits per ton compared to average price, to then buy furs (for example) at -10 credits per ton compared to average price: I earn 5 more credits per ton this way. (It's part of Comparative advantage theory in economics, I think :-p ).

Here is the snippet of code I used to display the diff value (replacing the content of the percentDiff method):

Code: Select all

		var d = (local - avg) / 10;
		var ds = d.toFixed(1);
		if (d < 0) {
			return Array(11 - ds.length).join(" ") + ds
		} else {
			return Array(10 - ds.length).join(" ") + "+"+ds
		}
Would you think it would be a good idea to be able to switch from diff percentage to diff value?
Post Reply