Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Creating a Doom styled game

Discussion in 'General Discussion' started by Blid_dev, Jul 4, 2021.

  1. Blid_dev

    Blid_dev

    Joined:
    Jun 6, 2021
    Posts:
    6
    Hi, I'm making a game with an art style like doom 2 and I've kinda been struggling with recreating this style in Unity.

    First of all, creating the level itself is hard, I've been using Probuilder up to this point and this will sound weird, but it's too unlimited (especially in outdoors areas). I want to be as accurate as possible and that means I need some limitations like not being able to make a room on top of another one. Long story short, I'm looking for the closest thing to a Doom level editor that I can get.

    Another thing I had trouble going back in time with was the lighting system, it was simply too good for it to look convincing, I turned the quality settings down but it's still not perfect.

    So at the end of the day, I have one question, how does one make a Doom styled game?

    Here's a reference image to the art style I'm going for:
    Screenshot_Doom_20210704_182415.png

    Have a nice day! :)
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    Heh.

    This is my unfinished project that has been put on hold.



    Step by step.
    1. Disable all texture filtration.
    2. Disable all lighting.
    3. Texture resolution should be small. 128x128 or less.
    4. Every sprite and texture should use the same texture palette.
    5. Ideally, emulate the palette in a shader, although that is a pain.
    6. Lighting is done through palette gradients that are precomputed.
    7. Level fades with distance using the same lookup precomputed lookup table.
    8. Wall textures should be done in asepritee, pretty much.
    9. It is possible to use 3d models for sprites, but you'll have to disable dithering.

    Next.... (style)
    1. There are no overhangs of any sort in doom engine. You can't have bridges where you can walk under and over the brige.
    2. All walls are vertical.
    3. All ceilings and floors are perfctly horizontal. They can move up down.
    4. Enemies use something like 3 frames of animation per action, but some frames can be seen from multiple angles (at 45 degree increments).
    5. There are no 3d models.

    Modern game engine and modern hardware will be fighting you at every step,. For example, in unity there's no proper API for dealing with paletted surfaces and even no proper function for extracting palettes from png.
     
    Ryiah likes this.
  3. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    Basically the most important things is to remember that Doom is 256 color game.

    Meaning lighting and distance fade is done through 256 color palette and lookup table.
    There are also two types of colors - "normal" colors used by the level and "emissive" ones that glow and do not fade in distance.

    All that means no lighting, no texture filtration.

    When you forget about it, it will look wrong.
     
    Joe-Censored likes this.
  4. Blid_dev

    Blid_dev

    Joined:
    Jun 6, 2021
    Posts:
    6
    Ok, that's super useful, up until now I used the photoshop color picker for my textures and it definitely looked too modern. Out of curiosity, what tool did you use for building the level?
     
  5. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    I recommend aseprite. It is fairly cheap and uses actual palette.

    I wrote my own level editor. It is on the last video.
     
  6. Blid_dev

    Blid_dev

    Joined:
    Jun 6, 2021
    Posts:
    6
    I'll consider buying asprite but I'll stick with the doom color palette for now.


    Is there any way I can get a version of this tool? It's the closest thing to a Doom level editor I've seen in unity
     
  7. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    954
    Take a look at PixaTool to create textures more easily.
     
  8. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    One of the reason this was put on hold is because on larger map sizes editor slows down to crawl due to using unity handles/widgets. Basically, it would need to be redone.

    I might eventually dump this onto github, but, uh, this is "don't hold your breath" kind of thing.
     
  9. Blid_dev

    Blid_dev

    Joined:
    Jun 6, 2021
    Posts:
    6
    Alright, no problem, I'll stick with ProBuilder for now. Thanks for the help!
     
  10. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Why not use the doom level editor...
     
  11. Blid_dev

    Blid_dev

    Joined:
    Jun 6, 2021
    Posts:
    6
    Because this isn't the only art style in the game and the rest of it is gonna be more modern
     
  12. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,083
    You don't have to use the same assets, even in the original Doom. Hell, most zdoom based games are all using some variety of UDB anyway. It'd definitely be way less tricky than implementing or trying to find a similar editor for Doom, so long as you don't try and implement beyond Doom/Boom you'll probably be fine.

    Most of the UDMF benefits you'd get from trying to implement that mess you can just handle more natively through Unity scripting.

    Since the Doom level format is extensively well documented, this mostly becomes an issue of getting a handle on your file I/O pipeline more than it will be getting Doom stuff to work. If you convert the results into a format Unity can recognize instead of making it a real time map loader, you could even export the geo itself out so you could edit it in blender or implement room over room stuff.

    This all sounds like a lot, but it'll give you the best results without having to build your own level editor from scratch, a process that can add a lot to your dev time. Remember, you're just implementing this for map loading/editing, not the whole renderer or movement system.
     
    angrypenguin likes this.
  13. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    For the record, the editor in the video took a week.

    For a non-programmer it will be probably at least two months.
     
  14. Blid_dev

    Blid_dev

    Joined:
    Jun 6, 2021
    Posts:
    6
    Well, it turns out you can design a level in the gzDoom builder and export it as obj which can be imported into unity. But I do recommend turning it into fbx with Blender so adding a collider would be easier, at least it is for me.
    The lighting isn't perfect of course but I'll do my best by following the steps you mentioned. I think this is the easiest and fastest way to do it.

    Here's an image that shows it working:
    doomtest.png

    Thanks so much for the help!
     
    Joe-Censored and angrypenguin like this.