Patch: simplified realistic acceleration

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

User avatar
Zojj
Engineer
Engineer
Posts: 97
Joined: 27 Apr 2007 17:58
Location: Vegas baby
Contact:

Post by Zojj »

Ok I built my own performance meter for OpenTTD. My acceleration patch speeds up the game ~1 - 3%.

I got these numbers by playing #openttdcoop's savegame #9 (1300 trains), playing at 1024x768 middle-zoom, testing for 120 seconds.

ticks per second:

Code: Select all

          cur accel  new accel  diff
no cache  43.4       44.9       +3.4%
cache     71.4       72.2       +0.8%
diff      +64.5%     +60.8%     
I need to test this some more, as my accel changes train speeds a little. Slower trains = faster game.

Press the FF button to activate the performance meter.
Attachments
performance meter.png
performance meter.png (3.06 KiB) Viewed 15311 times
realistic_acceleration2_r10051.diff
(10.1 KiB) Downloaded 458 times
performance_meter_r10051.diff
(4.74 KiB) Downloaded 428 times
I'm on the Zoloft to keep me from killing yall

My patches: Better graphs - Train acceleration - Crash rates
User avatar
Nickman
Engineer
Engineer
Posts: 66
Joined: 27 Jun 2006 23:07

Post by Nickman »

The performance meter is cool :).
I'll give it a test run ;).
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post by skidd13 »

Zojj wrote:Ok I built my own performance meter for OpenTTD. My acceleration patch speeds up the game ~1 - 3%.

Press the FF button to activate the performance meter.
The problem is that your code (of the performance meter) is Microsoft based and does not work at my linux. :( Could you fix that please.
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
User avatar
Zojj
Engineer
Engineer
Posts: 97
Joined: 27 Apr 2007 17:58
Location: Vegas baby
Contact:

Post by Zojj »

I don't have linux. =(

Code: Select all

SYSTEMTIME st;
GetSystemTime(&st);
int	cur_time = st.wHour * 3600000 + st.wMinute * 60000 + st.wSecond * 1000 + st.wMilliseconds;
Can someone convert that to compile on linux?
I'm on the Zoloft to keep me from killing yall

My patches: Better graphs - Train acceleration - Crash rates
User avatar
skidd13
OpenTTD Developer
OpenTTD Developer
Posts: 522
Joined: 03 Mar 2005 10:49
Location: Germany

Post by skidd13 »

Why don't you use time.h instead? ;)
What does that mean - the circumstances? I determine what circumstances prevail. -- Napoleon Bonaparte
---
If we cannot end now our differences, at least we can help make the world safe for diversity. -- John F. Kennedy
---
Our problems are man-made, therefore they may be solved by man. No problem of human destiny is beyond human beings. -- John F. Kennedy
User avatar
Zojj
Engineer
Engineer
Posts: 97
Joined: 27 Apr 2007 17:58
Location: Vegas baby
Contact:

Post by Zojj »

Time.h in windows doesn't do milliseconds. Can someone convert it? Or tell me how to use TIC() TOC()?
I'm on the Zoloft to keep me from killing yall

My patches: Better graphs - Train acceleration - Crash rates
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Post by Rubidium »

TIC/TOC is not usefull for this purpose, unless you want to show the number of frames per cpu tick.
kaan
Route Supervisor
Route Supervisor
Posts: 399
Joined: 02 Apr 2007 20:13
Location: Nørup, Denmark

Post by kaan »

You might want to consider if you really meant that the patch was made for r1051?
I think that it might be safe to bet that you really meant 10051 :)

Code: Select all

if (YouAreHappyAndYouKnowIt) {
    ClapYourHands();
}
User avatar
Zojj
Engineer
Engineer
Posts: 97
Joined: 27 Apr 2007 17:58
Location: Vegas baby
Contact:

Post by Zojj »

lol thx
I'm on the Zoloft to keep me from killing yall

My patches: Better graphs - Train acceleration - Crash rates
User avatar
Zojj
Engineer
Engineer
Posts: 97
Joined: 27 Apr 2007 17:58
Location: Vegas baby
Contact:

Re: Patch: simplified realistic acceleration

Post by Zojj »

I'm gonna split up my acceleration patch, cuz it has some good parts and some controversial parts.

This patch improves the curve, depot, and station speed limit code. The behavior is identical except for one difference: Trains are no longer slowed by successive S bends.

I have also left in the code (but commented out) 3 options that I think make sense:
-Trains' max speed is limited while inside a station, the same manner as while inside a depot but faster.
-Faster railtypes have faster speedlimits while inside a station; a monorail train can enter faster than an electric train.
-Faster railtypes have faster speedlimits while inside a depot. Maglevs enter at 151kph.

The current code is obfuscated, I really want to fix it. =)
Attachments
curve_speed_limits_r11596.patch
(6.53 KiB) Downloaded 212 times
snake.png
snake.png (8.51 KiB) Viewed 2608 times
I'm on the Zoloft to keep me from killing yall

My patches: Better graphs - Train acceleration - Crash rates
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 51 guests