News:

Congratulations!
 You've won the News Item Lottery! Your prize? Reading this news item! :)

Waypoints act no longer as signals

Started by TurfIt, September 03, 2012, 04:33:35 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TurfIt

Split off from the extension request:Waypoints act no longer as signals as it's meandering all over...

New version attached. Reasonably tested.

Schedule editing no longer causes aktuell mismatches.

I excluded airplanes, I don't see much benefit to it for them. Boats could be excluded too, but at least they work. Should planes/boats be included?

I also reverted the ist_erstes check you added to hop() for now. Causes issues with closely spaced waypoints and trains reversing direction - vorfahren() clears the erstes flag when it's doing the repositioning. All I can think of is adding another flag to disable the signal checks et al., instead of hijacking the erstes flag for that purpose. Any other ideas?

prissi

#1
I am not sure what happens with (the very few) vehicles with lenght zero, I have to check. Alternatively one could check once after vorfahren, if the leading cars route_index already passed the position of advancing schedule.

Why did you left air out? It should work also for air, and airplanes freezing in midair for a split second are most ugly.

TurfIt

I see three places where vehicles are moved after erstes has been set false.
1) vorhafen - leaving depot. Should never pass a waypoint in this case ?
2) vorhafen - after the convoi turns around. Added the check to update fpl_target there. Tested ok.
3) laden_abschliessen - easy to add the check, hard to test... Do you have a corrupted test save that triggers this condition?

Zero length vehicles - I didn't test this, didn't think was possible. Where can such vehicles be found?

air - left out due to sheer laziness. Didn't think of waypoints being set during the airborne seqments of the route; Pausing there is indeed ugly. So, need to find all the places where the planes modify with their route so fpl_target doesn't get out of sync... Will do.

TurfIt

Just bumping this back into sight seeing as it has come up again.
I had continued working on this trying to get aircraft functional, but was unable to find any 'nice' way. Shelved it hoping for some inspiration, but over a year later now...
IIRC the patch attached above was working ok for everything but aircraft, rather stale now though. If anyone else cares to try, I don't foresee myself having the time in the near future.

jamespetts

A late reply, I know, but I had a different approach that is intended to do something similar in Experimental, by simply extending the routes of trains (and other train like convoys that use signalling: other convoys, such as road vehicles, aircraft and boats do not need this in any event) beyond waypoints to the next item on the schedule immediately that the route is calculated to the waypoint (restricting the maximum number of times that this is done to the number of items on the schedule to prevent infinite loops in the case of waypoint only schedules). It it in the current release version of Experimental and seems to work effectively.
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 December 20, 2013, 11:04:58 PM
A late reply, I know, but I had a different approach that is intended to do something similar in Experimental, by simply extending the routes of trains (and other train like convoys that use signalling: other convoys, such as road vehicles, aircraft and boats do not need this in any event) beyond waypoints to the next item on the schedule immediately that the route is calculated to the waypoint (restricting the maximum number of times that this is done to the number of items on the schedule to prevent infinite loops in the case of waypoint only schedules). It it in the current release version of Experimental and seems to work effectively.

That won't work when the next waypoint is back down the track the train came up. Not unless the reservation system is also changed.

jamespetts

Experimental deals with that by distinguishing between reversing and non-reversing waypoints.
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.

TurfIt

Quote from: jamespetts on December 20, 2013, 11:04:58 PM
A late reply, I know, but I had a different approach that is intended to do something similar in Experimental, by simply extending the routes of trains (and other train like convoys that use signalling: other convoys, such as road vehicles, aircraft and boats do not need this in any event) beyond waypoints to the next item on the schedule
Completing the route search to the next item in the schedule when a waypoint is encountered is exactly what the above patch does... ??
I don't remember if trains reversing at waypoints was tested, trucks certainly were and had no issues. Aircraft accessing state information in the route search was what kills this working for them; It also seemed too easy to confuse the aircraft pathfinder completely, meaning it really needs much more logic to handle the airport layouts people throw at it. And seeing that huge increase in the patch, it fell to the bottom of the pile.

jamespetts

Hmm - why does this patch need to apply to anything other than trains and train like convoys, though? It does not need to apply to aircraft at all.
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.

prissi

#9
Especially airplanes need this patch, since they hand in midair during the waysearch for a second or so, depending on the CPU load.

EDIT: I tried to add something, but airplanes still jump. WIP attached.

EDIT2: Now working with airplanes too.

TurfIt

So this is where r7043 came from... really wish the forum would mark edited posts as unread - didn't see the edits.

Thanks for finishing this.

I'm seeing some glitches with the aircraft still. The planes are still pausing/hiccuping as they pass waypoints on the taxiways.
And, when the plane leaves the stop destined for an airborne waypoint, it jumps to flight altitude, and only returns to the ground when it hops off the stop onto the taxiway.

prissi

Yes the stop thing is now fixed too.

I gave up on waypoints un taxiways. Those are extremely difficult to get right. Probably the route finding for airlines rather need a postprocess call instead of this hackish assembly of intermediate informations.