Better statue placement
Moderator: OpenTTD Developers
Better statue placement
The normal placement just searches for first tile, which it can replace (house/tree/nothing) and do that. Often in smaller cities or cities which bizarre layout, it can replace "majority" (like 1-3 in city and one of them got replaced) of bigger houses. This patch is providing that it will search a little around for free tile (trees/nothing) and place statue there. If it fails, it will work as before.
EDIT: Added last revision of the patch.
EDIT: Added last revision of the patch.
- Attachments
-
- statue_placement_r22254.patch
- (2.09 KiB) Downloaded 517 times
-
- statue_placement_r24094.patch
- (3.25 KiB) Downloaded 547 times
Last edited by pavel1269 on 08 Apr 2012 17:47, edited 3 times in total.
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)
- JacobD88
- Chief Executive
- Posts: 708
- Joined: 16 Aug 2008 17:51
- Location: Long Eaton, Nottinghamshire. UK
- Contact:
Re: Better statue placement
Brilliant, thanks Pavel
It's little patches like this i love, might go back to placing statues again now, as i was always annoyed that sometimes, where the appropriate building was few in number placing a statue could stop a town accepting say goods (as that requires several buildings being present to change station acceptance) as the building, usually at the town centre, got built on
Hopefully this will reduce that considerably 

It's little patches like this i love, might go back to placing statues again now, as i was always annoyed that sometimes, where the appropriate building was few in number placing a statue could stop a town accepting say goods (as that requires several buildings being present to change station acceptance) as the building, usually at the town centre, got built on


High-Functioning Autistic & Proud... National Autistic Society * Asperger Foundation
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS

My personal website is occasionally here - sometimes it's just the family site - it's basically a lucky dip
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS
My personal website is occasionally here - sometimes it's just the family site - it's basically a lucky dip
Re: Better statue placement
A little update to current trunk, see first post. I will keep here also older version, because of nightly es.
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: Better statue placement
Update to trunk
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)
- JacobD88
- Chief Executive
- Posts: 708
- Joined: 16 Aug 2008 17:51
- Location: Long Eaton, Nottinghamshire. UK
- Contact:
Re: Better statue placement
Thanks Pavel, still using this patch 
I'm surprised no-one else has commented here, as mentioned in my last post, it's a very small change, but makes a big difference for small towns and some cargo types such as goods acceptance. Any devs tried this patch out? If so, what would pavel need to do for it to make it into trunk?

I'm surprised no-one else has commented here, as mentioned in my last post, it's a very small change, but makes a big difference for small towns and some cargo types such as goods acceptance. Any devs tried this patch out? If so, what would pavel need to do for it to make it into trunk?
High-Functioning Autistic & Proud... National Autistic Society * Asperger Foundation
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS

My personal website is occasionally here - sometimes it's just the family site - it's basically a lucky dip
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS
My personal website is occasionally here - sometimes it's just the family site - it's basically a lucky dip
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Re: Better statue placement
I just wanted to mention that duplicate code, with very little difference is not a good coding style.
It's just my hint, code style wise.
It's just my hint, code style wise.
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Re: Better statue placement
Thanks for your remark. Here's patch with updated coding style.
There is still one global variable. It could be removed as well, but would require (at least from my point of view) a structure given to the CircularSearch and this seems, again for me, better way.
EDIT: Patch removed.
There is still one global variable. It could be removed as well, but would require (at least from my point of view) a structure given to the CircularSearch and this seems, again for me, better way.
EDIT: Patch removed.
Last edited by pavel1269 on 08 Apr 2012 17:44, edited 1 time in total.
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: Better statue placement
Update to current trunk.
EDIT: Fixed coding style and stuff. (Thanks Alberth)
EDIT2: While fixing coding style, I created bug. Fortunately no one downloaded that bugged version. (Thanks Alberth)
EDIT3: Patch removed, in trunk (yay). Last revision of my patch in first post.
EDIT: Fixed coding style and stuff. (Thanks Alberth)
EDIT2: While fixing coding style, I created bug. Fortunately no one downloaded that bugged version. (Thanks Alberth)
EDIT3: Patch removed, in trunk (yay). Last revision of my patch in first post.
Last edited by pavel1269 on 08 Apr 2012 17:44, edited 1 time in total.
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: Better statue placement
It's in trunk!
Compared to the last version we exchanged, I eliminated _statue_house, and split out the clear tiles as a separate problem.
An other dev prefered struct, so I changed that too.
Thank you for your work.
Code: Select all
changeset: 19206:2a301ee800ca
tag: tip
user: alberth
date: Sun Apr 08 17:30:20 2012 +0000
summary: (svn r24105) -Feature: Be more careful with the population of a small town while placing a statue.
changeset: 19205:ffc3cdc27a30
user: alberth
date: Sun Apr 08 17:29:00 2012 +0000
summary: (svn r24104) -Codechange: Output the resulting tile through the user data.
changeset: 19204:90b494b476b1
user: alberth
date: Sun Apr 08 17:27:47 2012 +0000
summary: (svn r24103) -Codechange: Handle clear tiles separately from house tiles.
changeset: 19203:ab4ae39b95d1
user: alberth
date: Sun Apr 08 17:26:59 2012 +0000
summary: (svn r24102) -Codechange: Refactor tile clearability test out of the statue callback.
changeset: 19202:0519840052c3
user: alberth
date: Sun Apr 08 17:26:01 2012 +0000
summary: (svn r24101) -Codechange: Reverse a condition for increased readability.
An other dev prefered struct, so I changed that too.
Thank you for your work.
Re: Better statue placement
Nice. I thank you, for picking this patch.
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)
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Better statue placement
Thanks Pavel1269
Thanks Albert
Thanks Albert
Re: Better statue placement
@ Pavel1269: Looks like a very useful upgrade/addition for the game. Congratulations for having provided a patch that actually made it to trunk! 

