Conversation
|
This MUST BE MERGED. On Wednesday, March 6, 2013, khonkhortisan wrote:
|
|
Isnt this against the voxel idea of Minetest? |
|
Maybe slightly. In the games Transport Tycoon Deluxe/OpenTTD/Simutrans, even though the world is divided into squares, it's still able to have diagonal rails. Those rails are slightly more complicated, you can have two diagonal lines in the same square. I'm using this as an example of how diagonal rails work just fine in a cubical world. |
|
This would also complicate the movement of carts (if they want to move diagonal too). |
|
I think the rail texture looks a bit too "thin" - the wheel spacing seems to be slightly different from the default rail spacing. |
|
Should carts treat diagonal rail the same as curved rail and move diagonally on both of them? Or should it still move like a square on curves? Or should it actually arc on a curve yet move straight on a diagonal? The narrower rail can be made the same width as the wider rail either by drawing it larger than the size of one node, or making the regular rail narrower. |
|
I would like to add this, but why do you keep using 'or' instead of ||? |
|
...adds realism, but the idea has issues which are quite numerous...the idea of Minetest is that it can run on anything just about, this breaks that ideology...most users don't want this either to my understanding...I have to disagree on the old ideology of don't fix it it's not broken since in my mind everything can be improved |
|
I think this is good, with one thing to consider: How hard it is to make carts move diagonally so that they work reasonably with this? And does PilzAdam have any time to update the cart mod? Or will khonkhortisan do that? 8) In any case, merging this without updating the cart mod is not a good idea. |
|
@celeron55, just curious where's the pull request for mine carts or is there one...such as putting them in the base game? I retract my statement on performance not sure what I was thinking there, think I was sick in bed. I can't see it being too difficult, but the question still remains as to whether the users want this? |
|
DJSKIP18, I don't believe there is such a pull request. Rails don't really serve any functional purpose in the main game, besides maybe making bubbles of air underwater to build in. |
|
I changed the and/or to &&/||. |
|
Was this tested with the carts mod as well, and can carts drive diagonally? Also, can diagonal rails go up / down on nodes like straight rails? If all that works and there are no problems, I support this. Though I am suspicious on how anything diagonal can be achieved in a world of voxel blocks. |
|
whats the current state of this pull? |
|
please rebase |
|
I have rebased, and I would like to re-clarify. Minecraft has diagonal-moving carts on non-diagonal rail. Minetest has non-diagonal-moving carts on diagonal rail. Shouldn't be too hard to have both. |
|
Closing all PRs older than one year. Rebase and re-issue if needed. |

Abstract
This self-referencing pull request adds diagonal rails.
Proof of Concept
Gif
Images
They are just the same as regular rail except that they use two more images:
If this commit is used without the supplementary images, diagonals will appear as crossings. That is why I include child pull requests in three places [see Merging]
End diagonals aren't simply rotated to turn left like curves/diagonals are, they must be flipped so the end is on the other side.
If you use raillike nodes for roofing, this probably won't affect you, unless you use unusual non-rectangular roofing.
Pseudo-rules
A curve will turn diagonal if there are two or more curves in the same diagonal direction (no U-turns)
A rail will end diagonal if it is between a diagonal and a non-curve – unless it is next to the end of the line, in which case that will end diagonal (so non-curve includes non-rail)
Height differences don't apply, as they always create straight rail.
Intersections
There are no diagonal intersections. To do this, one would first have know how to keep two adjacent rail lines from intersecting. They aren't needed at this time.
How it works
It (a rail) reads its neighbors to know how many adjacencies there are, then based on that decides its image. Diagonals are based on more than just the immediate neighbors, so a recursive function is used. The top-level recursion is for a rail, and has its neighbors. The middle level gets its neighbors' neighbors. Using the neighbors' neighbors, a rail can decide if its neighbor is indeed curved, and become diagonal (as its neighbor does the same when the top-level function gets called at that position). But it goes one level further; there are three levels of recursion. The very end of a diagonal rail line (1) needs to know that its neighbor (2) is curved, and that its neighbor (3) is also curved (so it (1) knows that its neighbor (2) would've been an end diagonal had it (1) not been the end of a line). That is the end of the recursion.
Merging
May not automatically merge with connect_to_raillike but will merge manually (this moves the code it changes)
Merge around the same time as these child pull requests: minetest_game, carts, moreores
Problems