YAIM - (Yet Another) Infrastructure Maintenance Patch (V3.1)

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

Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch

Post by Rubidium »

As far as I can determine from the patch the "non-linear" cost depends on the amount of road/track bits, not the time.

So, e.g., for 1 you pay 1, for 10 you pay 15, for 100 you pay 200, for 1000 you pay 3000. Result: in early game the maintainance costs are low as you do not have a lot of infrastructure, but when you expand the costs for maintaining the infrastructure increase non-linearly with the amount of road/track bits.

Also the maintainance costs depend on the road/track type. So a slow rail can be made cheaper to maintain that fast rail. This makes it possible to have a network with many cities, just without having maglev going everywhere.
User avatar
Expresso
Tycoon
Tycoon
Posts: 1760
Joined: 09 Aug 2004 00:14
Location: Gouda, the Netherlands

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch

Post by Expresso »

Why not make the maintenance cost of stations dependent on the amount of cargo (transported), size, number of transport modes available (and which) and number of vehicles attending? This imho reflects reality and makes it attractive to have smaller and larger stations where appropriate.

Stations could also have maintenance costs associated to the town zone in which they are located (think more (expensive) facilities), making the player think twice about the position of his station.

Switches and signals should also be more expensive, in my opinion. Would it be possible to make signal blocks more expensive when there are more signals and/or switches involved?

To increase infrastructure costs exponentially or parabolic is quite a bit over the top, in my opinion. The current way of making infrastructure maintenance more expensive by newGRF specification is quite sufficient... stations are still lacking in that regard, though.
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch

Post by Michi_cc »

Dimme wrote:Just think of the difference between inflation of costs and income... it really kicks in after one or two hundred years, and destroys your game.
This is not a proper comparison as the infrastructure costs purely depend on the number of infrastructure pieces and not on play time (Inflation has an effect of course, because it affects all costs in the game, but that's not specific to maintenance costs). And nobody is forced to play with maintenance costs just as you can turn off inflation. If your goal is a coop-style game this is probably not the patch for you.
Expresso wrote:Why not make the maintenance cost of stations dependent on the amount of cargo (transported), size, number of transport modes available (and which) and number of vehicles attending? This imho reflects reality and makes it attractive to have smaller and larger stations where appropriate.
Station maintenance depending on tile count will be in the next version. I'm hesitant to include more complicated calculations because I want to avoid having too much code/data overhead.
Expresso wrote:Switches and signals should also be more expensive, in my opinion. Would it be possible to make signal blocks more expensive when there are more signals and/or switches involved?
Switches and signals are already accounted. A tile with overlapping track bits will count as "number of track bits squared" 'virtual' track bits.
Expresso wrote:To increase infrastructure costs exponentially or parabolic is quite a bit over the top, in my opinion.
Costs increase neither exponentially nor parabolic but less than quadratic. Have you already played a game were the infrastructure costs where too big even after you've optimized your infrastructure to remove unneeded stuff? I'll happily accept suggestions for changed base cost factors if you can give a specific example.

-- Michael Lutz
ic111
Director
Director
Posts: 608
Joined: 17 Jul 2007 17:56

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch

Post by ic111 »

Michi_cc wrote: Costs increase neither exponentially nor parabolic but less than quadratic. Have you already played a game were the infrastructure costs where too big even after you've optimized your infrastructure to remove unneeded stuff? I'll happily accept suggestions for changed base cost factors if you can give a specific example.
No, I did not yet play such a game, simply because I would need quite a lot of playing time for seeing / not seeing those effects in later game. So, ask me that question (maybe) again in some weeks ;-)

But for now, question: In what order does your function grow? Less than quadratic you say, what does that mean exactly, i.e. how much would one pay for 10, 100, 1000, 10000 track tiles? Maybe you could make the degree of non-linearity a parameter one can set from the advanced settings. Then, people could choose between (practically) linear, and different degrees of non-linearity, and we could declare this discussion finished :mrgreen:

