Re: Diagonal roads!
Posted: 13 May 2024 08:24
Sorry for bumping this old thread, but I want to make a proposal and hear your opinions.
I will make a few points. Most importantly I want to state, that diagonal roads are - in some sense - already there, the only problem is drawing a correct NewGRF and doing some minor changes to the source code (for the basic solution). What do I mean?
The fundamental assumption of the above is that the roads will look like and work like the roads in Simutrans - if you're not familiar with this, here are some links to posts that roughly display this:
viewtopic.php?p=980809#p980809
viewtopic.php?p=149090#p149090
So what, in detail is the solution?
The first part is that - for the visuals to be correct at least four sprites - for every curved road - would have to be redrawn, what I mean is explained on the folowing image:
And analogously for the 3 other curve sprites.
With the most basic implementation the existing roads NewGRFs would become obsolete, because, you guess it, the vehicles would not go aligned on the track.
And here comes the second part: the code. The basic solution will need to change one thing: the way that RV's pass through curved roads (and curved roads only). Now the path they go through looks like following:
And needs to look like following:
I guess this is not much of a work to do, since this is hardcoded somewhere in the source. Technically speaking the implementation would be even easier because we're speaking of 1 line segment for each direction instead of 3.
This is the most basic implementation of course. If we would like to go serious and keep the existing NewGRFs intact - the roadtypes NewGRF's would have to indicate what kind of roads in terms of diagonality they contain and the code should take appropriate actions when a vehicle enters a "curved" road.
I won't cover cons and pros of such an approach to diagonal roads, as this has been discussed all over the forums and is perhaps to some degree a matter of taste.
My actual proposal is to implement this by myself (perhaps with some help from other devs), but I would like to hear what you want. I don't know if this would go into trunk, but I might fork OTTD and implement this alone for now, so you could get a taste.
You can take a poll and vote for or against my proposal: https://poll-maker.com/poll5190243xFe0668FB-156
I'm not putting this in the development section of the forum, because this is not an in-depth technical discussion.
Have a nice day.
I will make a few points. Most importantly I want to state, that diagonal roads are - in some sense - already there, the only problem is drawing a correct NewGRF and doing some minor changes to the source code (for the basic solution). What do I mean?
The fundamental assumption of the above is that the roads will look like and work like the roads in Simutrans - if you're not familiar with this, here are some links to posts that roughly display this:
viewtopic.php?p=980809#p980809
viewtopic.php?p=149090#p149090
So what, in detail is the solution?
The first part is that - for the visuals to be correct at least four sprites - for every curved road - would have to be redrawn, what I mean is explained on the folowing image:
And analogously for the 3 other curve sprites.
With the most basic implementation the existing roads NewGRFs would become obsolete, because, you guess it, the vehicles would not go aligned on the track.
And here comes the second part: the code. The basic solution will need to change one thing: the way that RV's pass through curved roads (and curved roads only). Now the path they go through looks like following:
And needs to look like following:
I guess this is not much of a work to do, since this is hardcoded somewhere in the source. Technically speaking the implementation would be even easier because we're speaking of 1 line segment for each direction instead of 3.
This is the most basic implementation of course. If we would like to go serious and keep the existing NewGRFs intact - the roadtypes NewGRF's would have to indicate what kind of roads in terms of diagonality they contain and the code should take appropriate actions when a vehicle enters a "curved" road.
I won't cover cons and pros of such an approach to diagonal roads, as this has been discussed all over the forums and is perhaps to some degree a matter of taste.
My actual proposal is to implement this by myself (perhaps with some help from other devs), but I would like to hear what you want. I don't know if this would go into trunk, but I might fork OTTD and implement this alone for now, so you could get a taste.
You can take a poll and vote for or against my proposal: https://poll-maker.com/poll5190243xFe0668FB-156
I'm not putting this in the development section of the forum, because this is not an in-depth technical discussion.
Have a nice day.