
Patch: new town grids (r15096)
Moderator: OpenTTD Developers
Re: Patch: new town grids (r15096)
The best would be that each town could pick a random grid when generated, so you can have differently shaped towns... grids are boring 

Re: Patch: new town grids (r15096)
I think that was suggested back before I made this version of the patch, having towns select random grids. I'm not entirely certain if that's possible, given the way I've coded this one, but I'll have a look into it, see if I can't work out a way.
-
- Engineer
- Posts: 24
- Joined: 27 Jun 2007 16:23
- Location: Evil Lair, Norway
Re: Patch: new town grids (r14667)
To be honest, I think the 4x4 or 5x5 is quite realistic considering the town I live in: maprobo wrote:Is it possible to make a more realistic grid like the New York grid (240m x 60m)?
meh, some are more like 3x5, 4x5 and 4x6, but you catch my drift! The town _feels_ square, and that's what matters

I love the square towns in OpenTTD and especially that all the towns line up perfectly (at least with 3x3 grid, haven't tested higher), whoever made that work, extra kudos for you

We're all scared. You hid in that ditch because you think there's still hope. The only hope you have is to accept the fact that you're already dead. And the sooner you accept that, the sooner you'll be able to function as a soldier is supposed to function. Without mercy. Without compassion. Without remorse. All war depends on it
- Captain Ronald Speirs E CO 2nd BATL 506th REG 101st airborne div 8th core 1st ARMY
Re: Patch: new town grids (r15096)
You like digging graves?
Look at the date!
Look at the date!
-
- Engineer
- Posts: 24
- Joined: 27 Jun 2007 16:23
- Location: Evil Lair, Norway
Re: Patch: new town grids (r15096)
I only looked at the year, forgot the year is already 5 months old, sorry <.<
We're all scared. You hid in that ditch because you think there's still hope. The only hope you have is to accept the fact that you're already dead. And the sooner you accept that, the sooner you'll be able to function as a soldier is supposed to function. Without mercy. Without compassion. Without remorse. All war depends on it
- Captain Ronald Speirs E CO 2nd BATL 506th REG 101st airborne div 8th core 1st ARMY
Re: Patch: new town grids (r15096)
Except from the fact that the topic is relatively recent (within half a year) and that the poster actually had something to add to the discussion your point is totally valid.FHS wrote:You like digging graves?
Look at the date!
Oh wait, it isn't
Actually they aren't lined up afaik, the map generator just generates random location and it can be that towns are offset to each other with 2x2 or 3x3 grids, although that might have changed in the past 2 months or so.Andreander wrote:I love the square towns in OpenTTD and especially that all the towns line up perfectly (at least with 3x3 grid, haven't tested higher), whoever made that work, extra kudos for you
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)

OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone

OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone







Re: Patch: new town grids (r15096)
that has chaged in the past 2 months or so
Re: Patch: new town grids (r15096)
Make that three months or so.
changelog.txt with 0.7.1-RC1 wrote: - Feature: Make the road grids of town match, when all are using the same road layout ofcourse [FS#2390] (r14821)
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
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: new town grids (r15096)
Okay, a post to a thread that's old, I know. It's my thread, and it's my patch, so there.
I've just tried (again) to update this patch to trunk, and hit a slight problem. I can't find where the settings that appear in Advanced Settings in game appear.
The file they *used* to appear in, doesn't seem to contain any trace of the settings, and at the moment, I'm wondering if anyone knows where I should be looking instead before I go raiding everything and wasting some time.
And if anyone wants to, go ahead, rewrite the patch yourself to match trunk. I'd prefer to do it myself, but if you think you can do it better than me go ahead before I go insane first.
As to the issue mentioned, I don't think it's possible that towns of different grids can line up on the map, if even on one axis. Might be nice, but I doubt it's possible.
Edit: After a closer look, I realise I made a mistake. It's not the part in the Advanced Settings GUI, it's the part that used to be in the settings.cpp file. I'm attempting to figure it out again, any help is appreciated.
I've just tried (again) to update this patch to trunk, and hit a slight problem. I can't find where the settings that appear in Advanced Settings in game appear.
The file they *used* to appear in, doesn't seem to contain any trace of the settings, and at the moment, I'm wondering if anyone knows where I should be looking instead before I go raiding everything and wasting some time.
And if anyone wants to, go ahead, rewrite the patch yourself to match trunk. I'd prefer to do it myself, but if you think you can do it better than me go ahead before I go insane first.
As to the issue mentioned, I don't think it's possible that towns of different grids can line up on the map, if even on one axis. Might be nice, but I doubt it's possible.
Edit: After a closer look, I realise I made a mistake. It's not the part in the Advanced Settings GUI, it's the part that used to be in the settings.cpp file. I'm attempting to figure it out again, any help is appreciated.
Re: Patch: new town grids (r15096)
Uhm.. I didn't really understand what exactly your problem is.
As you may know this feature has been changed in trunk not to affect all of the towns, but each town may have their individual road scheme.
Thus, the setting in "advanced settings" has been changed to one that sets only the default for newly built towns (on generation, or in scedit).
Each town has their own personal layout to be saved, so this is found in src/saveload/town_sl.cpp. Is that what you're looking for?
As you may know this feature has been changed in trunk not to affect all of the towns, but each town may have their individual road scheme.
Thus, the setting in "advanced settings" has been changed to one that sets only the default for newly built towns (on generation, or in scedit).
Each town has their own personal layout to be saved, so this is found in src/saveload/town_sl.cpp. Is that what you're looking for?
Code: Select all
SLE_CONDVAR(Town, layout, SLE_UINT8, 113, SL_MAX_VERSION),
Re: Patch: new town grids (r15096)
Aha, that's the missing link.
Thanks, that's what I was after, I think I might be able to push out an update for this patch now.
Thanks, that's what I was after, I think I might be able to push out an update for this patch now.
Re: Patch: new town grids (r15096)
Hmm... I think that might be wrong.
Alright, attempt number two to explain, see if you can figure this out.
Have a look in the patch, at what gets done in settings.cpp
That's the bit I'm having trouble bringing up to date. Everything else seems to be able to patch in with little or no changes at all, but the chunk in settings.cpp I can't figure out where it goes now, and I don't think it's in the saveload commands.
Late edit: There seems to be a few other places too, I'll make a list of the problem chunks tomorrow for people to try and figure out if they like.
Alright, attempt number two to explain, see if you can figure this out.
Have a look in the patch, at what gets done in settings.cpp
That's the bit I'm having trouble bringing up to date. Everything else seems to be able to patch in with little or no changes at all, but the chunk in settings.cpp I can't figure out where it goes now, and I don't think it's in the saveload commands.
Late edit: There seems to be a few other places too, I'll make a list of the problem chunks tomorrow for people to try and figure out if they like.
Re: Patch: new town grids (r15096)
I had to do this too for the Found a Town patch while bringing it back from a similar revision number. I have attached three of the incremental versions I made while updating: r15400 has setting info in settings.cpp file and entries on settings_gui.cpp called PatchEntry("..."). Settings in 15400 still work the same way they did in 15096. r15700 has setting info in settings.cpp and entries on settings_gui.cpp called SettingEntry("...") (this also altered the name for STR_PATCHES_ strings to STR_CONFIG_). Finally, r15850 has setting info in table/settings.h. I hope these three files help you with this problem.
You will have to face another issue, though. Somewhere between r15096 and current trunk, a new feature related to town grids was added. Individual towns can have different town grid settings, and these individual settings can be selected at the create town window. This means that you will have to edit the Create town GUI (besides other things), which now uses nested widgets (you can check some helpful advice from Alberth about nested widgets in the Found a town thread). I recommend creating something like the table size selector in Office 2007. If not, a pair of buttons that create a textbox when clicked should be okay too.
Edit: For checking changes in trunk and dealing with them, I did the following:
1) Browse the SVN repository and search the file that is causing you problems: http://vcs.openttd.org/svn/browser/trun ... ttings.cpp
2) Click on "Last Change": http://vcs.openttd.org/svn/changeset/17 ... ttings.cpp
3) Edit the revision number to match the revision of the patch you are updating: http://vcs.openttd.org/svn/changeset/15 ... ttings.cpp
4) Click on "Next Change" until you can find the changes to trunk you were looking for. Use the changelog and description of that revision to know why your patch don't apply, and update it accordingly.
You will have to face another issue, though. Somewhere between r15096 and current trunk, a new feature related to town grids was added. Individual towns can have different town grid settings, and these individual settings can be selected at the create town window. This means that you will have to edit the Create town GUI (besides other things), which now uses nested widgets (you can check some helpful advice from Alberth about nested widgets in the Found a town thread). I recommend creating something like the table size selector in Office 2007. If not, a pair of buttons that create a textbox when clicked should be okay too.
Edit: For checking changes in trunk and dealing with them, I did the following:
1) Browse the SVN repository and search the file that is causing you problems: http://vcs.openttd.org/svn/browser/trun ... ttings.cpp
2) Click on "Last Change": http://vcs.openttd.org/svn/changeset/17 ... ttings.cpp
3) Edit the revision number to match the revision of the patch you are updating: http://vcs.openttd.org/svn/changeset/15 ... ttings.cpp
4) Click on "Next Change" until you can find the changes to trunk you were looking for. Use the changelog and description of that revision to know why your patch don't apply, and update it accordingly.
- Attachments
-
- found_town_15400.diff
- (14.65 KiB) Downloaded 125 times
-
- found_town_15700.diff
- (15.49 KiB) Downloaded 115 times
-
- found_town_15850.diff
- (16.23 KiB) Downloaded 132 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: new town grids (r15096)
I'll have a look into the town creation thing once I get the main patch up, but for when I do, what ideally I'd like it to do is mimic the same behavior as the advanced settings options - that is, you select Geometric Grid, and then give it the X and Y values. How this would work, however, I'm not sure.
Who is online
Users browsing this forum: No registered users and 1 guest