Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Wed Aug 22, 2018 4:10 am

All times are UTC




Post new topic  Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Forest Objects
PostPosted: Fri Nov 21, 2014 10:53 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 17, 2008 12:17 pm
Posts: 2369
Location: Virgo Supercluster
Next up in my series of useless GRFs ...
Image
...this and similar forest tiles (the ones now in EmptyGRF will be removed obviously).

Anyways, while doing this I've noticed some things I somehow missed with the other ones so far:
a) tree sprites aren't "climate sensitive". I thought they worked like groundsprites, but they don't. In other words: you can have palm trees in temperate climate, no problem:
Attachment:
palms.png
palms.png [ 19.5 KiB | Viewed 3728 times ]

b) there's this hide sprite feature I also didn't know about which you can use to still make them climate sensitive "manually" (in the code. It'll be "automatic" ingame). It's somewhat annoying to do, but doable. ^^

So. With some vague memory on 255 limit for NewObjects IDs (is this even true? I also seem to remember that something was changed there, but my m4d search skills failed me on the details...) and dealing with annoying NewObject menu cluster (it only ever gets worse!) I started thinking on this, but since that usually leads to nothing good I decided to just ask you guys instead.

Do we want to be able to build a pine tree forest in tropical climate? A jungle in arctic climate? (mind that someone might also play with Japanese landscape in arctic climate which leads to different results again ^^; ). Or is that unnecessary and would we rather have less menu cluster/less NewObject IDs used? Not saying that it has to be either or, but just a general tendency. Or maybe something different entirely. ;)

Also, if there's otherwise some suggestion, now 's a good time to speak up ^^


Top
   
 Post subject: Re: Forest Objects
PostPosted: Fri Nov 21, 2014 2:08 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Sep 28, 2009 5:15 pm
Posts: 6138
Location: Eastern KY
There's a total limit of 255 NewGRF sets, period. There is a limit of 65,000-something IDs (stations, vehicles, objects, waypoints, etc).

I would prefer to see one NewGRF that has a logical menu of related objects, but I'd like to see as many objects grouped together as possible, as makes sense. I don't want to see a menu selection with just two objects, I also don't really want to see one that tries to cram 24 of them together such as you see with Quast65's ISR/DWE set.

_________________
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
Image

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | RoadTypes?


Top
   
 Post subject: Re: Forest Objects
PostPosted: Fri Nov 21, 2014 3:09 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 17, 2008 12:17 pm
Posts: 2369
Location: Virgo Supercluster
Right, now that I found that changelog alternative thing I see
Quote:
@25835 [25835] 13 months frosch
-Change: Increase the total number of object types from 256 to 64000.

which I hope means it does what I hope...it does. Err. So that at least is no concern.

Kamnet wrote:
I would prefer to see one NewGRF that has a logical menu of related objects, but I'd like to see as many objects grouped together as possible, as makes sense.

It's a bit of an unsolvable issue, I'd say. Every NewObject GRF basically does it differently, some come with lots of categories, some with very few/none, some try for some middle ground, I guess. Stands to reason that people apparently have very different opinions on how this should be handled.

My personal thinking on this is that with this third around it'll be too chaotic to just throw them all into a "misc" category and that I'll probably go with one for each GRF unless there's some super-outlandish sub-category that makes lots of sense in some way or they get too big. Doubt that'll happen though. So it'd be 3 GRFs with 3 categories and something like 25-or-so objects, with 4 views each.
Attachment:
menu.png
menu.png [ 27.75 KiB | Viewed 3658 times ]

IMO with the resizable NewObject menu it makes more sense to use less categories as, well, you can see all build options in one go and select them easily while categories will only tell you so much. And, well, I don't really want to have to think up categories like "Forests: Pine Trees" "Forests: Tropical Woods" or somesuch (not that it woodn't (ha!) make any sense).


Top
   
 Post subject: Re: Forest Objects
PostPosted: Fri Nov 21, 2014 3:43 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9036
Location: Sol d
If the used category labels were documented, they could be shared among different NewGRFs

http://newgrf-specs.tt-wiki.net/wiki/ObjectLabels

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


Top
   
 Post subject: Re: Forest Objects
PostPosted: Fri Nov 21, 2014 6:36 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 17, 2008 12:17 pm
Posts: 2369
Location: Virgo Supercluster
Good point, but mostly a theoretical concern right now as far as I'm aware. Don't think there's too many NewObjectGRFs yet that have overlapping themes. Well. MISC seems to be covered by the list anyways. Guess the other two would probably be FARM and FRST. Or somesuch.

I'll put updating that table down somewhere on my list, once everything else is done ;) (and in case I forget: all opensource anyways, not like people can't check if they want to ^^).


Top
   
 Post subject: Re: Forest Objects
PostPosted: Sat Nov 22, 2014 12:35 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Apr 09, 2014 11:10 am
Posts: 262
Considering that network games are limited to loading only 58 NewGRFs, I'd suggest even if using a few seperate categories to keep it all as one GRF if possible, you can have up to 255 object IDs per file, with each object having 4 views.


Top
   
 Post subject: Re: Forest Objects
