Oberleitungsbusse!
Seid gegrüßt, Kollegen des Städtebaus, und willkommen zu einem weiteren Sunset Harbor-Entwicklertagebuch!
Seitdem Cities: Skylines veröffentlicht wurde, haben wir Hunderte von Anfragen für eine bestimmte Funktion erhalten: Oberleitungsbusse! Und um jeder dieser Anfragen nachzukommen, gab es innerhalb der Gemeinschaft lebhafte Debatten darüber, ob Oberleitungsbusse zu schwer zu implementieren sind, ob das Feature "zu nischenhaft" ist oder ob "sie" die Vorschläge in den Foren überhaupt jemals gelesen haben.
Lasst uns euch versichern, dass wir in der Tat ständig zuhören und jede einzelne Idee berücksichtigt wird, wenn wir entscheiden, was wir als nächstes tun! Außerdem sind wir von den öffentlichen Verkehrsmitteln genauso begeistert wie ihr, und ihr müsst schon sehr kreativ sein, um etwas vorzuschlagen, das wir als "zu nischenhaft" betrachten würden.
Der Grund dafür, dass Oberleitungsbusse nie hinzugefügt wurden, ist ihre technische Komplexität. Oberleitungsbusse sind im Grunde genommen "gleislose Straßenbahnen": elektrische Busse, die ihren Strom aus der Oberleitung beziehen. Im Gegensatz zu Straßenbahnen verwenden sie zwei Leitungen und zwei Stangenstromabnehmer, um den Stromkreis zu schließen. Und wie ein normaler Bus kann ein Oberleitungsbus die Fahrspur wechseln und am Straßenrand halten. Wenn sich der Bus bewegt, drehen und neigen sich seine Stangen, um Kontakt zu den Leitungen zu behalten. Sowohl im Spiel als auch in der Realität sind die Stangenstromabnehmer der kniffligste Teil des gesamten Systems.
Wir freuen uns, euch mitteilen zu können, dass es uns gelungen ist, die technischen Herausforderungen zu bewältigen, so dass Oberleitungsbusse nun endlich in Cities: Skylines – Sunset Harbor verfügbar sind!
Sie sind endlich da!
Das Oberleitungsbussystem in Cities: Skylines – Sunset Harbor besteht aus vier Elementen:
- Oberleitungsbusdepot
- Oberleitungsbusstraßen
- Oberleitungsbushaltestellen
- Oberleitungsbussen
Um mit den Oberleitungsbussen loszulegen, platziert ihr zunächst ein Oberleitungsbusdepot. Danach könnt ihr Oberleitungsbusstraßen bauen und Oberleitungsbuslinien mit Haltestellen am Straßenrand erstellen. Euer Depot sendet dann Oberleitungsbusse aus, um die Linien zu betreiben. Vergesst nicht, dass die Abnehmer immer an den Leitungen befestigt sein müssen, also müssen euer Depot und die Linien auch durch entsprechende Straßen verbunden sein!
Oberleitungsbusdepot beim Entsenden neuer Oberleitungsbusse.
Passagiertransport über den Fluss.
Dies war der einfache Teil! Im zweiten Teil dieses Entwicklertagebuchs möchten wir beleuchten, was wir getan haben, damit sich die Abnehmerstangen realistisch verhalten. Im Gegensatz zu anderen Tagebucheinträgen wird dieser Teil etwas technischer ausfallen. Auch wenn ihr mit Mathematik und Geometrie nicht viel anfangen könnt, hoffen wir, dass euch dieser Einblick gefällt!
Die Oberleitung
Schauen wir uns die Straßen mal genauer an! Auf jedem Straßenabschnitt findet ihr drei Oberleitungsmasten: Einer am Anfang, einer in der Mitte und einer am Ende. Die Oberleitungen spannen sich zwischen den Masten, und mit einigen mathematischen Berechnungen können wir die Anfangs- und Endkoordinaten jedes Oberleitungsabschnitts herausfinden. Nennen wir sie und (mit einem kleinen Pfeil, der sie als 3D-Vektoren kennzeichnet).
Eine mathematische Formel, um die Strecke der Oberleitung festzulegen, wäre mit und .
Wenn sich der Bus auf dem Straßenabschnitt befindet, wollen wir, dass sich sein Stangenstromabnehmer mit der Oberleitung verbindet, welche durch die obige mathematische Formel definiert ist. ist die Koordinate, an der der Abnehmer mit der Oberleitung verbunden ist.
Der Oberleitungsbus
Das Spiel weiß, wo und in welche Richtung der Bus in der Welt fährt, woraus sich die Koordinate berechnen lässt, an der der Stangenstromabnehmer am Bus befestigt ist. Nennen wir sie !
Die Stange ist aus stabilem Metall gefertigt, kann sich also nicht ausdehnen. Das bedeutet, dass der Abstand zwischen der Koordinate, an der die Stange am Bus befestigt ist (), und der Koordinate, an der die Stange mit der Oberleitung verbunden ist (), immer gleich der Länge der Stange sein muss. Nennen wir es und definieren diese Formel, um es zu berücksichtigen:
Das Gleichungssystem
Wenn wir die erste Formel in die zweite einfügen, erhalten wir eine einzige Gleichung mit einer einzigen unbekannten Variablen :
Mit ein paar Kniffen können wir sie in eine quadratische Gleichung umwandeln:
Zur Lösung können wir die quadratische Gleichung verwenden.
Wir erhalten keinen, einen oder zwei Werte für :
Man beachte, dass es keine Lösung gibt, wenn der Teil in der Quadratwurzel negativ ist (was passiert, wenn die Oberleitung zu weit vom Bus entfernt ist). Außerdem kann die mit dieser Formel berechnete Lösung für auch außerhalb des Bereichs () liegen, weswegen wir auch das überprüfen müssen.
Korrekte Ausrichtung
Durch Einfügen von und in unsere Formel für die Oberleitung können wir zwei theoretische Koordinaten und berechnen, an denen sich Abnehmer und Leitung treffen. Eine liegt über dem vorderen Teil und die andere überm Heck des Busses:
Da der Abnehmer eines Oberleitungsbusses üblicherweise nach hinten gerichtet ist, müssen wir herausfinden, welche der beiden Positionen die richtige ist.
Noch nicht genügend Vektoren bisher? Legen wir noch ein paar mehr fest:
Rendern des Stangenstromabnehmers
Puh, das war viel Mathematik! Jetzt, wo wir wissen, wo die Stange den Bus ( und der Abnehmer den Draht berührt (entweder oder ), ist es möglich, den Mast in der richtigen Position und Drehung darzustellen.
Wie wir gelernt haben, hat ein Oberleitungsbus zwei Stangen (sonst wäre der Stromkreis nicht geschlossen), also wiederholen wir einfach dieselben Schritte, um die zweite Stange darzustellen.
Und nun wisst ihr, was hinter den Kulissen geschieht, um die Stangenstromabnehmer zu rendern! Selbstverständlich war dies nur ein kleiner Teil der Gesamtarbeit, die nötig war, um Oberleitungsbusse realistisch darzustellen!
Die letzte Schicht des Abends.
Wieder einmal sind wir am Ende eines Entwicklertagebuchs angelangt. Wir hoffen, dass euch dieser Einblick in die Entwicklung von Cities: Skylines gefallen hat und dass wir euch nicht mit all den Formeln verschreckt haben! Ich muss sagen, das Endergebnis ist wirklich faszinierend. Wir könnten einfach stundenlang den Bussen beim Ziehen ihrer Kreise zuschauen! Was haltet ihr von den Oberleitungsbussen?
Bis zum nächsten mal, Städtebauer!
Euer Colossal Order-Entwicklerteam
Quelle: https://forum.paradoxplaza.com…y-2-trolleybuses.1362310/
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!
They are finally here!
The trolleybus system in Cities: Skylines – Sunset Harbor consists of four components:
- Trolleybus Depot
- Trolleybus Roads
- Trolleybus Stops
- Trolleybus Vehicle
Trolleybus Depot sending out new trolleybuses.
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!
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 [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-6-9-png.557036/] and [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-6-21-png.557035/] (using a small arrow to mark them as 3D vectors).
A mathematical formula to define the line of the wire would be [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-6-37-png.557034/] with [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-6-45-png.557033/] and [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-6-50-png.557032/] .
When the bus is on the road segment, we want its pole to connect to the overhead wire defined by the mathematical formula above. [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-7-39-png.557023/] 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 [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-12-56-png.557007/] !
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 ( [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-12-56-png.557007/] ) and the coordinate where the pole is attached to the wire ( [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-7-39-png.557023/] ) must always be equal to the length of the pole. Let’s call it [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-7-48-png.557021/] and define this formula to take that into account: [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-7-54-png.557020/]
The Equation System
By inserting the first formula into the second one, we end up with a single equation with a single unknown variable [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-9-46-png.557014/] :
[Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-8-12-png.557018/]
With a few tricks we can transform it into a quadratic equation:
[Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/screenshot_1-png.556991/]
We can use the quadratic formula to solve the equation.
We will get zero, one or two values for [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-9-46-png.557014/] :
[Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-9-30-png.557017/]
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 [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-9-46-png.557014/] calculated by this formula could also be out of range ( [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-9-51-png.557013/] ), so we have to check that as well.
Choosing the Right Position
By inserting [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-10-3-png.557012/] and [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-10-8-png.557011/] into our wire formula [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-10-17-png.557010/] , we can calculate two theoretical pole-wire-attachment coordinates [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-13-1-png.557006/] and [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-13-8-png.557005/] . One will be above the front part and the other above the back of the bus:
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:
Rendering the Trolley Poles
Uh, that was a lot of math! Now that we know where the pole is attached on the bus ( [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-12-56-png.557007/] ) and where the pole is attached to the wire (either [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-13-1-png.557006/] or [Blockierte Grafik: https://forum.paradoxplaza.com/forum/index.php?attachments/image2019-9-24_12-13-8-png.557005/] ), 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!
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