View unanswered posts | View active topics It is currently Thu Mar 28, 2024 3:09 am



Reply to topic  [ 27 posts ]  Go to page Previous  1, 2
 Fig & Shield Prices 
Author Message
1st Sergeant

Joined: Wed Jan 16, 2008 3:40 pm
Posts: 39
Location: Ireland
Unread post Re: Fig & Shield Prices
Great detective work EP!

I'm a bit uncomfortable with the value used for pi. Would you mind checking the following, using the correct value for pi ?:

Fig: =200+40*COS((NOW()-32142)*((2exp16 -1)/(2exp15-1))* pi /87.5)

Kav


Fri Dec 12, 2008 7:44 am
Profile
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1131
Location: Augusta, GA
Unread post Re: Fig & Shield Prices
Even such a small discrepancy as that diverges measurably as early as day 3. My formula is accurate to the sub-second from Dec 31, 1987, through leap-day, 2088. I'll post the screen cap later if I have time.

I realize that those values for Pi are the result of rounding errors in TW, but they are exact nevertheless.

_________________
Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.


Fri Dec 12, 2008 3:32 pm
Profile WWW
Gameop
User avatar

Joined: Thu Mar 08, 2001 3:00 am
Posts: 886
Location: USA
Unread post Re: Fig & Shield Prices
ElderProphet wrote:
First Hold = 200 + 50 * Sin(X * 2Pi / 17.5), where Pi = 3.14146.
Fig Price = 200 + 40 * Cos(X * 2Pi / 87.5), where Pi = 3.13999.
Shield Price = 150 - 40 * Cos(X * 2Pi / 87.5), where Pi = 3.13999.


if you're uncomfortable with the bogus values of PI, just change the other constants:

First Hold = 200 + 50 * Sin(X * 2Pi / 17.5007387), where Pi = 3.1415926.
Fig Price = 200 + 40 * Cos(X * 2Pi / 87.5446586), where Pi = 3.1415926.
Shield Price = 150 - 40 * Cos(X * 2Pi / 87.5446586), where Pi = 3.1415926.

i think you get the same result...

_________________
twgs : telnet://twgs.thereverend.org:5023
web : http://www.thereverend.org
games : http://www.thestardock.com/twgssearch/i ... verend.org
helper : http://svn.thereverend.org:8080/revhelper/


Fri Dec 12, 2008 3:41 pm
Profile
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1131
Location: Augusta, GA
Unread post Re: Fig & Shield Prices
Attachment:
LeapDay2088.jpg
LeapDay2088.jpg [ 112.01 KiB | Viewed 9447 times ]

I believe that says it all. Those are a mere 141 ms apart.

Rev, those decimal values would suffice, but would be .8 sec off after 100 years, far too great a discrepancy. :P

_________________
Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.


Fri Dec 12, 2008 7:13 pm
Profile WWW
Gameop
User avatar

Joined: Thu Mar 08, 2001 3:00 am
Posts: 886
Location: USA
Unread post Re: Fig & Shield Prices
ElderProphet wrote:
Rev, those decimal values would suffice, but would be .8 sec off after 100 years, far too great a discrepancy. :P

yeah but you get my point - you're not changing the value of pi. you're just keeping your 17.5 and 87.5 numbers simple and fudging pi a little, but in the end its 2 * pi * someConstant.

_________________
twgs : telnet://twgs.thereverend.org:5023
web : http://www.thereverend.org
games : http://www.thestardock.com/twgssearch/i ... verend.org
helper : http://svn.thereverend.org:8080/revhelper/


Fri Dec 12, 2008 7:42 pm
Profile
Private 1st Class

Joined: Fri Jan 02, 2009 9:07 pm
Posts: 2
Unread post Re: Fig & Shield Prices
I was going to say something witty, but the medieval registration process of these forums has taken it out of me. I'll instead just say "hi."


Fri Jan 02, 2009 11:08 pm
Profile
Commander

Joined: Tue Mar 26, 2002 3:00 am
Posts: 1416
Location: Canada
Unread post Re: Fig & Shield Prices
Hi Kemp!

if you mail that SG fool, he can give you your old account back :)


Sat Jan 03, 2009 4:50 pm
Profile ICQ
Site Admin
User avatar

Joined: Sun Dec 24, 2000 3:00 am
Posts: 1432
Location: USA
Unread post Re: Fig & Shield Prices
Silence wrote:
Hi Kemp!

