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

2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: Another Daylength patch

Post by 2007Alain2007 »

Hi pavel1269

I love this patch but could we see some eye candy like a night and day sort of thing

I asking this becuse see the day lengths are longer you could see trainsing runing at night and day

Just an idea
For Community Integrated Version http://code.google.com/p/civopenttd/
User avatar
Benny
Tycoon
Tycoon
Posts: 2185
Joined: 25 Aug 2007 17:03
Location: ~/

Re: Another Daylength patch

Post by Benny »

That's a LOT of work. You have to redraw every sprite in the game or maybe make an overlay thingy that makes all sprites darker.
Image
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: Another Daylength patch

Post by 2007Alain2007 »

I know it was done befor years ago but i did not know if it can be codeing in with this patch

but it have to be redone becuse of all the changes
For Community Integrated Version http://code.google.com/p/civopenttd/
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Re: Another Daylength patch

Post by XeryusTC »

I don't think it was ever done, every night screenshot you might've seen was either with a special night grf or was a mockup.
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: Another Daylength patch

Post by 2007Alain2007 »

For Community Integrated Version http://code.google.com/p/civopenttd/
Auge
Director
Director
Posts: 636
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: Another Daylength patch

Post by Auge »

Hello
2007Alain2007 wrote:here it was done

http://www.tt-forums.net/viewtopic.php?f=33&t=15487
Whow, a 4 years old thread. But yes, it was done. If you see the screensots, especially the animated one from the second page of the thread, you will see, that it was done with an overlay (like Bennythen00b said).
Bennythen00b wrote:You have to redraw every sprite in the game or maybe make an overlay thingy that makes all sprites darker.
I don't think that it is very usefull. It is overcomplicated with any daylengthpatch too. You have to set the daylength and the night-day-cycle in a usefull way (to short daylengths ends in flickering, longer daylengths are maybe boring). A similar idea that I like more: altering seasons. That would be usefull in normal speed too.

Tschö, Auge
User avatar
Benny
Tycoon
Tycoon
Posts: 2185
Joined: 25 Aug 2007 17:03
Location: ~/

Re: Another Daylength patch

Post by Benny »

Altering seasons is kinda possible with the arctic climate and temperate snow tiles mewGRFs. It's basically just the snowline that changes all the time to simulate winter and summer.
Image
Auge
Director
Director
Posts: 636
Joined: 23 Oct 2006 02:07
Location: Berlin

Re: Another Daylength patch

Post by Auge »

Hello
Bennythen00b wrote:Altering seasons is kinda possible with the arctic climate and temperate snow tiles mewGRFs. It's basically just the snowline that changes all the time to simulate winter and summer.
I know, but this is more or less eye candy (I know about town growth in snow). It's more a concept for seasons and physical behaviour of vehicles what's (not only) in my mind.

As an example: longer breaking distance and lower acceleration traction during fall and winter (wet and cold). There are some trainsets wich including locomotives for mountains (slow but with good traction for hilly areas). With changes like above they get more attention.

Tschö, Auge
User avatar
Benny
Tycoon
Tycoon
Posts: 2185
Joined: 25 Aug 2007 17:03
Location: ~/

Re: Another Daylength patch

Post by Benny »

It would be cool if the train tracks were covered in snow and you HAD to use a snow plow to clear the way. And also make the snowplow go slower when driving into snow covered tracks compared to when driving on normal rails. 8)
Image
2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: Another Daylength patch

Post by 2007Alain2007 »

I looked it up on the net there was a GRF for night and day but i think it dose not work with new sets :( but dose with the old ttd ones

http://users2.tt-forums.net/ttdur/ttdur.htm
Last edited by 2007Alain2007 on 03 Jul 2009 22:59, edited 1 time in total.
For Community Integrated Version http://code.google.com/p/civopenttd/
User avatar
Benny
Tycoon
Tycoon
Posts: 2185
Joined: 25 Aug 2007 17:03
Location: ~/

Re: Another Daylength patch

Post by Benny »

That's a redraw of every single sprite, which is a LOOOT of work as you have to use the TTD palette.
Image
laurijh
Engineer
Engineer
Posts: 19
Joined: 21 Jul 2009 11:52
Location: Finland

Re: Another Daylength patch

Post by laurijh »

I wanted to try pavel1269's patch but since it was made from a rather old version of the sources (from April), it wouldn't apply against the latest nightlies. I updated the patch and now it works cleanly with r16889.

I think I also managed to fix the bug where a high daylength factor and 1/1 production factor make vehicles be retired before new ones are introduced. I simply multiplied all 3 of the duration_phase_1, duration_phase_2 and duration_phase_3 initialization algorithms (in engine.cpp) by daylength_factor/production_factor. I noticed there was also another bug that this happens to fix; the increase of vehicle's reliability after introduction and decrease of vehicle's reliability before retirement were happening too fast.

I haven't done any real testing, this just happens to work for me so maybe someone else will also find it useful while we wait for pavel1269 to have time for this again. I do hope he'll continue developing the patch and submit it for inclusion into trunk. :)