After all, the amount of tiles you need for a network highly depends on factors like map size, number of cities, number of industries, fraction of land / water. So, a network you would consider optimal might contain 3000 track tiles on the one, sparsely settled map, and 15000 on the other map with much more cities / industries.
User avatar
prissi
Chief Executive
Chief Executive
Posts: 647
Joined: 15 Nov 2004 19:46
Location: Berlin, Germany
Contact:

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch

Post by prissi »

In simutrans we had this cost model from the beginning. However track maintenance rather makes the start difficult. Same is for station maintenance. The reason is simple that with a larger net the chances of reusing are higher. Hence it is nearly impossible to make starting easy and cut substancially into the pockets later.

This might be different, if maintenance is actually based on usage. In that case heavy used lines would be more expensive than branch lines.

So far, most impact from my ten year experience has the station maintenance cost. If this cost increases significantly per station tile it could alleviate the advantage of trains versus road a little.
I like to look at great maps and see how things flow. A little like a finished model railway, but it is evolving and actually never finished. http://www.simutrans.com
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch

Post by Zuu »

In OpenTTD the station cost is per transport mode activated in each station. Thus a bus stop cost the same as a large railway station or airport per year. For concepts that use a lot of bus/truck stations, station maintenance can already today be a critical thing when you have to pay about 500 pounds a year for each bus stop. This has been a significant cost for PAXLink that is now more restrictive with the amount of bus stops for collecting passengers that it builds and keeps in a town.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
bokkie
Transport Coordinator
Transport Coordinator
Posts: 327
Joined: 19 Jan 2007 19:26

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch

Post by bokkie »

