Dumping Expenses (stats) every year
Moderator: OpenTTD Developers
Dumping Expenses (stats) every year
I want to dump expenses (whatever stats) for all players every year just to txt or csv.
I've searched for quite some time for a solution - the closest was a patch written way back in 2006 - http://www.tt-forums.net/viewtopic.php? ... cs#p451840. If I compile the patch into a dedicated server will it still run okay for clients?
Or does anyone know if autopilot would give me the information?
Is the issue that there is noway to get this sort of information from the console?
Any advice would be helpful.
K
I've searched for quite some time for a solution - the closest was a patch written way back in 2006 - http://www.tt-forums.net/viewtopic.php? ... cs#p451840. If I compile the patch into a dedicated server will it still run okay for clients?
Or does anyone know if autopilot would give me the information?
Is the issue that there is noway to get this sort of information from the console?
Any advice would be helpful.
K
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Dumping Expenses (stats) every year
Use the logging function of the admin port.
You'll need a programme which interfaces with that - something which is a bit difficult to find and which you likely will have to write yourself (if you do, do better than existing solutions, don't keep it to yourself, but share it). Some starting places:
Java:
* Joan with the demo-implementation grapes and example-plug-in berries.
* openttd-admin
Python: libottdadmin
You'll need a programme which interfaces with that - something which is a bit difficult to find and which you likely will have to write yourself (if you do, do better than existing solutions, don't keep it to yourself, but share it). Some starting places:
Java:
* Joan with the demo-implementation grapes and example-plug-in berries.
* openttd-admin
Python: libottdadmin
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Dumping Expenses (stats) every year
Thanks to Xaroth's libottdadmin2 I've been able to make some progress on dumping stats. The stats are then loaded up and displayed on the web. So far so good.planetmaker wrote:Use the logging function of the admin port.
You'll need a programme which interfaces with that - something which is a bit difficult to find and which you likely will have to write yourself (if you do, do better than existing solutions, don't keep it to yourself, but share it). Some starting places:
Python: libottdadmin
Re: Dumping Expenses (stats) every year
That looks great. Does data get dumped every year?
Re: Dumping Expenses (stats) every year
It's run through the admin port, so data can be dumped at any interval. At first I had all data displayed monthly. but it's a bit overwhelming to chart. So 3, 6, or 12 months.3iff wrote:That looks great. Does data get dumped every year?
Unfortunately it looks like "income" information from the admin port is just change in money rather than any form of earnings.
Re: Dumping Expenses (stats) every year
First, I want to say that I don't know what information that is available through the admin port.
However, if there is any information available in the GS API, but not directly via the admin port, you can use ServerGS as a bridge to from admin port to GS API. Income information in the GS API is found in GSCompany.
The current version (version 1) of ServerGS will only support nightlies of r25808+, but IIRC it is quite trivial for me to support also 1.3.2 with it. Just let me know in its thread if you are interested in that.
However, if there is any information available in the GS API, but not directly via the admin port, you can use ServerGS as a bridge to from admin port to GS API. Income information in the GS API is found in GSCompany.
The current version (version 1) of ServerGS will only support nightlies of r25808+, but IIRC it is quite trivial for me to support also 1.3.2 with it. Just let me know in its thread if you are interested in that.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: Dumping Expenses (stats) every year
Just had a read rough the gs api - it looks like it'd be great! If you could make it compatible with 1.3.2 I would appreciate that.Zuu wrote:First, I want to say that I don't know what information that is available through the admin port.
However, if there is any information available in the GS API, but not directly via the admin port, you can use ServerGS as a bridge to from admin port to GS API. Income information in the GS API is found in GSCompany.
The current version (version 1) of ServerGS will only support nightlies of r25808+, but IIRC it is quite trivial for me to support also 1.3.2 with it. Just let me know in its thread if you are interested in that.
Can GSAPI be used concurrently with your other gs scripts such as 'neighbours are important'?
Re: Dumping Expenses (stats) every year
The ServerGS game script will be the most responsive GS to use if you want GS access from the admin port. It is possible to add such capability to other GS by perhaps releasing the Server GS core as a library which other GSes can use. However, I'm not sure how large the interest would be from GS authors to incorporate this into their GSes. The general interest of the Script Communication Protocol library (which adds AI<->GS communication to allow making AIs aware of GS goals not handled by OpenTTD API) has seemed to be quite low.
Another option is to look at doing what Server GS do, but inside OpenTTD. Though, then you are at a point where I wonder if users will be okay with having not 100% of the GS Squirrel API available or keep demanding that every feature in GS for squirrel to be available via admin port (which is non-easy when you come to things like valuating lists etc that use variables holding non-simple data types in Squirrel).
So, it is possible more the point that each GS should consider to offer some stats control points via the Admin Port rather than offering full GS API access.
Another option is to look at doing what Server GS do, but inside OpenTTD. Though, then you are at a point where I wonder if users will be okay with having not 100% of the GS Squirrel API available or keep demanding that every feature in GS for squirrel to be available via admin port (which is non-easy when you come to things like valuating lists etc that use variables holding non-simple data types in Squirrel).
So, it is possible more the point that each GS should consider to offer some stats control points via the Admin Port rather than offering full GS API access.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: Dumping Expenses (stats) every year
Zuu wrote:The current version (version 1) of ServerGS will only support nightlies of r25808+, but IIRC it is quite trivial for me to support also 1.3.2 with it. Just let me know in its thread if you are interested in that.
Hi Zuu, reckon you could make the ServerGS compliant with 1.3.3?
Re: Dumping Expenses (stats) every year
It is actually ready. I was only waiting for 1.3.3 to be released and have a version flag in bananas.
Edit: I've now released a Server GS v2 which is compatible with 1.3.3.
Edit: I've now released a Server GS v2 which is compatible with 1.3.3.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: Dumping Expenses (stats) every year
kaspaa, can you share your code? It looks amazing and doing something like this is on my list of TODO since months.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Who is online
Users browsing this forum: No registered users and 51 guests