News:

SimuTranslator
Make Simutrans speak your language.

One-way Two-lane road Fun Patch

Started by THLeaderH, February 06, 2017, 02:04:26 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

THLeaderH

Here is a new release of One-way Two-lane fun patch, OTRP ver7.
This time, the code patch is simutrans nightly r8125 based, and the patch can be easily integrated to the nightly trunk. Executable binaries are 120.2.1 stable based for stability - base version was upgraded. Of course you can make a nightly based binary by compiling the nightly based patch.
Source code can be seen on git. https://github.com/teamhimeh/simutrans/tree/OTRP
branch
OTRP : working branch (120.2.1 based)
master-S : nightly-based branch for making patch

The patch is attached to this post.
All executable binaries are 120.2.1 stable based. If you need a nightly based one, please compile by yourself.
~Executable Files~
:Simutrans:
For Windows: https://drive.google.com/open?id=0B_rSte9xAhLDSnFKUHpub21vcDg
For Mac: https://drive.google.com/open?id=0B_rSte9xAhLDOURHcHZBQUxjUVU
:makeobj:(These are same as ver5.)
For Windows: https://drive.google.com/open?id=0B_rSte9xAhLDN3hmUHpQVTZLVEE
For Mac: https://drive.google.com/file/d/0B_rSte9xAhLDRW51ei05NkUwTW8/view

<Change List>

  • The base of this patch is now upgraded to 120.2.1.
  • "lane fix sign" was implemented as a extension of single_way sign. This helps to reduce congestion caused by lane crossing.
  • WARNING: OTRP7 finally lost compatibility of sve data with the standard. sve of standard can be read on this patch, but sve of this patch cannot be read on simutrans standard.
There is no change in makeobj.

The issue list of One-way Two-lane road patch

  • Cars on the left lane enter the right roads crossing over vehicles. (mostly solved but not perfect.)
  • The new conditions for city cars should be written. (still in working.)
  • Sometimes a queue of stationary traffic still forms behind a stopped vehicle. (still in a research.)
  • Traffic jam occurs due to lane crossing. (relaxed better. Automatic lane yielding is to be implemented.)
Also I found and fixed a bug which prevents vehicles from overtaking citycars, but it is not clear this will solve problems with citycars.

Any bug reports and ideas for improvement are welcome!

Andyh

Hi THLeaderH - I would like to test v6 of the patch but if I understand correctly the new overtaking conditions only apply to roads that are flagged as 'one-way'; regular two way roads continue to use the old overtaking rules.  If that's the case it's not going to be possible to test the patch with any of the standard pak sets as they contain no 'one way' roads since all legacy roads are by default two way.    Am I correct?  Perhaps you could share, for testing purposes, a pak file for a road with the flag set to 'one way'?  I think more people would be prepared to test the patch if there was a ready made add-on to help them do that.

prissi

I can do a wayobj integration, but in that case please stop adding features. Patching and testing needs some time.

Also the citycars certainly needs to know about the new conditions too.

Andyh

Quote from: prissi on March 02, 2017, 07:29:28 AM

Also the citycars certainly needs to know about the new conditions too.

I agree with Prissi.  Based on what I observed, a lot of the bugs with the patch are a direct consequence of the new overtaking conditions not applying to Citycars.  Fix that gap and I believe a lot of the other problems will go away or be substantially reduced.

THLeaderH

#109
Quote
if I understand correctly the new overtaking conditions only apply to roads that are flagged as 'one-way'; regular two way roads continue to use the old overtaking rules.  If that's the case it's not going to be possible to test the patch with any of the standard pak sets as they contain no 'one way' roads since all legacy roads are by default two way.    Am I correct?
Yes. You are all correct  ;)

Quote
Also the citycars certainly needs to know about the new conditions too.
Writing conditions for citycars is just now in progress. This takes some time because the routing algorithm of citycars is quite different from that of road vehicles. In next release, this patch will work correctly with citycars!

QuotePerhaps you could share, for testing purposes, a pak file for a road with the flag set to 'one way'?  I think more people would be prepared to test the patch if there was a ready made add-on to help them do that.
QuoteI can do a wayobj integration, but in that case please stop adding features. Patching and testing needs some time.
To answer to these comments, I have to introduce SIS road project.
SIS, which means Systematic Infrastructure Standard, road project is a project which brings more realistic roads to reproduce various scenes in simutrans. The original aim of this patch is to reproduce highway system using SIS road addons, and that is still same now. I modified the dat files of SIS road addons and am using for testing. So, I want to share the modified SIS road for testing purpose but that needs a permission by the copyright holders. I'm contacting them but it takes some time to distribute. If you know road addons that is suitable for one-way road and that can be re-distributed, please tell me. I'll modify the dat file and share with you.
This project has very strong connection with SIS road project. I once thought that wayobj should have "overtaking_info" flag. However, wayobj is used as sidewalls. Please take a look at 1.jpg and 2.jpg. These are wayobj. If wayobj had overtaking_info flag, we would have to cut sidewalls at the point where the overtaking rule changes. Wayobj is wayobj, should not be used as a marker of overtaking conditions. A new object like wayobj but specified to overtaking_info flag should be provided to realize flexibility of conditions and avoid re-paking way objects. However, this would be a huge work so I'll think about this again after I finish writing conditions for citycars.

SIS road project can be seen from http://seesaawiki.jp/sis_simutrans/d/SIS%20Road, but they are all in Japanese. You can download various addons from this page.

Andyh

Maybe I wasn't looking in the right place, but I couldn't find any roads on the SIS page mentioned above which had overtaking flag set to one way.  So I just made a simple road myself with a one way flag and the makeobj provided in this thread.   When I tested v6 of the patch with this road, player vehicle behavior was very good, including overtaking of stationery vehicles; however, as expected citycar behavior was not right.  Player vehicles do not appear to overtake citycars in any circumstances.  Citycars, if fast enough, will overtake player vehicles but will not move into the overtaking lane (i.e. rather disconcertingly, they go straight 'through' the player vehicle).

THLeaderH

QuoteMaybe I wasn't looking in the right place, but I couldn't find any roads on the SIS page mentioned above which had overtaking flag set to one way
SIS project itself doesn't provide one-way flagged roads, sorry.




I made roads with overtaking_info flag by modifying SIS roads and I got permission to distribute.
You can download from here.
SIS_ExpressWay_road_ds.pak is the addon. This can be used only for testing purpose.

The road of...
999 km/h maximum : overtaking_info = 0
80 km/h maximum : overtaking_info = 3
100 km/h maximum : overtaking_info = 2
120 km/h maximum : overtaking_info = 4

jamespetts

To answer your question of suitable roads to use for testing purposes, Pak128.Britain is open source. The Github repository is here for the Standard version, and here for the Extended version.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

sheldon_cooper

The patch is running on one-way roads, but why the patch can not run on specific convetional roads?
Specifies such as:
img host

1=Dual roads, yellow or white track continues in the middle of the track.
2=Road single hand ''freeway and avenue''
3=two-way road with solid yellow stripe in the middle of the road
So we have example 1 and 3, as roads that the patch would not work. And example 2, of convetional roads that the patch could run (in addition to the SIS one-way)
The idea is that the patch can work on convetional roads with less speed, (50, 60, and 70 km / h) in the city, like an avenue.Well, it's just a suggestion, thank you very much for the attention! :D



THLeaderH

Quotewhy the patch can not run on specific conventional roads?
Do you mean "vehicles cannot overtake on specific conventional roads without flagging?"

As I explained before, all conventional roads without flagging are interpreted as two-way roads. If you can see overtaking on conventional roads, that is because overtaking happens under the conditions for two-way roads. Be sure that marking by single way road signs does not affect on overtaking conditions.




<Development information>
Writing conditions for citycars is now in progress, but it was revealed that this work is huge and quite difficult. I think this takes at least one week :(

prissi

A one way marker wayobj that visually indicates the direction is unfourtunately also a little more complex, since it would two directional graphics per tile. Not that other wayobj could not profit from that (it could solve some caternary on wrong side problems), but that will also need some more time to make it properly.

Tjoeker

#116
I have a question:

How would growing cities handle these streets?

Currently cities 'destroy' highways as they grow. (unless you build elevated ways)

I'd like this:
Cities don't have permission to destroy highways, nor build ramps/connect to these highways.
on the other hand, cities can't build houses along these highways and existing buildings would be destroyed over time unless they are connected to another road.
The downside is that it would create another border for the city to cross (like railways and rivers).

(probably another patch: )
and would cities be able to build one way streets/avenues?
This seems a bit unachievable to me, but sure it would be a cool gimmick. :p

edit:
I don't like a visual indicator on every tile to show direction.
How about an auto-included sign to show direction at every T- or +-crossing?

An_dz

Quote from: prissi on March 04, 2017, 11:31:51 AM
A one way marker wayobj that visually indicates the direction is unfourtunately also a little more complex, since it would two directional graphics per tile. Not that other wayobj could not profit from that (it could solve some caternary on wrong side problems), but that will also need some more time to make it properly.
Still it seems the best solution.

Using way-obj prevents you from having an electrified track + one-way overtaking. There would have a need to duplicate way-objs to have both overtaking-only & overtaking+electric. The same would apply to eye-candy wayobj.

Using roads allows electrified tracks or eye-candy wayobj, but it has lot of drawbacks:
- The implementation has to be ported to bridges, tunnels and elevated ways. A lot of work and terrible for the user to build. With wayobj it's simple.
- The pakset needs to duplicate all roads for the multiple possibilities. pak128 already has 17 roads/bridges/etc. If you only want to add the "one-way" overtaking you already double to 34. It's overwhelming.

Quote from: Tjoeker on March 04, 2017, 01:53:01 PM
Currently cities 'destroy' highways as they grow. (unless you build elevated ways)
But they don't destroy way_objects ;)

Tjoeker

Quote from: An_dz on March 04, 2017, 02:06:57 PM
But they don't destroy way_objects ;)

But they still connect to the highway whenever they want to? ;)
Still, your idea was a big game changer to me :p

