News:

Want to praise Simutrans?
Your feedback is important for us ;D.

One-way Two-lane road Fun Patch

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

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

THLeaderH

#280
This is a minor update of One-way Two-lane Road Patch, OTRP ver12_3.
This time, the patch file and the executable binaries are simutrans nightly r8301 based, and the patch can be easily integrated to the nightly trunk.
Source code can be seen on git. https://github.com/teamhimeh/simutrans/tree/OTRP

patch:https://drive.google.com/open?id=0B_rSte9xAhLDampoVkdsdE45NFE (This does not include Ribi-Arrow patch.)
~Executable Files~
:simutrans: (The executable binaries include Ribi-arrow patch. Ribi-arrow pak is required. Please download from here and put it into your pakset.)
win:https://drive.google.com/open?id=0B_rSte9xAhLDTnFFanBNeDMzVmM

To use ribi-arrow, add
simple_tool[37]=,:
into menuconf.tab.
This version can read a save data of ver12.

~How to use this patch~

  • Download ribi-arrow pak and put it into your pakset.
  • Assign an appropriate key to simple tool 37. Add simple_tool[37]=,: into menuconf.tab and you can use ribi-arrow using the colon key.
  • Download an executable file and put it in the directory where simutrans.exe exists.
  • Execute the OTRP file. Please do not overwrite your save data of simutrans standard.

On this version,

  • I did some more fix of the graphic glitch problem.
  • Some duplicated declaration of methods are removed.
  • The issue that overtaking mode selection window sometimes appears is fixed.

I think all bugs I know is now removed. So, I set this version as a candidate for the integration again!
Any bug reports and ideas for improvement are welcome!

THLeaderH

I found a small but a severe bug - the issue that simutrans often stops by SEGV while loading a game - and fixed it. These are the fixed code and binary.
patch:https://drive.google.com/open?id=0B_rSte9xAhLDNElXMmY4LUFGVXM
binary for windows: https://drive.google.com/open?id=0B_rSte9xAhLDc09PT1phTXphS0U
CHG: simconvoi.cc::L4039

By the way, is anyone doing a code review or something?

TurfIt

Quote from: THLeaderH on October 11, 2017, 02:06:29 PM
I think all bugs I know is now removed. So, I set this version as a candidate for the integration again!
Given issues brought up in April are still left unaddressed - hardly...
Logic incomplete and even flagged with TODO's, yet still left.
Road trains driving right through each other.

And then direct request from July ignored - lane fixing/affinity that doesn't seem to do anything at all. Still no example demonstrating correct behavior.

I'd spent 4 weeks with the v11 code. Intended to setup some simple test cases, but got completely bogged in the code instead - can't create a test case for things that make absolutely no sense.
My notes on suspicious code devolve from simply huh's to stuff not fit to post as the WTF'ery factor increases the deeper one looks.  3 weeks later and my mood has not improved.

Since past lists of specific issues were take too literal, no more detailed specifics. I'd suggest reading through the patch file, and the resultant code. Make sure it's complete. Make sure comments make sense, especially after cut'n' paste jobs. Make sure logical conditions make sense, not testing for things already tested for (I even found one testing the same condition in the same if()!). No state changes in query functions (likely the source of my lane fix/affinity issues). Maybe try using this new fangled keyword called 'else'. if(a), if(!a) yeesh. Avoid revenue being affected by traffic conditions - hint lane yielding.

And a quick peek at v12 - refleshing. what? I can't even...




THLeaderH

TurfIt, I appreciate your spending of 4 weeks for the code review.
You claimed that

  • Lane fixing/affinity that doesn't seem to do anything at all. Still NO example demonstrating correct behavior.
  • Road trains driving right through each other.
but I have never seen these phenomena as long as I use otrp v12_3. I made a demonstrating video.


As you insisted, I'll read through the whole patch file again. Also, I'll deal with the issues you listed here. However, unfortunately, writing on this forum scatters the issue reports in many messages and thread. Even your great advice will be surely buried by other many many posts on this topic. So I enabled the issues feature of GitHub. With the issues feature of GitHub, you can point out exactly where of the code is problem. Also you can always work with the latest code.
You spent no less than 4 weeks to do such a sensitive code inspection. Please write about  anything you doubt, anything you say huh about, anything you find incomplete, and anything you feel wrong as the issues on GitHub instead of scattering bug reports, writing something ironical, posting a vague indication on the forum, and keeping a great amount of your analysis in your private note, even though you think Git should be in a trash bin. Please make your issue posts as concrete as possible. For example of if ~ else, please point out at least 1 line that is malformed.
Please also use pull requests if you need.

