Longer history of Finances

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

oVRoM
Engineer
Engineer
Posts: 37
Joined: 11 Jan 2003 10:40
Location: Utah

Longer history of Finances

Post by oVRoM »

Edit: See below for an updated version by BamBam.


I started on a patch that shows a longer history in the finances window. Currently you can only see the last 2 and the current year, this patch adds a horizontal scrollbar to that window and has 5 years of history.

There are however some problems:

- I don't really know C, so the code might suck.
- When the company has just started the screen doesn't really work as it should. It's not totally broken though.
- When you change the date (via the cheat menu) and set it back to before the inauguration date, the thing borks.
- The history isn't saved. I suppose a change in the savegame stuff would have to be made. Wouldn't know where to begin :-)

I might try to fix some of these things, but if someone else feels like doing so, please feel free ;-)
Attachments
economy_history.002.diff
Patch file
(4.56 KiB) Downloaded 523 times
Last edited by oVRoM on 13 May 2011 20:02, edited 2 times in total.
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Post by SirkoZ »

Nice patch - I remember sometimes wanting this behaviour back when I was playing TTD and even now it would be nice, to see who destroyed the terrain (OpenTTD - multiplayer game).

I'll be quiet about the programming part too, as I'm also not strong in C. :)
User avatar
Arsenal
Traffic Manager
Traffic Manager
Posts: 227
Joined: 06 Jan 2004 21:25

Post by Arsenal »

date changing borks the finances anyway, with or without the patch.
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Post by SirkoZ »

Well then - the finance window should then be set to the year, that is chosen via the date_change cheat and maybe save the previous state/progress...
BobDendry
Tycoon
Tycoon
Posts: 2215
Joined: 06 May 2004 09:10
Location: Sydney

Post by BobDendry »

Great job on this patch, seems like a great idea
Formerly known as Lachie
User avatar
Bob Smith
Engineer
Engineer
Posts: 111
Joined: 17 May 2005 23:25

Post by Bob Smith »

Yay, no more making logs in Excel....
User avatar
Arsenal
Traffic Manager
Traffic Manager
Posts: 227
Joined: 06 Jan 2004 21:25

Post by Arsenal »

Bob Smith wrote:Yay, no more making logs in Excel....
You're not serious?
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Post by SirkoZ »

Bob Smith wrote:Yay, no more making logs in Excel....


:lol:

Really - did you mean that?
User avatar
webfreakz.nl
Director
Director
Posts: 627
Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:

Post by webfreakz.nl »

Bob Smith wrote:Yay, no more making logs in Excel....
lol
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)
User avatar
Bob Smith
Engineer
Engineer
Posts: 111
Joined: 17 May 2005 23:25

Post by Bob Smith »

Ha. When I first started playing TT when I was like 10 I used to write down the years finances on paper so I check back all the way to the beginning. Later I copied the list onto Excel. I remember being annoyed that I still had to write it down on paper first, since TT ran on DOS and Excel Win3.1.

I think I only ever did it for my first game or two though. So not for a long time.
User avatar
lepkka
Engineer
Engineer
Posts: 117
Joined: 18 Jan 2005 12:32
Location: Barcelona

Post by lepkka »

hahahaha!
great!!
the most conscientious player ever!!

the town statues should be in your honour
oVRoM
Engineer
Engineer
Posts: 37
Joined: 11 Jan 2003 10:40
Location: Utah

Post by oVRoM »

Hm, I did that Excel stuff too, until I realized that using Microsoft software may be damaging to your health ;-)
A while ago I wrote a patch for openttd which printed the finances data to a logfile each year, and made a perl script that used that data to generate an overview in HTML... I've since stopped working on that patch & script, because I figured a history in TTD itself is nicer.
User avatar
Bob Smith
Engineer
Engineer
Posts: 111
Joined: 17 May 2005 23:25

Post by Bob Smith »

If you could make the patch export to a standard csv format you could import the data in Excel and have endless amounts of graphs generated. Just a thought. :)
User avatar
Arsenal
Traffic Manager
Traffic Manager
Posts: 227
Joined: 06 Jan 2004 21:25

Post by Arsenal »

Are you sure you're not taking things a fraction too seriously?
User avatar
webfreakz.nl
Director
Director
Posts: 627
Joined: 11 Aug 2005 08:22
Location: Localhost, 127.0.0.1, [The Netherlands: South Holland-> Westland]
Contact:

Post by webfreakz.nl »

Bob Smith wrote:If you could make the patch export to a standard csv format you could import the data in Excel and have endless amounts of graphs generated. Just a thought. :)
why not XML? Think that works better (cross-platform...)
# Programming is like sex, one mistake and you have to support it for the rest of your life. (Michael Sinz)
User avatar
Bob Smith
Engineer
Engineer
Posts: 111
Joined: 17 May 2005 23:25

Post by Bob Smith »

Whatever. So long as it is a generic format (which CSV is, to my knowledge).

Another benefit is that you could remove inflation, so you could see if you're really making more money than you were 10 years ago (since the numbers will get bigger over time without you having to do anything).

@Arsenal: well if you're going to do a job, best do it properly. Anyway, I like to reminisce over past glories.
BamBam
Engineer
Engineer
Posts: 34
Joined: 06 May 2007 17:49

Post by BamBam »

I like the idea of this patch.

So I updated it to aktually trunk (r9824) and extended it.

- You can choose in the config how long the history are.
- The whole history-length (you choose in config) will be saved.
- If your company not exist so long how the adjustment will be it only show as many as years you played.

I hope you enjoy it and please post bugs/comments.

-BamBam

Edit 19. June 2007: update to r10230 and some code changes (particularly the saveload thing)
Attachments
finance_history_10230.patch
(10.96 KiB) Downloaded 352 times
finance_history_10230.7z
Win32 executable
(905.46 KiB) Downloaded 297 times
Last edited by BamBam on 19 Jun 2007 22:05, edited 1 time in total.
User avatar
CMircea
Chairman
Chairman
Posts: 887
Joined: 29 Dec 2006 14:05

Post by CMircea »

I'm out to compile it.
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1732
Joined: 30 Mar 2005 09:43

Post by peter1138 »

Your savegame changes look dodgy :)
He's like, some kind of OpenTTD developer.
BamBam
Engineer
Engineer
Posts: 34
Joined: 06 May 2007 17:49

Post by BamBam »

peter1138 wrote:Your savegame changes look dodgy :)
I tried to make the save small as possible.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 36 guests