PostPosted: Sat Nov 22, 2014 3:39 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 17, 2008 12:17 pm
Posts: 2369
Location: Virgo Supercluster
Mh, true. I don't have that limit very often on my radar since I never get anywhere near it. ^^;

I probably won't merge them though. First of all I don't like forcing anybody to cluster their NewObject menu with piles of objects they don't want, so reasonably splitting them makes sense for that (just 'cause you like sheep doesn't mean you like trees equally ;) ). And secondly code organization isn't exactly a strength of mine and I think I'd horribly get lost if I wanted to change anything later on with all of them merged together ^^;



Talking about my mad coding skills - say I have an object sort of like this:
Code:
   ground {
        sprite: 4164;
   }
   building {
      sprite: 1758;
      hide_sprite: (terrain_type == TILETYPE_SNOW);
   }
   building {
      sprite: 1814;
      hide_sprite: (terrain_type != TILETYPE_SNOW);
   }

Shows tree A while not on snow, and tree B while on snow. Works perfectly fine when built, but neither of the trees show up in the purchase menu (well, I guess it can't predict where I'm going to build them. Stupid thing :p ). Anyways, anyone having some advice or pointer somewhere on how to fix that?


Top
   
 Post subject: Re: Forest Objects
PostPosted: Sat Nov 22, 2014 4:23 pm 
Offline
Tycoon
Tycoon

Joined: Tue Feb 22, 2011 6:34 pm
Posts: 2646
Pyoro wrote:
Shows tree A while not on snow, and tree B while on snow. Works perfectly fine when built, but neither of the trees show up in the purchase menu (well, I guess it can't predict where I'm going to build them. Stupid thing :p ). Anyways, anyone having some advice or pointer somewhere on how to fix that?

I guess you need a purchase callback in the graphics-block of the object. It can be a single sprite, but also a result from several switch-blocks using available variables (not all variables are available as the object does not exist yet).

_________________
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML


Top
   
 Post subject: Re: Forest Objects
PostPosted: Sat Nov 22, 2014 4:24 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9036
Location: Sol d
in the purchase menu you don't have any ground defined. Easiest solution: define a separate layout for the purchase menu.
http://dev.openttdcoop.org/projects/ogf ... .pnml#L252

Alternatively: have a sprite shown when none of the ground variables return anything sensible

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


Top
   
 Post subject: Re: Forest Objects
PostPosted: Sat Nov 22, 2014 5:05 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 17, 2008 12:17 pm
Posts: 2369
Location: Virgo Supercluster
A'ight, that seems simple enough. Thanks :)

€: so what I did is basically make a _purchase duplicate for the spritelayouts in question, a switch so they show correctly for the views and use that as purchase graphics for the item. Which kinda seems like a lot of code for the problem to me - but then it's working, so, well, good enough for me I think ^^;


Top
   
 Post subject: Re: Forest Objects
PostPosted: Sat Nov 22, 2014 11:59 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Apr 09, 2014 11:10 am
Posts: 262
Pyoro wrote:
code organization isn't exactly a strength of mine and I think I'd horribly get lost if I wanted to change anything later on with all of them merged together

A lot of the bigger projects here use templates to split each item into its own file and use preprocessing magic to combine it all together at compile time, it can make it a lot easier to change or add new items.


Top
   
 Post subject: Re: Forest Objects
PostPosted: Sun May 17, 2015 1:25 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 17, 2008 12:17 pm
Posts: 2369
Location: Virgo Supercluster
Since I'm getting nowhere anways I finally got around to quickly zip up the GRF and source. GPLv2 as always.

In any case, you can plant a few different type of forests with this and expand the FIRS tree farms, I think. Should work in all climates; might not make too much sense in Toyland, though. ;) Some are climate / groundtype sensitive, others aren't; it's kinda been a struggle between "well, if I want a jungle in temperate, why should I get one?" and "doesn't really make much sense to have green trees in snow...". Nowhere near perfect or finished, for that matter, but it shouldn't crash any games or anything. ^^


Attachments:
forestobjects.7z [1.79 KiB]
Downloaded 167 times
forestobjects_source.7z [12.46 KiB]
Downloaded 74 times
Top
   
 Post subject: Re: Forest Objects
PostPosted: Sat Aug 11, 2018 10:46 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 17, 2008 12:17 pm
Posts: 2369
Location: Virgo Supercluster
Don't misunderstand me! Just because I could be bugged to spend a few minutes on this GRF doesn't mean I like it! Baka!


... well, trees not being snow-sensitive bothered me too much lately this evening, so the "normal" trees now change in winter. There's an obvious caveat: depending on which tree GRF etc you use it might actually change a leaf tree into some pine tree or whatever. Or might just not be wintry at all in some circumstances - I'm looking at you, Japanese trees. Unless you memorize the specifics of your trees I doubt it'll be very noticeable, but just sayin'. In case anyone does.

So a sloppy GRF gets marginally less sloppy. Or maybe actually more? Well. You decide.

Otherwise it's exactly the same. Code's a bit different, but everything's compatible and such.
Attachment:
forestobjects.7z [8.7 KiB]
Downloaded 12 times

Attachment:
forestobjects_source.7z [9.53 KiB]
Downloaded 7 times


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 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.