The OTRP repository on GitHub is here. Thank you for your cooperation.

Andyh

Possible to get this patch implemented, or are we at a complete impasse?  It's a huge improvement over the existing functionality so would hate to see this fail.  I hope we are not making 'the perfect the enemy of the good'.

Ters

It doesn't look like TurfIt is asking for perfection, just saying that applying this patch now will introduce severe bugs and reduce the quality of the code (which in turn affects others people ability or willingness to work with it).

THLeaderH


Ters

Simutrans development coordination happens on this forum. We don't use issue trackers.

TurfIt

Quote from: THLeaderH on October 17, 2017, 03:26:00 AM
  • Lane fixing/affinity that doesn't seem to do anything at all. Still NO example demonstrating correct behavior.
Yes, I can have a vehicle forced into the passing lane for a while as your latest video shows. As a player, why would I want to do this? And why shouldn't the truck do it itself if required?

In your previous video, I took from a different purpose for this roadsign when selected to the driving lane. I thought the intent of the sign was to prevent a vehicle that's going to exit a highway at the next exit from entering the passing lane and getting stuck there. I can't make this work, but again, why as a player do I have to manually do this?

And, looking at the relevant variables in debug as a vehicle passes a oneway sign with the driving lane selected, absolutely nothing happens. Hence my claim of something broken, or me not understanding what this is actually supposed to be doing. So, thus far I still consider no example of correct behaviour having been provided.


Quote from: THLeaderH on October 17, 2017, 03:26:00 AM
  • Road trains driving right through each other.
but I have never seen these phenomena as long as I use otrp v12_3. I made a demonstrating video.

Example video showing truck driving right through a roadtrain's trailers: https://drive.google.com/open?id=15UnG71GBj8Of7vneVmF3V5pPoVZQ6H9f
Quite easy to create many many anomalies whenever intersections are involved; Also when overtaking mode changes along a vehicles path - the logic just doesn't handle anything but the most simplistic road.

danivenk

Today I found out that my OTR simutrans crashes when using R (Rotate). Also my simutrans runs really slow, I don't know if it is the fault of my big map (pak128+addons, 1024x1024\ about 500 convois) or it is the fault of the patch... I use OTR v12.3.2

THLeaderH

This patch has not been updated for over a month, and I decided to suspend the development.
Still I continue to distribute the binaries and follow the changes of the master brunch, but I cannot go further.
If there is someone who want this feature in simutrans standard, it's someone in this forum that completes this patch, not me.

jamespetts

Quote from: THLeaderH on November 25, 2017, 03:28:14 PM
This patch has not been updated for over a month, and I decided to suspend the development.
Still I continue to distribute the binaries and follow the changes of the master brunch, but I cannot go further.
If there is someone who want this feature in simutrans standard, it's someone in this forum that completes this patch, not me.

That is rather a shame. I should be happy to have this in Extended with perhaps a few minor adjustments if you would like to work on that.
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

Quote from: THLeaderH on November 25, 2017, 03:28:14 PM
This patch has not been updated for over a month, and I decided to suspend the development.
Still I continue to distribute the binaries and follow the changes of the master brunch, but I cannot go further.
If there is someone who want this feature in simutrans standard, it's someone in this forum that completes this patch, not me.

I'm sad about it, but thanks for developing such a wonderful and fantastic Patch. Thank you!

Andyh

Quote from: sheldon_cooper on November 26, 2017, 01:24:25 PM
I'm sad about it, but thanks for developing such a wonderful and fantastic Patch. Thank you!


I agree, but at least we can all now go back to the important things like expunging German from the Simutrans code.

THLeaderH

Today I followed the commit of the master brunch and the binary for windows is available.
The repository is r8346 based now.
https://drive.google.com/open?id=15L3AY3wZ_bZuczHZQbRrBPXT2l_4S59E

To understand how to use this patch, please see this post.

THLeaderH

This is a small update of OTRP. I dealt with a bug that vehicles on the passing lane cannot restart when the crossing road is congested.
The repository is r8365 based now. The binary for windows and mac is available.

windows: https://drive.google.com/open?id=1O0YS4HvyBUgkv1m6jnpNMKJ8Qp76WVCd
mac: https://drive.google.com/open?id=1qQXHfgVybAPvE5AM7WMqLDl6qgtTAIVh

To understand how to use this patch, please see this post.

THLeaderH

OTRP ver.13 was released.
The commits of the master brunch were followed and this patch was included to the OTRP binary.
v13 can load the data of v12.