Everybody can contribute to OTTD! It does not require you to be an IT specialist or designer. And it does not take days or weeks of your time either.
There are many simple yet important tasks like translations, investigating facts and details and many other that need work and if you help a bit then the experienced developers can focus more on making OTTD even more awesome!
OTTD = Awesomeness created by a whole lot of volunteers, be one of them if you like the game!
There are many simple yet important tasks like translations, investigating facts and details and many other that need work and if you help a bit then the experienced developers can focus more on making OTTD even more awesome!
OTTD = Awesomeness created by a whole lot of volunteers, be one of them if you like the game!
Re: Better statue placement
Perhaps I'm being dense, but what does this feature actually do? I just gave it a quick try in the lastet nightly and in one town the statue wiped out a 2x2 shopping mall!
My projects: New Town Names | Snow Aware Arctic Buildings | Custom Buildings | Funny Cars | Mini GRFs | Bits & Bobs
Contributions: BK Enhanced Tunnel Set | Fix TTD GRF Bugs | INFRA Foundations | OpenGFX | OpenGFX+ Airports
Other stuff: The GRFs That Time Forgot! | Buildings in Glasgow
What's that in my avatar? It's the Brighton & Rottingdean Seashore Electric Railway - bonkers Victorian engineering!
Contributions: BK Enhanced Tunnel Set | Fix TTD GRF Bugs | INFRA Foundations | OpenGFX | OpenGFX+ Airports
Other stuff: The GRFs That Time Forgot! | Buildings in Glasgow
What's that in my avatar? It's the Brighton & Rottingdean Seashore Electric Railway - bonkers Victorian engineering!
Re: Better statue placement
Little around, means 5 * 5 square. Center tile is center of the town. So mostly, only small towns aka villages are affected.pavel1269 wrote:The normal placement just searches for first tile, which it can replace (house/tree/nothing) and do that. Often in smaller cities or cities which bizarre layout, it can replace "majority" (like 1-3 in city and one of them got replaced) of bigger houses. This patch is providing that it will search a little around for free tile (trees/nothing) and place statue there. If it fails, it will work as before.
That should explain everything. Anything more?
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: Better statue placement
OK, I see.
That's certainly useful, but some suggestions for improvement:
* Avoid replacing buildings with certain flags set, i.e. multi-tile buildings, churches, stadiums
* For cities search a wider area, e.g. 7*7
* Thinking outside the box here, but what about placing statues manually?

* Avoid replacing buildings with certain flags set, i.e. multi-tile buildings, churches, stadiums
* For cities search a wider area, e.g. 7*7
* Thinking outside the box here, but what about placing statues manually?
My projects: New Town Names | Snow Aware Arctic Buildings | Custom Buildings | Funny Cars | Mini GRFs | Bits & Bobs
Contributions: BK Enhanced Tunnel Set | Fix TTD GRF Bugs | INFRA Foundations | OpenGFX | OpenGFX+ Airports
Other stuff: The GRFs That Time Forgot! | Buildings in Glasgow
What's that in my avatar? It's the Brighton & Rottingdean Seashore Electric Railway - bonkers Victorian engineering!
Contributions: BK Enhanced Tunnel Set | Fix TTD GRF Bugs | INFRA Foundations | OpenGFX | OpenGFX+ Airports
Other stuff: The GRFs That Time Forgot! | Buildings in Glasgow
What's that in my avatar? It's the Brighton & Rottingdean Seashore Electric Railway - bonkers Victorian engineering!
Re: Better statue placement
You're in the wrong forum now 

Who is online
Users browsing this forum: No registered users and 9 guests