Sacros day length patch
Moderator: OpenTTD Developers
Sacros day length patch
Here is the first release of my day length patch, currently its just a multiplyer for the date incrementer, and i still need to sort out the impacts made on the economy. Any problems or ideas, send us a message!
- Attachments
-
- daylength-5370.diff
- (12.81 KiB) Downloaded 809 times
-
- daylength-5370MiniIN.diff
- MiniIN patch
- (13.38 KiB) Downloaded 623 times
Last edited by Sacro on 26 Jun 2006 19:54, edited 4 times in total.
We Am De Best
Host of ThroughTheTube site
Host of ThroughTheTube site
-
- Engineer
- Posts: 72
- Joined: 29 Sep 2004 15:30
- bobingabout
- Tycoon
- Posts: 1850
- Joined: 21 May 2005 15:10
- Location: Hull, England
i think its back.
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
-
- Traffic Manager
- Posts: 175
- Joined: 19 Jan 2004 17:25
- Location: kotka or Savitaipale, Finland
- Contact:
we have been testing this patch in our private dedicated server with latest subsidiaries version. It's excelent patch and gives quite lot to the game, but there's few bugs we have come across:
- The time miltiplier isn't set up correctly to clients when they connect. (friend of mine did a small fix for this but I don't have a source nor diff for it.) and wrong time multiplier causes out of sync (naturally).
- all trains, trucks, airplanes, busses and ships are having their age in old time. (so with multiplier 3, busses gets old in 4 years. )
- if city has even one station, it grows on full rate all the time. (not a bug exactly, if you like metropolies...)
As a note, it's actually much easier make money in slowed time game than in regular one, because vechile moving speeds nor cargo payment rates aren't affected.
Still, this patch is definetely worth of developing, so keep up the good work.
- The time miltiplier isn't set up correctly to clients when they connect. (friend of mine did a small fix for this but I don't have a source nor diff for it.) and wrong time multiplier causes out of sync (naturally).
- all trains, trucks, airplanes, busses and ships are having their age in old time. (so with multiplier 3, busses gets old in 4 years. )
- if city has even one station, it grows on full rate all the time. (not a bug exactly, if you like metropolies...)
As a note, it's actually much easier make money in slowed time game than in regular one, because vechile moving speeds nor cargo payment rates aren't affected.
Still, this patch is definetely worth of developing, so keep up the good work.
- bobingabout
- Tycoon
- Posts: 1850
- Joined: 21 May 2005 15:10
- Location: Hull, England
the money issues are 1 of the things we were considering changing. its something we arn't sure about, because half of the point is to make the game last longer, so we were thnking of making it an option you can turn on and off, and if its on, it simply devides some money transactions by the daylenth multiplier, such as running costs and cargo payments. building costs shouldn't be effected.
city growth also seems like it should be changed too.
thanks for reporting these "test" results
however, i've been trying to contact sacro, and he seems to have vanished...
i'm guessing that the daylenth isn't passed to the clients for the same reason the game doesn't save the daylenth... sacro hasn't programmed that part yet.
I'm sure he'd apreciate the help of whoever it was who patched his patch to transmit it
city growth also seems like it should be changed too.
thanks for reporting these "test" results
however, i've been trying to contact sacro, and he seems to have vanished...
i'm guessing that the daylenth isn't passed to the clients for the same reason the game doesn't save the daylenth... sacro hasn't programmed that part yet.
I'm sure he'd apreciate the help of whoever it was who patched his patch to transmit it
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
Right, im having a few problems in life at the moment, its a long story, but I should be back home and developing this patch soon!
I will take a look at getting the server to send the day length to the clients on connection, I'm sure I can remember how to do that one, as for the aging and city sizes, im sure I can have a look at sorting those out too, also there was mention of income and production being multiplied too, do these also want sorting?
Thanks for testing it for me too! Feels nice to know people are actually using it!
I will take a look at getting the server to send the day length to the clients on connection, I'm sure I can remember how to do that one, as for the aging and city sizes, im sure I can have a look at sorting those out too, also there was mention of income and production being multiplied too, do these also want sorting?
Thanks for testing it for me too! Feels nice to know people are actually using it!
We Am De Best
Host of ThroughTheTube site
Host of ThroughTheTube site
Just thought that i'd see how many people are after this patch having a few updates, and if they could suggest what kind of things could be implemented. At the moment all it does is increase the number of ticks before a new day is started, however the economy and income are still at the original rate.
Any feedback would be much appreciated.
Any feedback would be much appreciated.
We Am De Best
Host of ThroughTheTube site
Host of ThroughTheTube site
- bobingabout
- Tycoon
- Posts: 1850
- Joined: 21 May 2005 15:10
- Location: Hull, England
wasn't the first things you were suposed to be doing making it save the state of this flag when you saved the game, and transmitting it to other players in multiplayer?
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
I 've played often with last IN with your patch. I never cared about economics but on custom 1024x1024 maps it is a MUST.
My standard setting is around game day at 20 real time sec. (10x)
I hope that you update your patch for the 0.4.5
My standard setting is around game day at 20 real time sec. (10x)
I hope that you update your patch for the 0.4.5
Sidewinder
Italian Town names patch for OTTD (R5266) now in trunk since 0.4.8
For typo, errors or bug on OTTD italian translation, please PM me.
unofficial italian TTD/OpenTTD forum: http://wolf01.game-host.org/forum/index.php
Italian Town names patch for OTTD (R5266) now in trunk since 0.4.8
For typo, errors or bug on OTTD italian translation, please PM me.
unofficial italian TTD/OpenTTD forum: http://wolf01.game-host.org/forum/index.php
nice patch for "semi-persistent" serverSacro wrote:Just thought that i'd see how many people are after this patch having a few updates, and if they could suggest what kind of things could be implemented. At the moment all it does is increase the number of ticks before a new day is started, however the economy and income are still at the original rate.
Any feedback would be much appreciated.
I'll be pleased to have bobingabout idea integrated ("devides *or multiply* some money transactions by the daylenth multiplier, such as running costs and cargo payments")
maybe vehicule age and reliability decay should be locked at too.
- bobingabout
- Tycoon
- Posts: 1850
- Joined: 21 May 2005 15:10
- Location: Hull, England
thats why i sugested the option of making everything 32x lower. if it takes 32x the length of time to make any money at all, that might get boring fast, so, a small config option to devide by "1", "DAY_LENGTH/2", "DAY_LENGTH", you can name the settings later. so, thats keeping it as it is, deviding by 16, and deviding by 32. assuming DAY_LENGTH is 32. some things such as vehicle age should always relly on DAY_LENGTH.
also, erm, if production of some things gets too large (like 65000 grain a month, more worries are with the oil, when set with a high daylength) it might be a good idea to display grain per day, rather than per month. also, when editing the values, the display needs updating, because although it says 2048 oer month when you set it, it jumps to like 65000 soon after, so the number in that setting wants multiplying by daylength.
also, erm, if production of some things gets too large (like 65000 grain a month, more worries are with the oil, when set with a high daylength) it might be a good idea to display grain per day, rather than per month. also, when editing the values, the display needs updating, because although it says 2048 oer month when you set it, it jumps to like 65000 soon after, so the number in that setting wants multiplying by daylength.
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
Right, well thanks to Wolf01, we have a shiny new daylength patch, not only is updated to the latest revisions, its MiniIN compatible, and should work for network games too.
Also he's adjusted the timings for network messages and other such things, so they stay for so many ticks, rather than so many days.
I will post the updated patch in the top post, merges with "-p 0" for trunk and "-p 0 -F 100" against MiniIN, and hopefully if my cross-compiler is working, then a windows binary.
Any suggestions, problems, questions etc, let me know!
Also he's adjusted the timings for network messages and other such things, so they stay for so many ticks, rather than so many days.
I will post the updated patch in the top post, merges with "-p 0" for trunk and "-p 0 -F 100" against MiniIN, and hopefully if my cross-compiler is working, then a windows binary.
Any suggestions, problems, questions etc, let me know!
We Am De Best
Host of ThroughTheTube site
Host of ThroughTheTube site
Moving this discussion back to the thread it belongs in.Wolf01 From MiniIN Thread wrote:i found a biiiiig bug on the daylength patch, and i'm looking for somebody which can help me and sacro to fix it
the bug description is this: if you stretch the day length by increasing the multiplier you can earn more money than the default day length, this because all the running costs, maintenance and interests are based on the year, instead industry production is based on (old) day length, so if before stretching the days a train can do a travel in i say 15 days, now a train can do the same travel in 2 or less days (also 2 travels a day) and for each travel it earn the same profit!!!
[Start Edit] Opps, spoke too soon . Well, I'll leave my idea here just in case it can help you out in the future. Actually I found a different function that maybe more appropriate.
Code: Select all
File: economy.c
int32 GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, CargoID cargo_type)
[End Edit]
[Start Old idea]
Ok, I did a quick runthrough of the money code. I've got an idea of where to look.
Code: Select all
File: players.c
static void SubtractMoneyFromAnyPlayer(Player *p, int32 cost)
{
p->money64 -= cost;
UpdatePlayerMoney32(p);
p->yearly_expenses[0][_yearly_expenses_type] += cost;
if (HASBIT(1<<7|1<<8|1<<9|1<<10, _yearly_expenses_type)) {
p->cur_economy.income -= cost;
} else if (HASBIT(1<<2|1<<3|1<<4|1<<5|1<<6|1<<11, _yearly_expenses_type)) {
p->cur_economy.expenses -= cost;
}
InvalidatePlayerWindows(p);
}
Those bit shifts all refer to a yearly expense, which is defined as follows:
Code: Select all
File: openttd.h
enum {
EXPENSES_CONSTRUCTION = 0,
EXPENSES_NEW_VEHICLES = 1,
EXPENSES_TRAIN_RUN = 2,
EXPENSES_ROADVEH_RUN = 3,
EXPENSES_AIRCRAFT_RUN = 4,
EXPENSES_SHIP_RUN = 5,
EXPENSES_PROPERTY = 6,
EXPENSES_TRAIN_INC = 7,
EXPENSES_ROADVEH_INC = 8,
EXPENSES_AIRCRAFT_INC = 9,
EXPENSES_SHIP_INC = 10,
EXPENSES_LOAN_INT = 11,
EXPENSES_OTHER = 12,
};
Code: Select all
File: players.c
static void SubtractMoneyFromAnyPlayer(Player *p, int32 cost)
{
/* Daylength Adjustment code start here */
if (HASBIT(1<<7|1<<8|1<<9|1<<10, _yearly_expenses_type)) {
cost = /* Magical Daylength formula */;
}
/* Daylength Adjustment code end here */
p->money64 -= cost;
UpdatePlayerMoney32(p);
p->yearly_expenses[0][_yearly_expenses_type] += cost;
if (HASBIT(1<<7|1<<8|1<<9|1<<10, _yearly_expenses_type)) {
p->cur_economy.income -= cost;
} else if (HASBIT(1<<2|1<<3|1<<4|1<<5|1<<6|1<<11, _yearly_expenses_type)) {
p->cur_economy.expenses -= cost;
}
InvalidatePlayerWindows(p);
}
I'm not exaclty sure when it prints the money on the main screen, so that might need some special attention. Give it a try!
-Hazelrah
0x10000/0x375 ≈ 74 ticks/day.Hazelrah wrote:Maybe what you can do is change 'transit_days' to 'transit_ticks' instead, or something simmilar to that. How many ticks per day in a normal game?
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
but this patch multiplies it from 1 to 32 so we have 2 possibilities:DaleStan wrote:0x10000/0x375 ≈ 74 ticks/day.Hazelrah wrote:Maybe what you can do is change 'transit_days' to 'transit_ticks' instead, or something simmilar to that. How many ticks per day in a normal game?
1) multiply the day ticks first and divide it where it has to be the old behavior (as now)
2) multiply the day ticks only where we need (but is a pain with the day calculation)
however thanks for the info Hazelrah
Who is online
Users browsing this forum: No registered users and 39 guests