Streets & Road Vehicles

P1SIM is a commercial game under development featuring traffic, logistics, city building and more.
lukasz1985
Route Supervisor
Route Supervisor
Posts: 429
Joined: 27 Mar 2013 08:58
Location: Strumien

Re: Streets & Road Vehicles

Post by lukasz1985 » 01 Apr 2014 16:22

The thing is that you can't beat the math. You either have to get wasted space or make unrealistic appearing of roads.
That's simple square math: 1, 1.41 and halves of this values are not natural. The only good compromise I've found is the way SC4 does it.

User avatar
smallfly
Chairman
Chairman
Posts: 862
Joined: 19 Oct 2009 13:29
Location: Germany

Re: Streets & Road Vehicles

Post by smallfly » 01 Apr 2014 17:01

Changing the graphics...
diag_concept.png
diag_concept.png (128.82 KiB) Viewed 3656 times
... so that diagonal lanes have a width of 1.06 and horizontal lanes a width of 1.00 ...

... and creating the modules with the in-game-module-editor leads to this in-game view:
diag_concept_in_game.png
diag_concept_in_game.png (172.88 KiB) Viewed 3656 times
As Loco has correctly stated, code changes were not necessary.

But since I dont want the cars to not-use the center line of the road I will adjust their positions. This needs some recoding, but the diagonal logistics nodes are only used for diagonal roads and tracks. Thus its totally acceptable to adjust their intra-tile-positions.

One problem left are diagonal single-lane roads - as well as single-lane tracks. They will have a small gap before other diagonal roads/tracks/etc. follow.
diag_single_lane.png
diag_single_lane.png (17.8 KiB) Viewed 3656 times
www.p1sim.org - P1SIM - Traffic, Logistics, City-Building & more
Join the discussions here on tt-forums.net!

LocoMH
Chairman
Chairman
Posts: 845
Joined: 26 Nov 2005 16:21
Location: Dresden (formerly Ruhr Area)
Contact:

Re: Streets & Road Vehicles

Post by LocoMH » 01 Apr 2014 19:15

lukasz1985 wrote:The thing is that you can't beat the math. You either have to get wasted space or make unrealistic appearing of roads.
That's simple square math: 1, 1.41 and halves of this values are not natural. The only good compromise I've found is the way SC4 does it.
That is almost true. With this new method, though, one reaches a road width of 1.5/2*sqrt(2) which equals as smallfly pointed out roughly 1.06. Seems close enough, doesn't it?

@smallfly: how are the nodes placed, anyways? Maybe by allowing a pixel fine placing, you can avoid those last problems. And maybe you could code "internodes", meaning the path will run through these nodes, yet they don't define the end of the path.

User avatar
smallfly
Chairman
Chairman
Posts: 862
Joined: 19 Oct 2009 13:29
Location: Germany

Re: Streets & Road Vehicles

Post by smallfly » 01 Apr 2014 19:50

LocoMH wrote:@smallfly: how are the nodes placed, anyways?
https://www.youtube.com/watch?v=_lSru4foyMo

But the "normal" player wont create own modules. The module editor is meant for fast module creation for people who want to build exceptional/missing modules.
www.p1sim.org - P1SIM - Traffic, Logistics, City-Building & more
Join the discussions here on tt-forums.net!

LocoMH
Chairman
Chairman
Posts: 845
Joined: 26 Nov 2005 16:21
Location: Dresden (formerly Ruhr Area)
Contact:

Re: Streets & Road Vehicles

Post by LocoMH » 01 Apr 2014 20:05

Nice! Good to see another video, thanks. I see the procedure now and realize the problem involved here. I'm sure, you'll work it out, though ;)

User avatar
glenjimen
Engineer
Engineer
Posts: 102
Joined: 16 Aug 2013 00:44

Re: Streets & Road Vehicles

Post by glenjimen » 02 Apr 2014 01:47

This is so awesome!!
I'm glad at least one of my ideas helped you design better looking 45 degree roads!

