### Author Topic: Roads: Different length of outer and inner curve  (Read 2970 times)

0 Members and 1 Guest are viewing this topic.

#### Leartin

• Heir-Benevolent-Dictator-Apparent
• Devotee
• Posts: 1469
• PAK-DEV P192C
• Languages: DE, EN
##### Roads: Different length of outer and inner curve
« on: January 26, 2016, 04:02:23 PM »
Current Situation:
The length of a diagonal piece of way is measured by it's center. This makes a lot of sense since most vehicles use the center of the road, and even when not, in sum diagonal pieces in different directions cancel each other in terms of total way length.
However, it leads to cars and especially pedestrians to "teleport" whenever they travel on a curve (change from straight to diagonal direction),
since they, too, move along the center of their way and have just an offset graphic.

Request:
Less jumping by changing the actual travel distance and time on diagonal roads.

How:
Start by getting rid of the graphical offset and replace it with a parameter.
The parameter should be a number that gives the offset in pixel in NE/SW direction. This is because that offset would be the biggest number, NW/SE would be half that number, and NS/EW half of both of those in the respective directions.

However, this is not for each vehicle, but once for the pakset settings or for each road. The vehicles who are to be offsetted automatically gain "use_auto_offset = 1" or something (backwards-compatibility)

Whenever a vehicle traverses a NE/SW diagonal, instead of the usual diagonal length, it uses that length plus/minus offset parameter.
Whenever a vehicle traverses a NW/SE diagonal, instead of the usual diagonal length, it uses that length plus/minus 2x offset parameter.

Further implications one might realize based on this:
slightly different offset for each invidiual vehicle to not drive them exactly the same amount of pixels away from the edge (but probably only useful in really high-scale paks)
Similarly, using the same alterations of offset for pedestrians makes them use the full sidewalk
someday, if multilane-ways are realized, they might profit from centered car images.
...but that's just the future.

For now, the idea is getting rid of teleporting vehicles. Pretty please!

#### Dwachs

• DevTeam, Coder/patcher
• Posts: 4755
• Languages: EN, DE, AT
##### Re: Roads: Different length of outer and inner curve
« Reply #1 on: January 26, 2016, 08:24:18 PM »
I like the request. Honestly, I wonder why nobody else proposed something like this before.

For the implementation / dat files, it could be done by a scaling factor ranging from 0 .. 100: 100 = vehicles is in the centre of the way, 0 = vehicle is at the border of the tile.

If implemented it should be implemented per vehicle.

Also there is the question if you have a train or truck + trailer with vehicles with different positions on the track/road....

• Devotee
• Posts: 3448
• Languages: EN, CS
##### Re: Roads: Different length of outer and inner curve
« Reply #2 on: January 26, 2016, 08:59:03 PM »
There is a similar offset unit for signals on left side, which is in range 0..16, where 0 is centre (no shift) and 16 is border. Yes it is a bit coarse, but it will be nice to be consistent.

#### Leartin

• Heir-Benevolent-Dictator-Apparent
• Devotee
• Posts: 1469
• PAK-DEV P192C
• Languages: DE, EN
##### Re: Roads: Different length of outer and inner curve
« Reply #3 on: January 26, 2016, 10:55:21 PM »
For the implementation / dat files, it could be done by a scaling factor ranging from 0 .. 100: 100 = vehicles is in the centre of the way, 0 = vehicle is at the border of the tile.
There is a similar offset unit for signals on left side, which is in range 0..16, where 0 is centre (no shift) and 16 is border. Yes it is a bit coarse, but it will be nice to be consistent.

I don't understand the advantage of using such scale instead of a pixel value, especially if the scale is finer than pixels. Wouldn't that just mean that the human pak-creater would have to calculate which number to use to get the right amount of pixels, while the game again has to calculate back to the pixel amount? Is this just a code design principle (seperation of graphics and function), or is there an actual advantage I can't see?
Btw. 16 would mean 6 pixel steps in pak192, that is indeed a bit coarse.

If implemented it should be implemented per vehicle.
I wouldn't complain, but what is the advantage?

#### prissi

• Developer
• Posts: 10238
• Languages: De,EN,JP
##### Re: Roads: Different length of outer and inner curve
« Reply #4 on: January 26, 2016, 11:31:53 PM »
I think this could be bound to the waytype, since only road can have this behaviour (maybe water too).

Vehiclewise may not a good idea, since some vehicle would jump and other not, and stop suddenly before a "slower" diagonal vehilce.

#### Leartin

• Heir-Benevolent-Dictator-Apparent
• Devotee
• Posts: 1469
• PAK-DEV P192C
• Languages: DE, EN
##### Re: Roads: Different length of outer and inner curve
« Reply #5 on: January 27, 2016, 06:07:17 AM »
I think this could be bound to the waytype, since only road can have this behaviour (maybe water too).

Special case for pedestrians, where the teleporting is most prominent since they are furthest outside.

#### prissi

• Developer
• Posts: 10238
• Languages: De,EN,JP
##### Re: Roads: Different length of outer and inner curve
« Reply #6 on: January 27, 2016, 09:11:38 PM »
Sure, if we touch this, one can easily do this.