Another Daylength patch

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

Eddy Arfik
Transport Coordinator
Transport Coordinator
Posts: 260
Joined: 09 Apr 2014 11:10

Re: Another Daylength patch

Post by Eddy Arfik »

chrissicom wrote: when increasing the daylength factor by 4, everything works like you would expect (e.g. industries produce 4 times as much a month).
Besides the fact that approach you are suggesting has been tried previously and proven to break almost every game mechanic, I don't see the logic to doing things that way, I expect that slowing down the time slows the pace of the game, ie: industry productions and other such game mechanics remain at standard trunk values regardless of daylength setting, otherwise it's simply an almost pointless game date hack.
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: Another Daylength patch

Post by Pyoro »

Before bothering with (probably) additional settings like production factor (which, as the name implies, doesn't seem to me to be an integral part of a daylength path, although devs might disagree) it'd probably need to fix the bugs it has, foremost I can remember is the smoke-animation one (probably some other problems with animations, too).
abregado
Engineer
Engineer
Posts: 35
Joined: 02 Apr 2015 22:39

Re: Another Daylength patch

Post by abregado »

With the Balance Factor of this patch I would expect that you can use this patch either way. Set the Balance Factor to 1 and Daylength to 4 and it should just increase day length without changing any other mechanics (except you will have 4 years of cash after 1 year)

Any chance that the balance factor can be set to a very small number (or even 0)? I'm interested in vehicles moving but no money/date change (as a replacement for pause in a multiplayer game, so you can still debug your network)
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Re: Another Daylength patch

Post by chrissicom »

With the Balance Factor of this patch I would expect that you can use this patch either way. Set the Balance Factor to 1 and Daylength to 4 and it should just increase day length without changing any other mechanics (except you will have 4 years of cash after 1 year)
Last time I've been working on a daylength patch it did not affect other mechanics. E.g. industry production being 4 times as much a month with a daylength factor of 4 is no change of game mechanics. It's just what you would expect. Changing game mechanics would mean that a daylength factor of 4 is not equal to industry production being 4 times as much a month and this would just complicate things. You can make a patch that influences the amount of industry production independently from a daylength patch (I believe there is a NewGRF for this already as there is for running costs etc.).

Also there is much misunderstanding in how payment calculation works (unless it changed in the last 10.000 revisions a lot). IIRC payment is actually not calculated by days in transit (as the graphical representation in the game says) but by ticks in transit. The length of a tick is not changed by a daylength patch, only the amount of ticks a day has and this is just a date representation and as I previously said should ONLY influence the introduction date of vehicles and coloured newspaper and NOTHING else, because everything else has nothing to do with how long a day is, but rather how many ticks have passed and this is always the same irregardless of how many ticks a day has. (I hope that was understandable my English is a bit rusty)
User avatar
pavel1269
Route Supervisor
Route Supervisor
Posts: 473
Joined: 03 Dec 2006 13:22
Location: Czech Republic
Contact:

Re: Another Daylength patch

Post by pavel1269 »

chrissicom wrote:Last time I've been working on a daylength patch it did not affect other mechanics. ...
AFAIK this approach breaks Newgrf industries a big time, especially ESC vectors.
chrissicom wrote:The length of a tick is not changed by a daylength patch, only the amount of ticks a day has and this is just a date representation ...
And that is the difference of my "true day length" and other day lengths as this one makes "ticks" longer instead of days which results in unbroken NewGRFs but also lower production and so on and on.

Neither of the two approaches "modifies the mechanics", it's just a lot of consequences which are changed, because we change the "core mechanics" which everything else depends on.
Eddy Arfik
Transport Coordinator
Transport Coordinator
Posts: 260
Joined: 09 Apr 2014 11:10

Re: Another Daylength patch

Post by Eddy Arfik »

chrissicom wrote:Nothing else but the speed time passes by should be changed by a daylength patch.
Indeed, so why make other statements that contradict this? Pavel's approach of simply increasing the length of a "tick" achieves this almost perfectly
chrissicom wrote: industry production being 4 times as much a month with a daylength factor of 4 is no change of game mechanics. It's just what you would expect
Industry production in measured in units per month of game time, not units per second of real time. I would expect that it doesn't matter if that in-game month takes 30 seconds or 5 minutes to pass, the "units per month" measurement will remain constant.
chrissicom wrote:Also there is much misunderstanding in how payment calculation works (unless it changed in the last 10.000 revisions a lot). IIRC payment is actually not calculated by days in transit (as the graphical representation in the game says) but by ticks in transit.
The misunderstanding here is yours, if it was in fact based on "ticks in transit" my modification to adjust payment rate by daylength factor would not have been necessary, here is the relevant line from economy.cpp (unpatched trunk)

Code: Select all

	Money profit = GetTransportedGoodsIncome(accepted, DistanceManhattan(source_tile, st->xy), days_in_transit, cargo_type);
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: Another Daylength patch

Post by Eddi »

Eddy Arfik wrote:
chrissicom wrote:Nothing else but the speed time passes by should be changed by a daylength patch.
Indeed, so why make other statements that contradict this? Pavel's approach of simply increasing the length of a "tick" achieves this almost perfectly
the "contradiction" here is that different people have different expectation of what so-called "core mechanics" should be based on ticks and which ones should be based on days. the game is also not fully consistent here.

e.g. some people hate the fact that an engine's running costs exceeds the engine's purchase cost. other people feel the opposite, that if the running costs gets scaled back, then the game gets "unbalanced" (which isn't balanced in the first place either, but that's a different problem)
chrissicom wrote: industry production being 4 times as much a month with a daylength factor of 4 is no change of game mechanics. It's just what you would expect
Industry production in measured in units per month of game time, not units per second of real time. I would expect that it doesn't matter if that in-game month takes 30 seconds or 5 minutes to pass, the "units per month" measurement will remain constant.
no, industry production happens every 256 ticks, independent from days. i think the problem with ECS was that it planned ahead its production based on 8 or 9 of these production cycles happening per month, but most daylength patches increased this amount.
chrissicom wrote:Also there is much misunderstanding in how payment calculation works (unless it changed in the last 10.000 revisions a lot). IIRC payment is actually not calculated by days in transit (as the graphical representation in the game says) but by ticks in transit.
The misunderstanding here is yours, if it was in fact based on "ticks in transit" my modification to adjust payment rate by daylength factor would not have been necessary, here is the relevant line from economy.cpp (unpatched trunk)

Code: Select all

	Money profit = GetTransportedGoodsIncome(accepted, DistanceManhattan(source_tile, st->xy), days_in_transit, cargo_type);
this is also a misconception. "days_in_transit" have nothing to do with the "gui" days, but they are actually counted up every 2.5 days (185 ticks). this gets more problematic nowadays, because NewGRFs can adjust this value up or down depending on which vehicle loaded the cargo.


anyway, a naive "we just change daylength and leave everything else untouched" approach never worked. and there is no reason why it would work the next time around. you need to touch EVERYTHING. and make sure that it both adheres to people's wishes, and that it results in a somewhat balanced gameplay. and like i said, people's wishes vary a lot.

the problem with basically all previous daylength patches was that this "everything" part was not consequently and consistently done, and thus no such patch was ever going to be fit for review.
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Re: Another Daylength patch

Post by chrissicom »

Despite my opinion that daylength should only affect when vehicles are introduced: On big maps I go from historic locomotives to maglevs before I could even build on 10% of the map, that's why I want days to be longer to have more time to build and nothing else should change, especially I don't want to half profits by doubled daylength, because then I am where I was before, 10% of the map when I can build maglevs already. Let's make a list containing aspects of the game that could / should / might whatever depending on people's opinion be affected (not to say changed) by a daylength patch.

I want to have a look at the current code, since I have missed a few thousand revisions :lol: I'll start and you add stuff hopefully (no specific order). Let's be neutral here, i.e. I leave out my opinion of what of these "mechanics" should or should not be changed by a daylength patch.
  1. Vehicle introduction date
  2. Coloured newspaper introduction date
  3. Monthly industry production
  4. Yearly running costs of vehicles
  5. Yearly inflation of prices
  6. Engine breakdowns
  7. Economy changes (inc. funding and closing of industries)
  8. Cargo / Passenger generation and disappearance
  9. Cargo payment rates
  10. Station / Town rating
  11. Town growth (by time and by goods delivery)
  12. Vegetation growth
  13. Performance rating
  14. Subsidies
  15. ...
  16. ...
  17. ...
  18. ...
  19. ...
  20. ...
P.S. And an idea for another approach. It seems to be a problem that there is inconsistency in the usage of days and ticks. Why not changing this before making a daylength patch? I.e. making everything depending on days OR ticks and not both depending on where you are in the code.
Eddy Arfik
Transport Coordinator
Transport Coordinator
Posts: 260
Joined: 09 Apr 2014 11:10

Re: Another Daylength patch

Post by Eddy Arfik »

chrissicom wrote:Despite my opinion that daylength should only affect when vehicles are introduced: On big maps I go from historic locomotives to maglevs before I could even build on 10% of the map, that's why I want days to be longer to have more time to build and nothing else should change, especially I don't want to half profits by doubled daylength, because then I am where I was before, 10% of the map when I can build maglevs already.
That's actually quite similar to what I expect daylength patch to do, if you replace the words "I don't want to half profits by doubled daylength" with "I don't want to double profits by doubled daylength". The reason I use this patch is so by setting daylength to say 4, I can move the same amount of cargo using less vehicles which allows semi-realistic network to be built, if productions are multiplied by daylength factor, I would be back where I was before, ie: 12-track mainlines and roads clogged with truck spam (in a game with 3 players this often causes so much lag the game becomes unplayable and must be abandoned before goals are reached).
chrissicom wrote: Let's make a list containing aspects of the game that could / should / might whatever depending on people's opinion be affected (not to say changed) by a daylength patch.

I want to have a look at the current code, since I have missed a few thousand revisions
Instead of making theoretical list based on assumptions about code, I suggest playing a few games with this patch and then posting list of what you feel doesn't quite work right.
the version here should apply to current trunk.
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Another Daylength patch

Post by kamnet »

chrissicom wrote:Despite my opinion that daylength should only affect when vehicles are introduced: On big maps I go from historic locomotives to maglevs before I could even build on 10% of the map, that's why I want days to be longer to have more time to build and nothing else should change...
If that is your only goal, then grab the source code for OpenGFX+ Trains (or any other vehicle NewGRF) and modify the introduction dates. Problem solved, no patching required.

For the record, the reason I use daylength patches is because I think it's ridiculous that it takes a road vehicle a week to shift cargo from one side of a city to another, or for trains to be in transit non-stop for months at a time on one cargo delivery run. I don't need gobs of money. If I needed that, there's the cheat menu.
Stepp
Engineer
Engineer
Posts: 1
Joined: 18 Apr 2015 08:29

Re: Another Daylength patch

Post by Stepp »

Hi everybody, I want to play with this patch, but I dont know how to make a compilation. Eventhough I read some manuals, my PC experience is so small. Can somebody make (or does somebody have it) a compilation of this patch with newest version OTTD 1.5.0 please? It would by great and I would be gratefull...
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Another Daylength patch

Post by kamnet »

The best way to gain experience is to try and fail, and then examine your failings and try again.

I'm sure somebody will eventually come along and do so, though.
User avatar
DarkenMoon
Engineer
Engineer
Posts: 11
Joined: 03 Aug 2014 18:43
Location: Reno, NV

Re: Another Daylength patch

Post by DarkenMoon »

Hey all, I updated this to trunk (27261), and made win32 and win64 binaries for 1.5.0 and 27261. This was updated from the version made for 27051.
Attachments
01_true_day_length_r27261.diff
Patch
(7.86 KiB) Downloaded 496 times
OpenTTD_Daylength_1.5.0-win32.zip
Win32 Binary
(5.64 MiB) Downloaded 234 times
OpenTTD_Daylength_1.5.0-win64.zip
Win64 Binary
(8.97 MiB) Downloaded 596 times
User avatar
DarkenMoon
Engineer
Engineer
Posts: 11
Joined: 03 Aug 2014 18:43
Location: Reno, NV

Re: Another Daylength patch

Post by DarkenMoon »

27261 post, since there is apparently a limit of 3 files per post.
Attachments
OpenTTD_Daylength_r27261-win32.zip
(6.98 MiB) Downloaded 233 times
OpenTTD_Daylength_r27261-win64.zip
(9.25 MiB) Downloaded 482 times
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Another Daylength patch

Post by Wahazar »

After some gamex4 years, frequent desync errors started to occur.
Regardless of above client or compiled myself, Every client is affected, compiled by myself or above linked, regardless of OS platform.

Did anybody else tested this patch in MP mode?
Formerly known as: McZapkie
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, wired, ECS industry extension, V4 CEE train set, HotHut.
Another favorite games: freeciv longturn, OHOL/2HOL.
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Another Daylength patch

Post by Wahazar »

False alarm - desync errors occurs also on 1.5.0 version, probably due to one of the newgrf's.
Last edited by Wahazar on 19 May 2015 17:53, edited 1 time in total.
emp_zealoth
Engineer
Engineer
Posts: 1
Joined: 19 May 2015 14:25

Re: Another Daylength patch

Post by emp_zealoth »

I'm sorry for my nubness, but I think I can't get it working properly
What I did:
I took this : OpenTTD_Daylength_1.5.0-win64.zip from DarkMoon's post, unpacked it overwriting the previous vanilla installation
The game launches with version 1.5.0M, but there are no Economy settings

Cheers

EDIT: I managed to get only Day length factor in Accounting settings tab (It does slow the days changing). How can i get the remaing options? Balance factor/etc
Wahazar
Tycoon
Tycoon
Posts: 1451
Joined: 18 Jan 2014 18:10

Re: Another Daylength patch

Post by Wahazar »

EDIT: I managed to get only Day length factor in Accounting settings tab (It does slow the days changing). How can i get the remaing options? Balance factor/etc
There are two completely different patches within one thread, which is somewhat confusing.
In my opinion, this thread should to be split into two separate: Another Daylength patch and True Daylength patch.
Last edited by Wahazar on 19 May 2015 19:39, edited 1 time in total.
User avatar
pavel1269
Route Supervisor
Route Supervisor
Posts: 473
Joined: 03 Dec 2006 13:22
Location: Czech Republic
Contact:

Re: Another Daylength patch

Post by pavel1269 »

The options you see in the first post refer to different approach of the day length patch which I abandoned long time ago. The new day length approch, which I call "true day length", functions very differently and has the only one option which you probably see.
User avatar
SVW-Gigant
Engineer
Engineer
Posts: 28
Joined: 05 Jun 2008 20:12
Location: Bremen, HB, Germany
Contact:

Re: Another Daylength patch

Post by SVW-Gigant »

Hey, thank u for this implimented daylenght patch in 1.5.0! Now, it is more possible to integrate very slow vehicles (ships, airships, helicopters v.e.) in the business, so they have more time to supply the freight and make more profit. A game is no longer finshed after a few dozend hours :)
experience Northern Germany 2.1!
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 1 guest