Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Oct 22, 2018 12:17 am

All times are UTC




Post new topic  Reply to topic  [ 16 posts ] 
Author Message
 Post subject: Better statue placement
PostPosted: Tue Jul 27, 2010 9:47 am 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Sun Dec 03, 2006 1:22 pm
Posts: 473
Location: Czech Republic
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.


Attachments:
statue_placement_r22254.patch [2.09 KiB]
Downloaded 162 times
statue_placement_r24094.patch [3.25 KiB]
Downloaded 140 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)


Last edited by pavel1269 on Sun Apr 08, 2012 5:47 pm, edited 3 times in total.
Top
   
PostPosted: Tue Jul 27, 2010 3:23 pm 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Sat Aug 16, 2008 5:51 pm
Posts: 674
Location: Long Eaton, Nottinghamshire. UK
Brilliant, thanks Pavel :bow:

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 :roll: Hopefully this will reduce that considerably :D

_________________
High-Functioning Autistic & Proud... National Autistic Society * Asperger Foundation
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS
Image
I now work for DE PHOTO - CLICK TO BOOK US TO SHOOT YOUR EVENT! We Shoot Kids with Canons!


Top
   
PostPosted: Tue Jul 27, 2010 7:17 pm 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Sun Dec 03, 2006 1:22 pm
Posts: 473
Location: Czech Republic
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)


Top
   
PostPosted: Thu Mar 17, 2011 9:52 am 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Sun Dec 03, 2006 1:22 pm
Posts: 473
Location: Czech Republic
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)


Top
   
PostPosted: Sun Mar 20, 2011 6:05 pm 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Sat Aug 16, 2008 5:51 pm
Posts: 674
Location: Long Eaton, Nottinghamshire. UK
Thanks Pavel, still using this patch :bow:

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
Image
I now work for DE PHOTO - CLICK TO BOOK US TO SHOOT YOUR EVENT! We Shoot Kids with Canons!


Top
   
PostPosted: Mon Mar 21, 2011 6:06 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Tue Apr 05, 2005 1:48 am
Posts: 1507
Location: Deep down the deepest blue
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.

_________________
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


Top
   
PostPosted: Mon Mar 21, 2011 8:39 pm 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Sun Dec 03, 2006 1:22 pm
Posts: 473
Location: Czech Republic
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.

_________________
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)


Last edited by pavel1269 on Sun Apr 08, 2012 5:44 pm, edited 1 time in total.

Top
   
PostPosted: Thu Apr 05, 2012 10:05 pm 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Sun Dec 03, 2006 1:22 pm
Posts: 473
Location: Czech Republic
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.

_________________
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)


Last edited by pavel1269 on Sun Apr 08, 2012 5:44 pm, edited 1 time in total.

Top
   
PostPosted: Sun Apr 08, 2012 5:36 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4672
Location: home
It's in trunk!

Code:
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.


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.


Top
   
PostPosted: Sun Apr 08, 2012 5:52 pm 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Sun Dec 03, 2006 1:22 pm
Posts: 473
Location: Czech Republic
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)


Top
   
PostPosted: Sun Apr 08, 2012 7:22 pm 
Offline
Director
Director
User avatar

Joined: Wed Dec 10, 2008 4:08 pm
Posts: 550
Location: tile 0x0000
Thanks Pavel1269
Thanks Albert

_________________
Chunnel , Distance between ships , Playing with Heightmaps , Signals tunnel , Waypoint air , Everest , Tunnel end


Top
   
PostPosted: Sun Apr 08, 2012 8:32 pm 
Offline
Engineer
Engineer

Joined: Tue May 24, 2011 9:01 pm
Posts: 97
@ Pavel1269: Looks like a very useful upgrade/addition for the game. Congratulations for having provided a patch that actually made it to trunk! :D

_________________
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!


Top
   
PostPosted: Sun Apr 08, 2012 8:47 pm 
Offline
Director
Director
User avatar

Joined: Mon Jul 31, 2006 12:40 pm
Posts: 610
Location: Lancs, England
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 | 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!


Top
   
PostPosted: Sun Apr 08, 2012 8:55 pm 
Offline
Route Supervisor
Route Supervisor
User avatar

Joined: Sun Dec 03, 2006 1:22 pm
Posts: 473
Location: Czech Republic
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.

Little around, means 5 * 5 square. Center tile is center of the town. So mostly, only small towns aka villages are affected.

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)


Top
   
PostPosted: Sun Apr 08, 2012 10:04 pm 
Offline
Director
Director
User avatar

Joined: Mon Jul 31, 2006 12:40 pm
Posts: 610
Location: Lancs, England
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?

_________________
My projects: New Town Names | Snow Aware Arctic Buildings | Custom Buildings | 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!


Top
   
PostPosted: Mon Apr 09, 2012 7:22 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4672
Location: home
You're in the wrong forum now ;)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 16 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.