windows: https://drive.google.com/open?id=1BbZiIlxHeKO20Nq6tY_aeDI0CSM0LuqG
mac: https://drive.google.com/open?id=1q_bf8UforE9-j_0eW6ySow2lxtGiYdCr
source to compile: https://github.com/teamhimeh/simutrans/tree/OTRP-distribute

To understand how to use this patch, please see this post.

prissi

I have finally more free time ahead, and would like to see into the patch (and the performance issues). Although from what I saw that this endevour had become maybe a little too complex (like five overtaking modi and hidden flags by special tools) for the normal casual player.

It may as well that a simpler approach to relaxed overtaking is needed, especially for performance. Anyway, in order to start looking into this, which is actually the current state. I see five active branches, which one I should check?

(Also the patch files of github seems uneccessary large since a lot of identical lines (maybe with whitespaces) are contained within.)

THLeaderH

#298
Thank you for being interested in. "OTRP" branch is always the latest pure OTRP branch. "OTRP-distribute" branch is the branch for distribution, which contains ribi-arrow patch and signal open direction control patch. The others are obsolete.

sheldon_cooper

Thanks for the new update! :D
I do not understand how implementations of Patch files work in the simutrans game. So, I wonder if it is possible to add other Patch in this update, is it possible? If so, how should I do this?

THLeaderH

#300
OTRP ver.13_2 was released.
The commits of the master brunch were followed and this version is r8424 based.
v13_2 can load the data of v12 and v13.

OTRP v13_2 was replaced by v13_21 because of a bug. Please see the post below to download.
windows: https://drive.google.com/open?id=1YU_5fvANPZ4s6yj0gcan-325VDGm-KH3
mac: https://drive.google.com/open?id=1q_bf8UforE9-j_0eW6ySow2lxtGiYdCr
source to compile: https://github.com/teamhimeh/simutrans/tree/OTRP-distribute

In this version, a new overtaking_mode, halt mode, is introduced. The behavior of a vehicle in halt mode is basically same as oneway mode, but halt mode enables a vehicle to stop on the passing lane at a halt.

To understand how to use this patch, please see this post.

Bringing the modification of this version to simutrans extended takes some more time.

jamespetts

This seems to be an interesting development - do I understand that this allows vehicles to overtake road vehicles waiting at stops even if the underlying road type is not the special one way road? If so, this would be extremely useful, both for Standard and Extended.
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

halt mode is one of the overtaking modes, that is listed as fig1.png.
Even with oneway mode, a vehicle must go on the traffic lane when it stops at a halt to load passengers or cargo. However, with halt mode, a vehicle can stop on the passing lane to load passengers or cargo.
The video in this tweet describes what is happening. Please note that the limitation in this video that a vehicle needs one clearance tile before the halt tile is already fixed.

jamespetts

Interesting. Is there any reason for not making "halt mode" the default? Indeed, is there any reason for retaining "twoway" separately from "halt mode" - in other words, is there ever a reason for a player not to want halt mode enabled on a two way road?
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

Stopping on the passing lane for a long time is not good for traffic, regardless of overtaking_mode. On a twoway mode road, stopping on the passing lane totally blocks the facing traffic. On a normal twoway road, a bus usually won't go on the passing lane to load passengers even if there is a stopping vehicle in front of the bus. Halt mode should be used only for the dedicated places, such as a bus terminal, otherwise, stopping on the passing lane gives a bad effect for the traffic. This is why halt mode is not the default.

Somebody may claim that halt mode should be used with twoway mode too because a bus terminal can consist of twoway roads. However, there is a technical issue to support both twoway mode and allowing to stop on the passing lane at once. On a halt tile whose road is twoway mode, a vehicle can make a turn. When making a turn, a vehicle moves from the lane to the another. If we allow a vehicle to stop on the passing lane, a vehicle that want to make a turn cannot make a turn because of the stopping vehicle on the other lane, or overlaps on the vehicle on the other lane and this should not happen. In my implementation, halt mode is an extension of oneway mode and a vehicle cannot make a turn on a halt mode tile. This avoids deadlocking and overlapping of vehicles.

Therefore, halt mode is implemented as an extension of oneway mode, and stopping on the passing lane to load passengers cannot be supported on twoway roads. Players should use oneway mode or twoway mode for a halt on a normal street. Halt mode should be used on a dedicated place such as a bus terminal, where through traffic does not exist.

THLeaderH

In OTRP v13_2, a bug that a vehicle was stuck before a choose sign was found. This bug was already fixed and released as v13_21. You can download the executable files from the links below.

