Author Topic: One-way Two-lane road Fun Patch  (Read 6999 times)

0 Members and 1 Guest are viewing this topic.

Offline fam621

Re: One-way Two-lane road Fun Patch
« Reply #140 on: March 12, 2017, 11:29:12 AM »
Will this be available for Simutrans Extended, James?

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 14769
  • Total likes: 308
  • Helpful: 143
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: One-way Two-lane road Fun Patch
« Reply #141 on: March 12, 2017, 11:53:10 AM »
Will this be available for Simutrans Extended, James?

Please see above.
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8568
  • Total likes: 254
  • Helpful: 226
  • Languages: De,EN,JP
Re: One-way Two-lane road Fun Patch
« Reply #142 on: March 12, 2017, 09:36:18 PM »
I will review the code; but I am currently on the last few day during move houses (for a family of five to another continent). So no quick action before the end of the month, sorry.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 14769
  • Total likes: 308
  • Helpful: 143
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: One-way Two-lane road Fun Patch
« Reply #143 on: March 13, 2017, 12:25:36 AM »
I will review the code; but I am currently on the last few day during move houses (for a family of five to another continent). So no quick action before the end of the month, sorry.

Goodness, that sounds like hard work. Very best wishes for 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.

Offline THLeaderH

Re: One-way Two-lane road Fun Patch
« Reply #144 on: March 13, 2017, 01:50:05 AM »
Quote
I will review the code; but I am currently on the last few day during move houses (for a family of five to another continent). So no quick action before the end of the month, sorry.
So I have to do refactoring before Prissi reviews my code because Ver8 code is so dirty...
Actually this project was my first time of modifying a big software :-[
Is there anything to do as a reviewee?
« Last Edit: March 13, 2017, 02:04:04 AM by THLeaderH »

Offline Andyh

Re: One-way Two-lane road Fun Patch
« Reply #145 on: March 13, 2017, 03:38:43 PM »
Thank you THLeaderH!  I tested this in a number of different scenarios over the weekend.  It really works very well.  Both player vehicles and city cars behave as expected and very realistically.  I'll leave it to smarter people than me to comment on the code, but from a functionality perspective I would definitely support immediate integration into Simutrans standard.

Offline THLeaderH

Re: One-way Two-lane road Fun Patch
« Reply #146 on: March 19, 2017, 11:35:59 AM »
I uploaded a minor update, OTRP ver8.1, on Google Drive. See from here.
This time, the code patch is simutrans nightly r8141 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

The aim of this update is adaptation for the latest nightly code, fixing code style, and fixing a minor bug. In ver8, vehicles sometimes fail to avoid head-on crash and block the street. I don't make executable binaries this time.

This version, ver8.1, can read settings.xml and sve data of standard, but cannot read these of past OTRPs. I think this is because there were changes in rdwr methods between r8128 ~ r8141 and that causes conflict. However, I couldn't find the exact reason. Is there any changes in rdwr methods between r8128 ~ r8141?

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2446
  • Total likes: 223
  • Helpful: 86
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: One-way Two-lane road Fun Patch
« Reply #147 on: March 19, 2017, 01:46:25 PM »
Yes, the 16 bit colour patch. r8134

Offline Commander Noddy

Re: One-way Two-lane road Fun Patch
« Reply #148 on: March 20, 2017, 12:40:05 PM »
The mod is good:) However, when I test it when the patch v8, my bus (set by human player) can't overpass the citycar (default citycar). The bus has already changed into the faster lane. However, the bus suddenly stop and then it can't overpass the citycar until it left the highway. I want to know what is the problem, thanks:)

May The Force Be With You Always!

Offline THLeaderH

Re: One-way Two-lane road Fun Patch
« Reply #149 on: March 21, 2017, 12:35:45 PM »
Quote
The mod is good:) However, when I test it when the patch v8, my bus (set by human player) can't overpass the citycar (default citycar). The bus has already changed into the faster lane. However, the bus suddenly stop and then it can't overpass the citycar until it left the highway. I want to know what is the problem, thanks:)
I can't reproduce the problem. Could you share a video or sve data with the pakset?

Offline THLeaderH

