• Pre order now!

    Paradox Development Studio brings you the sequel to one of the most popular strategy games ever made! Crusader Kings III is soon upon us and you can pre order it today!


    Releasing September 1st 2020

co_emmi

Captain
Sep 22, 2014
487
263
  • Colossal Order Staff
Trolleybuses!

Greetings fellow city-builders and welcome to another Sunset Harbor Dev Diary!

Ever since Cities: Skylines was released, we have received hundreds of requests for one specific feature: Trolleybuses! And to go along with every one of those requests, vivid debates took place within the community about whether or not trolleybuses are too hard to implement, if the feature is “too niche” or if “they” actually ever even read the suggestions posted on the forums.

Let us assure you that we are indeed constantly listening, and every single idea is considered when we are deciding what to do next! Also, we are just as enthusiastic about public transport as you are, and you would have to be very creative to suggest something that we would consider to be “too niche”

The reason trolleybuses have never been added is their technical complexity. Trolleybuses are basically “trackless trams”: electrical buses that draw their power from overhead wires. Unlike trams, they utilize two wires and two trolley poles to complete the electrical circuit. And like a normal bus, a trolleybus is able to change lanes and stop on the side of the road. As the bus is moving, its poles rotate and tilt to stay attached to the wires. In the game as well as in reality, the trolley poles are the most tricky part of the whole system.

We are glad to inform you that we have managed to overcome the technical challenges, so Trolleybuses will finally be available in Cities: Skylines – Sunset Harbor!

DevDiary_Trolleybus1.png

They are finally here!

The trolleybus system in Cities: Skylines – Sunset Harbor consists of four components:
  • Trolleybus Depot
  • Trolleybus Roads
  • Trolleybus Stops
  • Trolleybus Vehicle
To get started with trolleybuses, you first place a Trolleybus Depot. After that, you can place Trolleybus Roads and create Trolleybus Lines with roadside stops. Your depot will then send out trolleybuses to operate the lines. It is important to remember that the trolley poles must be attached to the wires at all times, so your Trolleybus Depot and your Trolleybus Lines must be connected by Trolleybus Roads as well!

DevDiary_TrolleybusDepot.png
Trolleybus Depot sending out new trolleybuses.

DevDiary_Trolleybus2.png
Taking passengers over the river.

That’s the easy part! In the second part of this Dev Diary, we would like to shed light on what we did to make the trolley poles behave realistically. Unlike other diary entries, this one will be slightly more technical. Even if you are not that math and geometry savvy, we still hope you enjoy this inside look!

trolleybus1.jpg

The Wire

Let’s take a closer look at the roads! On every road segment, you will find three catenary masts: One at the start, one in the middle and one at the end. The electrical wires span the masts, and with some mathematical calculations we can find out the start and end coordinate of each wire section. Let’s call them image2019-9-24_12-6-9.png and image2019-9-24_12-6-21.png (using a small arrow to mark them as 3D vectors).

A mathematical formula to define the line of the wire would be image2019-9-24_12-6-37.png with image2019-9-24_12-6-45.png and image2019-9-24_12-6-50.png .

When the bus is on the road segment, we want its pole to connect to the overhead wire defined by the mathematical formula above. image2019-9-24_12-7-39.png is the coordinate where the pole is attached to the wire.

The Trolleybus

The game knows how the bus is positioned and rotated in the world, and from that it is possible to calculate the coordinate where the trolley pole is attached to the bus. Let’s call it image2019-9-24_12-12-56.png !

The trolley pole is made of sturdy metal, so it cannot stretch. That means the distance between the coordinate where the pole is attached to the bus (image2019-9-24_12-12-56.png ) and the coordinate where the pole is attached to the wire (image2019-9-24_12-7-39.png) must always be equal to the length of the pole. Let’s call it image2019-9-24_12-7-48.png and define this formula to take that into account: image2019-9-24_12-7-54.png

The Equation System

By inserting the first formula into the second one, we end up with a single equation with a single unknown variable image2019-9-24_12-9-46.png :

image2019-9-24_12-8-12.png

