Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sun Oct 22, 2017 5:18 pm

All times are UTC




Post new topic  Reply to topic  [ 1045 posts ]  Go to page Previous 149 50 51 52 53 Next
Author Message
 Post subject: Re: JGR's Patch Pack
PostPosted: Thu Oct 12, 2017 2:02 am 
Offline
Engineer
Engineer

Joined: Mon May 20, 2013 8:20 pm
Posts: 63
JGR wrote:
I've implemented a fix for this which will be in the next release.

Could you please attach patch file? Or is this fix in your git repo?
JGR wrote:
Interestingly this bug is in trunk and can be triggered by using the same GRF list as in your savegame.

Yup, I'm a lucky man! When I've compiled ottd with full optimization, I've found another little but, but this time in compiler, in MS VC++ compiler! It just ignored "value == 0 ? last_value : " part and compiled only "last_value / value". I've found this by inspecting asm code; nothing like "cmp" nor "je/jne", only "div".

Upd.: yeah, clipboard brokes transportaion. Trains loading only by half, they ignore other freight, cargodist is in panic, timetables going mad, freight isn't removed from station after it's loaded to transport. Dunno, maybe I'll try to rewrite it to be less invasive. What's so hard in copying chunk of map anyway? As I see it, it's just create a buffer, copy map data into it (maybe exclude something like town buildings, industry, trees, etc), and then rebuild tile by tile starting from given tileindex and using cmd's to calculate price.


Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Thu Oct 12, 2017 6:56 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Aug 08, 2005 1:46 pm
Posts: 1697
Location: Ipswich
aberro wrote:
Could you please attach patch file? Or is this fix in your git repo?

It's in the repo, commit 86a94380

aberro wrote:
Yup, I'm a lucky man! When I've compiled ottd with full optimization, I've found another little but, but this time in compiler, in MS VC++ compiler! It just ignored "value == 0 ? last_value : " part and compiled only "last_value / value". I've found this by inspecting asm code; nothing like "cmp" nor "je/jne", only "div".

If the compiler can infer that the value will always be non-zero (assuming defined behaviour) by analysing caller sites, prior and subsequent code paths, etc, it can omit the branch.
This is particularly the case when using whole program optimisation, which it sounds like you're using.

Quote:
As I see it, it's just create a buffer, copy map data into it (maybe exclude something like town buildings, industry, trees, etc), and then rebuild tile by tile starting from given tileindex and using cmd's to calculate price.

This is the basic idea, but there are many details to be handled, doing it correctly is non-trivial. Generally clipboard patch implementations make sweeping changes to map storage and access methods which doesn't help for compatibility with other patches/features either.

Redirect Left wrote:
Hopefully you can submit it trunk for fixing too then? If you have that sort of access.

I will look to draft a bug report at some point.

_________________
Ex TTDPatch Coder, Grumpy Greymuzzle
Avatar by MoonsongWolf.
Patch Pack, Github


Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Thu Oct 12, 2017 7:14 pm 
Offline
Engineer
Engineer

Joined: Mon May 20, 2013 8:20 pm
Posts: 63
JGR wrote:
If the compiler can infer that the value will always be non-zero (assuming defined behaviour)

But it was zero (why else would I want to check assembler code?)
JGR wrote:
clipboard patch implementations make sweeping changes to map storage and access methods which doesn't help for compatibility with other patches/features either.

Current implementation, yes. That's what I've meant by saying "do it less invasive". I don't see any real necessity in doing any changes in main map and especially in rewriting most of functions accepting TileIndex into triplets of template function with two specialization functions. Don't know why author made it that way and in any case it was very arguable decision. But anyway, I need to dive into the code to see what I can do (right now I've finished with checking diffs and importing everything which isn't breaking other stuff, like new files, separate functions, new constants, etc. and soon will start reimplementing this patch)

Upd.: oh my... How's that code even launched?! It has so many incompatibilities, it's ignoring all btree optimizations... How's that even possible to run the game in such state? :shock:


Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Fri Oct 13, 2017 9:30 pm 
Offline
Engineer
Engineer

