News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Net wealth in saves. Please.

Started by Iluvalar, December 07, 2012, 03:27:25 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Iluvalar

I believe the save data should be based on the net wealth instead. This would greatly improve the compatibility between paks versions.


When I make a change in the vehicles price in my pak. Even a tiny change of 2-3% only. It's enough to screw the entire save. Either I become incredibly rich, or else it's an instant bankrupt. Basing the loading on the net wealth would prevent that.

prissi

The net  wealth is changed every month due to aging vehicles and the aging also of started vehicles. Thus it must be recalculated every month.

greenling

Iluvalar
Have you get a Speedbonus in your calculation?
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

Iluvalar

Quote from: prissi on December 07, 2012, 09:52:00 AM
The net  wealth is changed every month due to aging vehicles and the aging also of started vehicles. Thus it must be recalculated every month.
I meant to recalculate the account balanced based on the previous net wealth when you load a game. So you will stay at the same point even if the price of the vehicles changed in the pak. You wouldn't bankrupt half of the time.

TurfIt

The actual purchase price of a vehicle is not kept track of at all, since normally it never changes, hence it is not saved. The networth calculation always obtains this data as needed directly from the pak. It is expected that a game is always loaded with the same pak it was created with, but this is not enforced.

Iluvalar

I'm confused. I'm in the "request" section and I'm proposing that to change.

I suggest to save the networth, and use it backward to retrieve the account balance at the loading. This would solve most of the compatibility issues between pak versions. Players that reload the same pak wouldn't notice anything.

Now, I understand that everybody are not making pak all day long. And you might argue that it's on the very low priority thread. That's fine with me i'm just sharing my ideas :) .

Sarlock

If this is just for pak testing, why not just increase your cash to $1 billion or so so that bankruptcy isn't an issue?
Current projects: Pak128 Trees, blender graphics

Ters

I'd be very confused if my account balance suddenly changed "over night". Is it really possible to get a negative net worth with a positive balance?

greenling

Ters
Yes, that what you there speak on was a bug but those bug it now remove.
I hope that.
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

TurfIt

Quote from: Iluvalar on December 08, 2012, 04:14:22 PM
I suggest to save the networth, and use it backward to retrieve the account balance at the loading.
Can you provide the detailed algorithm that would make this work? I don't see it...
Networth is a calculated quantity, if it were simply saved/reloaded, it would be overwritten on the next calculation. Instead all numbers feeding into the calculation would need saving - the actual purchase price of each vehicle. Consider a large game has easily 16000 vehicles, there's another 65k memory used.


Quote from: Ters on December 08, 2012, 06:04:28 PM
I'd be very confused if my account balance suddenly changed "over night". Is it really possible to get a negative net worth with a positive balance?
The account balance doesn't change, only the assets, where both make up the net worth. With pakIlu, it's rather unlikely you'll have a positive account balance with the astronomical vehicle prices; There's one train convoy I seen that would cost 515 million!

Iluvalar

onSave(){
-     save(balance);
+    save(netWealth);

}


onLoad(){
-    netWealth=get(balance)-CalculateAsset();
+   balance=get(netWealth)+CalculateAsset();
}
Quote from: Ters on December 08, 2012, 06:04:28 PMI'd be very confused if my account balance suddenly changed "over night". Is it really possible to get a negative net worth with a positive balance?
Your balance wouldn't change unless you load another version of the pak. in which case, I prefer to see my balance change than to insta-bankrupt. Do you really keep a positive balance all game long ?

kierongreen

I have to say I can't see this being a useful change myself. It's likely to confuse far more people than it helps in my opinion.

Sarlock

QuoteThe account balance doesn't change, only the assets, where both make up the net worth. With pakIlu, it's rather unlikely you'll have a positive account balance with the astronomical vehicle prices; There's one train convoy I seen that would cost 515 million!

Ah!  So this is a pakIlu specific issue given the extremely high purchase prices... and only for testing purposes does it matter as well, unless purchase prices changed wildly after official releases.
For testing reasons, as I mentioned before, just set your cash really high so that there isn't a chance of insta-bankrupt no matter how much vehicle prices are changed.

I imagine that changing the save game data would require a translation between old save games and new save games... something that I presume should be reserved only for major updates.
Current projects: Pak128 Trees, blender graphics

prissi

Or just save the games with freeplay on.

Ters

Quote from: Iluvalar on December 08, 2012, 07:48:15 PM
Your balance wouldn't change unless you load another version of the pak. in which case, I prefer to see my balance change than to insta-bankrupt. Do you really keep a positive balance all game long ?

I load new versions of pak64 from time to time, but I currently have so much money that even though I have a monthly deficit of 2 million (mostly due to an unachivable speed bonus that set in recently), it'll be many years (probably a century) before I approach 0.

If an pak upgrade should cause my net worth to go negative, I'd revert to the previous pak version, play back up to positive balance (which should mean that net worth is positive too, right?), and upgrade again then. The balance is what counts. Net worth is just some number I normally don't pay attention to.

Iluvalar

#15
Quote from: kierongreen on December 08, 2012, 08:01:40 PM
I have to say I can't see this being a useful change myself. It's likely to confuse far more people than it helps in my opinion.
How could they be confused ? they would be unaware of that.


Sarlock : No it's not pakilu specific, let me give you an exemple with my recent pak128 game.

I started with 100'000 ¢ and amongts other vehicles, I have 4 locomotives Nabe-JNR each with a value of 22'000 ¢ by now and I have 7'000 ¢ in net wealth (-235'000 ¢ in balance). it's march 31.

Now let's say that as a pak maker, I consider that this locomotive was a bit too much expensive, and I change the cost from 22'000 to 20'000. (that's not an awesome change... just a  smooth 10% change on a single vehicle). If i then reload the game, I will have 8'000 less cash, my netwealth will be -1'000 ¢ and it will be an Instant bankrupt.


Quote from: prissi on December 08, 2012, 11:20:09 PM
Or just save the games with freeplay on.
Of course, I understand that there is work around. But the purpose of those test is to play an in game situation to see how it "feel" (on top of playing of course  ;D ).


But I guess Sarlock is right, it wouldn't change anything in the game, but it would brake other saves compatibility once.