Calculating error in 0.5-RC2

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
Xon3
Engineer
Engineer
Posts: 4
Joined: 09 Jan 2007 17:40
Location: Infront of my Computer with my lovely girlfriend in mind

Calculating error in 0.5-RC2

Post by Xon3 »

When holding "SHIFT" and removing something I get a notice that tells me what the cost/earn will be but when I then remove or build the money earned/spent isn't the same as in the calc box! It can change with tens of millions! Please solve this problem!
/><0n3
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Post by XeryusTC »

I think that the wiki says that it might not be accurate, so it isn't suppose to as there is a disclaimer. I do think that it should be accurate though ;).
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

I think you'll have to produce a savegame, Xon3, and tell us what operation you performed.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

Seconded. Your post was about as useful as a random bunny with a pancake on its head.. Eg 0.0

Please do as DaleStan said or at least be specific.
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Post by XeryusTC »

Darkvater wrote:Seconded. Your post was about as useful as a random bunny with a pancake on its head.. Eg 0.0

Please do as DaleStan said or at least be specific.
He is talking about the cost estimation feature that comes with pressing the shift key, if you build a rail and press the shift key while doing it you will get the red popup that says "Cost estimation: x". The cost estimation can be off from time to time, as said on the wiki (I'm repeating myself)
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Um... Duh? We all know that. Give us at least a little credit.

If every single one was off by tens of millions, don't you think we'd have noticed?
Since we haven't noticed, that must mean that it works most of the time, so we need to know exactly how to make it break.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Xon3
Engineer
Engineer
Posts: 4
Joined: 09 Jan 2007 17:40
Location: Infront of my Computer with my lovely girlfriend in mind

Post by Xon3 »

Well, I don't think that there is something special to make it break but when I i.e. hold shiftkey down and try to even the land where there is lakes and hills it says like sums up to 60 million swedish kronor and when I do the real thing it will cost about only 16 million swedish kronor.

I'll attach a savegame and picture when I come home so after 1500 GMT!
/><0n3
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

Ah, that.

That is logical. What your estimation does is give you the cummulative cost of clearing ALL water-tiles. That costs 60 million.

But when you actually start doing that you clear 1 tile, pay the full price and for the second one (next to the already terrformed, raised tile) you pay less because a part is already raised and is land.

Shift is an estimation and cannot take into effect any side-effects other parts of the command will actually cause.
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
Xon3
Engineer
Engineer
Posts: 4
Joined: 09 Jan 2007 17:40
Location: Infront of my Computer with my lovely girlfriend in mind

Post by Xon3 »

OK so it can't be fixed? Because it would be a little more helpfull in the beginning to know exactly what the cost will be.
/><0n3
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

I still can't reproduce this, so I, at least, would still like to see a savegame.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

The topic poster probably means something like the attachment.
Attachments
estimation_vs_actual.png
estimation_vs_actual.png (29.89 KiB) Viewed 2870 times
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
Xon3
Engineer
Engineer
Posts: 4
Joined: 09 Jan 2007 17:40
Location: Infront of my Computer with my lovely girlfriend in mind

Post by Xon3 »

Yes that is exactly what I mean! :D
/><0n3
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

Xon3 wrote:Yes that is exactly what I mean! :D
Which is not a bug ;)
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Post by Rubidium »

Xon3: what happens here is that for the estimation no actual modifications are done, what basically happens is that cost to raise every tile edge within that rectangle is going to be calculated. However, as you are building on water, clearing a tile costs a lot of money; for every tile's edge that is going to be raised, it says has to clear 4 tiles. In reality you have to clear much less tiles, as the tiles that need to be cleared overlap.

This explains the about factor 4 difference in the estimated and real cost.

It is, however, not feasible to do the check with modifications, as one needs to store the whole state of the game, perform the modifications to determine the actual cost and restore the game to the state before the modifications were done.
As the same (code-)path is used to determine whether you are performing a valid command (especially in the game server), it will mean that for every action a user does, the state has to be stored and restored.
This can cost so much time on a heavily loaded multiplayer server, that OpenTTD would become unplayable. Therefore the decision has been made to make the estimate without actually performing the modifications, which can cause a difference in estimation when the costs of modification are influenced by modifications done in the same command on neighbouring tiles.

I hope it clears up Darkvater's comment that it is not a bug.
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

Darkvater wrote:Ah, that.

That is logical. What your estimation does is give you the cummulative cost of clearing ALL water-tiles. That costs 60 million.

But when you actually start doing that you clear 1 tile, pay the full price and for the second one (next to the already terrformed, raised tile) you pay less because a part is already raised and is land.

Shift is an estimation and cannot take into effect any side-effects other parts of the command will actually cause.
Didn't I just say that a few days ago? 8)
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

Well, it's in the nature of an estimate to be only an estimate. Be glad you're getting such a good deal on your artificial island; building on the sea bed isn't that inexpensive when you try it for real.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 6 guests