windows: https://drive.google.com/open?id=1Ypv05zz5Kpz1jNxKfNL35AkRCj_1RS4U
mac: https://drive.google.com/open?id=17VdFzhilB_rEn9D3pt3hnLou0fA6Qw-k

I already fixed this bug for ex-OTRP too.

fam621

When will this be extended compliant James?

jamespetts

THLeaderH - thank you - that is most helpful.

Fam622 - it is not easy accurately to predict this, as it depends on how long that it takes me to do all higher priority work such as fixing bugs, and the amount of time that it takes to fix any given bug is inherently unknowable until the cause of the bug has been identified, which identification is often ~75% of the work in bug fixing.
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

Thank you for your support for OTRP project.
OTRP was updated to ver14_2. Also, I made an English version of the users document. The download link and some more useful information are available on the web page below.
https://github.com/teamhimeh/simutrans/blob/OTRP-distribute/documentation/OTRP_information_en.md

Since there is no hope for the integration due to madness of the code, I introduced the separated version management of save data from the simutrans standard. This enables me to follow up new features in simutrans standard without a sacrifice of data compatibility. However, this change means that OTRP is no longer integrable into simutrans standard. Also, the meaning was lost that I maintain the two branches, OTRP and OTRP-distribute, separately. I haven't decided yet how to treat these two branches, but at this moment, only OTRP-distribute branch contains the latest improvement of this project. OTRP branch is not updated, preserving the code of version 13.

Anyway, the changes of version 14 are as follows.

  • v14 is based on simutrans standard 120.3. Both data of 120.3 and that of OTRP v12 and 13 can be loaded, although a simple setting is required to load the data of OTRP v12 and 13. Please check the compatibility section of the document for this topic.
  • Vehicles stops before an intersection without a traffic light under certain conditions. This realizes more realistic behavior of motor vehicles and gives incentive for players to put a traffic light. This feature can be disabled with settings.
  • Simutrans standard 120.3 has a problem that the depot window can freeze when there are so many vehicle add-ons. OTRP v14 contains a solution for this problem. (I'll post a patch for this problem of the standard in another thread.)
  • Ribi-Arrow is showed only for street.

Enjoy your OTRP life :)

THLeaderH

#309
OTRP was updated to ver14_4. To download the latest executable files, visit https://github.com/teamhimeh/simutrans/blob/OTRP-distribute/documentation/OTRP_information_en.md

<updates for 14_3>
a bug fix for the depot frame only.

<updates for 14_4>

  • Some bugs related to OTRP vehicle control are fixed.
  • The maximum height of the world is now 64.
  • The changes of simutrans nightly were followed and OTRP is now r8525 based.

THLeaderH

#310
OTRP was updated to ver15. To download the latest executable files, visit https://github.com/teamhimeh/simutrans/blob/OTRP-distribute/documentation/OTRP_information_en.md

<updates for 15>

  • Incorporate latest changes of simutrans standard nightly trunk
  • Thanks to the tile reservation system, the possibility of being dead-locked in a big intersection was greatly reduced.
  • Ribi-Arrow feature is now available through the display settings.
  • "Avoid becoming cityroad" option is implemented.

THLeaderH

OTRP was updated to ver16. To download the latest executable files, visit
https://github.com/teamhimeh/simutrans/blob/OTRP-distribute/documentation/OTRP_information_en.md
↑ a document written in English :D

<updates for 16>

  • The movement of citycars are greatly improved. Now citycars support lane yielding, lane affinity sign, and tile reservation. Acceleration of citycars are now more realistic than that of the standard. Citycars choose their direction wisely, considering road traffic, sharp turn and road spec.
  • "Citycars do not enter" option is available for roads.
  • Regional mass construction of buildings. This feature was implemented by @shingoushori.

Sorry for being late in the transplantation of new OTRP features to simutrans extended...

Andyh

Thank you!  I like the new features (including the mass building feature, even though it's rather unrelated to the one-way theme... makes building modern-looking more homogeneous cities a lot easier)

THLeaderH

OTRP was updated to ver17. To download the latest executable files, visit
https://github.com/teamhimeh/simutrans/blob/OTRP-distribute/documentation/OTRP_information_en.md

<updates since v16>

  • Various bug fixes around citycars.
  • Fix for map rotating.
  • Regional land raise/lower tool, removal tool, and building platform tool. These tools are regional when used with ctrl key. This feature was implemented by @shingoushori

Sorry for being late in the transplantation of new OTRP features to simutrans extended. It seems that transplantation is conducted by the end of September...

THLeaderH

A cool logo of OTRP by 128Na!


Since OTRP is now a forked version of simutrans standard rather than a patch proposal, the official name of OTRP is One way Two lanes Road Project!