What´s wrong with this Train Bounding Boxes?

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
temporal8
Route Supervisor
Route Supervisor
Posts: 430
Joined: 17 May 2019 14:15

What´s wrong with this Train Bounding Boxes?

Post by temporal8 »

.
.
.
I estimate that it has to do with the Locomotive bounding box height, but I understand that I cannot increase the height in vehicles, right?
tgv.png
tgv.png (532.46 KiB) Viewed 2913 times
Real Projects 32bpp releases:

Real Semi Trucks 32bpp: viewtopic.php?t=90996
Real Houses Eyecandy Objects 32bp: viewtopic.php?t=90767
Real Ships 32bpp: viewtopic.php?t=90733
Real Industries 32bpp: viewtopic.php?t=90183
Real Houses Townset 32bp: viewtopic.php?p=1254605
Real Stations 32bpp: viewtopic.php?p=1255635
Real Cars 32bpp: viewtopic.php?p=1249244
Real Vehicles 32bpp: viewtopic.php?p=1253581
Real Bus 32bpp: viewtopic.php?p=1249245
Real Trucks 32bpp: viewtopic.php?p=1254468
Real Parks 32bpp: viewtopic.php?p=1250255
Argentina World Cup 2022 Champions Bus 32bpp viewtopic.php?p=1257026
Brickblock1
Engineer
Engineer
Posts: 117
Joined: 04 Apr 2022 12:44
Location: The openttd discord server

Re: What´s wrong with this Train Bounding Boxes?

Post by Brickblock1 »

temporal8 wrote: 28 Jul 2023 21:28 .
.
.
I estimate that it has to do with the Locomotive bounding box height, but I understand that I cannot increase the height in vehicles, right?

tgv.png
The problem isn't the height but rather that the graphics are larger than the bounding box
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: What´s wrong with this Train Bounding Boxes?

Post by Eddi »

in general, trying to fix a problem by increasing the bounding box size is a bad idea. because bigger bounding boxes makes it more likely that bounding boxes overlap, and once you have overlapping bounding boxes, it's basically game over.
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: What´s wrong with this Train Bounding Boxes?

Post by Eddi »

a long time ago i made a topic on this: viewtopic.php?t=53511

i've also later made a set based on this idea. (but it was never finished)
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: What´s wrong with this Train Bounding Boxes?

Post by Eddi »

also, if you think your train clipping with stations is bad, try to send it into a depot or tunnel
temporal8
Route Supervisor
Route Supervisor
Posts: 430
Joined: 17 May 2019 14:15

Re: What´s wrong with this Train Bounding Boxes?

Post by temporal8 »

Eddi wrote: 29 Jul 2023 06:43 a long time ago i made a topic on this: viewtopic.php?t=53511

i've also later made a set based on this idea. (but it was never finished)
Yes i Saw, Anyway my idea is not to smooth the curves but just to make them long.

I had a similar problem a while back with my stations and Real Houses buildings and I fixed it by increasing the height of the bounding boxes (which is possible in stations and objects but I understand not in trains)
viewtopic.php?t=90208

Image




Another approximation would be the one used by the guys from CZ, 1 partial sprite for each of the 3 parts that make up a vehicle BUT on slopes and horizontal rails only 1 long sprite, but I don't know how they did it.

Image
Image
Attachments
bounding h.png
(1.51 MiB) Not downloaded yet
cz2.png
cz2.png (171.09 KiB) Viewed 2744 times
cz.png
(646.83 KiB) Not downloaded yet
Real Projects 32bpp releases:

Real Semi Trucks 32bpp: viewtopic.php?t=90996
Real Houses Eyecandy Objects 32bp: viewtopic.php?t=90767
Real Ships 32bpp: viewtopic.php?t=90733
Real Industries 32bpp: viewtopic.php?t=90183
Real Houses Townset 32bp: viewtopic.php?p=1254605
Real Stations 32bpp: viewtopic.php?p=1255635
Real Cars 32bpp: viewtopic.php?p=1249244
Real Vehicles 32bpp: viewtopic.php?p=1253581
Real Bus 32bpp: viewtopic.php?p=1249245
Real Trucks 32bpp: viewtopic.php?p=1254468
Real Parks 32bpp: viewtopic.php?p=1250255
Argentina World Cup 2022 Champions Bus 32bpp viewtopic.php?p=1257026
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: What´s wrong with this Train Bounding Boxes?

Post by Eddi »

yes, higher bounding boxes is not possible for trains, it would clash with the bounding boxes of trains on bridges and catenaries. like i said, if bounding boxes overlap it's game over.

the 3-part trains is what "most" people use nowadays, it's the evolution of that old post i made.

the smooth curves is just a bonus, not necessary.

the way you detect curves and slopes to switch between 3-part and single-part drawing is with var 0x62
temporal8
Route Supervisor
Route Supervisor
Posts: 430
Joined: 17 May 2019 14:15

Re: What´s wrong with this Train Bounding Boxes?

Post by temporal8 »

I'm thinking that I could try to make progress in terms of trains if I take into account the 3 parts regarding the slopes and the smooth curves too, I think that this has not advanced due to the difficulty of drawing so many graphics but when modeling in 3d that is more simple, i can try.

I wrote to Stefino_cz about the slopes and I would like to deepen about the smooth curves, somewhere in the forum is the nml code? I have searched about Britrains and CETS but I have not found the source code.

I think that one of the things that we like the most about Openttd are the trains, and I think that paving the way for trains with realistic proportions in 32bpp would be a very good idea.
Real Projects 32bpp releases:

Real Semi Trucks 32bpp: viewtopic.php?t=90996
Real Houses Eyecandy Objects 32bp: viewtopic.php?t=90767
Real Ships 32bpp: viewtopic.php?t=90733
Real Industries 32bpp: viewtopic.php?t=90183
Real Houses Townset 32bp: viewtopic.php?p=1254605
Real Stations 32bpp: viewtopic.php?p=1255635
Real Cars 32bpp: viewtopic.php?p=1249244
Real Vehicles 32bpp: viewtopic.php?p=1253581
Real Bus 32bpp: viewtopic.php?p=1249245
Real Trucks 32bpp: viewtopic.php?p=1254468
Real Parks 32bpp: viewtopic.php?p=1250255
Argentina World Cup 2022 Champions Bus 32bpp viewtopic.php?p=1257026
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: What´s wrong with this Train Bounding Boxes?

Post by Eddi »

the CETS code used to be on the (now defunct) devzone. i still have it, but i never got round porting it to github
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 15 guests