Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sat May 25, 2019 12:09 pm

All times are UTC




Post new topic  Reply to topic  [ 31 posts ]  Go to page Previous 1 2
Author Message
 Post subject: Re: "Real" time patch
PostPosted: Mon May 06, 2019 11:00 am 
Offline
Engineer
Engineer
User avatar

Joined: Thu Jun 23, 2005 7:45 pm
Posts: 88
Location: Cyberspace
Ah, gotcha. Okay then.

_________________
Extreme network builder. screenshot thread


Top
   
 Post subject: Re: "Real" time patch
PostPosted: Mon May 06, 2019 1:46 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7350
SciFurz wrote:
I'm currently trying to figure out why cargo only gets a destination with a day length factor of 1038 or lower
i can think of two obvious ways this could happen:
  1. a counter overflows, and never reaches a trigger threshold
  2. a division by a large value results in always rounding to 0

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
 Post subject: Re: "Real" time patch
PostPosted: Mon May 06, 2019 7:48 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sat Oct 13, 2018 4:33 pm
Posts: 34
Eddi wrote:
i can think of two obvious ways this could happen:
  1. a counter overflows, and never reaches a trigger threshold
  2. a division by a large value results in always rounding to 0


Looks like it did have something to do with an overflow of ticks, I reverted the simple linkgraph code changes and added code that uses _date and _date_fract seperately without multiplying the lot together with day ticks and the day length factor (in the end it was too much for int32 while I thought at first I calculated enough overhead). Suddenly a bunch of people want to go places. :-p

Now to do the same trick for other functions where doing things in less that one day is useful..

_________________
Tinkering in the code in between writing mostly naughty stuff.
See https://www.patreon.com/scifurz


Top
   
PostPosted: Mon May 06, 2019 8:06 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sat Oct 13, 2018 4:33 pm
Posts: 34
See top post for the patch.

Modified linkgraph code which seems to work now. A few changes still have to be made though.
Introduced several macros for code clarity and abbreviation, eleminating some long code lines dealing with ticks and their multiplications.

Thought about creating a single date stamp variable with functions for calculations but that would be overkill and a lot of extra code stuffed in between. Where necessary I'll add bits to calculate total days and day fractions seperately.

And now back to digging through the code.

Attachment:
beta, 1980-10-13.png [499.88 KiB]
Not downloaded yet

_________________
Tinkering in the code in between writing mostly naughty stuff.
See https://www.patreon.com/scifurz


Top
   
PostPosted: Wed May 08, 2019 6:47 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sat Oct 13, 2018 4:33 pm
Posts: 34
Getting closer to done now.

Made the time factor a selection list with reasonable options up to running at near real time.
At least for busses it all seems to work, so I'll just be busy creating a network to check out other cargo, trains, etcetera.
If that seems fine I can continue work on the JGR patch and on adding the time factor variable to the savegame code.

_________________
Tinkering in the code in between writing mostly naughty stuff.
See https://www.patreon.com/scifurz


Top
   
 Post subject: Tile size test
PostPosted: Fri May 10, 2019 8:54 am 
Offline
Engineer
Engineer
User avatar

Joined: Sat Oct 13, 2018 4:33 pm
Posts: 34
Checked for tile size at a time factor of 1440 yesterday while tweaking code. Ran a train and a fast bus between two stations with a travel time of 3600 ticks and calculated speed versus number of tiles, and came up with a tile size of roughly 1.73 kilometre.
Taking that into account the tile size at the current highest time factor would go down to around 50 metres, and I could add even one step higher to get around 25 metres but then the game would run at half the real time.
On the other hand that might not matter to anyone wanting to run it as a model train track. It's a lot more room to scale than the tile size of around 18 kilometres with day length patch set at 125.

_________________
Tinkering in the code in between writing mostly naughty stuff.
See https://www.patreon.com/scifurz


Top
   
PostPosted: Sat May 11, 2019 3:25 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sat Oct 13, 2018 4:33 pm
Posts: 34
After trouble with savegame settings, started from scratch again with the JGR source for a clean patch.

As with the vanilla TTD patch, this one introduces the time factor selection for setting the game speed among some minor tweaks.

Have to start a new game to test changes to linkgraph, and timetables and dispatch still have to be converted to the extra real time variables I added, but the patch is playable as far as I see.
As sson as this timing replacement is done I'll have to try out the shunting patch here, which would look awesome on a huge distribution yard with some real timetabling.
Creating day and night cycles seems like a real option too now.

_________________
Tinkering in the code in between writing mostly naughty stuff.
See https://www.patreon.com/scifurz


Top
   
 Post subject: Small update JGR patch
PostPosted: Sat May 11, 2019 6:58 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sat Oct 13, 2018 4:33 pm
Posts: 34
Linkgraph is working now, made a small update of the JGR patch.

Getting dispatch working is next.

_________________
Tinkering in the code in between writing mostly naughty stuff.
See https://www.patreon.com/scifurz


Top
   
 Post subject: Updated JGR patch
PostPosted: Sun May 12, 2019 2:36 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sat Oct 13, 2018 4:33 pm
Posts: 34
Hopefully fixed the dispatch time issue.

Everything seems to be functional now, which doesn't seem bad for something others said couldn't be done. :-p

_________________
Tinkering in the code in between writing mostly naughty stuff.
See https://www.patreon.com/scifurz


Top
   
 Post subject: Update vanilla patch
PostPosted: Tue May 14, 2019 6:42 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sat Oct 13, 2018 4:33 pm
Posts: 34
Modified savegame code for changed and new variables, no problems saving and loading new games but original 1.9.1 savegames fail with invalid chunk size error.
I thought that would work after this last change but maybe I overlooked one variable.

_________________
Tinkering in the code in between writing mostly naughty stuff.
See https://www.patreon.com/scifurz


Top
   
PostPosted: Tue May 14, 2019 9:34 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sat Oct 13, 2018 4:33 pm
Posts: 34
Updated the JGR patch for version 0.31.0 and implemented the saveload changes.

Noticed town labels turned red despite authority on a good level, so building is not a problem.

_________________
Tinkering in the code in between writing mostly naughty stuff.
See https://www.patreon.com/scifurz


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 31 posts ]  Go to page Previous 1 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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-2019 phpBB Limited

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