Adventures in JGRPP

Screenshots of your games! All Transport Tycoon games acceptable (including TTDPatch and OpenTTD).
Post Reply
User avatar
le_harv
Engineer
Engineer
Posts: 87
Joined: 27 Sep 2014 05:16

Adventures in JGRPP

Post by le_harv »

I am hoping to turn this thread into exploration of some of the more complex features available in JGRPP (starting with 0.53.0). There isn’t a huge amount of detailed information out there on how to use some of these features so hopefully I can provide some insight here. I am by no means an expert and simply got here through trial and error as well as seeing what others had done.

Boring Background
[+] Spoiler
After a long (too long) hiatus from OpenTTD I was drawn back after remembering how I used some of the JGRPP features back then to create a suburban rail network that ran to a quasi-realistic schedule including stabling overnight and peak demand services.

That save is all but lost, so I fired up the latest version of JGRPP and am blown away about all the new features that have been incorporated since I have been away. Features, that mean you can truly do some remarkable stuff in creating a realistic service pattern using a clock.

I’ve always wanted to create a mammoth, ‘to scale’ transport network but I always end up just sinking hours into little experiments on the side to explore how some of the feature’s work. The beauty of OpenTTD is you can play exactly how you want.

Combining Scheduled Dispatch, Conditional Orders and Slots
This first post will take a look at using Scheduled Dispatch, Conditional Orders and Slots to create a functioning, scheduled, ‘realistic’ bus route in the test city of Montreux. It simulates:
  • Stabling busses overnight
  • Running services across a route from either end.
  • Handling distribution of busses across the network for the first departure of the day
  • Running the service schedules throughout the day
  • Handling the last service of the day and returning busses to the depot.
Here is CONNECT ROUTE 1, a simple 2.75km (one way) bus route that offers service every 5 minutes in each direction from 04.45 to 23.15. One direction takes about 7 or 8 minutes to complete and to offer the frequency of service it needs 4 busses to run. The order list below gives you a preview of the logic at play:

Orders.png
Orders.png (29.54 KiB) Viewed 3245 times
User avatar
le_harv
Engineer
Engineer
Posts: 87
Joined: 27 Sep 2014 05:16

Re: Adventures in JGRPP

Post by le_harv »

3 schedules using scheduled dispatch (Schedule 1 to control when each bus leaves the depot and Schedule 2 and 3 to control the schedules in each direction, from each termini). As there are 4 busses then there are only 4 departures that need scheduling from the depot compared with from each termini.

Schedule 1.png
Schedule 1.png (7.41 KiB) Viewed 3244 times
Schedule 2.png
Schedule 2.png (7.92 KiB) Viewed 3244 times

Assigning the schedules to specific orders at the depot and at the termini is the basis for how this route successfully functions. As mentioned, Schedule One control depot departures and Schedules 2 and 3 control departures at each end of the line.

Dispatch Assignments.png
Dispatch Assignments.png (27.38 KiB) Viewed 3244 times
User avatar
le_harv
Engineer
Engineer
Posts: 87
Joined: 27 Sep 2014 05:16

Re: Adventures in JGRPP

Post by le_harv »

Slots are used to control distribution of buses to the right end of the line for the first service in the AM otherwise they will all go to the same station.

Slot List.png
Slot List.png (13.66 KiB) Viewed 3243 times

Conditional orders are used each time a bus reaches each end of the line to determine whether it is the last service or not.

Orders Part 2.png
Orders Part 2.png (6.13 KiB) Viewed 3243 times

Special instructions are included to let the bus know what to do in the last service of the day.

Orders Part 4.png
Orders Part 4.png (4.95 KiB) Viewed 3243 times
User avatar
le_harv
Engineer
Engineer
Posts: 87
Joined: 27 Sep 2014 05:16

Re: Adventures in JGRPP

Post by le_harv »

In the morning the first bus is scheduled to leave the depot at 04.30 (Schedule 1) to arrive at a termini on time for the first service at 04.45. We need to split the busses between the termini evenly so we can use slots to do this. The first two buses are conditionally ordered to acquire a slot in CONNECT Morning A (Order 3) and then instructed to proceed to the first termini (Order 7). The last two busses will try and also acquire a slot in CONNECT Morning A (Order 3) but won’t be able to (Order 4) as will be full with the first two buses. Therefore, they acquire a CONNECT Morning B Slot (Order 5) and are then conditionally ordered to head to the second termini (Order 18).

