Как сделать doom на unity

Обновлено: 03.07.2024

Недавно я натолкнулся на одно видео и решил попробовать написать по нему в будущем свою игру ( на Python ) по такому же принципу, как и была написана данная игрушка. Меня очень привлек возможный результат, который можно получить буквально в считанные минуты! Vektozavr-ilinblog в своем не очень длинном видео рассказал ужасную правду: многим полюбившиеся игры Doom и Wolfenstein 3d , которые покорили всех геймеров прорывом в 3D игроиндустрии, далеко не являются 3D играми.

Для начала давайте разберем код Vektozavr-а . Данный ютубер выбрал C++ для написания иллюзии 3D . В своем видео и статье программист говорил о неком методе Ray casting . По статье в Википедии это:

Один из методов рендеринга в компьютерной графике, при котором сцена строится на основе замеров пересечения лучей с визуализируемой поверхностью
Пример Ray casting (Гиф был скачан с официальной статьи о Ray casting в Википедии) Пример Ray casting (Гиф был скачан с официальной статьи о Ray casting в Википедии)

Если говорить проще, это один из методов получения изображения в компьютерной графике, когда оно создается посредством различных измерений пересекающихся лучей (некого "зрения" игрока) и поверхностей в визуализации, допустим, игры. Ниже я более подробно объясню о употреблении метода "бросания лучей" в создании собственной игры. Возвращаясь к началу: некий Иван Ильин писал в своей статье, что был вдохновлен видео Code-It-Yourself! First Person Shooter (Quick and Simple C++) с канала javidx9 (OneLoneCoder) :

Мне настолько понравилась идея и простота её реализации , что я просто не мог сдержаться, чтобы не рассказать о ней !

Давайте, прежде чем познавать простоту геймдева, вернемся немного в прошлое и познакомимся с играми , которые стали маяком для создания чего-то ностальгического , и в тоже время нового и необычного , без невероятной графики и реализма, чего-то простого , но при этом затягивающего . Вообщем консольной игрушки,"екзешки"-называйте как хотите, а мы перейдем к сути:

Олды псевдо-3D игроиндустрии

В данной статье я не буду затрагивать такие недокументированные игры, как Maze War и SPASIM . Хочется поговорить немного именно о тех, которые стали неким переходом от тривиальных бродилок и консольных программок до полноценных 3D шутеров и «трипл-эй» ( высокобюджетных ) проектов

How do you create a DOOM replica in Unity3D?


Is there anything?

New comments cannot be posted and votes cannot be cast


I want to make a replica of the DOOM engine (iDtech 1).

"Replica" and "Recreate the DooM engine" are conflicting statements here.

This is pretty simple to do. I set out to do this myself a while ago. This controller a a great place to start.

I built all the mecanics around this in like 4 weeks

Here is my pipeline:

Save all maps in UDMF format in a single .WAD file sitting in my Assets folder

Как сделать doom на unity

Various tools for working with Doom WADs and levels in Unity. Also a Doom engine, called NaSTY (Not a Sourceport, Thank You)

Because it doesn't already exist. There are various cool applications for such a set of tools but personally I just like the idea of letting potential games of mine use doom levels.

Download a zip of the project from the code or release section and extract the DoomUnity folder contained within into your Unity project, or create a new folder in your Unity project called "DoomUnity" and clone the repository there.

You will also need to download the SharpZip DLL and import it into your Unity project for PK3 support. At some point I will try to include this in the source, or make it optional.

Here are some commands you can try once everything is imported:

Can I play Doom WADs with this yet?

  • Doom
  • Doom II
  • Final Doom
  • Freedoom
  • Chex Quest

Playing with the compiled build

  1. Download the latest nasty build (Linux, OSx or Win) from the Releases section and extract it.
  2. Add one or more supported IWADS to the root of the nasty build folder.
  3. Run nasty.exe. If there is more than one IWAD in the folder you will be prompted to select one.

Playing in Unity with source code

To run the engine in Unity, you'll first need to generate the engine wad and put that in the root folder of your Unity project (just below Assets). See "Building the engine wad" below for more info. Alternatively, you can just download a build and extract the nasty.wad from there. It won't be updated to the latest source, but this might not be a problem.

To start the engine in Unity, just create an empty gameobject in a new scene and add the GameSetup component to it. Then add the VanillaPlayer prefab to the "Player Prefab" field.

You can also enter commandline arguments here in the Editor Args field. For example, to run extra PWADs, add -file path_to_wads to the commandline parameters.

For Midi, you must have a soundfont file in the root directory, and merge in a wad with MIDI files. The IWADS use MUS files and those are not supported yet.

Building the engine wad

To build the engine wad (nasty.wad): you'll need python 3, omgifol, and pillow.

pip install omgifol
pip install pillow

You will want to change the path to the root directory of the project or build. then just run python3 build_wad.py to generate the engine wad.

Free Public License 1.0.0

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

SimpleJSON.cs has an MIT License, and is outlined in the source

Читайте также: