Поиск по STEAMB

Игры по онлайну и скины по объёму продаж

Ничего не найдено

Попробуйте другое название или переключите категорию.

Меню

Developers Diaries #40

FIRST VERSIONS OF TRAFFIC

For our first car simulator, even before CCD, traffic was created as an extremely logical and disciplined entity - it was planned that there would be a certain “manager” who strictly regulates and coordinates the actions of all cars. Individual cars could not analyze the traffic situation and make decisions on their own. Simply put, they had no autonomy and acted only on the order of the “manager”. It was an attempt to make a fully deterministic traffic, where no surprises occur.

However, creating such traffic is an extremely difficult task, given that there is at least one element of unpredictability on the road - the player. Therefore, the resulting result can be described with one phrase: “it somehow worked”.

TRAFFIC IN CITY CAR DRIVING

When development of the first CCD began, that system was abandoned. It was neither flexible, nor extensible, nor realistic enough for the product we were aiming for.

The only thing we took from the first version was the road network. Lanes for car traffic in it are defined with the help of splines (pre-planned mathematical curves), along which cars drive and pedestrians walk. The splines are laid out by level designers in an internal editor, which we have already mentioned in the early developer diaries. This road network turned out to be a very good solution, and, albeit with modifications, it is still in use today.

But unlike the first version, the cars were finally given free will. Each road user began to make his own decisions about where to go and what maneuver to make, and about other participants knew only what he could observe.

Machine vision, however, is not an easy issue at all. In this version it was implemented in a very simple way. The cars saw only the nearest car in front and the nearest car behind in their lane, as well as two cars in front and two behind in the neighboring lanes. To analyze the situation for a farther distance, we had to go through the cars in a chain, asking the front car its front car and so on.

It followed that the cars could not drive side-by-side in the same lane, and their movement was something like the movement of train cars. Implementation of maneuvers of lane change and overtaking caused a lot of problems, and turned out to be far from perfect, and at intersection we even we even had to make an external dispatcher, because there cars did not see each other at all!

Despite these limitations, in general the system turned out to be quite successful and has been used in many products for over 10 years. During this period the following features have been added to it:

  • Dynamic trajectories for pedestrians crossing in the wrong place

  • Cars entering and exiting parking lots

  • Narrow forest roads with “pockets” for passing traffic

  • Traffic passing other cars in the same lane on wide roads.

But the core of the system remained the same, so to implement all these features we had to resort to more and more “crutches”, and their work was not devoid of various “glitches”.

TRAFFIC IN CITY CAR DRIVING 2.0

When we started planning City Car Driving 2.0, we were going to simply transfer the traffic from the original part and only do adaptation to the new city. However, we couldn't get away with just an adaptation

  • The traffic was not designed for such narrow roads and sharp turns, the cars often failed to fit into a corner or could notpass each other at an intersection.

  • Due to the abundance of unregulated intersections, there was a constant emergence of traffic jams.

  • A lot of long-standing problems were revealed, when cars drove into each other because they “didn't see” each other.

1 / 1 · 100%

Illustration of road widths for traffic. These are only the most glaring problems that could not be left unsolved in City Car Driving 2.0. But they were enough to realize - the old core on simple principles will have to be changed.

The first thing that was created anew was the “vision” subsystem. Cars and pedestrians were given the ability to see everyone driving or walking around them, both on the roads and at intersections. This eliminated the problem of cars driving into each other during lane changes and other maneuvers because they couldn't see where they were going. If a car gets “stuck” between lanes, in the middle of a maneuver - the other cars now not only see it, but also try to go around in the same lane, if there is enough space.

After that, we moved on to the next big problem - traffic at intersections. The existing “dispatcher” didn't work perfectly: it allowed cars to enter the intersection even if they couldn't complete the passage, and thus create dead traffic jams.

1 / 1 · 100%

All possible intersection transit trajectories So it had to be replaced as well. Now the cars themselves decide how to pass the intersection, but they are provided with information how and where their own trajectory crosses trajectories of all other cars approaching the intersection. They then take priorities into account, try to predict who will approach the intersection faster, and decide whether to pass the intersection or stop in front of it.

And if they decide to stop- and this is key difference - they stop in positions that will not prevent other cars from passing the intersection, and if they have already stopped for a left turn, they stop so as not to interfere with the oncoming traffic. This improvement has radically reduced the frequency of dead jams, and now cars can pass each other even at very tight intersections.

1 / 1 · 100%

Active intersection driveways and their cross zones Also, there were unexpected problems, caused by the fact that traffic system itself controlled the dynamics of cars, and expected them to obey its commands immediately. In CCD2, however, we utilize the full range of features of the Unreal Engine 5 engine, including multi-threaded physics. With the physics of cars being simulated in parallel and somewhat in advance, meaning that it can only receive commands from the AI belatedly, and the AI will only receive updated positions even more belatedly, it was impossible to keep the old way of control. Therefore, this module too was completely redesigned.

Thus, although CCD2 traffic is a direct successor of the first CCD version, it has been deeply reworked and improved enough to be considered a new, third version.

In the future, we will definitely talk more about the interaction between AI traffic and car physics. The developer diaries are released every two weeks, don't miss it!

Читать в Steam ↗

Комментарии 0

Гостевые никнеймы не подтверждают личность. Все комментарии проходят проверку владельцем сайта.

Обсуждение ещё не началось.

    Настройки cookies

    Вы можете изменить выбор в любой момент. Отказ от аналитики не ограничивает доступ к сайту.

    Технологии, провайдеры и сроки хранения