Joined: Mon May 20, 2013 8:20 pm
Posts: 63
Here is build of this patchpack optimized for modern CPUs (without clipboard, so you could play in multiplayer and it should be as stable as JGR's version). With latest JGR's fix of crash at some newgrfs reload. Again, usual warning - you shouldn't download builds from random persons like me.
But I'll look to downloads counter this time to see if there is any point in publishing my builds further.


Attachments:
openttd.7z [4.92 MiB]
Downloaded 29 times
Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Sun Oct 15, 2017 1:36 pm 
Offline
Engineer
Engineer

Joined: Sun Feb 19, 2012 8:39 am
Posts: 2
So hello people,

I was wondering why Vanilla OpenTTD have many multiplayer server but JGR Patch Pack have only a couple of MP servers and most of them are passworded. I would love to play patch features with other people.

Thanks


Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Sun Oct 15, 2017 1:46 pm 
Online
Traffic Manager
Traffic Manager

Joined: Thu Nov 18, 2010 7:48 pm
Posts: 249
I guess because it's not featured on the openttd.org main page, there are not that many people knowing about this patchpack. Start your own dedicated server, I guess.


Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Sun Oct 15, 2017 2:03 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Mon Apr 17, 2017 4:52 pm
Posts: 288
Location: S.W. London
The servers tend to be passworded because the players tend to take the game more seriously... I guess

_________________
Image

https://www.tt-forums.net/viewtopic.php?f=47&t=76619&p=1188249#p1188249


Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Mon Oct 16, 2017 2:42 am 
Offline
Engineer
Engineer

Joined: Mon May 20, 2013 8:20 pm
Posts: 63
JGR, here is a little patch I've made, which changes vehicle group display name to format "parent group.nested group". It's changed only in vehicles list. Also, requirement for group name to be unique was removed. As far as I checked the code, it's not required to be unique by code, so anyway what's the point to make it so. If player wants - he should be able to make ten groups with same name, for whatever reason.
But mostly this patch makes more use of group nesting, like, naming scheme "PAS.Nonamewille", or "Nonamewille.Suburb.Line 1.Mail". Of course, such names could be entered by hand, but it's very annoying to type same names over and over again for every group.
It'd be a honor if you'd include this patch in your pack.


Attachments:
group-name-patch_r27927.diff [63 KiB]
Downloaded 6 times
Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Mon Oct 16, 2017 2:38 pm 
Offline
Engineer
Engineer

Joined: Mon May 20, 2013 8:20 pm
Posts: 63
Yet another patch, which allows filter vehicles in company vehicles lists by cargo they able to accept. This one I'll post in separate topic (as soon as I'll check it's applies for trunk version), because it's not depended on groups nesting.


Attachments:
filter_by_cargo_r27927.diff [8.49 KiB]
Downloaded 6 times
Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Mon Oct 16, 2017 8:35 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Mon Oct 23, 2006 2:07 am
Posts: 291
Location: Berlin
Hello

I got a crash every time I want to exit a game to the welcome window. The tar/bz2 file contains the log-, png-, and sav-files of the crash. I hope it helps.

Attachment:
crash-jgrpp-0.21.auge.tar.bz2 [443.59 KiB]
Downloaded 9 times


Tschö, Auge

_________________
further development of My Little Forum 1


Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Mon Oct 16, 2017 8:52 pm 
Offline
Engineer
Engineer

Joined: Mon May 20, 2013 8:20 pm
Posts: 63
Auge wrote:
I got a crash every time I want to exit a game to the welcome window.

This is the same crash I've reported and it was fixed already but not yet build into new version (not for 'nix at least).


Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Mon Oct 16, 2017 11:22 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Aug 08, 2005 1:46 pm
Posts: 1697
Location: Ipswich
aberro wrote:
JGR, here is a little patch I've made, which changes vehicle group display name to format "parent group.nested group". It's changed only in vehicles list. Also, requirement for group name to be unique was removed. As far as I checked the code, it's not required to be unique by code, so anyway what's the point to make it so. If player wants - he should be able to make ten groups with same name, for whatever reason.
But mostly this patch makes more use of group nesting, like, naming scheme "PAS.Nonamewille", or "Nonamewille.Suburb.Line 1.Mail". Of course, such names could be entered by hand, but it's very annoying to type same names over and over again for every group.
It'd be a honor if you'd include this patch in your pack.

Conceptually this has some non-trivial implications as various other areas of the codebase and UI assume a mostly flat namespace. I'll take a look soonish.

aberro wrote:
Yet another patch, which allows filter vehicles in company vehicles lists by cargo they able to accept. This one I'll post in separate topic (as soon as I'll check it's applies for trunk version), because it's not depended on groups nesting.

Thanks, I've merged this with some slight adjustments/additions.

aberro wrote:
Auge wrote:
I got a crash every time I want to exit a game to the welcome window.

This is the same crash I've reported and it was fixed already but not yet build into new version (not for 'nix at least).

It shouldn't be too long before I can do another release.

_________________
Ex TTDPatch Coder, Grumpy Greymuzzle
Avatar by MoonsongWolf.
Patch Pack, Github


Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Wed Oct 18, 2017 12:39 am 
Offline
Engineer
Engineer

Joined: Mon May 20, 2013 8:20 pm
Posts: 63
I have some strange bug - I barely can scroll map in cargo flow mode. It's like it's returning to same point it was a frame before. And the more stations there is the harder becomes to scroll map. Sadly, I don't have time to debug now.


