On sprite overlapping for objects
Moderator: Graphics Moderators
- GuilhermeJK
- Engineer
- Posts: 55
- Joined: 01 Nov 2014 05:24
- Location: São José dos Campos, Brazil
On sprite overlapping for objects
Hello there, I'm fiddling around an idea of creating a "fake docktypes" grf in nml, using objects that overlay the standard dock sprites. After initial attempts, I'm confused on which order does OpenTTD draw the sprites. I tried these two combinations:
My question: look at the trees in front of the base of the docks (ignore the fact the overlay doesn't follow the shore slope). How would be possible to make this sprite in order to "stay behind the tree"? I also put another building in place of the trees and the building also stays behind the green tile (instead of in front of it).
The two sprites are basically one water tile that servers as the actual placement (marked on the picture by the mouse cursor) with the two green tiles that mark the overlap intent. So on the left picture, the water tile is SW of the dock water tile and on the right one, the water tile in NE of the dock water tile.My question: look at the trees in front of the base of the docks (ignore the fact the overlay doesn't follow the shore slope). How would be possible to make this sprite in order to "stay behind the tree"? I also put another building in place of the trees and the building also stays behind the green tile (instead of in front of it).
-
- Tycoon
- Posts: 5948
- Joined: 27 Apr 2005 07:09
- Contact:
Re: On sprite overlapping for objects
"Sprite overlapping" is just an ugly hack and shouldn't be used at all.
regards
Michael
regards
Michael
- GuilhermeJK
- Engineer
- Posts: 55
- Joined: 01 Nov 2014 05:24
- Location: São José dos Campos, Brazil
Re: On sprite overlapping for objects
I fiddled around more and there was no way of making what I wanted to look nice. So I'm abandoning this idea. The proper way of doing this would be (I think) implementing DockTypes and custom ship depots which I know would require a lot of working fiddling around the game source.
So I'm moving to more simple ideas first, I'm still too much of a rookie
So I'm moving to more simple ideas first, I'm still too much of a rookie
Re: On sprite overlapping for objects
IIRC, the order is from left to right, from the top-down.
If you want to overlap the dock, then your sprite should be to the left of the dock and then offset to the right.
If you want to overlap the dock, then your sprite should be to the left of the dock and then offset to the right.
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
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 | GarryG's Auz Sets
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 | GarryG's Auz Sets
Re: On sprite overlapping for objects
Don't give up that easy .. have a break and try again.
What I have found with overlaps mostly depends where you place the main tile and how you make the overlap piece. Found them a bit hard to to place them right when slopes are involved. This is basically what I use these days. The yellow tile is where the main building goes. The overlap I found works better in either of the green or the red tile section.
If Overlap goes in the pink you can expect glitches.
Anything drawn in the green and red, the game thinks it part of the object in the yellow.
One other thing to look for is this in the code:
Code: Select all
zextent: 16;
}
Hope these help.
Soot Happens
Screenshot Of The Month Winner March 2020
All my projects are GPLv2 License unless stated.
Auz Road Sets: viewtopic.php?f=29&t=87335
Auz Project Releases: viewtopic.php?f=67&t=84725
Auz Trains: http://www.tt-forums.net/viewtopic.php?f=26&t=74193
Auz Industry Sets: http://www.tt-forums.net/viewtopic.php?f=26&t=74471
Auz Objects: viewtopic.php?f=26&t=75657
Auz Bridges: viewtopic.php?f=26&t=75248
Auz Stations: viewtopic.php?f=26&t=76390
Auz Tracks: viewtopic.php?f=26&t=82691
Auz Subway Stations: viewtopic.php?f=26&t=85335
Auz Eyecandy TramTracks: viewtopic.php?t=89908
Screenshot Of The Month Winner March 2020
All my projects are GPLv2 License unless stated.
Auz Road Sets: viewtopic.php?f=29&t=87335
Auz Project Releases: viewtopic.php?f=67&t=84725
Auz Trains: http://www.tt-forums.net/viewtopic.php?f=26&t=74193
Auz Industry Sets: http://www.tt-forums.net/viewtopic.php?f=26&t=74471
Auz Objects: viewtopic.php?f=26&t=75657
Auz Bridges: viewtopic.php?f=26&t=75248
Auz Stations: viewtopic.php?f=26&t=76390
Auz Tracks: viewtopic.php?f=26&t=82691
Auz Subway Stations: viewtopic.php?f=26&t=85335
Auz Eyecandy TramTracks: viewtopic.php?t=89908
- GuilhermeJK
- Engineer
- Posts: 55
- Joined: 01 Nov 2014 05:24
- Location: São José dos Campos, Brazil
Re: On sprite overlapping for objects
Hmm, interesting stuff, I'll give another try
Re: On sprite overlapping for objects
How far can you go with this? How many tiles in NE or NW direction can you overlap?
Re: On sprite overlapping for objects
As far as you want. But keep in mind that eventually you're going to run out of space on the map - you put it too close to the map edge and the graphics will show up somewhere off the screen. Also, keep in mind that overlays like this will display occasional glitches, especially if vehicles move through those areas or if the background scenery changes (like trees growing, grass dying, fields changing, buildings changing, etc.).
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
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 | GarryG's Auz Sets
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 | GarryG's Auz Sets
Re: On sprite overlapping for objects
Does the overlay object overlap vehicles or vice versa?
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: On sprite overlapping for objects
Possibly yes. OpenTTD does only update tiles which need an update. So when you extent your sprite beyond the tile it belongs to to left or right, or beyond the stated z-extent, you will get such glitches pretty sure; it's sometimes a question of likelyness which also depends on conditions of the surroundings. Thus I'd encourage you to simply try and see (but not be too surprised if the result might not be as good as hoped for).
Usually the better answer to the problem you want to solve is actually some changes in OpenTTD's code for the kind of objects you want to modify in order be become more flexible and increased NewGRF control. It doesn't mean necessarily it's an easy answer which will happen quickly though and it might result in many more questions than you are ready to answer at this stage
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
Who is online
Users browsing this forum: No registered users and 3 guests