With a few tricks we can transform it into a quadratic equation:

Screenshot_1.png

We can use the quadratic formula to solve the equation.
We will get zero, one or two values for image2019-9-24_12-9-46.png :

image2019-9-24_12-9-30.png

Note that there will be no solutions if the part in the square root is negative (which happens if the wire is too far away from the bus). Note that the solutions for image2019-9-24_12-9-46.png calculated by this formula could also be out of range (image2019-9-24_12-9-51.png ), so we have to check that as well.

Choosing the Right Position

By inserting image2019-9-24_12-10-3.png and image2019-9-24_12-10-8.png into our wire formula image2019-9-24_12-10-17.png , we can calculate two theoretical pole-wire-attachment coordinates image2019-9-24_12-13-1.png and image2019-9-24_12-13-8.png . One will be above the front part and the other above the back of the bus:

image2019-9-24_12-10-37.png
As the pole of a trolleybus is typically facing backwards, we need to find out which of the two positions is the correct one.

Haven’t had enough of vectors yet? Let’s define a few more:

Screenshot_2.png

Rendering the Trolley Poles

Uh, that was a lot of math! Now that we know where the pole is attached on the bus (image2019-9-24_12-12-56.png ) and where the pole is attached to the wire (either image2019-9-24_12-13-1.png or image2019-9-24_12-13-8.png ), it is possible to render the pole in the correct position and rotation.

As we learned, a trolleybus has two poles (otherwise the electrical circuit would be incomplete), so we will just repeat the same steps to draw the second pole.

And now you know what kind of stuff goes on behind the scenes to render the poles! Of course, in order to make trolleybuses realistic, this was just one small portion of the overall work that was needed!

DevDiary_TrolleybusNight4.png
The last shift of the evening.

Once again, we've reached the end of a Dev Diary. We hope that you liked this insight into the development of Cities: Skylines and that we didn’t scare you with all the formulas! Gotta say, the end result is really mesmerizing. We could just watch the buses circle around for hours! What do you guys think about the trolleybuses?

Until next time, city-builders!

Your Colossal Order dev team
 

Attachments

Last edited:

Meesmoth

Philippine Cities Builder
Sep 21, 2016
588
2
meesmoth.wikia.com
Never thought trolleybuses are actually going to be added on base game, but at least it got what some people requested for (In the Philippines no trolleybus systems were ever used, as the country instead built trams during the 19th century, while elevated metros replaced them by the 20th century).

While I can use some of these trolleybuses as a cheaper variation of trams in custom or non-PH cities, I might not use this when building Philippine cities.

Also the main post has a lot of broken .img previews. Looking foward to buy this on release day!

EDIT: Looks like has been fixed.
 
Last edited:

TTJ

Second Lieutenant
Aug 8, 2018
135
5
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
So you are telling us, that the DLC was delayed by 6 months because you had to finish the equations? ;)

Just kidding, looks fantastic! Can't wait to try them out! (Even when the power lines are clipping with the depot doors) :D
 

DJMT

Recruit
Sep 7, 2017
6
0
  • Stellaris: Apocalypse
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Age of Wonders III
  • Cities: Skylines - Green Cities
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Crusader Kings II: Reapers Due
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Cities: Skylines Industries
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Cities: Skylines - Campus
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Cities: Skylines - Snowfall
  • Crusader Kings II: Conclave
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Cities: Skylines
  • Warlock: Master of the Arcane
  • Naval War: Arctic Circle
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Stellaris
  • Cities: Skylines Deluxe Edition
  • Stellaris: Synthetic Dawn
  • Cities in Motion
Will the model selector be available for trolleybuses or is it still reserved for normal buses?
 

TTJ

Second Lieutenant
Aug 8, 2018
135
5
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
Fun fact: From step 1 to step 4 you proved the first binomial formula! :cool:
 

BADA_IC

Recruit
Mar 21, 2020
1
0
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Mount & Blade: With Fire and Sword
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
I wanted a Bus Rapid Transit(BRT) system that would fit in a modern metropolis, but the trolley bus is fine. good job.
 

KorKimchi

