Patch: New graphs
Moderator: OpenTTD Developers
Thanks for feedback guys. I've decided to rip % change. I tried your suggestions hertogjan, but graph still sucks. The numbers are so scattered they are useless, even with smooth. BUT if you can make it work I'll be happy to put it back in!
I'm working on cleaning up the code / documenting now.
I'm working on cleaning up the code / documenting now.
I'm on the Zoloft to keep me from killing yall
My patches: Better graphs - Train acceleration - Crash rates
My patches: Better graphs - Train acceleration - Crash rates
Latest ver. Apart from fixing a bunch of stuff, I've added a "maximum yearly income" mode in the cargo payment graph... But I don't like it and will probably scrap it. =)
Does the game use miles or km in the code? It seems like both...
Does the game use miles or km in the code? It seems like both...
- Attachments
-
- new graphs r9897.diff
- (64.69 KiB) Downloaded 304 times
I'm on the Zoloft to keep me from killing yall
My patches: Better graphs - Train acceleration - Crash rates
My patches: Better graphs - Train acceleration - Crash rates
hmm so it uses miles for distance... but speed is in kph?
we got some ex-nasa people working on this? =)
Code: Select all
const RailVehicleInfo orig_rail_vehicle_info[NUM_TRAIN_ENGINES] = {
// image_index max_speed (kph) running_cost_base ai_rank
// | flags | power (hp) | running_cost_class | railtype
// | | base_cost | weight | | capacity | |
// | | | | | | | | | cargo_type | | engclass
// | | | | | | | | | | | | |
RVI( 2, G, 7, 64, 300, 47, 50, S, 0, 0 , 1, R, S), // 0
RVI(19, G, 8, 80, 600, 65, 65, D, 0, 0 , 4, R, D), // 1
I'm on the Zoloft to keep me from killing yall
My patches: Better graphs - Train acceleration - Crash rates
My patches: Better graphs - Train acceleration - Crash rates
-
- Engineer
- Posts: 44
- Joined: 25 Aug 2005 00:42
- Location: Bedfordshire, England.
- Contact:
Well, the game uses strange units for speeds. Speeds are measured in units of 1/1.6 mph, despite numerous comments that claim it is km/h. The difference is not much, but it may cause speeds to be off by a few km/h. However, internal functions often work in arbitrary units.*
The unit for power is imperial horsepower, which is slightly different to the horsepower(s) as defined on the European continent. The other units (weight, volume and force) seem to be metric however.
*Once a while ago, these were proper km/h, but for some intelligent reasons (which I did not understand) they were changed to 1/1.6 mph units.
The unit for power is imperial horsepower, which is slightly different to the horsepower(s) as defined on the European continent. The other units (weight, volume and force) seem to be metric however.
*Once a while ago, these were proper km/h, but for some intelligent reasons (which I did not understand) they were changed to 1/1.6 mph units.
Ok I'll try to figure all this out in the code. Maybe they did it that way because
is faster than
Or is it the same with processors today?
Anyways thanks for help!
note: in puerto rico, speed is mph and distance km =)
Code: Select all
x * 10 >> 4
Code: Select all
(x << 4) / 10
Anyways thanks for help!
note: in puerto rico, speed is mph and distance km =)
I'm on the Zoloft to keep me from killing yall
My patches: Better graphs - Train acceleration - Crash rates
My patches: Better graphs - Train acceleration - Crash rates
Here is a completed version of new graphs! I figured out a good way to make the graphs smooth and accurate. What do yall think of the cargo max income graph?
Much appreciation for anyone who can play around with this patch and find a bug or 2.
Much appreciation for anyone who can play around with this patch and find a bug or 2.
- Attachments
-
- new graphs r9915.diff
- (73.08 KiB) Downloaded 283 times
-
- Maximum income graph
- Unnamed, 2nd Apr 2025.png (13.61 KiB) Viewed 8954 times
I'm on the Zoloft to keep me from killing yall
My patches: Better graphs - Train acceleration - Crash rates
My patches: Better graphs - Train acceleration - Crash rates
Cool! Glad you like it.JameiLei wrote:personally i love it - it looks amazing and no matter what other people were saying earlier, i have a strong preference for the black over the grey
Does anyone else have this problem? They are super visible on my screen.Psistorm wrote: make the "year seperator lines" a bit more visible, I didnt notice they were there until I looked closely
I'm on the Zoloft to keep me from killing yall
My patches: Better graphs - Train acceleration - Crash rates
My patches: Better graphs - Train acceleration - Crash rates
Here it is as a patch option, "better_graphs".
I put the max player history back to 24 quarters. The devs can choose to increase this, if they include this patch in the trunk. I'd like a 100 quarter history. =)
What else does this patch need?
I put the max player history back to 24 quarters. The devs can choose to increase this, if they include this patch in the trunk. I'd like a 100 quarter history. =)
What else does this patch need?
- Attachments
-
- better_graphs_r10002.diff
- (52.61 KiB) Downloaded 246 times
I'm on the Zoloft to keep me from killing yall
My patches: Better graphs - Train acceleration - Crash rates
My patches: Better graphs - Train acceleration - Crash rates
Nice graphs!
But perhaps that is too revolutionary and should better be done as a separate patch that provide some generic infrastructure for a such feature.
What about something such revolutionary as having the setting, not (only) in the patch-screen but close to where it is used. That chould be a small graph-settings dialogs accessible from the graph-windows.Zojj wrote:XeryusTC wrote:I don't like the black background too muchThis will be probably be a patch option. =)Born Acorn wrote:Ooh, I like the black background
But perhaps that is too revolutionary and should better be done as a separate patch that provide some generic infrastructure for a such feature.
- Attachments
-
- Possible config-button.
- config.png (12.62 KiB) Viewed 8571 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Would this be a button that you would use much? I think that people will pick their favorite graph style and stick with it.Zuu wrote:...graph-settings dialogs accessible from the graph-windows
If my graphs are inferior to the originals in any way, making it necessary to switch, please do tell. =)
Last edited by Zojj on 01 Jun 2007 21:35, edited 1 time in total.
I'm on the Zoloft to keep me from killing yall
My patches: Better graphs - Train acceleration - Crash rates
My patches: Better graphs - Train acceleration - Crash rates
Hadn't thought of newgrf cargos. =)Rubidium wrote:It's just that newgrfs authors *might* have chosen to use black as color for the cargo type, which makes them invisible on your graphs...
According to ottd--pallette.gif, the black (or near black) indexes are: 0, 70, 104, 215. What if I make all those display as gray in my graphs? The same gray as the original graph background.
Or do I need to be thinking further into the 32bbp switch?
I'm on the Zoloft to keep me from killing yall
My patches: Better graphs - Train acceleration - Crash rates
My patches: Better graphs - Train acceleration - Crash rates
I would probably not use it much, no. And you should probably not spend time to implement it in your patch either.Zojj wrote:Would this be a button that you would use much? I think that people will pick their favorite graph style and stick with it.Zuu wrote:...graph-settings dialogs accessible from the graph-windows
But at some point patch-settings have to come closer to where they affect things. And the graph-window is a good example of where it can be done in a nice way.
Put it like this, if you open the graph-window, do you then want to open the patch dialog and look thought the list of 20 GUI options (today, and soon they are say 50) too see if there is an option for what you want to do with the graph-window? I have some ideas for how this can be done, but that is out of the scope for your patch, so please continue with your good work and ignore my comments.

My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
I put in a fix for newCargos with black legend color. It changes the color to #40 (gray).
- Attachments
-
- better_graphs_r10040.diff
- (52.82 KiB) Downloaded 1241 times
I'm on the Zoloft to keep me from killing yall
My patches: Better graphs - Train acceleration - Crash rates
My patches: Better graphs - Train acceleration - Crash rates
-
- Route Supervisor
- Posts: 415
- Joined: 07 Oct 2004 10:05
This is great! I hope it's ok that I will post a link to this patch in my modified daylength patch thread. I think this payment graph fits a lot better then the standard graph with the daylength patch. What I did was only changing the graph from days in transit to seconds in transit since that is not a relative value affected by the daylength patch.
Who is online
Users browsing this forum: No registered users and 7 guests