edit: I tested this, but the city still reduces the speed from 130+ to 50km/h..

(Sorry, if this gets a bit offtopic, maybe these posts belong in the extension request forum..)

An_dz

Quote from: Tjoeker on March 04, 2017, 02:14:04 PM
But they still connect to the highway whenever they want to? ;)
Still, your idea was a big game changer to me :p

edit: I tested this, but the city still reduces the speed from 130+ to 50km/h..
Of course, but they keep being electrified or oneway according to the sings. That was my point of creating a new way-obj.

Quote from: Tjoeker on March 04, 2017, 02:14:04 PM
(Sorry, if this gets a bit offtopic, maybe these posts belong in the extension request forum..)
Yes.

prissi

Electrification and overtaking do not mix on real life too. I still have to see a trolley box overtaking another trolley bus ...

jamespetts

Quote from: prissi on March 05, 2017, 12:11:09 AM
Electrification and overtaking do not mix on real life too. I still have to see a trolley box overtaking another trolley bus ...

A trolleybus can, of course, overtake a non-electric vehicle.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

THLeaderH

Some players in Japan reported that network games disconnected very frequently when using this patch. I didn't change the code which is directly related to network games, so I don't know what the cause is. I have to research and fix this problem.
Generally, what is the main reason for disconnecting of network games?

sheldon_cooper

Quote from: THLeaderH on March 04, 2017, 04:32:08 AM

As I explained before, all conventional roads without flagging are interpreted as two-way roads.
I think I lost this information, ???
Then does this signaling allow the normal operation of the patch by applying over the convivial roads? What is this signaling?
Are plates for single hand of roads?

jamespetts

Quote from: THLeaderH on March 05, 2017, 12:47:40 AM
Generally, what is the main reason for disconnecting of network games?

Simutrans uses lockstep networking. That means that the server and each client must remain exactly in sync with one another and do precisely the same things at precisely the same (game) time when running on different computers.

Desyncs can be caused by not saving data (so that the clients end up with a different game state to the server on loading) or functions with an indeterminate outcome (so that the client and server have a different outcome from a single function). To handle synchronising randomness, the random number generator's seed is sent by the server to all of the clients, so that, when calling simrand(), the "random" number is identical on the server and all the clients. Make sure to use this rather than sim_async_rand() anywhere where it matters vis a vis the game state.

This sort of problem is, I am afraid, one of the hardest sorts of problems to fix.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ters

Quote from: jamespetts on March 05, 2017, 12:20:40 AM
A trolleybus can, of course, overtake a non-electric vehicle.

Not if overtaking causes it to lose power. This can be because the poles are not flexible or long enough or the other vehicle is so tall that it gets in the way of the poles, and the poles can not be disconnected at speed or the trolleybus doesn't have a good enough battery.

prissi

If the cars change into overtaking in random order, than that my be the cause. With this new patch, depending on subtle differences in timing, one car or the other may block the second lane or not. That will cause different arrivial times etc. It might have not been a issue so far, since the overtaking was seldom.

Having said that, I have watched maps with overtaking also as a network and there were no desyncs.

However, maybe the overtaking state is not saved as complete as it needs to be. Then, upon joining the local save-reload and the server save-reload in the second client would be different.

jamespetts

Quote from: Ters on March 05, 2017, 02:45:04 PM
Not if overtaking causes it to lose power. This can be because the poles are not flexible or long enough or the other vehicle is so tall that it gets in the way of the poles, and the poles can not be disconnected at speed or the trolleybus doesn't have a good enough battery.

It was quite normal for trolleybuses to overtake vehicles such as vans when trolleybuses were commonplace.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Vladki

