Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sat Aug 18, 2018 4:51 pm

All times are UTC




Post new topic  Reply to topic  [ 47 posts ]  Go to page 1 2 3 Next
Author Message
 Post subject: Sacros day length patch
PostPosted: Sun Jul 31, 2005 9:20 pm 
Offline
Tycoon
Tycoon

Joined: Sat Jun 18, 2005 9:08 pm
Posts: 1141
Location: Here
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 601 times
File comment: MiniIN patch
daylength-5370MiniIN.diff [13.38 KiB]
Downloaded 415 times

_________________
We Am De Best

Host of ThroughTheTube site


Last edited by Sacro on Mon Jun 26, 2006 7:54 pm, edited 4 times in total.
Top
   
 Post subject:
PostPosted: Thu Aug 11, 2005 7:05 am 
Offline
Engineer
Engineer
User avatar

Joined: Wed Sep 29, 2004 3:30 pm
Posts: 72
I used the windows compilation that used to be here. I thought the patch worked well and I had no problems with it.

_________________
Image Image


Top
   
 Post subject:
PostPosted: Thu Aug 11, 2005 8:36 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Aug 02, 2005 1:00 pm
Posts: 992
Location: Jerusalem, Israel
I had cilcked on the "downloud" link, and Eror 404 appeared.


Top
   
 Post subject:
PostPosted: Mon Aug 15, 2005 9:07 pm 
Offline
Tycoon
Tycoon

Joined: Sat Jun 18, 2005 9:08 pm
Posts: 1141
Location: Here
Sorry people, I don't have the internet at home, and as such it can take me a while so update the files, I will upload them asap, the .diff file is on the sf tracker though, and a windows binary will be up soon.

_________________
We Am De Best



Host of ThroughTheTube site


Top
   
 Post subject:
PostPosted: Thu Sep 01, 2005 9:58 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat May 21, 2005 3:10 pm
Posts: 1850
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]


Top
   
 Post subject:
PostPosted: Wed Oct 05, 2005 9:57 am 
Offline
Traffic Manager
Traffic Manager

Joined: Mon Jan 19, 2004 5:25 pm
Posts: 175
Location: kotka or Savitaipale, Finland
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. :D )
- 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.


Top
   
 Post subject:
PostPosted: Wed Oct 05, 2005 1:11 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat May 21, 2005 3:10 pm
Posts: 1850
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 :P

_________________
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]


Top
   
 Post subject:
PostPosted: Sat Oct 15, 2005 4:03 pm 
Offline
Tycoon
Tycoon

Joined: Sat Jun 18, 2005 9:08 pm
Posts: 1141
Location: Here
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!

_________________
We Am De Best



Host of ThroughTheTube site


Top
   
 Post subject:
PostPosted: Thu Feb 09, 2006 1:22 am 
Offline
Tycoon
Tycoon

Joined: Sat Jun 18, 2005 9:08 pm
Posts: 1141
Location: Here
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.

_________________
We Am De Best



Host of ThroughTheTube site


Top
   
 Post subject:
PostPosted: Thu Feb 09, 2006 9:00 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat May 21, 2005 3:10 pm
Posts: 1850
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]


Top
   
 Post subject:
PostPosted: Thu Feb 09, 2006 9:53 am 
Offline
Engineer
Engineer
User avatar

Joined: Wed Aug 31, 2005 6:46 am
Posts: 115
Location: Milan, Italy
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

_________________
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


Top
   
 Post subject:
PostPosted: Thu Feb 09, 2006 8:13 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Thu Apr 29, 2004 9:53 pm
Posts: 150
Sacro 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.


nice patch for "semi-persistent" server :D

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.


Top
   
 Post subject:
PostPosted: Thu Feb 09, 2006 8:16 pm 
Offline
Tycoon
Tycoon

Joined: Sat Jun 18, 2005 9:08 pm
Posts: 1141
Location: Here
Well i was planning on looking into that, however im not sure how many variables will need to be altered, also the way i see it the game could end up 32x longer to actually do anything (due to income being 32x slower) rather than 32x longer.

_________________
We Am De Best



Host of ThroughTheTube site


Top
   
 Post subject:
PostPosted: Thu Feb 09, 2006 9:05 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Thu Apr 29, 2004 9:53 pm
Posts: 150
Sacro wrote:
Well i was planning on looking into that, however im not sure how many variables will need to be altered, also the way i see it the game could end up 32x longer to actually do anything (due to income being 32x slower) rather than 32x longer.


maybe max loan 32x higher ?


Top
   
 Post subject:
PostPosted: Thu Feb 09, 2006 9:11 pm 
Offline
Tycoon
Tycoon

Joined: Sat Jun 18, 2005 9:08 pm
Posts: 1141
Location: Here
I dont think thats a good way of sorting it. I can see that breaking things.

_________________
We Am De Best



Host of ThroughTheTube site


Top
   
 Post subject:
PostPosted: Fri Feb 10, 2006 8:32 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat May 21, 2005 3:10 pm
Posts: 1850
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.

_________________
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]


Top
   
 Post subject:
PostPosted: Mon Jun 26, 2006 6:09 pm 
Offline
Tycoon
Tycoon

Joined: Sat Jun 18, 2005 9:08 pm
Posts: 1141
Location: Here
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!

_________________
We Am De Best



Host of ThroughTheTube site


Top
   
 Post subject:
PostPosted: Fri Jun 30, 2006 1:54 am 
Offline
Traffic Manager
Traffic Manager

Joined: Wed Apr 13, 2005 5:41 am
Posts: 196
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!!!


Moving this discussion back to the thread it belongs in. ;)


[Start Edit] Opps, spoke too soon :oops:. 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:
File: economy.c

int32 GetTransportedGoodsIncome(uint num_pieces, uint dist, byte transit_days, CargoID cargo_type)


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?

[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:
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);
}


This code might be efficient (not sure about that) but it's hell on the eyes!

Those bit shifts all refer to a yearly expense, which is defined as follows:

Code:
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,
};


This was just a quick look through the code, so your still going to need to do the math. Basically, check to see if it is of type 7, 8, 9, or 10, (possibly OTHER, but I haven't looked at what goes in there yet). Then work out some magical formula that divides the money by the same factor that you slow days with.


Code:
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


Top
   
 Post subject:
PostPosted: Fri Jun 30, 2006 2:56 am 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
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?

0x10000/0x375 ≈ 74 ticks/day.

_________________
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


Top
   
 Post subject:
PostPosted: Fri Jun 30, 2006 10:44 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Apr 24, 2004 10:43 am
Posts: 2003
Location: Venezia - Italia
DaleStan wrote:
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?

0x10000/0x375 ≈ 74 ticks/day.

but this patch multiplies it from 1 to 32 so we have 2 possibilities:
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 :D

_________________
ImageImage
ImageImage
ImageImage
newgrf tests, see: newgrf test topic, my patches: Wolf01's Hire Point
Italian TTD Forum
Wiki Page


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 47 posts ]  Go to page 1 2 3 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 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.