[question]Slow down years counter
Moderator: OpenTTD Developers
[question]Slow down years counter
Hi, people ..
First of all, I found about OpenTTD just recently and I just love it! You are the best!
But one thing there is I can not found on this forum { dont know what to put to search },
I would pretty much like to slow down the game date/years progress, is it possible? Only the date/years everything else like vehicles, economy, etc. not affected { some console command or line of C code to edit? }. I would like to make one year last for about an hour, or even more .... so I can start the biggest posible map and play { with default rate in OpenTTD I am in year 1990 and I only managed to interconnect with rails only half of the map! }
I would pretty much like it { not as a cheat }, but I liked the times back when one year was about 40+ minutes of real-time { original TT on my 486DX2 machine } and I could play for a more than two weeks { game-time } and have enough time to search for perfection in rail design ...
Thanks for any help
PS: putting back years manualy with that cheat menu is not what I am looking for
First of all, I found about OpenTTD just recently and I just love it! You are the best!
But one thing there is I can not found on this forum { dont know what to put to search },
I would pretty much like to slow down the game date/years progress, is it possible? Only the date/years everything else like vehicles, economy, etc. not affected { some console command or line of C code to edit? }. I would like to make one year last for about an hour, or even more .... so I can start the biggest posible map and play { with default rate in OpenTTD I am in year 1990 and I only managed to interconnect with rails only half of the map! }
I would pretty much like it { not as a cheat }, but I liked the times back when one year was about 40+ minutes of real-time { original TT on my 486DX2 machine } and I could play for a more than two weeks { game-time } and have enough time to search for perfection in rail design ...
Thanks for any help
PS: putting back years manualy with that cheat menu is not what I am looking for
It would be nice, however AFAIK it's impossible (many ppl already asked for that feature). Meantime you can try another thing (which I'm doing): Pause the game, press CTRL+ALT+C to get to that cheat menu and enable Build on Pause. Thank's to it I made a lot of progress in one year unpausing game only to let trains out of their depots and get more money to build new lines.
I know this isn't what you were looking for, however I think it's the best solution right now.
I know this isn't what you were looking for, however I think it's the best solution right now.
There is a patch writen by Sacro which can slow down the game but it is very outdated. It can still be found in the MiniIN.
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)
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Oh well, I looks like searchig the C code files is still the last option ... maybe I dig into that after semester exams. I just hope that date/year and world do not share the same timing. Bullet time would look funny
PS: stupid question, what is this "MiniIN" ? { I am total newbie here, so bear with me }
PS: stupid question, what is this "MiniIN" ? { I am total newbie here, so bear with me }
A quick search comes up with this.
And you can also look at Sacro's original patch to see which line you have to edit, I don't know where that patch is though .
And you can also look at Sacro's original patch to see which line you have to edit, I don't know where that patch is though .
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)
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
-
- Engineer
- Posts: 123
- Joined: 16 Nov 2006 16:52
If you guys have OpenTTD dev gurus here who would like to respond to this, I would be happy . You know where to find them, not me, I would be happy to find out few weeks from now that something like this has been done, it will save the code from being tempered by me { with a possibility of failure }. I know my way in C { IT student }, but I just came to this forum so I do not want to post mainstream suggestions, mostly for I do not know comunity around OpenTTD { Maybe this was brought up in the past and was rejected and now some newbie will spam suggestion subforum with it - that newbie => me }... Currently I am just glad that I can have a good time with something surpassing my old days with TTD and do not have to emulate it on my precious linux with beryl box
PS: If someone here thinks it is to be posted in suggestion subforum, pls do it yourself, thx
@Mihr: I did not bothered to check times properly , I just noticed that date moves WAY TOO QUICK compared to old TT and TTD in my opinion.
PS: If someone here thinks it is to be posted in suggestion subforum, pls do it yourself, thx
@Mihr: I did not bothered to check times properly , I just noticed that date moves WAY TOO QUICK compared to old TT and TTD in my opinion.
As for my previous suggestion, I made it myself ... the only thing is to edit the date.c code file and do a recompile ...
So this is what I have done :
downloaded current stable version 5.1
edited date.c
on line 241 { or nearby } you will see something like this in "void IncreaseDate(void)" function
-- this increase date whenever it detects timing update { first part of function }
What I have done is really just a brute cycle waste
This will make one day last for 3 times as usual { 8sec on my system right now, I will make it 30sec for my own reasons } if you want more, just change the value in the "if" line ...
Anyway, I am not OpenTTD dev so I can not tell if this will have any unexpected problems ... but I will post any if they occur.
-- it violates C code ISO about declaring variables inside functions but atleast it keeps it eazy for you non coders to copy paste it there
-- I am going to do some gameplay to test it ..
So this is what I have done :
downloaded current stable version 5.1
edited date.c
on line 241 { or nearby } you will see something like this in "void IncreaseDate(void)" function
Code: Select all
/* yeah, increase day counter and call various daily loops */
_date++;
What I have done is really just a brute cycle waste
Code: Select all
/* yeah, increase day counter and call various daily loops */
static int slowDown = 0;
if ( slowDown < 3 ){
slowDown++;
return;
}
slowDown = 0;
_date++;
Anyway, I am not OpenTTD dev so I can not tell if this will have any unexpected problems ... but I will post any if they occur.
-- it violates C code ISO about declaring variables inside functions but atleast it keeps it eazy for you non coders to copy paste it there
-- I am going to do some gameplay to test it ..
Does this even work?ZerXen wrote:As for my previous suggestion, I made it myself ... the only thing is to edit the date.c code file and do a recompile ...
So this is what I have done :
downloaded current stable version 5.1
edited date.c
on line 241 { or nearby } you will see something like this in "void IncreaseDate(void)" function-- this increase date whenever it detects timing update { first part of function }Code: Select all
/* yeah, increase day counter and call various daily loops */ _date++;
What I have done is really just a brute cycle wasteThis will make one day last for 3 times as usual { 8sec on my system right now, I will make it 30sec for my own reasons } if you want more, just change the value in the "if" line ...Code: Select all
/* yeah, increase day counter and call various daily loops */ static int slowDown = 0; if ( slowDown < 3 ){ slowDown++; return; } slowDown = 0; _date++;
Anyway, I am not OpenTTD dev so I can not tell if this will have any unexpected problems ... but I will post any if they occur.
-- it violates C code ISO about declaring variables inside functions but atleast it keeps it eazy for you non coders to copy paste it there
-- I am going to do some gameplay to test it ..
Seems to me like the slowDown variable is just reinitialized as 0 every time you enter the scope.
Code: Select all
if (YouAreHappyAndYouKnowIt) {
ClapYourHands();
}
Learn C man ... "static" means single inicialization variable { sometime devs call it "sticky" variable } ... so it keeps value even out of function scope and it is not initialized again when program executes that function and hit that initialization line, so it's ignored because that variable already exist in memory.kaan wrote:Does this even work?ZerXen wrote:As for my previous suggestion, I made it myself ... the only thing is to edit the date.c code file and do a recompile ...
So this is what I have done :
downloaded current stable version 5.1
edited date.c
on line 241 { or nearby } you will see something like this in "void IncreaseDate(void)" function-- this increase date whenever it detects timing update { first part of function }Code: Select all
/* yeah, increase day counter and call various daily loops */ _date++;
What I have done is really just a brute cycle wasteThis will make one day last for 3 times as usual { 8sec on my system right now, I will make it 30sec for my own reasons } if you want more, just change the value in the "if" line ...Code: Select all
/* yeah, increase day counter and call various daily loops */ static int slowDown = 0; if ( slowDown < 3 ){ slowDown++; return; } slowDown = 0; _date++;
Anyway, I am not OpenTTD dev so I can not tell if this will have any unexpected problems ... but I will post any if they occur.
-- it violates C code ISO about declaring variables inside functions but atleast it keeps it eazy for you non coders to copy paste it there
-- I am going to do some gameplay to test it ..
Seems to me like the slowDown variable is just reinitialized as 0 every time you enter the scope.
That is not a bug ... because it was really meant that way .. I want all the economy to work unchanged { compared to game movement not date progress } .. It's really only about having the ability to play the game longer ... my intention was to stop only date dependent progress { like vehicles getting old, getting new vehicles and so on ...Just to get the feel that one decade is more than just afternoon break } and leaving everything else as it is... It could be considered a cheat .. but only in statics, about whitch I do not care ...
.. another thing is that if I would to change even factory production rates, it would result in situations that most of my trains will be waiting for cargo all the time .. and that is not what I wanted.
Plus, I don't know about what industry has displayed { no time to play - exam tomorow } but consider that trains can then do 30 times as much transport cycles in that month, so it do not affect the game mechanics. Everything has 30 times more time to do its work in realtime.
.. another thing is that if I would to change even factory production rates, it would result in situations that most of my trains will be waiting for cargo all the time .. and that is not what I wanted.
Plus, I don't know about what industry has displayed { no time to play - exam tomorow } but consider that trains can then do 30 times as much transport cycles in that month, so it do not affect the game mechanics. Everything has 30 times more time to do its work in realtime.
As you state yourself it violates the ISO and therefore you can't expect C++ compilers to react the same (not to mention different platforms).ZerXen wrote:Learn C man ... "static" means single inicialization variable { sometime devs call it "sticky" variable } ... so it keeps value even out of function scope and it is not initialized again when program executes that function and hit that initialization line, so it's ignored because that variable already exist in memory.kaan wrote:Does this even work?ZerXen wrote:
-- it violates C code ISO about declaring variables inside functions but atleast it keeps it eazy for you non coders to copy paste it there
Seems to me like the slowDown variable is just reinitialized as 0 every time you enter the scope.
It's nice that you share your code with us, but in the future you should consider doing it right and post a diff. Most people here know how to use them.
Anyway, welcome to the community. You made a nice start here i think
Code: Select all
if (YouAreHappyAndYouKnowIt) {
ClapYourHands();
}
Well, you can use variable for the whole file/module and declare it before the function, but I doub that ISO standart will have any impact on compilers as that "static" is one of key C language features and that ISO is realy just a template { one ISO is for language itself but this ISO is only on a way to write code } on how to write the code so it would be readable by fellow programers ... I can almost promise you that my code will be able to compile on any C/C++ compiler as of all C++ compilers are back compatible with C to the extend of all it's abilities including static declaration.
I found first bug of this solution, Trains still age in normal speed { as well as their running cost } so I am in 30th march 1930 { started 1930 } and there is a train that is 1 year old ...
I will have to look on the main timing functions, not just date counter ... I just hope that basic things like movement and factory production woudn't be inseparable ...
I will have to look on the main timing functions, not just date counter ... I just hope that basic things like movement and factory production woudn't be inseparable ...
knedle wrote:It has one serious bug.
It modifies time displayed in game, but does not change production rate of industries.
So if you have slowDown < 30 it will not make industries work 30 times slower, but at their normal peace, which means you will get 30 times amount of cargo displayed in industry info.
my patch did this too, but with the "daylenght affect economy" patch you was able to balanche the costsknedle wrote:I found the same bug. It really looks funny.
Faster aging of trains looks weird, however I would leave running cost calculations without changes. It would be weird if train that made 20 or 40 trips still generated really low running costs.
Who is online
Users browsing this forum: Google Adsense [Bot] and 34 guests