Orders Part 1.png
Orders Part 1.png (5.28 KiB) Viewed 3242 times

Once the busses arrive at the termini they will now wait for the first scheduled service at 04.45 (Schedule 2) and will leave on time and complete the route to the other termini (Orders 8 -13). After the penultimate stop before the termini some conditional orders are used to determine behaviour. If the bus is not the last bus of the day on this schedule (Order 15) then it will proceed to the termini as normal (Order 18) but if it is the last bus of the day (Order 16) it will be given some special instructions (Order 33). Note, the slots here refer to Scheduled Dispatch slots and not the slots mentioned above.

Orders Part 2.png
Orders Part 2.png (6.13 KiB) Viewed 3242 times

Once the bus arrives at the other terminal it waits for the next departure the same logic applies in the opposite direction (Schedule 3). Again it is tasked with some conditional orders to determine if the bus is the last service of the day. If it isn’t, then it is routed back to the top of the route order (Order 7) to wait for the next departure at that terminus. If it is the last then it proceeds to special instructions (Order 29).

Orders Part 3.png
Orders Part 3.png (5.61 KiB) Viewed 3242 times
User avatar
le_harv
Engineer
Engineer
Posts: 87
Joined: 27 Sep 2014 05:16

Re: Adventures in JGRPP

Post by le_harv »

So what if the bus IS the last service of the day at 23.15? There is a special process that the busses will get directed to follow based on the outcome of Order 15/16 and 26/27. These orders send the last service to the respective termini depending on what end of the line they are at to unload passengers but leave empty. Can’t have any passengers being taken back to the depot! Once there, they also release whatever slot they are occupying so that the slots are available for morning procedures. Note that Order 32 ensures that the last services of the day at the first termini do not go to the second termini before the depot. The last service at the second termini will never see this order because it has been directed to Order 33.

Orders Part 4.png
Orders Part 4.png (4.95 KiB) Viewed 3241 times

I really hope this helps break it down for someone who is thinking of using these powerful features without having to repeat order lists or fiddle with timings or speeds.

Let me know what you think and whether I can provide anymore information. All feedback is welcome.

CONNECT Route 1 resize.png
CONNECT Route 1 resize.png (585.24 KiB) Viewed 3239 times
User avatar
le_harv
Engineer
Engineer
Posts: 87
Joined: 27 Sep 2014 05:16

Re: Adventures in JGRPP

Post by le_harv »

I was learning about procedures while messing about with some NML. What if you could apply 'procedural' logic to a timetable? Maybe I can annotate my 'code' too.

I streamlined as much as possible and I am sure there is more that can be done or is redundant. Happy to hear opinions of different approaches! But essentially...
  • Trains start in a handful of holding places and when their scheduled dispatch tells them its time to go... off they head.
  • They then try to acquire the appropriate 'slot' depending on the time of day and the resulting service pattern
  • Next they tackle the route repeatedly until conditions change such as time of day. (note you only have to put the route in once).
  • When the service pattern changes so does the number of slots available, meaning some trains get taken out of service.
  • When a train gets removed from service, it gets distributed to the appropriate stabling points, especially ahead of tomorrows schedule
Something that saved me from going crazy was having the jump order, jump targets be the label... not the actual order so that you could rearrange the content of that section without having to always make sure that jump orders were pointing to the right places!

This format is also quite modular and the template can be 'cloned' over to other vehicles and edited appropriately. Want to add more service patterns? Easy to duplicate orders and create a new slot group. Want to change when rush hour is? Just change the time check. Want to add more stabling points? Just add more and create a new scheduled dispatch for it.
Orders.png
Orders.png (125.65 KiB) Viewed 1547 times
orders.gif
orders.gif (242.92 KiB) Viewed 1543 times
User avatar
le_harv
Engineer
Engineer
Posts: 87
Joined: 27 Sep 2014 05:16

Re: Adventures in JGRPP

Post by le_harv »

Or is this even cleaner?
Orders2.png
Orders2.png (123.01 KiB) Viewed 1537 times
User avatar
le_harv
Engineer
Engineer
Posts: 87
Joined: 27 Sep 2014 05:16

Re: Adventures in JGRPP

Post by le_harv »