Edit: removed patch. No need for it now that Pavel has posted updated and improved versions. :)
Last edited by laurijh on 17 Aug 2009 04:48, 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 »

Update :-)

Removed secondish patch (slow down economy). Added balance type (see first post). And completely rewrite (no saving values).
Tested and hope, hope no bugs. Any found, please report.
laurijh
Engineer
Engineer
Posts: 19
Joined: 21 Jul 2009 11:52
Location: Finland

Re: Another Daylength patch

Post by laurijh »

Thanks for the update Pavel :) But I think there are a few bugs.
  1. (Cosmetic): the displayed production value of industries is a little funny when "Slow down industry changes with daylength factor" is "On". For example, a forest which normally has a production of 170 tonnes a month shows a production of 306 tonnes with daylength factor 2 even when "Show original production value of industry" is "On". When it's "Off", the production shows as 612 tonnes. With higher daylength factors you get quite absurd production values...
  2. This is related to what you and W_neun discussed earlier about the loan interest. When "Balancing of daylength" is set to "Running costs", all of the following costs are multiplied by the daylength factor: "Property Maintenance", "Loan Interest" and "Other". Shouldn't they only be multiplied when using the "All costs" option? By the way, is it intentional that the running costs are multiplied twice, in other words by (daylength factor)^2 ?
  3. With high daylength factors, vehicles seem to be losing their reliability very fast and they don't obey the service intervals (I'm using daylength 10 and service interval 15 days). Additionally, they get old too fast; I've only played for a couple of years in game-time and my vehicles' ages are something like 16 years.
Last edited by laurijh on 07 Aug 2009 19:42, 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 »

laurijh wrote:Thanks for the update Pavel :)
Thanks for a feedback!
laurijh wrote:I think there are a couple of bugs. The first one seems to be just cosmetic; the displayed production value of industries is a little funny when "Slow down industry changes with daylength factor" is "On". For example, a forest which normally has a production of 170 tonnes a month shows a production of 306 tonnes with daylength factor 2 even when "Show original production value of industry" is "On". When it's "Off", the production shows as 612 tonnes. With higher daylength factors you get quite absurd values...
Tested and really strange, but only cosmetic bug. Mine with production of 176, Slow down ... On, factor 50, at 1st of the february -> 9834. When i turn show orig values off. 491 700 :-D ... but cargo generated at station was same. At 1st of March it went down to 8900. Have to take a look at it.
laurijh wrote:The second bug is related to what you and W_neun discussed earlier about the loan interest. When "Balancing of daylength" is set to "Running costs", all of the following costs are multiplied by the daylength factor: "Property Maintenance", "Loan Interest" and "Other". Shouldn't they only be multiplied when using the "All costs" option?
In my opinion, this is "linked" to running cost. But i think, making a new patch option (include property maintenance a loan interests in running costs) will solve everything :-)
laurijh wrote:One more thing; with high daylength factors, vehicles seem to be losing their reliability very fast and they don't obey the service intervals (I'm using daylength 10 and service interval 15 days).
So, they are loosing their reliability the same, but 15 days flow 10times more? Or what do you mean?

EDIT:
laurijh wrote:By the way, is it intentional that the running costs are multiplied twice, in other words by (daylength factor)^2 ?
Yes. If you dont want to balance the runnign costs and you set factor to 10, then your vehicle spends 10more times at road and pay the same. So at building and info guis this needs to be multiplied. Also if you choose a Running costs it needs to be once more multiplied, but not only gui, but even the amounts ;-)
laurijh wrote:I've only played for a couple of years in game-time and my vehicles' ages are something like 16 years.
Does vehicles also disappear or the only get faster older in-game?
laurijh
Engineer
Engineer
Posts: 19
Joined: 21 Jul 2009 11:52
Location: Finland

Re: Another Daylength patch

Post by laurijh »