Attachments:
1.sav [10.39 MiB]
Downloaded 5 times
Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Wed Oct 18, 2017 7:29 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Mar 19, 2009 7:25 pm
Posts: 2516
Location: Kent
Im playing on an 8k x 8k map, currently with only a single train running, but the games feels sluggish and the fast forward does nothing.

I have a reasonably powerful computer with 24GB RAM and the game is only using 13% CPU.

Any ideas how i can improve performance and why its goung so slow?

_________________
Image


Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Wed Oct 18, 2017 8:14 am 
Offline
Engineer
Engineer

Joined: Mon May 20, 2013 8:20 pm
Posts: 63
Leanden wrote:
Im playing on an 8k x 8k map, currently with only a single train running, but the games feels sluggish and the fast forward does nothing.

I have a reasonably powerful computer with 24GB RAM and the game is only using 13% CPU.

Any ideas how i can improve performance and why its goung so slow?

Well, I'm full of ideas, from multithreading to optimization. But only few of them are realistic. First of all, if you're running Win x64 version, you could download my build, just look in previous messages. Then, you could try to make your build with optimization flags according to your CPU capabilities, but results are highly depends on used compiler.
As for "why" - because OTTD uses only single thread to do almost everything. And in your case it's doing mostly tile ticking: every tick the game checks and updates 1/8 (if i'm not mistaken) of all ticks. Like, do it need to grow grass on freshly demolished tile, or do this tile need to be flooded by water from neighboring tile. Furthermore, there is animated tiles, which checked and updated every tile. And on large maps there are probably many animated tiles.
Therefore, the game very weakly depends on your CPU (only on it's frequency) and don't depend on your RAM at all (unless it's lower than required; or actually OTTD depends on it's timings, but changing that is far too much for one game).


Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Wed Oct 18, 2017 8:26 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Mar 19, 2009 7:25 pm
Posts: 2516
Location: Kent
I am running a 64x computer. Even with animation switched off it doesnt go any quicker.

I also host a server, is your build compatible with 0.21 of JGR for Multiplayer purposes?

_________________
Image


Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Wed Oct 18, 2017 1:31 pm 
Offline
Engineer
Engineer

Joined: Mon May 20, 2013 8:20 pm
Posts: 63
Leanden wrote:
I am running a 64x computer.

Windows?
Leanden wrote:
I also host a server, is your build compatible with 0.21 of JGR for Multiplayer purposes?

It should be (it's compiled from JGR's version 0.21). I doesn't changed anything, all patchs which I've posted here isn't included in that build.
Hey, but anyway I wouldn't recommend you to run 8kx8k map, because it's too large even for optimized build. I'm running 2kx8k (same as 4kx4k) on Core i7 3770 and I think it's largest map which can run smoothly even on better CPUs.


Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Wed Oct 18, 2017 4:11 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Mar 19, 2009 7:25 pm
Posts: 2516
Location: Kent
aberro wrote:
Leanden wrote:
I am running a 64x computer.

Windows?
Leanden wrote:
I also host a server, is your build compatible with 0.21 of JGR for Multiplayer purposes?

It should be (it's compiled from JGR's version 0.21). I doesn't changed anything, all patchs which I've posted here isn't included in that build.
Hey, but anyway I wouldn't recommend you to run 8kx8k map, because it's too large even for optimized build. I'm running 2kx8k (same as 4kx4k) on Core i7 3770 and I think it's largest map which can run smoothly even on better CPUs.


Yep Windows

The map size unfortunately has to stay as it is because of a project i am working on which needs the smaller scale

_________________
Image


Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Wed Oct 18, 2017 8:28 pm 
Offline
President
President
User avatar

Joined: Sat Jan 18, 2014 6:10 pm
Posts: 908
omer584 wrote:
I was wondering why Vanilla OpenTTD have many multiplayer server but JGR Patch Pack have only a couple of MP servers and most of them are passworded. I would love to play patch features with other people.

I apply to use latest JGRPP on my PlExp server, without password. It is the only patchpack which offer glimpse of economic challenge (maximal loan can be set to 5M GBP instead of vanilla 500k, and purchase prices can be increased accordingly, so investment returns are matter of few years, not half of year, and player must take interest rates into account).

_________________
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension.


Top
   
 Post subject: Re: JGR's Patch Pack
PostPosted: Wed Oct 18, 2017 11:07 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Jan 22, 2005 7:31 pm
Posts: 6048
Location: Wakefield, West Yorkshire
If there is demand, I can easily throw together a UK based JGR Patch server on my RaspberryPI3 (assuming the patchpack has equal low requirements as the vanilla does server wise).

_________________
Image
Worst Behaved IRC Member of 2008, 2009 & 2010 - Go Me!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1045 posts ]  Go to page Previous 149 50 51 52 53 Next

All times are UTC


Who is online

Users browsing this forum: Alberth, Darthrafael, pelya and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2017 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2017.
Hosted by Zernebok Hosting.