A little fun with slots to make trains line up for storage on the same line! Thanks to some kind people on Discord who gave me their saves to learn the tricks of the trade.
doublestorage.gif
doublestorage.gif (247.67 KiB) Viewed 1509 times
User avatar
le_harv
Engineer
Engineer
Posts: 87
Joined: 27 Sep 2014 05:16

Re: Adventures in JGRPP

Post by le_harv »

Scale

Does OpenTTD really have a ‘scale’? Perhaps but it’s a little inconsistent here and there. I think its hard to have a conversation about time for scheduling without acknowledging distance and speed.

I can’t remember exactly how I got here but for me, each tile is 50m x 50m. It kind of makes sense as the more traditional newgrf 2 car trains typically fit on 1 tile (2x 25m carriages). You do have to ignore a few things like distance between tracks!

When you do the maths on distance between stops, it just feels right.
  • Bus stops every 400m are 8 tiles apart
  • Subway stations every 1km = 20 tiles
  • 100km = 2000 tiles
  • 512 x 512 map is 25.6km x 25.6km
  • 8192 tiles is 409.6km (near enough the straight line distance between Paris and Amsterdam!)
For a simple calculation:
  • Kms = tiles multiplied by 0.05
  • Tiles = kms divided by 0.05
But how does this relate to timetabling?

I used this base number to set ticks per minute based on how many ticks it takes a vehicle travelling at 60 km/h to cover 20 tiles (1km)… 1km at 60km/h should take exactly 1 minute. In this case… 690 ticks = 1 minute.

timetest4.gif
timetest4.gif (141.35 KiB) Viewed 1372 times

This might be quite a long time for gameplay but it is ‘accurate’. Hope this might be useful!
Attachments
tpm.png
tpm.png (5.34 KiB) Viewed 1372 times
User avatar
le_harv
Engineer
Engineer
Posts: 87
Joined: 27 Sep 2014 05:16

Re: Adventures in JGRPP

Post by le_harv »

I received some feedback through discord seeking more information on the dispatch schedules in my 'stabling and sidings' example. So here is a cleaner post that lays out some screenshots showing the mechanics in more detail. First the order list...

Orders2.png
Orders2.png (123.01 KiB) Viewed 1259 times

And here is where the stabling and sidings schedules for dispatch are tagged. Each of these 'storage' schedules contain the release slots for both the morning entries into service and the re-entry for the afternoon rush.

SD1.png
SD1.png (82.96 KiB) Viewed 1259 times
StablingsidingSD.png
StablingsidingSD.png (56.31 KiB) Viewed 1259 times
User avatar
le_harv
Engineer
Engineer
Posts: 87
Joined: 27 Sep 2014 05:16

Re: Adventures in JGRPP

Post by le_harv »

Here is where the schedules for each of the stations are tagged...
SD2.png
SD2.png (82.92 KiB) Viewed 1258 times
The actual schedules themselves look complicated but they are pretty straightforward. For example, for morning rush, I'd CTRL click 'add slot' and set the times (5am to 9am) and 6tph at 10 minute intervals (period).
Multislot.png
Multislot.png (5.41 KiB) Viewed 1258 times
Then for the next window (9am to 3pm) at 4tph I'd pick 15 minute intervals and add those slots... and so on. Once you've got all the windows figured out you end up with this!
StationsSD.png
StationsSD.png (85.89 KiB) Viewed 1258 times
User avatar
le_harv
Engineer
Engineer
Posts: 87
Joined: 27 Sep 2014 05:16

Re: Adventures in JGRPP

Post by le_harv »

And finally for good measure... the slot set up as well.
Slots.png
Slots.png (39.9 KiB) Viewed 1257 times
User avatar
le_harv
Engineer
Engineer
Posts: 87
Joined: 27 Sep 2014 05:16

Re: Adventures in JGRPP

Post by le_harv »

And here is an effort at balanced storage at the end of service. Its very much a work in progress and could do with further refinement (the scheduled dispatches are a disaster and I think the departure boards want to quit) but the logic works!

Perhaps some of the slot acquisition behaviour at the termini could actually be handled by programmable signals rather than the order list.
BSA.png
BSA.png (96.3 KiB) Viewed 1228 times
BSB.png
BSB.png (72.99 KiB) Viewed 1225 times
Post Reply

Return to “Screenshots”

Who is online

Users browsing this forum: No registered users and 30 guests