if you mail that SG fool, he can give you your old account back :)


hey k3 hit me up email i'll get you all fixed up.


Sat Jan 03, 2009 4:55 pm
Profile
Private 1st Class

Joined: Fri Jan 02, 2009 9:07 pm
Posts: 2
Unread post Re: Fig & Shield Prices
I was just ended up here from some various random websurfing and thought I would say hi. No point in getting my old account back, I don't plan on hanging around. Nice to see some people still remember me :P


Sun Jan 04, 2009 9:18 pm
Profile
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1131
Location: Augusta, GA
Unread post Re: Fig & Shield Prices
Ah, the legend himself... Hope you are doing well, and that you'll poke your head in and fight some of this mis-information from time to time.

Hope to see you again before another 2+ yrs go by.

+EP+

P.S. I'm interested in the witty remark that you didn't say.

_________________
Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.


Mon Jan 05, 2009 8:12 pm
Profile WWW
Warrant Officer
User avatar

Joined: Thu Jan 31, 2002 3:00 am
Posts: 96
Location: USA
Unread post Re: Fig & Shield Prices
Elder, I've found the chart below which you created to be an invaluable resource for me. But I'm having a wierd issue coming up. I have my own excel spreadsheet which I use to keep track of planets, ports, figs, etc. I wanted to copy your chart into my existing spreadsheet, so as to have a single excel file with multiple sheets, simplifying things for myself.

So I select all from your chart, copy, and paste into a new blank sheet in my own spreadsheet. At first, everything goes fine. But, as soon as I close your chart, mine goes haywire with the dates. They change into numbers, starting at 39830, and increasing by 10 for each date. All the data appears to remain the same, its only the dates listed on the chart.

As soon as I reopen your chart, the dates go back to normal. Any idea what could be causing this, and any possible fix?

Screenshot is below



ElderProphet wrote:
Okay, so about those formulas...

In the formulas below, X is NOW - 32142. NOW is the number of days, including the fractional part, since 00:00:00 on Dec 31, 1900. 32142 is equivalent to 00:00:00 on Dec 31, 1987 (or 1999 in-game). The sine is calculated with X as a radian measurement.

The prices are always truncated for the display, but the real price includes the fractional part. You will be charged this hidden fractional amount.

First up is the Holds price. Review Traitor's formulas for calculating the cost for holds. The first hold cost (B in Traitor's formula) is calculated as follows:

First Hold = 200 + 50 * Sin(X * 2Pi / 17.5), where Pi = 3.14146.

And now for the important one, the Fig Price:

Fig Price = 200 + 40 * Cos(X * 2Pi / 87.5), where Pi = 3.13999.

And last but not least, Shield Price:

Shield Price = 150 - 40 * Cos(X * 2Pi / 87.5), where Pi = 3.13999.

In Excel:
Hold1: =200+50*SIN((NOW()-32142)*2*3.14146/17.5)
Fig: =200+40*COS((NOW()-32142)*2*3.13999/87.5)
Shield: =150-40*COS((NOW()-32142)*2*3.13999/87.5)


I'll post the scripts on Grimy in a few days.

I've attached an Excel spreadsheet to this post, that forecasts prices for 70 days from NOW, which will update each time you load it. A pic of the chart is below.

Regards,
+EP+

Attachment:
The attachment EP_HFS_Chart.jpg is no longer available


Attachments:
screenshot.JPG
screenshot.JPG [ 126.31 KiB | Viewed 9128 times ]

_________________
"Freedom is not free, but the U.S. Marine Corps will pay most of your share." -Ned Dolan
"Tolerance is the virtue of a man without convictions." -GK Chesterton
Thu Jan 29, 2009 11:42 am
Profile ICQ YIM WWW
Gameop
User avatar

Joined: Tue Sep 25, 2007 7:27 pm
Posts: 530
Location: Long Island
Unread post Re: Fig & Shield Prices
Poodle,

The problem is that excel is not converting the date values to dates, but rather is keeping them as integers. If you look at the format option for the chart, you should be able to select dates rather than a number, which will cause excel to show it in the correct format.

Regards,
V

_________________
If you have a building game, they will come...

Proud Sysop of ICE9 TWGS
Home of Building and Non Regulated Games
http://www.oregonsouth.com/ice9
telnet://ice9-tw.com:2002


Thu Jan 29, 2009 1:20 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 27 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users and 10 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
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.