Февраль 2017 — Заметка №6

Люблю такие истории.

В игре Fallout 3 есть поезд. Выглядит он вот так. Но в движке игры, на котором ее делали, не было понятия “поезд” или “машина” (так как движок от Elder Scrolls Oblivion, где фэнтэзи и лошади, поездов там не было). Поезда нет, а поезд нужен. Что же делать?

И вот решение! Они сделали поезд ШАПКОЙ у персонажа (NPC). Персонажа не видно, шапка есть. Персонаж ходит - шапка двигается. Персонаж же можно запрограммировать ходить по заданному маршруту.

Потом ваш герой может сесть в поезд. Это работает другим образом. Когда вы сами садитесь в поезд, то шапка надевается на вашего персонажа и она заслоняет обзор. Потом камера начинается двигаться и кажется, что поезд едет.

А вот еще. Все предустановленные драйвера в Windows помечены одной датой - 2006 год, даже если драйвера были созданы сильно позднее. Оказывается это такой хитрый способ расставить приоритеты: https://blogs.msdn.microsoft.com/oldnewthing/20170208-00/?p=95395

When the system looks for a driver to use for a particular piece of hardware, it ranks them according to various criteria. If a driver provides a perfect match to the hardware ID, then it becomes a top candidate. And if more than one driver provides a perfect match, then the one with the most recent timestamp is chosen. If there is still a tie, then the one with the highest file version number is chosen.
Suppose that the timestamp on the driver matched the build release date. And suppose you had a custom driver provided by the manufacturer. When you installed a new build, the driver provided by Windows will have a newer timestamp than the one provided by the manufacturer. Result: When you install a new build, all your manufacturer-provided drivers get replaced by the Windows drivers. Oops.
Intentionally backdating the drivers avoids this problem. It means that if you have a custom manufacturer-provided driver, it will retain priority over the Windows-provided driver. On the other hand, if your existing driver was the Windows-provided driver from an earlier build, then the third-level selection rule will choose the one with the higher version number, which is the one from the more recent build.

Системы вокруг нас полный костылей - обходных, элегантных и не очень решений, который выглядят смешно со стороны, но решают какую-то проблему.