Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Wed Aug 15, 2018 10:56 am

All times are UTC




Post new topic  Reply to topic  [ 219 posts ]  Go to page Previous 17 8 9 10 11
Author Message
PostPosted: Sat May 21, 2011 12:30 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7086
i took the liberty to update the town cargo patch to trunk and yacd


Attachments:
town-cargo-factor-02-noslv-trunk.patch [5.58 KiB]
Downloaded 119 times
town-cargo-factor-02-noslv-yacd.patch [5.76 KiB]
Downloaded 99 times
daily-autosave-01-trunk.patch [3.9 KiB]
Downloaded 94 times

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


Last edited by Eddi on Sat May 21, 2011 3:34 pm, edited 2 times in total.
Top
   
PostPosted: Sat May 21, 2011 2:33 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Oct 04, 2008 11:05 pm
Posts: 2622
Location: Lost in spaces
Nice Eddi, with the CargoD*st patches (maybe YACD too) that patch is very usefull.

Unfortunately I have a bit to much on my plate already to update it myself at the moment but if someone is looking to update the daylength part of the sprinkles ... I have adjusted a few more places in my patchpack that needed tweaking also, I'd be happy to point them out.

IIRC the changes are:
- hs->minimum life (town_cmd.cpp) multiplied by daylength factor because town growth and shrinkage is unbalanced.
- t->time_untill_rebuild (town.h) multiplied by daylength factor for the same reason as above.
- t->exlusive_counter (town_cmd.cpp) multiplied by daylength factor because a year is a year.
- Vehicle profit (economy.cpp) devided by daylength factor prevents skyrocketing of income with higher daylength factors. (still needs some adjustments -> fractional income for profits below 1)

Some of these values need also their defenition changed to prevent overflowing. (eg. byte minimum_life -> uint16 minimum_life in house.h)
Others require additional changes in the savegamecode. (eg. the exclusive_counter)

I will post more details and check if I forgot to mention something if someone shows interest in continuing to develop this version of the daylength patch. ;)


Edit:
Almost forgot ...
- In CargoDist I adjusted the linkgraph recalculation to use the ORIG_DAY_TICKS. (ignoring the daylength factor.)
- I do not see or understand why the daylength factor needs to be saved globally, most likely I will change the savegamecode to SDT_VAR instead of using SDTG_VAR and disable changing it in network games ... (not yet done as I think it will break the savegamecompatibiliyty I have been keeping for a while.)

_________________
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.


Last edited by ChillCore on Sat May 21, 2011 3:40 pm, edited 1 time in total.

Top
   
PostPosted: Sat May 21, 2011 3:32 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7086
thanks for these hints, i'll take a look at them. in the mean time, my attempt at updating the daylength patch (without those changes mentioned above) (note that they don't apply cleanly to yacd, because it has not been updated to trunk yet, and last trunk revision (r22482) is relevant to this patch)

autosave patch also updated, and attached in my previous post above


Attachments:
variable-daylength-01-noslv-trunk.patch [3.38 KiB]
Downloaded 216 times
variable-daylength-02-towngrowthfreq-trunk.patch [783 Bytes]
Downloaded 152 times
variable-daylength-03-autofill-roundoff-trunk.patch [632 Bytes]
Downloaded 139 times

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)
Top
   
PostPosted: Sat May 21, 2011 3:43 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7086
ChillCore wrote:
- I do not see or understand why the daylength factor needs to be saved globally, most likely I will change the savegamecode to SDT_VAR instead of using SDTG_VAR and disable changing it in network games ... (not yet done as I think it will break the savegamecompatibiliyty I have been keeping for a while.)

don't know either, i am just updating as closely to the original as possible at this point. might be because the settings struct is not necessarily available everywhere where DAY_TICKS is used. savegame compatibility should not be affected as long as the same position in the savegame structure is kept.

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


Top
   
PostPosted: Sat May 21, 2011 3:53 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Oct 04, 2008 11:05 pm
Posts: 2622
Location: Lost in spaces
Hehe, edited my post without noticing you posted ...

If you need help finding things, just give me a yell, I'd be happy to help. ;)

Edit:
Eddi wrote:
ChillCore wrote:
- I do not see or understand why the daylength factor needs to be saved globally, most likely I will change the savegamecode to SDT_VAR instead of using SDTG_VAR and disable changing it in network games ... (not yet done as I think it will break the savegamecompatibiliyty I have been keeping for a while.)

don't know either, i am just updating as closely to the original as possible at this point. might be because the settings struct is not necessarily available everywhere where DAY_TICKS is used. savegame compatibility should not be affected as long as the same position in the savegame structure is kept.
I know there sometimes is a problem in my patchpack when changing the daylength factor ingame, saving with the modified value, and loading the game again ...
It could be because of me making a mistake while trying to maintain backwards compatibilty ... ¿or because of the value being saved globally in the savegame.? (-> needs testing after I changed it.)

I tried changing it before and the code complained because of not finding "daylength_factor", IIRC, it has been a while ...

_________________
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.


Top
   
PostPosted: Sat May 21, 2011 4:04 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7086
ChillCore wrote:
I know there sometimes is a problem in my patchpack when changing the daylength factor ingame, saving with the modified value, and loading the game again ...

it is very unlikely that this is due to the saveload code from the daylength patch itself. it might be because some counters somewhere else get out of range. but using SDT_VAR or SDTG_VAR doesn't change the savegame structure at all, only the way the code handles the data. this change wouldn't even need a savegame bump.

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


Top
   
PostPosted: Sun May 22, 2011 1:19 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Oct 04, 2008 11:05 pm
Posts: 2622
Location: Lost in spaces
Eddi wrote:
ChillCore wrote:
I know there sometimes is a problem in my patchpack when changing the daylength factor ingame, saving with the modified value, and loading the game again ...