That module creator in the video looks fantastic, I can't wait to give it a try myself.

You rock smallfly :bow:
... but what do I know? I play with trains.

rsdworker
Traffic Manager
Traffic Manager
Posts: 144
Joined: 18 Mar 2009 13:58

Re: Streets & Road Vehicles

Post by rsdworker » 02 Apr 2014 04:13

looks nice - so maybe you couold show some more like how to add lanes and such?

lukasz1985
Route Supervisor
Route Supervisor
Posts: 429
Joined: 27 Mar 2013 08:58
Location: Strumien

Re: Streets & Road Vehicles

Post by lukasz1985 » 02 Apr 2014 08:32

LocoMH wrote:
lukasz1985 wrote:The thing is that you can't beat the math. You either have to get wasted space or make unrealistic appearing of roads.
That's simple square math: 1, 1.41 and halves of this values are not natural. The only good compromise I've found is the way SC4 does it.
That is almost true. With this new method, though, one reaches a road width of 1.5/2*sqrt(2) which equals as smallfly pointed out roughly 1.06. Seems close enough, doesn't it?

@smallfly: how are the nodes placed, anyways? Maybe by allowing a pixel fine placing, you can avoid those last problems. And maybe you could code "internodes", meaning the path will run through these nodes, yet they don't define the end of the path.
No, it's always true, because in the end if you still going to place another pierce of road next to the other - you will get into the issue again.

LocoMH
Chairman
Chairman
Posts: 845
Joined: 26 Nov 2005 16:21
Location: Dresden (formerly Ruhr Area)
Contact:

Re: Streets & Road Vehicles

Post by LocoMH » 02 Apr 2014 09:26

I don't get your point. The only time one wastes just a little bit of space is when using an odd number of lanes diagonally. Otherwise no waste, just a road width that is slightly higher than the one going horizontally/vertically.

lukasz1985
Route Supervisor
Route Supervisor
Posts: 429
Joined: 27 Mar 2013 08:58
Location: Strumien

Re: Streets & Road Vehicles

Post by lukasz1985 » 02 Apr 2014 09:46

Do yourself a favor and try to place a single lane in a diagonal angle.
Then try to place annother one.
Then repeat this 10 times.

Even if you write an algorithm that alignes each lane - then you end with something that you didn't actually wanted.

Even writing such an algorithm is probably a lot of pain (even if only possible for an average experienced programmer) and possible not worth it at all.
Last edited by lukasz1985 on 02 Apr 2014 09:59, edited 1 time in total.

LocoMH
Chairman
Chairman
Posts: 845
Joined: 26 Nov 2005 16:21
Location: Dresden (formerly Ruhr Area)
Contact:

Re: Streets & Road Vehicles

Post by LocoMH » 02 Apr 2014 09:56

And that's why for an even number of lanes, the 1.5/2*sqrt(2) are the lane widths. Thus two lanes together use exactly 1.5 diagonal pieces. Just as pictured on this and the last page. So really, your problems mentioned are not there - at least not the amount you're talking about.

lukasz1985
Route Supervisor
Route Supervisor
Posts: 429
Joined: 27 Mar 2013 08:58
Location: Strumien

Re: Streets & Road Vehicles

Post by lukasz1985 » 02 Apr 2014 10:32

And there is this problem still left:

Image

LocoMH
Chairman
Chairman
Posts: 845
Joined: 26 Nov 2005 16:21
Location: Dresden (formerly Ruhr Area)
Contact:

Re: Streets & Road Vehicles

Post by LocoMH » 02 Apr 2014 10:37

You were the one saying that a four lane road is its own module compared to two two lane road modules. So this is no problem, following your argumentation. Also, this is just graphical, nothing involving coding.

lukasz1985
Route Supervisor
Route Supervisor
Posts: 429
Joined: 27 Mar 2013 08:58
Location: Strumien

Re: Streets & Road Vehicles

Post by lukasz1985 » 02 Apr 2014 11:03

So now make 5 lane roads and hopefully you will get the idea what I'm talking about.