Here in Brno trolleybuses are still common. They normally overtake only stationary or very slow vehicles (bikes). The poles are long enough, but it does not make sense to overtake anything else.Trolleybuses operate in the city so 50 km/h limit applies to them, and they stop often. Also they often have to slow down at crossroads where the trolleybus lines split, or cross with tram line. At terminal stops they sometimes overtake each other - one has to stop and disconnect the poles while the other is overtaking

An_dz

Quote from: jamespetts on March 05, 2017, 12:20:40 AM
Quote from: prissi on March 05, 2017, 12:11:09 AM
Electrification and overtaking do not mix on real life too. I still have to see a trolley box overtaking another trolley bus ...
A trolleybus can, of course, overtake a non-electric vehicle.
Who said about trolleybuses? Obviously they don't overtake fast vehicles. I'm talking about non-electric cars. A non-electric car can overtake trolleybuses and other vehicles. Just like a tram can go on a one-way road but is fixed on a track (it can't choose lanes) the same applies to trolleybuses. The bus will stay in the left lane, but other vehicles will be able to use the other lane to overtake.

THLeaderH

#130
Here is a new release of One-way Two-lane fun patch, OTRP ver8.
This time, the code patch is simutrans nightly r8128 based, and the patch can be easily integrated to the nightly trunk. Executable binaries are 120.2.1 stable based for stability as usual. Of course you can make a nightly based binary by compiling the nightly based patch.
Source code can be seen on git. https://github.com/teamhimeh/simutrans/tree/OTRP

The patch file became so big that it cannot be attached to the message. So, I uploaded the patch file to Google Drive. You can download it from here.
All executable binaries are 120.2.1 stable based. If you need a nightly based one, please compile by yourself.
~Executable Files~
:Simutrans:
For Windows: https://drive.google.com/open?id=0B_rSte9xAhLDazNFUTR3NXVWUWs
For Mac: https://drive.google.com/open?id=0B_rSte9xAhLDbVN5cUZuajl1Qnc
:makeobj:(These are same as ver5.)
For Windows: https://drive.google.com/open?id=0B_rSte9xAhLDN3hmUHpQVTZLVEE
For Mac: https://drive.google.com/file/d/0B_rSte9xAhLDRW51ei05NkUwTW8/view
~Sample road addon with overtaking_info~
Download from here (testing purpose only)

<Change List>

  • Overtaking conditions for citycars were finally written! Now buses can overtake citycars, and citycars can overtake other vehicles. There are so many things to be considered to apply the conditions to citycars, so this may contain some minor bugs. Since routing system greatly differs, processing of citycars' overtaking is not same as that of road vehicle.
  • <For Mac> AVFoundation is used to play midi and wav instead of QTKit. Current Mac cannot build sources with QTKit, so I integrated this patch. It works fine.
There is no change in makeobj.

Note: This is the last release of 120.2.1 stable based binaries because renaming of variables are rapidly proceeding in the development trunk. I have to keep up with the latest code.

The issue list of One-way Two-lane road patch

  • The new conditions for city cars should be written. (Done, but some bugs might been contained.)
  • Traffic jam occurs due to lane crossing. (Automatic lane yielding is to be implemented.)
  • Cars on the left lane enter the right roads crossing over vehicles. (mostly solved but not perfect.)
  • Marking overtaking_info by dragging a new kind of object. (Maybe this should be implemented after wayobj 255 project is done.)

Although the code is not perfect and some features are yet to be implemented, I think this version has enough features and enough stability to be integrated to simutrans standard. I want to set this version as the candidate for integration. Of course I'm willing to fix bugs and add new features if necessary.

Any bug reports and ideas for improvement are welcome!

jamespetts

Splendid! Were you able to fix the network desync issue?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

THLeaderH

I think the cause of the network desync issue was forgetting initializing a variable, and I fixed it. However, it is not clear whether this issue was completely solved because I haven't tested it yet.

killwater

Awesome. Can we get a nice youtube video as before but with city cars?


THLeaderH

#134
A demo video with citycars was uploaded  ;D


Also, I made another video which explains how to use OTRP!

killwater

Wow. Excellent job. That is a huge step forward for Simutrans. Thanks.

Isaac Eiland-Hall

This really is fantastic. My only complaint is that everyone's driving on the wrong side of the road! (I'm kidding, of course)

Although seriously - it's amusing to see cars merging from the middle of the highway and crossing lanes to go to the outer lane. hehe

I really do hope this makes it into Simutrans. I've been hoping for true freeways like this for more than a decade!

jamespetts

This does look to be a splendid project.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

THLeaderH

Thanks :)  Then... who has permission of integration?

Yona-TYT

Quote from: THLeaderH on March 12, 2017, 12:43:17 AM
Thanks :)  Then... who has permission of integration?

Great project!  :thumbsup: :thumbsup:
We wait for the approval of the great prissi.  ;D