The International Simutrans Forum

 

Author Topic: Thoughts on ships for experimental  (Read 4027 times)

0 Members and 1 Guest are viewing this topic.

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
Thoughts on ships for experimental
« on: September 25, 2009, 06:47:21 AM »
So historically I can think of the following types of water vehicles:
(1) Huge ocean-going ships which cannot go up rivers (too big)
(2) Riverboats and barges which cannot go on the open ocean, or into narrow canals
(3) Medium-sized ships and lake boats which can handle both the ocean or large lakes, and rivers
(4) Narrowboats which can handle rivers and narrow canals

pak128.britain already seems to have ocean/big lakes, "Wide Rivers", "Small Rivers", and "Streams".
If historical plausibility is the goal, I would suggest having two types of Canal, narrow and wide, with narrow being cheaper, and with each being faster than the corresponding type of river, but only slightly faster.  Small rivers should be navigable but restricted.

I would also suggest having:
(1) a class of barges and river ferries which work *only* on wide rivers and canals
(2) a class of sailing/steam ships which work *only* in the ocean
(3) a class of smaller ocean ferries and sailing ships which work on both
(4) a class of narrowboats and tiny ferries which work on small rivers/narrow canals, wide rivers and canals, but not the ocean

It's actually plausible to use weight restrictions to determine who can go into which, since it's related to the ships' draft, but waytype restrictions would work just as well.

If ships are ever prohibited from walking on top of each other (which I devoutly hope will happen some day -- they should follow road-like rules), canal one-way signs should also be added.  Many canals were actually only one boat's width wide and were therefore one-way outside of 'passing sections'. I would expect each canal to have intermittent canal basins for ships to pass each other -- which can be built convincingly right now using the existing tools.
 
I'd suggest drawing the river barges for goods first, since there are a lot fewer distinct designs historically than for ocean-going ships or passenger ferries.  Basically there's just poled, horse-drawn, and motor-powered, and they all look pretty similar to each other anyway, and go almost the same speed (very slow upstream, faster downstream).  If only there were a way to tweak the game engine so boats could 'go with the flow', some way of adding a speed to a river vehicle going downstream and subtracting it upstream.... but how could the game engine know which way was downstream?

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Thoughts on ships for experimental
« Reply #1 on: September 25, 2009, 07:47:11 AM »
Constraints: Exactly the direction things are going to go when I get round to drawing ships (next on the list after trucks at the minute) - jamespetts and I have a plan for how way constraints in experimental will work with pak128.Britain, and I think there is going to be a distinction between open water only, river/canal only, and able to use both (we rejected the idea of 2 types of canal IIRC, best to keep things moderately simple and any extra detail can be handled by weight limits).

Single-direction: agree entirely.  But that's up to the coders not pak maintainers.  I intend to draw canal barges at least so that they appear to pass in canals rather than drive through each other...

Speed on rivers: the game should be able to work out which way a river flows as they are all built with a source and a mouth and I think the map creator builds them from source to mouth.  I know it was discussed in the initial river discussions, but I think people were generally happy just to see rivers implemented at all and the more advanced bits got forgotten.  You could post an extension request, or better still if you can code, try writing a patch and see what people think :)

Drawing: It seems you know more than me about boats.  If you want to and have time, you could dig out some pictures and write the dat files for the different ships/boats you want to see in the game, and I can just do the drawing (similar to how jamespetts did for the trucks - http://forum.simutrans.com/index.php?topic=2109.0)

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Thoughts on ships for experimental
« Reply #2 on: September 25, 2009, 08:48:52 AM »
One problem with this approach on a techincal level is that there is currently no way of applying any sort of constraint to open water, as open water is not a waytype, and way constraints apply only to ways.

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Thoughts on ships for experimental
« Reply #3 on: September 25, 2009, 08:52:41 AM »
James, doesn't your way constraints allow:
1) boats which MUST use a canal/river waytype
2) boats which MUST NOT use a canal/river waytype
3) boats which can use anything

which does just about everything we need?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Thoughts on ships for experimental
« Reply #4 on: September 25, 2009, 09:09:31 AM »
Ahh, the problem is that the check for a permissive constraint ("MUST use canal/river") only checks whether a way has that permissive constraint. Although I have not tested it, I strongly suspect that, because an ocean is not a way, per se, it will not even run a way constraints check. Perhaps somebody could test this and report back? Perhaps it wouldn't be too hard to prohibit any vehicle with a permissive constraint using something other than a way, although that might bog down the route finder for open ocean...

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
Re: Thoughts on ships for experimental
« Reply #5 on: October 05, 2009, 06:58:09 PM »
Speed on rivers: ...better still if you can code, try writing a patch and see what people think
I can code, but I've had trouble getting into the simutrans sources, partly because most of the comments, variable names, and function names are in German (or sometimes broken English, and I think some French), and I haven't really figured out the code structure yet.  Is there an "architectural overview" of the codebase floating around somewhere?

Anyway, I think there are some design issues to resolve before making rivers and canals have a "flow direction"; I've thought of at least two conceptual problems already (junctions and deletions), and I think a really *good* solution would require introducing springs/water sources as explicit permanent objects.

I think rewriting canals to prevent ships from standing on top of each other in rivers, which just requires making the rivers work like roads (i.e. reuse code...) would be a lot easier and I might do that if I get my head around the codebase.

Quote
It seems you know more than me about boats.
Only about canal boats, not about ocean-going ships, which are really a complicated topic.  ;-)  I had a bit of 'canal fandom' a while back, but I'd have to dig out my sources of information again.
Quote
  If you want to and have time, you could dig out some pictures and write the dat files for the different ships/boats you want to see in the game,
Gah, I hope I have time and energy... no promises though.
Quote
and I can just do the drawing (similar to how jamespetts did for the trucks - http://forum.simutrans.com/index.php?topic=2109.0)

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Thoughts on ships for experimental
« Reply #6 on: October 05, 2009, 07:52:59 PM »
Further to this topic, I have successfully implemented way constraints for waterways and oceans (using the simple rule that any vehicle with any permissive constraints set cannot use any ocean tile) in my current testing code, which will be available when Simutrans-Experimental 7.0 is released.