Page 1 of 1

What´s wrong with this Train Bounding Boxes?

Posted: 28 Jul 2023 21:28
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 5147 times

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

Posted: 28 Jul 2023 21:47
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

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

Posted: 29 Jul 2023 06:38
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.

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

Posted: 29 Jul 2023 06:43
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)

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

Posted: 29 Jul 2023 07:08
by Eddi
also, if you think your train clipping with stations is bad, try to send it into a depot or tunnel

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

Posted: 29 Jul 2023 16:58
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

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

Posted: 30 Jul 2023 00:25
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

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

Posted: 30 Jul 2023 13:38
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.

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

Posted: 31 Jul 2023 02:09
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