Recruit
Dec 23, 2014
2
0
  • Dungeonland
  • Cities: Skylines - After Dark
  • Cities: Skylines - Campus
  • Cities: Skylines Industries
  • Shadowrun Returns
  • Cities: Skylines - Parklife
  • Cities: Skylines - Parklife Pre-Order
  • Stellaris: Humanoids Species Pack
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Natural Disasters
  • Stellaris: Digital Anniversary Edition
  • Cities: Skylines - Snowfall
  • Magicka: Wizard Wars Founder Wizard
  • Cities: Skylines
  • Warlock: Master of the Arcane
  • Victoria 2
  • Teleglitch: Die More Edition
  • Crusader Kings II: The Old Gods
  • Crusader Kings II
  • Cities: Skylines Deluxe Edition
  • Stellaris
  • Age of Wonders III
  • Lead and Gold
  • Europa Universalis IV
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
@co_emmi
What is the difference between other modes of transportation for the "Trolley Bus" that will be added this time?
What is the difference between tram and bus? Is there a difference in capacity? Is it for tourists only?


Not more than BRT, but I agree with the additional elements of this DLC. However, if there is no discrimination from existing transportation ... maybe ...
 

CocoaBean

Recruit
Mar 21, 2020
1
0
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
Will they be able to stop on bus stops? It would be very silly without integrated stops, which is something I find quite frustrating about trams in the game.
 

Sp3ctre18

Corporal
Feb 16, 2019
26
0
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Mass Transit
  • BATTLETECH
  • Cities: Skylines - Green Cities
  • BATTLETECH - Digital Deluxe Edition
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • BATTLETECH: Flashpoint
  • Cities: Skylines - Campus
  • BATTLETECH: Heavy Metal
  • Cities: Skylines Deluxe Edition
  • BATTLETECH: Season pass
Simple math, but still brought back nightmares from vector classes in Physics.

So I guess no other vehicle has a need for such complex calculations for rendering, right?
 

Beer Fiend

Better to have a keg than a six-pack
Apr 28, 2017
684
29
  • Cities in Motion 2
  • Cities: Skylines Deluxe Edition
  • Stellaris
  • Cities: Skylines
  • Stellaris: Lithoids
  • Cities: Skylines - Campus
  • Stellaris: Megacorp
  • Cities: Skylines Industries
  • Stellaris: Distant Stars
  • Cities: Skylines - Parklife
  • Cities: Skylines - Parklife Pre-Order
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Mass Transit
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Natural Disasters
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Cities: Skylines - Snowfall
  • Cities: Skylines - After Dark
  • Stellaris: Synthetic Dawn


Eh, I might use this as a single line along the harbour but the tram will always be king.
 

Kovepi

Recruit
Mar 21, 2020
4
0
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Deluxe Edition
As we learned, a trolleybus has two poles (otherwise the electrical circuit would be incomplete), so we will just repeat the same steps to draw the second pole.
Will there be any benefit to modeling a single wide two-contact pantograph attached to the twin contact wire overhead line instead? (I know dual trolley pole is the norm)
 

zubozrout

Sergeant
Oct 6, 2012
69
0
  • Cities in Motion 2
  • Crusader Kings II
  • Cities in Motion
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines - Campus
  • Cities: Skylines Industries
  • Cities: Skylines - Parklife
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Natural Disasters
  • Cities: Skylines - Snowfall
  • Cities: Skylines - After Dark
  • Cities: Skylines
  • Heir to the Throne
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
Will there be any benefit to modeling a single wide two-contact pantograph attached to the twin contact wire overhead line instead? (I know dual trolley pole is the norm)
Do you know this one is only for static charging? The pantograph goes down when in operation (it would not be able to run like this without precise guiding system like having tracks = that would be a tram or a train). So this is in no way a trolleybus but an electric bus equipped with batteries ;)
 

Ibske

Recruit
Mar 21, 2020
1
0
I have a lot of questions.


Will they be able to stop at bus and/or tram stops?

Will they be able to use tram tracks and lanes?

What will their capacity be?

What kind of roads will there be? Only 2-lane?