Patch: Minimum Town Distance
Moderator: OpenTTD Developers
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: Patch: Minimum Town Distance
look down for update of this patch
Last edited by 2007Alain2007 on 30 Mar 2009 21:31, edited 3 times in total.
For Community Integrated Version http://code.google.com/p/civopenttd/
Re: Patch: Minimum Town Distance
Then you clearly updated it wrong.2007Alain2007 wrote:updated it a bit but now got C:/msys/1.0/home/Alainspc/ottdsrc/trunk/src/town.h:379: warning: 'bool IsCloseToTown(TileIndex, uint)' defined but not used
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: Patch: Minimum Town Distance
but it seemed to work so were did i go wrong
For Community Integrated Version http://code.google.com/p/civopenttd/
Re: Patch: Minimum Town Distance
By trying to build a patchpack before learning to program a bit. You don't have to be an expert, but being able to write a simple program yourself is certainly necesary.2007Alain2007 wrote:were did i go wrong
Re: Patch: Minimum Town Distance
proper update .... they just merget that if you will just "ignore" that one fail, it works
- Attachments
-
- min_town-ind_r15895.patch
- (9.06 KiB) Downloaded 136 times
My patches: Day length (new concept), Conditional loading, Auto separation, Unload all adds Leave empty, Better statue placement (in trunk)
My abandoned patches: Speed limits for RVs, Day length (old concept)
My abandoned patches: Speed limits for RVs, Day length (old concept)
Re: Patch: Minimum Town Distance
Update
- Attachments
-
- min_town-ind_r18517.patch
- (9.04 KiB) Downloaded 133 times
My patches: Day length (new concept), Conditional loading, Auto separation, Unload all adds Leave empty, Better statue placement (in trunk)
My abandoned patches: Speed limits for RVs, Day length (old concept)
My abandoned patches: Speed limits for RVs, Day length (old concept)
Re: Patch: Minimum Town Distance
Do you need a binary for this one?
Re: Patch: Minimum Town Distance
I dont need any binary. Usually, those patches I update just fit to some patchpatck, here on forums or just personal ones
My patches: Day length (new concept), Conditional loading, Auto separation, Unload all adds Leave empty, Better statue placement (in trunk)
My abandoned patches: Speed limits for RVs, Day length (old concept)
My abandoned patches: Speed limits for RVs, Day length (old concept)
Re: Patch: Minimum Town Distance
If anyone is interested: here is a custom version of the patch that only implements minimum distance between towns. Industry generation is left unchanged.
- Attachments
-
- minimum_ONLY_town_distance_r18656.diff
- (4.34 KiB) Downloaded 206 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.
Re: Patch: Minimum Town Distance
can anybody make this patch in grf format for usual users like me?
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Patch: Minimum Town Distance
No. It's technically not possible.Haskey wrote:can anybody make this patch in grf format for usual users like me?
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: Patch: Minimum Town Distance
Has anyone used this patch recently? I would've applies and uploaded an updated version (in particular for the "minimum town distance" variant) but I have no idea how to adapt to the new settings.ini (replacing the settings.h from older versions). This was the old entry used by the patch:
if someone could tell me how that translates to an entry for the new settings.ini I'd be happy to upload a patch for a current revision.
Code: Select all
SDT_CONDVAR(GameSettings, economy.minimum_distance_town, SLE_UINT16,200, SL_MAX_VERSION, 0, 0, 20, 10, 500,10, STR_CONFIG_SETTING_TOWN_MIN_DISTANCE, NULL),
Re: Patch: Minimum Town Distance
that's easy, at the beginning of settings.ini there's a line like
so you just match them: (the order might have been changed)
you can leave out values that are default. and make sure you add it at the same position as previously.
Code: Select all
SDT_VAR = SDT_VAR($base, $var, $type, $flags, $guiflags, $def, $min, $max, $interval, $str, $strval, $proc, $from, $to),
Code: Select all
[SDT_VAR]
base = GameSettings
var = economy.minimum_distance_town
etc.
Last edited by Eddi on 04 Jan 2012 20:00, edited 1 time in total.
Re: Patch: Minimum Town Distance
There you go ... minus the coding style.
Have a looksie near line 80 of the settings.ini file ... if a value matches the defaults you can leave it out.
Also you must drop the "COND" part out of STD_CONDVAR
edit : Eddi was faster
Code: Select all
[SDT_VAR]
base = GameSettings
var = economy.minimum_distance_town
type = SLE_UINT16
from = 200
def = 20
min = 10
max = 500
interval = 10
str = STR_CONFIG_SETTING_TOWN_MIN_DISTANCE
Also you must drop the "COND" part out of STD_CONDVAR
edit : Eddi was faster
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
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.
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
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.
Re: Patch: Minimum Town Distance
First of all, thank you both for the rather quick reply! Didn't expect such a swift answer so I only just saw it.
The main thing that confused me (or at least made me ask) was the fact that the old syntax apparently had STD_CONDVAR and STD_VAR, which seems to no longer be the case.
It's quite a simple patch obviously since it mostly comes into play with generating a new map (and maybe when founding a town, if allowed in game, which I've never done), which is why I don't understand why the SAVEGAME_VERSION is bumped. I checked the load functions and there doesn't seem to be any verification upon loading if the towns are allowed to be placed where they are. So I would conclude it's safe to leave out the version bump, at least for the town-distance-only variant?
Anyway, the patch (town distance ONLY) for r23754 is attached. If the savegame version needs to be bumped because I missed something, let me know and I'll update it accordingly.
EDIT: Updated the patch to include savegame version bump
The main thing that confused me (or at least made me ask) was the fact that the old syntax apparently had STD_CONDVAR and STD_VAR, which seems to no longer be the case.
It's quite a simple patch obviously since it mostly comes into play with generating a new map (and maybe when founding a town, if allowed in game, which I've never done), which is why I don't understand why the SAVEGAME_VERSION is bumped. I checked the load functions and there doesn't seem to be any verification upon loading if the towns are allowed to be placed where they are. So I would conclude it's safe to leave out the version bump, at least for the town-distance-only variant?
Anyway, the patch (town distance ONLY) for r23754 is attached. If the savegame version needs to be bumped because I missed something, let me know and I'll update it accordingly.
EDIT: Updated the patch to include savegame version bump
- Attachments
-
- minimum_ONLY_town_distance_r23754.patch
- updated patch for current trunk revision, now including savegame version bump again
- (4.44 KiB) Downloaded 146 times
Last edited by Creat on 15 Jan 2012 15:07, edited 2 times in total.
Re: Patch: Minimum Town Distance
The reason for the save game version bump is that the industry generation code runs when a new industry spawns during game, so that value must be part of the save game. When you have both industry distance and town distance, there is a change to the save game data.
In older versions you couldn't fund a town, but in recent version you can. So the town distance check could now also run during the game. Therefore with the current code, both of these settings should be connected to the save game, and the save game version should bump.
Personally I think it is awesome that this patch still lives.
In older versions you couldn't fund a town, but in recent version you can. So the town distance check could now also run during the game. Therefore with the current code, both of these settings should be connected to the save game, and the save game version should bump.
Personally I think it is awesome that this patch still lives.
Re: Patch: Minimum Town Distance
Thanks for the clarification, I've updated the patch (above) accordingly, just to be on the safe side.
It's worth mentioning that it shouldn't ever matter for single player if you load a game saved without this patch (so feel free to omit the patch to saveload.cpp). If you load it once with and without the patch, and you use the "Fund Town" the result MIGHT be different, but apart from that nothing should change.
Of course for a network game this value needs to be synchronized (which it is) or you might get desyncs upon funding a town (but only then).
It's worth mentioning that it shouldn't ever matter for single player if you load a game saved without this patch (so feel free to omit the patch to saveload.cpp). If you load it once with and without the patch, and you use the "Fund Town" the result MIGHT be different, but apart from that nothing should change.
Of course for a network game this value needs to be synchronized (which it is) or you might get desyncs upon funding a town (but only then).
Re: Patch: Minimum Town Distance
Update to latest nightly.
Edit: To clarify, this only affects towns, industries have the default behaviour (of min 20 tiles from a town centre).
Edit: To clarify, this only affects towns, industries have the default behaviour (of min 20 tiles from a town centre).
- Attachments
-
- Minimum_Town_Distance_r25754.patch
- (3.94 KiB) Downloaded 176 times
Who is online
Users browsing this forum: No registered users and 21 guests