Re: One-way Two-lane road Fun Patch
« Reply #150 on: March 25, 2017, 12:02:21 PM »
Here is a new release of One-way Two-lane fun patch, OTRP ver9.
This time, the code patch is simutrans nightly r8151 based, and the patch can be easily integrated to the nightly trunk. Executable binaries are nightly r8128 based for a reason - I'll explain it later. Of course you can make a latest nightly based binary by compiling the nightly based patch.
Source code can be seen on git. https://github.com/teamhimeh/simutrans/tree/OTRP

patch:https://drive.google.com/open?id=0B_rSte9xAhLDb1M3U1F5aVk1Zzg
~Executable Files~
:Simutrans:
win:https://drive.google.com/open?id=0B_rSte9xAhLDMFVMZ1d2R2Y5SEE
mac:https://drive.google.com/open?id=0B_rSte9xAhLDM291R3pUYWpHdkE
:makeobj: (new version!)
win:https://drive.google.com/open?id=0B_rSte9xAhLDWkhZMTRlQWhrX0E
mac:https://drive.google.com/open?id=0B_rSte9xAhLDR2pNbkZYVl90WG8

I uploaded r8128 based binaries because r8151 based binaries cannot load sve data of previous versions of OTRP. This is because r8151 integrated color patch. r8151 based binaries can load data of simutrans standard stable version and r8151 based binaries.

Since this version, way-obj also has overtaking_info flag. You can rewrite the condition for overtaking by building way-obj with overtaking_info.
I also integrated decoration way patch. Overtaking condition can be re-written by wayobj-road and wayobj-255. If both wayobj has the flag that changes overtaking_info, wayobj-255 has priority.
This feature enables you to enjoy one-way overtaking on conventional roads! You can use conventional road's wayobj by using wayobj-255.

Making wayobj with overtaking_info is easy. Just add
Code: [Select]
overtaking_info=0to the dat file. If you write
Code: [Select]
overtaking_info=-1the wayobj does not change overtaking_info.

To make wayobj-255, set waytype like this.
Code: [Select]
waytype=decoration
own_waytype=decoration

Sample road addon with overtaking_info can be downloaded from here. Also, sample wayobj-255 with overtaking_info can be downloaded from here.

To use wayobj-255, you need to add wayobj(255) in the menuconf.tab so they show in any or some of the menus. For examle, add
Code: [Select]
toolbar[6][12]=wayobjs(255)in the menuconf.tab of the pakset.

I uploaded a demo video on twitter. This video shows that you can rewrite overtaking condition and use one-way overtaking on the conventional road.
https://twitter.com/himeshi_hob/status/845469009571069952

Any bug reports and ideas for improvement are welcome!
« Last Edit: Yesterday at 01:20:44 AM by THLeaderH »

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2446
  • Total likes: 223
  • Helpful: 86
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: One-way Two-lane road Fun Patch
« Reply #151 on: March 25, 2017, 08:47:57 PM »
Adding other patches will only make your patch worse to be checked, and you'll only create more work when the patch is committed and it creates conflicts.

Offline THLeaderH

Re: One-way Two-lane road Fun Patch
« Reply #152 on: Yesterday at 01:14:18 AM »
Quote
Adding other patches will only make your patch worse to be checked, and you'll only create more work when the patch is committed and it creates conflicts.
Of course I know that. Adding other patches should be avoided but it was inevitable this time.
When I firstly thought about the condition changer, I came up with implementing a completely new object, named road-marker. However, it resulted in completely failure because of its complexity. So, I decided to use way-obj as a condition marker.
However, I had to preserve the role of wayobj of road. I had to implement other kind of wayobj that can be build on road, otherwise it does a huge bad impact on SIS project. Decoration-way patch is the ideal solution for this. Though I can make a new kind of waytype, not any_wt, for wayobj, it will make the conflict worse.
Perhaps I should have waited until deco_way patch is integrated, but I don't know when the integration is done. So, I decided to integrate the patch to this project. I have to apologize for making a cause of conflict.

I think solving this conflict is not so hard. When deco patch is integrated, I'm willing to solve the conflict, of course :)