Empty Tile GRF

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Empty Tile GRF

Post by Pyoro »

Sorry for no tag, but I have no idea if this little thing works in TTDP or not. In fact, I basically have no idea what I was doing at all, but it seems to "work" and I haven't found any other GRF that does this (doesn't mean much, I'll admit ^^), so might as well post it here. Just in case ;)

Point was to get a "empty" NewObjects tile to build on slopes. Picture is probably self explaining what for. Should work regardless of climate, but it's not "tile-sensitive" (always a desert-grass tile even when build on sand, no snow, always the green toyland tile etc).
Attachments
Unbenannt.png
Unbenannt.png (83.24 KiB) Viewed 16475 times
EmptyGRF.grf
(395 Bytes) Downloaded 468 times
User avatar
NoWa
Engineer
Engineer
Posts: 28
Joined: 31 Aug 2011 08:28
Location: At Home
Contact:

Re: Empty Tile GRF

Post by NoWa »

Good idea, i like it. :D
Cold you make different fence tiles?
After testing it:
Maybe it could be more cheaper than now. Maybe. :D
Hungarian City Set

Coming soon!

Miau miau :3
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: Empty Tile GRF

Post by Pyoro »

Thx for testing :D

Cheaper? I'm not even sure that's possible. Tile itself costs next to nothing, it only gets "expensive" when build on slopes because of the foundations. No idea though if that prize can be influenced for just one grf.

And on fences - I can't draw and I can't code, so ...probably no ;)

...I did however manage to make a second "version" that actually includes two tile types depending on climate (normal: grass/snow, arctic: grass/snow, tropical: grass/desert, toyland: normal/snow).
Guess that's about it then ^^
Attachments
EmptyGRF.grf
(511 Bytes) Downloaded 313 times
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Empty Tile GRF

Post by FooBar »

There's no need to have two separate objects for that. You can also have the game determine automatically what terrain to use.
In fact the NML tutorial has an example on how to code that: http://www.tt-wiki.net/wiki/NMLTutorial/Object_slopes
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: Empty Tile GRF

Post by Pyoro »

That's actually where I c&p the code from, pretty much ;)
Didn't quite get that part to work, I'll admit *cough* - I assume the game would've decided what tile to place? Since it's only deco anyway I'd say leaving the decision to the player is fine as well. ^^
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Empty Tile GRF

Post by FooBar »

It's your grf, so it's up to you what you want to do with it :)

Anyways, feel free to comment in the NML Tutorial topic on what you in particular don't understand from that part of the tutorial. That way we may be able to improve it in a way that you do understand!
Ovenbaked
Engineer
Engineer
Posts: 31
Joined: 25 Jun 2011 13:32

Re: Empty Tile GRF

Post by Ovenbaked »

I love this idea. simple, but very useful.
The cost is the issue, but that comes with building on a slope.
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: Empty Tile GRF

Post by Pyoro »

Currently playing a game that disallows towns from building roads I found this GRF rather useful to invisibly prevent cities from growing along roads they're not supposed to, but obviously it doesn't look too good on sloped terrain to have foundations everywhere ...
...which is why I quickly made a new batch of these simple GRFs, all containing one object with 4 views (thx to the great NML tutorial ;) ).
First is pretty much the same as the old one: normal, snow, desert and water on foundations.
Second is a sloped normal ground and a sloped terrain sensitive tile (unfortunately no transitions though), plus SE and SW coastal tiles as it's rather beyond me how to detect and draw coastal tiles properly and I needed some of those for my current game ^^.
Third are simply some field tiles on foundations as I got annoyed with cities destroying all farm land. ;)
Attachments
EmptyGRF.grf
(1.63 KiB) Downloaded 342 times
EmptyGRF_2.grf
(1.67 KiB) Downloaded 352 times
EmptyGRF_3.grf
(1.62 KiB) Downloaded 331 times
User avatar
Bob_Mackenzie
Chairman
Chairman
Posts: 823
Joined: 25 Mar 2010 13:36

Re: Empty Tile GRF

Post by Bob_Mackenzie »

I can find a use for them :)
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: Empty Tile GRF

Post by Pyoro »

Good to hear :)

Bit of playing with them actually quickly found me annoyed by #3 being rather limited, so I made another version with more farming related sprites, including references to some FIRS animals (obviously those will only load properly when playing with FIRS).
Example of a rather dirty sheep farm:
farm.png
farm.png (27.63 KiB) Viewed 15666 times
Also tried to find a sensible use for that fake water tile. Elevated city pools perhaps? ^^;
pool.png
pool.png (45.94 KiB) Viewed 15666 times
Either way, new version attached ;)
€: deleted. Didn't work as hoped ^^
Last edited by Pyoro on 29 Aug 2012 12:14, edited 1 time in total.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Empty Tile GRF