Just a thumbs up for this patch, it really seems to encourage/reward rail re-use from the game instead of my own aesthetics :)
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch (V

Post by Michi_cc »

I've updated YAIM to version 2.1 which is savegame compatible with the previous version. First post updated as well.

Changes:
  • Station maintenance per tile
  • Airport maintenance
  • Infrastructure window now shows cost first
I've opted to treat airports separately from the other station types as a pure tile count doesn't really make sense here, as for example the City and the Metropolitan airport have the same number of tiles, but with an additional runway the latter should be more expensive. Additionally, as you won't have a few thousand airports either, airport cost is not included in the non-linear portion, but instead has a high base cost (aircraft income is high enough anyway).

As before, the base costs in src/table/pricebase.h are meant as a first draft and justified change suggestions will be looked at.

-- Michael Lutz
Attachments
infra_maint_v2_1.patch
git patch against r23191
(95.89 KiB) Downloaded 149 times
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch (V

Post by Rubidium »

Might it be an interesting option to not use the number of station tiles, but something based on the catchment rectangle? This way a two tile road stop is cheaper than a 2 tile rail station. Consequently "cheating" with station walking will get considerably more expensive as well.
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch (V

Post by Michi_cc »

It's easily done, but I'm not sure if it's better to still use the total coverage area of all stations for the cost progression or if it makes more sense to treat each station separately and do the non-linear increase per station.

-- Michael Lutz
ziond
Engineer
Engineer
Posts: 50
Joined: 04 Mar 2009 10:55
Location: Moscow, Russia

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch (V

Post by ziond »

First of all: Thanks for the patch. The idea is awesome :)
But i found the bug. When i'm trying to remove station tile that have no rails i'm getting this...
Безымянный.png
Безымянный.png (67.13 KiB) Viewed 4324 times
Attachments
crash.zip
(825.87 KiB) Downloaded 105 times
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch (V

Post by Michi_cc »

Thanks for the bug report.

A fix is included in the YAIM release 2.2 attached here, which is the only difference to the previous 2.1 release.

-- Michael Lutz
Attachments
infra_maint_v2_2.patch
git patch against r23202
(95.87 KiB) Downloaded 157 times
John_Smith
Chairman
Chairman
Posts: 780
Joined: 15 Apr 2010 10:00

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch (V

Post by John_Smith »

Hi Michi_cc,
This is a very nice patch, one thing I personal do not like the used of is the word “Pieces” and “Tiles” I think in my view using “Km\Miles” and “m^2\ft^2” would be better. In addition I think the idea of Kogut to put it in the financial windows (http://www.tt-forums.net/viewtopic.php? ... d5#p979051) is where it should be placed.

JS.
I not an boring person, I just get excited over boring things.
Eddi
Tycoon
Tycoon
Posts: 8257
Joined: 17 Jan 2007 00:14

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch (V

Post by Eddi »

John_Smith wrote:“Pieces” and “Tiles” [...] “Km\Miles” and “m^2\ft^2”
the problem with that is that there is no exact measure how long a tile actually is. depending on what game feature you look at, it could be anything from 10m to 5000km...
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch (V

Post by Michi_cc »

I've updated YAIM to current trunk, leading to release 3.0. There is no change in functionality compared to the previous release, but as OpenTTD bumped the savegame version in the mean time, thusly no savegame compatibility, the major version was increased.

Thanks to TrueBrain there are now also precompiled binaries: http://www.openttd.org/en/download-yaim

-- Michael Lutz
Attachments
yaim_v3_0.patch
Patch for r23342
(95.92 KiB) Downloaded 122 times
Xaroth
Engineer
Engineer
Posts: 103
Joined: 01 May 2006 09:09

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch (V

Post by Xaroth »

Seeing TrueBrain was bugging me, I set up a server running Yaim_3.0 so people can test the online functionality as well.
Lead Manager of OpenDUNE
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2822
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch (V

Post by ChillCore »

Xaroth wrote: Seeing TrueBrain was bugging me, I set up a server running Yaim_3.0 so people can test the online functionality as well.
Hey, stop doing that ... if this continues we will have no Devs left at all to improve the code.
I mean Devs and playing the game they write themselves, :?, where are we going if this continues. :mrgreen:



Michi_cc: Me likes a lot 8) , especially the part where '1 + 1 + 1 != 3' (in regards of rail-junctions and bridges), it makes games very interesting and challenging.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch (V

Post by Michi_cc »

ChillCore wrote: Michi_cc: Me likes a lot 8) , especially the part where '1 + 1 + 1 != 3' (in regards of rail-junctions and bridges), it makes games very interesting and challenging.
Yep, death to the single-tile, all-way junction :twisted: All six track bits on a single tile now counts as 6*6=36.

-- Michael Lutz
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch (V

Post by TrueBrain »

Impressive work michi_cc. I really like playing this. The cost seems fairly okay, I love that airports are expensive (relative), and that signals are expensive (relative). No longer it is a good idea to put a signal ON EVERY SINGLE TILE. That will improve many layouts :D

A few suggestions:

- Station cost seems really low. As in .. it is nothing compared to the rest.
- The window shows payment per month, while most of the game is per year. This is a bit confusing, and made me convert it to per year every time in my head.
- The detail window is a bit hard to find. I have no good suggestions to where to put it (given the obvious choices are f*** hard to program :P).

I know I told you these already, but I thought it would be nice to make a post for it and go all:

WOW! I JUST PLAYED THIS PATCH WITH 2 OTHER DEVS ON A SERVER! IT WAS f*** EPIC!

There :D

PS: tnx Xaroth, for setting up the server after me bugging you for hours on end about it :D
The only thing necessary for the triumph of evil is for good men to do nothing.
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YAIM - (Yet Another) Infrastructure Maintenance Patch (V

Post by Michi_cc »

Quoting myself from IRC:
<michi_cc> Some notes from our YAIM test game: Airport maintenance: way too low, I'm making ~300k with two airports and two aircraft, but only pay 70k. Station tiles: too low as well. Rail, higher as well. I only pay ~3% of my rail profit for maintenance. I realize that I don't have much infrastructure yet so the non-linear costs isn't kicking in yet, but still, too easy :)
-- Michael Lutz
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 9 guests