it is very unlikely that this is due to the saveload code from the daylength patch itself. it might be because some counters somewhere else get out of range. but using SDT_VAR or SDTG_VAR doesn't change the savegame structure at all, only the way the code handles the data. this change wouldn't even need a savegame bump.
Yeah, it is more likely that date_fract (asserts points at this when trying to load) is not correct (or overflown) after changing the daylength factor and saving during the same day.
That is why I think changing it ingame should be disabled ...

Do you happen to know if globally saved values can be changed by clients in multiplayer games? When changing to SDT_VAR it would best be disabled for network games, I think.

_________________
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.


Top
   
PostPosted: Sun May 22, 2011 1:22 am 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7086
i have not looked into it, but i guess that is either one of the "flags" or one of the "guiflags". there should be plenty of examples, and it should also not depend on SDTG_VAR or SDT_VAR

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


Top
   
PostPosted: Sun May 22, 2011 1:37 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Oct 04, 2008 11:05 pm
Posts: 2622
Location: Lost in spaces
In current trunk.
flags = SLF_NO_NETWORK_SYNC
or
guiflags = SGF_NO_NETWORK (I think this is the one ...)

If globally saved or not does not make a difference then it was/is not disabled. ;)

_________________
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.


Top
   
PostPosted: Mon May 23, 2011 11:01 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Sep 20, 2006 11:43 pm
Posts: 327
Location: UK
Do you reckon you can fork the cargodist git repo with this?
would make life easier for all if we could just pull cargodisst-daylength from git


Top
   
PostPosted: Tue May 24, 2011 9:50 am 
Offline
Engineer
Engineer

Joined: Sat May 14, 2011 10:58 am
Posts: 45
Location: Sausagewood
Hello Eddi,

although I've settled on another patch now, the update will be helpful for other players. Thanks for your work!

Kind Regards,
The Axe


Top
   
PostPosted: Sun Jul 03, 2011 3:06 pm 
Offline
Engineer
Engineer
User avatar

Joined: Thu Nov 12, 2009 3:50 pm
Posts: 5
Excuse me if this issue has already been discussed, but I cannot find it anywhere on these boards or on the web.

I am running the cargodist + sprinkles build (r19964M) with a daylength factor of 16 so time passes by nice and slowly. But it seems this is messing up cargodist. Whenever my train loads a bunch of passengers from station A to C, but the train passes a station B en-route, it will just unload everything at station B. I am not using non-stop orders by the way, is that of any relevance?

Please let me know if this is a known problem and how to fix is, and once more my apologies if I should have been able to find this myself.

_________________
Something witty.


Top
   
PostPosted: Sun Jul 03, 2011 5:39 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7086
yes. that very likely is the cause. newer cargodist versions should have that fixed, but r19964 is very old.

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


Top
   
PostPosted: Thu Jul 11, 2013 12:18 pm 
Offline
Engineer
Engineer

Joined: Tue May 03, 2011 11:52 am
Posts: 37
I have updated the towncargo patch against trunk: 25581. I have not extensively tested this


Attachments:
File comment: 25581
towncargo-25581.diff [5.88 KiB]
Downloaded 115 times
Top
   
PostPosted: Tue Sep 10, 2013 12:40 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Mon Mar 24, 2008 1:04 pm
Posts: 265
Location: Finland
Now that Cargodist is in trunk, could someone update those three daylength patches up to current trunk?

_________________
Projects in progress: Finnish Trainset (DevZone)| Finnish Rail Infrastructure and Stations Set (DevZone)


Top
   
PostPosted: Fri Apr 03, 2015 3:19 am 
Offline
Engineer
Engineer

Joined: Fri Mar 01, 2013 6:47 pm
Posts: 23
<PUNT> Yes, can we get these in the trunk please?

_________________
Image


Top
   
PostPosted: Fri Apr 03, 2015 3:50 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Sep 28, 2009 5:15 pm
Posts: 6131
Location: Eastern KY
HAAH! How funny, I just pulled up this topic to ask the same. Anybody? :D

_________________
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
Image

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | RoadTypes?


Top
   
PostPosted: Sat Apr 04, 2015 6:39 pm 
Offline
Engineer
Engineer

Joined: Fri Mar 01, 2013 6:47 pm
Posts: 23
It's the passenger traffic reduction that's the biggest thing......now we've got Cargodist in the trunk.......it's fantastic but I just can't keep up with the traffic unless it's 2020 and I've got a dozen super fast electric trains per route.

_________________
Image


Top
   
PostPosted: Mon Oct 12, 2015 6:38 pm 
Offline
Engineer
Engineer

Joined: Fri Apr 06, 2012 3:07 am
Posts: 4
Swoop wrote:
It's the passenger traffic reduction that's the biggest thing......now we've got Cargodist in the trunk.......it's fantastic but I just can't keep up with the traffic unless it's 2020 and I've got a dozen super fast electric trains per route.

Indeed. It turns out that the cargo factor one is fairly small.

I've attached my attempt at forward porting it to trunk revision 27400. I make no representation that it operates correctly or that it won't eat your games, explode your computer, or torture small kittens. I have tested it briefly on a saved game with a crazy high number of passengers at dozens of stations. Adjusting the factor did reduce the congestion after some time passed. I don't take any credit for the actual code. I only modified it to build with the trunk.


Attachments:
File comment: Town cargo factor patch updated for r27400
town-cargo-factor-lw01-r27400.patch [6.8 KiB]
Downloaded 56 times
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 219 posts ]  Go to page Previous 17 8 9 10 11

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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-2018 phpBB Limited

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