Post by planetmaker »

Why don't you combine it all into one NewGRF?
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: Empty Tile GRF

Post by Pyoro »

Mh, no particular reasons, except that I personally slightly prefer to only have in-game what I actually use - as it's just a bit of c&p here's an all-in-one version.

Also, completely misunderstood how referencing to sprites works, so no more FIRS sprites in this. Wouldn't have worked in almost all cases anyways ^^;
Attachments
EmptyGRF_full.grf
(6.99 KiB) Downloaded 378 times
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Empty Tile GRF

Post by planetmaker »

Pyoro wrote:Mh, no particular reasons, except that I personally slightly prefer to only have in-game what I actually use - as it's just a bit of c&p here's an all-in-one version.

Also, completely misunderstood how referencing to sprites works, so no more FIRS sprites in this. Wouldn't have worked in almost all cases anyways ^^;
Well, there's a limit of 63 NewGRFs per game. Having one for each object or vehicle would quickly exhaust that. If you want to restrict availability of not-to-be-used objects, use a NewGRF parameter to offer a choice of which objects become available.

As with respect to referencing: in this particular case it's not easy. On the other hand, FIRS is licensed under the GPL. Thus should you adopt that and adhere to that licensing scheme as well, you'd be free to just grab and copy the related code and sprites and incorporate them here. That'd even supply those independent of the presence of FIRS within a game.
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: Empty Tile GRF

Post by Pyoro »

Mh, makes sense. I had that limit somewhat higher in memory as I personally never came across it, but with only 63 it definitely makes more sense as one grf.

And yes, I briefly considered that, but I'd say it's beyond the scope of this grf - actually, I should've done that as something separate from the beginning probably ^^;
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: Empty Tile GRF

Post by Pyoro »

One last(?) version to clean up this mess; everything neatly packed into one GRF and 9 objects -
objects.png
objects.png (59.27 KiB) Viewed 15358 times
- and while I said "clean up", this (as can be seen) comes with some glitches. Coastal tiles are especially unfriendly to flat terrain. Water, that pile of coal and concrete are flat tiles, but don't have foundations (WAD: allows to neatly cut off hills as seen in the picture. Either way, they're just in to not waste these views ;) ).
Also, some trees aren't drawn correctly in the purchase menu and they'll stay the same for all climates, so they really only make sense for temperate climates (and maybe arctic). And, one last glitch, building bridges over the trees is allowed, but will of course glitch with bridges only 1-2 tiles high ... can look pretty good with higher bridges though ;)

Could maybe have a bit more variation for the trees, or maybe sloped farm tiles, but altogether I consider this done :)
Attachments
EmptyGRF.grf
(10.02 KiB) Downloaded 334 times
User avatar
Bob_Mackenzie
Chairman
Chairman
Posts: 823
Joined: 25 Mar 2010 13:36

Re: Empty Tile GRF

Post by Bob_Mackenzie »

I for one will be using this...

A version with the GFX trees would be nice...
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Empty Tile GRF

Post by planetmaker »

Bob_Mackenzie wrote:I for one will be using this...

A version with the GFX trees would be nice...
If you do it right [TM] you use whatever trees the user uses (by just referencing the base set trees)
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: Empty Tile GRF

Post by Pyoro »

I'd never claim to do anything right, but that for one should work, yes. Probably. Hopefully. At least it does for me. ^^;

Currently trying to figure out steep slopes, and coast tiles apparently might not work the way they're supposed to though I haven't really been able to reproduce this.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Empty Tile GRF

Post by planetmaker »

If you're writing in NML, base_sprite_no is the flat ground tile of the tile type you're looking for (for many cases, not all, might fail for coasts):

Code: Select all

spritelayout company_land_layout(base_sprite_no) {
	ground {
		sprite: base_sprite_no + slope_to_sprite_offset(nearby_tile_slope(0, 0));
	}
}
And you don't have to worry about the actual slope.
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: Empty Tile GRF

Post by Pyoro »

Alright, thanks, I'll take a look at that. :)

Also, I've again been too naive with coastal tiles - they don't work as hoped, at least not for any nightly at least from 24448 onwards. Only works for some revs around 24110 - 24309. I guess the sprite numbers changed somewhere in-between ...
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Ahrefs [Bot] and 6 guests