Bounding boxes

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Bounding boxes

Post by Gwyd »

No, but it said something along the lines of unknown value for callback, and set the loco length to 1
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: Bounding boxes

Post by Leanden »

oberhümer wrote:I summon Blue Eyes White Oberhuemer
Image
oberhümer
Tycoon
Tycoon
Posts: 1283
Joined: 23 Oct 2009 19:35
Location: Here and there, sometime or another

Re: Bounding boxes

Post by oberhümer »

Leanden wrote:Seems not, hopefully oberhuemer can shine some light this way as to how he achieved it.
Eddi/planetmaker wrote that code originally. Anyway, this:
stefino_cz wrote:8 is maximum and bigger boxes have to done by articulated parts
is exactly correct. In fact, all vehicles in the CETS/Britrains code consist of three articulated parts. The first part is assigned the actual vehicle graphics, and the curvature between the first/second and second/third part is queried to show intermediate sprites when going around a curve. With this approach, you can have semi-smoothly turning vehicles with a length of between 3 and 16 units, as long as you manage to figure out good-looking sprite offsets. Once again, all credits for this go to Eddi/planetmaker.
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---

--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
User avatar
stefino_cz
Transport Coordinator
Transport Coordinator
Posts: 268
Joined: 02 Jul 2015 08:05
Location: Czech Republic
Contact:

Re: Bounding boxes

Post by stefino_cz »

oberhümer wrote:
Leanden wrote:Seems not, hopefully oberhuemer can shine some light this way as to how he achieved it.
Eddi/planetmaker wrote that code originally. Anyway, this:
stefino_cz wrote:8 is maximum and bigger boxes have to done by articulated parts
is exactly correct. In fact, all vehicles in the CETS/Britrains code consist of three articulated parts. The first part is assigned the actual vehicle graphics, and the curvature between the first/second and second/third part is queried to show intermediate sprites when going around a curve. With this approach, you can have semi-smoothly turning vehicles with a length of between 3 and 16 units, as long as you manage to figure out good-looking sprite offsets. Once again, all credits for this go to Eddi/planetmaker.
But in CETS you still have one long graphics or not? And this graphics is loaded where? At the middle 8 units long box? If so, you have to have the same problems as us on the bridges etc.
Image
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: Bounding boxes

Post by Leanden »

I think because the graphics are trailing instead of forerunning, the glitches are minimal. As the front of the bounding box still encompasses the front of the train fully which is where you usually get weird overlaps.
Image
oberhümer
Tycoon
Tycoon
Posts: 1283
Joined: 23 Oct 2009 19:35
Location: Here and there, sometime or another

Re: Bounding boxes

Post by oberhümer »

Yes, should be that.
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---

--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
User avatar
V453000 :)
President
President
Posts: 946
Joined: 01 Feb 2011 11:22
Location: Beer

Re: Bounding boxes

Post by V453000 :) »

I think the glitches will just move to a different area, aka if you had them at the front-facing tunnels originally, they will start appearing at away-facing tunnels.
ImageImageImage
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Bounding boxes

Post by Eddi »

the code for CETS roughly follows the ideas outlined in this ancient thread (some things were updated for newer features/fixes)

and here is the core of the display code: https://paste.openttdcoop.org/pystey9tu

the sprite is split into 3 parts when the vehicle is on a straight piece of track, and shown as one full sprite for the center vehicle, not the first vehicle, if the vehicle is on a curve/slope

this does not eliminate all glitches, but goes quite a long way.
maquinista
Tycoon
Tycoon
Posts: 1828
Joined: 10 Jul 2006 00:43
Location: Spain

Re: Bounding boxes

Post by maquinista »

This is the main reason because I moved to Locomotion... the smooth curves and realistic train proportions.

But OpenTTD is still a good game. :D Also, I miss a lot of things from OpenTTD in Locomotion, because it doesn't allow liveries and the number of different vehicles is really small. Also, building tracks OpenTTD is much better than in Locomotion, you don't need thousands of mouse clicks.

For developing new graphics I prefer Locomotion, because I feel better with the result, but OpenTTD is better for playing.
Last edited by maquinista on 30 Dec 2017 20:37, edited 1 time in total.
Sorry if my english is too poor, I want learn it, but it isn't too easy.[/list][/size]
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 721
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Bounding boxes

Post by Gwyd »

I wonder why...
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: Google [Bot] and 2 guests