These modules are not intended to be lied in parallel so it's irrelevant if you miss the space.

Because every module is supposed to have it's own space, and like in reality - there is no point to lie down two parallel highways, instead - rebuild the existing by adding another n rows to it, but that is a completely different module

User avatar
smallfly
Chairman
Chairman
Posts: 862
Joined: 19 Oct 2009 13:29
Location: Germany

Re: Streets & Road Vehicles

Post by smallfly » 02 Apr 2014 11:12

lukasz1985 wrote:And there is this problem still left:
May I support you with a corresponding in-game screenshot.
two_curves_same_radius.png
two_curves_same_radius.png (113.38 KiB) Viewed 3571 times
And yeah. There is space. But thats absolutely realistic. Two curves with same radius always have a gap. And I think it looks quite nice, dont you?

And to be honest, the shown curve cannot be placed like that at the moment. How close a module can be built to another one is defined by the blocked areas (red) and the unblocked areas (green) of a module. Since there are only very simple unblockers available you cannot unblock a curved module pixel by pixel.
blocked_areas.png
blocked_areas.png (12.77 KiB) Viewed 3571 times
www.p1sim.org - P1SIM - Traffic, Logistics, City-Building & more
Join the discussions here on tt-forums.net!

User avatar
smallfly
Chairman
Chairman
Posts: 862
Joined: 19 Oct 2009 13:29
Location: Germany

Re: Streets & Road Vehicles

Post by smallfly » 02 Apr 2014 11:19

lukasz1985 wrote:So now make 5 lane roads and hopefully you will get the idea what I'm talking about.

These modules are not intended to be lied in parallel so it's irrelevant if you miss the space.
odd_number_of_lanes.png
odd_number_of_lanes.png (120.75 KiB) Viewed 3571 times
The reason why its red (saying: cannot be build here) are the unblockers. Compare the red and green areas in module editor on this screenshot.
www.p1sim.org - P1SIM - Traffic, Logistics, City-Building & more
Join the discussions here on tt-forums.net!

rsdworker
Traffic Manager
Traffic Manager
Posts: 144
Joined: 18 Mar 2009 13:58

Re: Streets & Road Vehicles

Post by rsdworker » 02 Apr 2014 11:48

ah that's sense - so that's good to know

LocoMH
Chairman
Chairman
Posts: 845
Joined: 26 Nov 2005 16:21
Location: Dresden (formerly Ruhr Area)
Contact:

Re: Streets & Road Vehicles

Post by LocoMH » 02 Apr 2014 12:14

That's why there should only be modules with an even number of lanes! If you want an odd number, just build 2 lanes + 1 lane. It will have a gap, but it's the easiest and most useful solution, in my opinion.

User avatar
smallfly
Chairman
Chairman
Posts: 862
Joined: 19 Oct 2009 13:29
Location: Germany

Re: Streets & Road Vehicles

Post by smallfly » 02 Apr 2014 12:18

LocoMH wrote:That's why there should only be modules with an even number of lanes! If you want an odd number, just build 2 lanes + 1 lane. It will have a gap, but it's the easiest and most useful solution, in my opinion.
See the 3-lanes modules above? It consists of a 2-lane and a 1-lane module. So there doesnt have to be gap in every case. After implementing the new diagonal nodes needed for centering the diagonal paths I will upload a video showing all corresponding aspects of our discussion.
www.p1sim.org - P1SIM - Traffic, Logistics, City-Building & more
Join the discussions here on tt-forums.net!

LocoMH
Chairman
Chairman
Posts: 845
Joined: 26 Nov 2005 16:21
Location: Dresden (formerly Ruhr Area)
Contact:

Re: Streets & Road Vehicles

Post by LocoMH » 02 Apr 2014 13:10

Alright, sounds good. I get the point - however, if you rotate those modules by 180 degrees, they're different. That could be a downside.

Post Reply

Return to “P1SIM”

Who is online

Users browsing this forum: No registered users and 0 guests