Patch: Maximum Subsidy Distance
Moderator: OpenTTD Developers
Re: Patch: Maximum Subsidy Distance
Oh, I know how to do a square root the hard way, but I am pretty sure that this is not 1957; I should not have to write my own math functions, and even if that was appropriate, its a task better handled by a computer scientist. I am certain that I could not make as good a square root function as one that already exists.
I suspect that there is another function that does square roots that belugas would be happy with, but I just don't know what it is. Google only seems to tell me to use cmath. I was hoping belugas or someone else infinitely more familiar with C++ and the openttd code would just say use the square root function in foo.h and be done with it.
I suspect that there is another function that does square roots that belugas would be happy with, but I just don't know what it is. Google only seems to tell me to use cmath. I was hoping belugas or someone else infinitely more familiar with C++ and the openttd code would just say use the square root function in foo.h and be done with it.
Re: Patch: Maximum Subsidy Distance
Instead of using sqrt(MapSize) you could average MapSizeX and MapSizeY (maybe weighted); doesn't give the exact same result but should give something reasonably close I reckon.
As Belugas tried to mention earlier: floats (can) cause desyncs, thus no chance they'll get included in the main logic used in network games.
As Belugas tried to mention earlier: floats (can) cause desyncs, thus no chance they'll get included in the main logic used in network games.
Re: Patch: Maximum Subsidy Distance
Or square the distance instead of square-rooting the map area.
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
Re: Patch: Maximum Subsidy Distance
This is the piece of information I was missing.Rubidium wrote: As Belugas tried to mention earlier: floats (can) cause desyncs, thus no chance they'll get included in the main logic used in network games.
Re: Patch: Maximum Subsidy Distance
2007Alain2007 list of patches brought this patch to my knowledge, and it is something I felt as needed for a long time. I have downloaded the latest version of the patch and updated it to current trunk. To solve the possible desyncs problem I made a quick-and-dirty integer square root function and changed all floats to integer divisions, but maybe there's a better solution. Also, I don't know where to put the IntegerSquareRoot function.
Here is the patch and the win32 binary: [DELETED, SEE MY NEXT POST]
Here is the patch and the win32 binary: [DELETED, SEE MY NEXT POST]
Last edited by Terkhen on 14 Apr 2009 09:48, edited 1 time in total.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: Patch: Maximum Subsidy Distance
thank you very much and great work there i add it in to my patch pack in a sec keep them comeing please
For Community Integrated Version http://code.google.com/p/civopenttd/
Re: Patch: Maximum Subsidy Distance
can someone update this please? is very usefull for large maps
The rest is confetti!
Re: Patch: Maximum Subsidy Distance
After playing a few games with this patch in big maps, I see that subsidies between very distant places are too common. I think that it would be better that the probability of a subsidy decreased with the distance between two industries / towns. I can do it if there's more people who think the same as me.
Here's a version updated to trunk, with both a diff and a win32 binary:
Here's a version updated to trunk, with both a diff and a win32 binary:
- Attachments
-
- max-subsidy-distance-r16049.diff
- (4.7 KiB) Downloaded 107 times
-
- max-subsidy-distance-r16049.rar
- (2.9 MiB) Downloaded 102 times
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: Patch: Maximum Subsidy Distance
Hi Terkhen
would that make it less common for long distance
Becuse at the start of game you want only a short Subsidy but as your money grows you can go for longer Subsidy
Also with network games were have more of a mix for new players joining and players that have been on the game for some years
Is that what this will
would that make it less common for long distance
Becuse at the start of game you want only a short Subsidy but as your money grows you can go for longer Subsidy
Also with network games were have more of a mix for new players joining and players that have been on the game for some years
Is that what this will
For Community Integrated Version http://code.google.com/p/civopenttd/
Re: Patch: Maximum Subsidy Distance
I don't understand completely what you are suggesting / asking, 2007Alain2007. Anyways subsidy distance should't change as the game progresses. IMO subsidies are meant to be a way to help new companies, and they shouldn't change to help established companies.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: Patch: Maximum Subsidy Distance
I know but on big maps a mix of long and short not just all long or all short
with this patch they seem all long
with out this patch there all short
with this patch they seem all long
with out this patch there all short
For Community Integrated Version http://code.google.com/p/civopenttd/
Re: Patch: Maximum Subsidy Distance
That's the problem I explained when I posted the last version. Anyways after playing a long time without this patch I think that normal distance is enough for young companies to start making money, even in really big maps. Long subsidies are only useful to companies that have the cash to make them, and they prefer to do routes that are more profitable in the long run anyways.
Spanish translation of OpenTTD
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
Extended heightmaps
Have fun, don't quarrel too much and add as many advanced settings as you can.
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: Patch: Maximum Subsidy Distance
thats what i like to see so there are some subs big companies as well
For Community Integrated Version http://code.google.com/p/civopenttd/
Who is online
Users browsing this forum: Baidu [Spider] and 1 guest