News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

Total Asset Value?

Started by knotwork, November 30, 2020, 03:31:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

knotwork

Does the game "know" the total current value in "local currency" (whatever value is measured/accounted in within an instance of the game)?

If so, is there a way/place whereby a shell script can obtain that metric?

If not, would a tool that, pointed at a saved game (or its log!), returns the total asset value be a relatively trivial/easy tool to build?

Apparently there are or can be un-owned assets so it seems it is not as simple as adding up the assets of all the players including the public player, but maybe the game keeps a total for "the" unplayer, as it were? So then one culd add up all of those and be done?

(I am not concerned about potential mineral resources potentially obtainable by mining the terrain and items like that, just how much game money is in that game instance including game money that is "in asset form".)

Total Liquidation Value could also possibly be interesting or useful if known or easily knowable, but is not essential since a discrepancy between total coins issued and total coins actually still in circulation not lost forever due to lost private keys or whatever is common in the cryptocurrency world and I usually just use total number of coins minted as a figure to divide total "treasury" (assets) by to arrive at a value per coin for purposes of computing conversion rates between different currencies.

(The converse of "market cap", in effect. Take the total assets as "market cap" and divide it by the number of units of currency.)

Some applications for such a tool include such things as being able to assign a "kitty" or "treasury" of some arbitrary currency to an instance of the game and be able to divvy it up in proportion to each player's, or each "winning" player's, holdings-as-a-fraction-of-total-game-worth.

So it would not be just for embedding a game within a meta-game that this could be useful, except of course to the extent that a tournament or suchlike can I suppose technically be considered a metagame in its own right.

-MarkM-

prissi

For embedding, I think the use of the Simutrans scripting engine is the best choice. THat has access to almost any of the parameters ingame, and can selectively set or enforce actions.

However, in extended the script engine is not working, as far as I know.

jamespetts

Simutrans (including Simutrans-Extended) is not generally designed to export data to the command line, except what is necessary for online multi-player games using the nettool interface. Scripted scenarios can interact with certain values, but, as Prissi points out, this feature has never been fully integrated into Simutrans-Extended.

There is not a system of keeping track of the value of unowned items, not least because many such items (e.g. industries, rivers, trees, ground objects such as rocks and ponds) do not, in fact, have any value assigned to them as the player never needs to interact with them financially.

The value of each player company is ascertainable in Simutrans-Extended, as there is an option for one player to be able to take over another player, and this requires the cost of doing this to be calculated.

The currency in Simutrans is known as SimuCents, incidentally.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

knotwork

Thank you both.

I have have been looking into the scripting, it does seem more than adequate to work with.

I think all I (or who-ever decides to put up a kitty) will miss out on from unowned things not being counted is automatically having a residual value (kitty/collateral) for the remaining map once all players have been "paid off".

That is really very trivial since they are free to provide any value to what is left simply by pouring in more of whatever arbitrary currency they are using for the kitty.

In fact I imagine from the point of view of a player on the map it makes more sense that paying off all the players (who qualify) leaves nothing in the kitty.

From the outside it maybe looks a little strange (a whole planetoid, trees empty factories and all, totally free?!?) but that is an artifact of only assigning a value to a virtual world, game, item, object etcetera based on how much "actual" collateral is, basically, "being represented in the form of" that virtual whatever, based on your view of what is "actual".

(To the cryptocurrency moguls only the "hard currency", the coins on the blockchain, are "actual", all the rest is just "window-dressing" making a particular pile of coins have some kind of storyline or whatever whereby they are "appearing in the form of" virtual things.

-MarkM-

[C] Ranran

https://github.com/Ranran-the-JuicyPork/simutrans-extended/tree/player_stats
This patch adds a new tab to the finance window to display asset and maintenance information.
This is one of the player's information. I'm not sure if this is the information you wanted to see.

(´・ω・`)らんらん♪

jamespetts

Quote from: Ranran on July 07, 2021, 09:03:43 AM
https://github.com/Ranran-the-JuicyPork/simutrans-extended/tree/player_stats
This patch adds a new tab to the finance window to display asset and maintenance information.
This is one of the player's information. I'm not sure if this is the information you wanted to see.

(´・ω・`)らんらん♪

Thank you for this - now incorporated with translations.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Matthew

Quote from: Ranran on July 07, 2021, 09:03:43 AM
https://github.com/Ranran-the-JuicyPork/simutrans-extended/tree/player_stats
This patch adds a new tab to the finance window to display asset and maintenance information.
This is one of the player's information. I'm not sure if this is the information you wanted to see.

(´・ω・`)らんらん♪

Thank you for this patch, Ranran! It makes our systems feel more real. And it's also interesting to compare different players' systems.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

Sirius

Thank you, that patch is very useful.
However, I noticed the numbers to be right-aligned whilst the title is left-aligned.
That's quite confusing especially when there is much space between the colums.
Is there a chance to get the title right-aligned or to add borders around the colums?

[C] Ranran

The code brought from the standard did not have the ability to center or right-align the image inside the auto-aligned table cell. The align option does not work.
This is because the apparent size of the cell and the actual size (= image size) are different.
This patch was made about half a year ago. I was unfortunately defeated after fighting for a while trying to align it then. (´ ・ ω ・ `)

However, today again I revenged and was lucky enough to win. (´・ω・`)おほーっ(Woohoo)!
The cell was divided into 3 parts and the juicy image was sandwiched between <gui_fill_t>.
Check the pull request #426.

jamespetts

Thank you - now incorporated.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.