pavel1269 wrote:
laurijh wrote:One more thing; with high daylength factors, vehicles seem to be losing their reliability very fast and they don't obey the service intervals (I'm using daylength 10 and service interval 15 days).
So, they are loosing their reliability the same, but 15 days flow 10times more? Or what do you mean?
Reliability drops in the same real-time, so you have to service more frequently in game-time. I guess this can be considered a feature, but then with higher daylengths it's necessary for user to set service intervals to something else than the defaults. But never mind what I said about vehicles not obeying the service intervals, I had actually set it wrong myself... :)
pavel1269 wrote:
laurijh wrote:I've only played for a couple of years in game-time and my vehicles' ages are something like 16 years.
Does vehicles also disappear or the only get faster older in-game?
The available vehicles don't disappear. Only the vehicles I have built are getting old at an "accelerated" speed.
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 »

Thanks, at least some bug from old version disappear :-)
And another todo: patch option ... vehicle reliability drops down with daylength, if true, interval set to 15, with day length factor 3, will mean, vehicle will service in 5 days :-)
W_neun
Engineer
Engineer
Posts: 24
Joined: 03 Apr 2009 11:03

Re: Another Daylength patch

Post by W_neun »

Great patch, Pavel! And thanks especially for the new payment reducing option.

There is one thing I think isn't right though: why is the running cost increased even at the 'no balancing' and 'payments' settings? I read your explanation above:
pavel1269 wrote:If you dont want to balance the runnign costs and you set factor to 10, then your vehicle spends 10more times at road and pay the same. So at building and info guis this needs to be multiplied.
but I think you're wrong here. In the case of no balancing, the idea is that the expenses aren't changed at all (while the vehicles would make much higher profits per year, thus making the game very easy indeed), right? If someone does want to lower the profit, he can use one of the other options. And in the case of the 'payments' option, higher running costs aren't needed for balancing (and just make the game stupidly hard). Running costs should be increased only if the 'more expenses' method is used for balancing - that means the 'running costs' and 'all costs' settings. (By the way, I don't really understand why is there a setting for just the runnning costs.)

And I would request a new feature: please make a separate variable for the balancing options (I mean it wouldn't be the same as the 'daylength factor'). I would like to play with 4x daylength + halved payments, what isn't possible now.
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 »

W_neun wrote:Great patch, Pavel! And thanks especially for the new payment reducing option.
Thanks.
W_neun wrote:There is one thing I think isn't right though: why is the running cost increased even at the 'no balancing' and 'payments' settings? I read your explanation above:
pavel1269 wrote:If you dont want to balance the runnign costs and you set factor to 10, then your vehicle spends 10more times at road and pay the same. So at building and info guis this needs to be multiplied.
but I think you're wrong here. In the case of no balancing, the idea is that the expenses aren't changed at all (while the vehicles would make much higher profits per year, thus making the game very easy indeed), right? If someone does want to lower the profit, he can use one of the other options. And in the case of the 'payments' option, higher running costs aren't needed for balancing (and just make the game stupidly hard). Running costs should be increased only if the 'more expenses' method is used for balancing - that means the 'running costs' and 'all costs' settings. (By the way, I don't really understand why is there a setting for just the runnning costs.)
Simple answer: if you touch only one line of code, the day_ticks, lets say, 5x more. You will simply pay 5x more per year for running costs, only the "gui" will show wrong value. So actually, I multiply it only one time, when going to pay.
ANd why is it there? I dont know, but actually i use it myselft :-)
W_neun wrote:And I would request a new feature: please make a separate variable for the balancing options (I mean it wouldn't be the same as the 'daylength factor'). I would like to play with 4x daylength + halved payments, what isn't possible now.
New patch option ... day length balance multiplier ( 1 (no balance type ),2 ... day length factor ) ... :-)
laurijh
Engineer
Engineer
Posts: 19
Joined: 21 Jul 2009 11:52
Location: Finland

Re: Another Daylength patch

Post by laurijh »

Hmm, well even if you think multiplying running costs twice is the right behaviour, there's one thing that I would consider a bug; an inconsistency between displayed vehicle profits and the total sum of income - running costs.

Example: I'm currently playing (at daylength factor 5 and balancing with running costs) with only 1 Airship, which shows "Profit this year: €3,536", yet in the Company Finances window for current year it shows "Aircraft running costs -€103,160" and "Aircraft Income +€24,168".

This might not otherwise be a big deal but now you can't see which vehicle makes a profit and which makes a loss in the vehicle list window.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 15 guests