1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

DopeFish: Load 3D Maps from Doom/Hexen

Discussion in 'Work in Progress' started by IGameArt, Nov 27, 2019.

  1. IGameArt

    IGameArt Member

    Joined:
    Jun 21, 2016
    Posts:
    145
    A small number of you may remember some time ago there was a Doom wad loader on the marketplace. Well that was my project, and it had a lot of issues at the time. Issues that ended up requiring me to pull it from the marketplace.

    Well I've been one hecking busy guy over the last couple of years but now that my game is nearing completion I figured that I would take some of my free time and put it back into that wad loader, rebrand it, improve a lot of things about it, and get it working in GMS2. So I'd like to use this thread as a devlog on the system, which I hope to get back onto the marketplace when it's ready.

    [​IMG]
    So here it is, DopeFish (formerly Deimos Engine), a 3D map loader, complete with a basic FPS controller and some rudimentary collisions that reads map geometry, textures, sprites and map logic straight from a wad file, the game data format of classic games like Doom, Heretic, Hexen, Chex Quest, Strife, and so on.

    [​IMG]
    [​IMG]
    [​IMG]

    In the past few days I've managed to get the system working in GMS2, reorganized much of my messy old code, and rebranded it to avoid any potential copyright issues, and implemented a few key fixes, one of which being the detection and proper loading of a Hexen formatted map.

    In a wad, there are basically two map formats, there's the classic Doom format, and the Hexen format. When the game Hexen was released they changed the format to allow for extra scripting to be assigned to any thing you add to a map. This addition shifted bits around in the wad, and made it so my original loading algorithm completely failed. This is no longer an issue as you can see:

    [​IMG]
    You'll also probably notice in some of these screenshots, like the one above, that the game looks low resolution with a dithered look, this is due to me using one of my new assets in development that can be used to emulate a software rendered look, similar to how Doom originally looked back in 1993. That will not be a part of this asset, so don't worry if that's not your jam.

    Anyways, there is still a lot of work left to do on this, namely I need to get the BSP node renderer working for optimizations sake. That Hexen map, without any form of optimization is running at a measly 13 fps.

    Second, I need to create a few databases for every map thing that exists for Doom, Doom 2, Final Doom, Heretic, Hexen, and Strife so that it will be more fully compatible with any kind of map you make. This will allow the engine to properly load objects into the map and assign them the correct sprites and stats.

    To Do For Release
    • Create database of all things (Doom, Doom 2, Final Doom, Heretic, Hexen, and Strife)
    • Implement Node tree optimizations
    • Add overrides for Things, Textures, and Sprites ( replace any texture in the map with your own, good for HD texture swaps, or replace any enemy with whichever object you choose )
    • Improve first person controller physics/collision
    • Implement a backend to handle data management and feedback

    Possible Future Features:
    • 3D floors (rooms over rooms)
    • Sloped floors/ceilings
    • Geometry Normals
    • Dynamic Lighting/Shadows
    Anywhoo, that's enough babbling for now. I'd love some feedback or suggestions if you guys have any.
     
    Last edited: Dec 6, 2019
    Yal, Joe Ellis, CyberTwister and 5 others like this.
  2. IGameArt

    IGameArt Member

    Joined:
    Jun 21, 2016
    Posts:
    145
    Just implemented the databases for Doom, Doom 2, Final Doom, and Heretic:

    [​IMG]

    [​IMG]

    Also here's a video of how doors work at the moment:
    https://gyazo.com/0c8a9e19246b064a61bc6171f70d4f7e

    Nevermind the low frame rate in this clip.


    EDIT: Holy crap, I got sprites!! Haha I feel really proud of myself right now. I should go to bed, it's 9am. LMAO

    [​IMG]
     
    Last edited: Nov 27, 2019
    Mookal and Joe Ellis like this.
  3. IGameArt

    IGameArt Member

    Joined:
    Jun 21, 2016
    Posts:
    145
    Just spent the entire day implementing proper texture alignments. This is a huge deal for me and marks the final thing I've had to implement to get level geometry looking EXACTLY as it does in the classic games.

    As a comparison this is what Hexen looked like before:
    [​IMG]

    And this is what that same scene looks like now, with the addition of proper texture alignment and map things:
    upload_2019-11-28_7-11-7.png

    I am very happy with the progress I'm making on this!


    Feel free to leave any feedback, comments, suggestions, questions, feature requests, whatever! :)
     
  4. Joe Ellis

    Joe Ellis Member

    Joined:
    Aug 30, 2016
    Posts:
    991
    It looks really good, I used to love making levels with build (duke3d level editor that came with the atomic edition) and I'd love to be able to make levels in that or a doom editor and use them in gamemaker \ convert them to a model. You've inspired me to start making a converter like this

    I have a few suggestions that are mainly to do with taking advantage of the gpu and pc's being alot more powerful now,

    If you're not already, I recommend building the level geometry into vertex buffers.

    If you packed the textures used by the level onto a single texture, you'd be able to just have 1 vertex buffer for the entire level.
    You could make a shader that repeats the texture tiles, by writing the tile index (x & y) to each vertex and use a uniform for the tile resolution\number of tiles per row & column to make the uvs wrap around that tile. eg. vec2 uv = v_tile_index + fract(v_texcoord) * tile_res;

    I worked out a trick a month or 2 ago for eliminating overdraw by prerendering everything to the depth buffer but not draw anything to the pixel colors,
    so when you draw everything properly it already has the depth of the nearest surface in the depth buffer and doesn't have to process any of the pixels behind it, which saves millions of texture reads, and this would probably be the same as the bsp performance wise, or could be even better because of less going on in the cpu.

    The blockmap could be made at a higher resolution, which would be better for performance as long as you don't mind it taking up about 5mb in ram. And you could generate this during the loading sequence and not bother loading the info from the wad.

    I noticed that when you look down, sprites are only using the view's yaw, if they use the pitch aswell they look the same as they do in doom and stops them looking flat.

    For the "things", you could make a kind of map that links doom thing types to specific gamemaker objects. That could make it better for making levels in a doom editor and being able to place the enemies and stuff in there and it would play in gm without any extra configuration outside the doom editor, besides coding the actual objects.
    You could do that with a single list if you made constants for the thing types, like:
    thing_object[_type.mancubus] = obj_mancubus


    But yeah, really impressive stuff so far! I hope it all goes well
     
    RujiK and IGameArt like this.
  5. IGameArt

    IGameArt Member

    Joined:
    Jun 21, 2016
    Posts:
    145
    Thanks for all the tips Joe! A few of your suggestions are currently on my to do list. I plan on including some scripts to allow the end user to define whichever objects they want to represent things on a map, as well as overriding any textures used in a map. This way you can set up complex materials or swap in an HD texture or whatever.

    A lot of people are commenting about how I'm using billboards that only rotate to match the camera yaw. But this is an intentional choice. Things in the map are meant to appear as though they are standing on the ground or hanging from the ceiling. If you rotate along the X and the Z, and look down, suddenly that enemy you've been shooting is laying flat on the ground, which looks so incredibly weird.
    [​IMG]
    That might be suitable for some things but this just looks weird. The only actual "solution" to the issue is to use a 3d model or a voxel or something.

    I've also been thinking about packing the textures to reduce the number of swaps each frame. But baking the whole level into a single vertex buffer probably won't happen because of how many different uniforms have to be passed into the shader for each sub sector for them to display properly.

    I like your idea about using a depth pass to reduce the number of texture reads, but I think that may not be possible if I want to retain platform independence with this asset. I'm hoping to get this working for every export module. I know I could probably write different shaders and scripts for each module, but if I have to hard code something to get good performance out of mobile, may as well just use that for all platforms lol.

    Anywho, thanks for all of the suggestions like I mentioned. You've given me some extra things to consider moving forward!


    EDIT: Working on the Deimos Testbed interface. The theme will change to match the game that you have selected, this is the Heretic theme. This is how I'll be testing out the engine.

    upload_2019-11-28_21-3-56.png
    upload_2019-11-29_3-24-50.png

    The testbed will be available for download from my patreon once I have that up and running.
     
    Last edited: Nov 29, 2019
    Joe Ellis likes this.
  6. IGameArt

    IGameArt Member

    Joined:
    Jun 21, 2016
    Posts:
    145
    So the Wad Lab works:

    [​IMG]

    HD Video: https://imgur.com/jYRC9GP

    Also I managed to get audio to load from a wad file with a great deal of ease, so that's a thing now. Haha.
     
    Last edited: Nov 30, 2019
    Joe Ellis likes this.
  7. IGameArt

    IGameArt Member

    Joined:
    Jun 21, 2016
    Posts:
    145
    Working on the proper integration of doors.
    Prior to this update the height a door would open/close to/from would just be defaulted to 64 map units. This update marks the first time since development began that the height a door would open too was actually dependent upon nearby ceilings. Now the door's will open to 4 map units lower than the lowest adjacent ceiling height, just like it is in Doom 1993 and all other games based on the engine.

    [​IMG]

    The next step in this process is getting the speed of the open/close to an accurate representation.
     
    Joe Ellis likes this.
  8. MaGicBush

    MaGicBush Member

    Joined:
    Jul 17, 2016
    Posts:
    30
    I had much interest in this until you mentioned Patreon. Source ports are free btw including the old map editors:p.
     
  9. IGameArt

    IGameArt Member

    Joined:
    Jun 21, 2016
    Posts:
    145
    I'm not working on a source port MaGicBush. I'm creating a way for GM users to easily integrate complex 3d level design into their games using a widely available mapping format. I'm sorry that the idea of a patreon makes you lose interest in this project, but I am currently in the negative and damn close to being homeless at the moment. Just looking for a way to help keep food on my plate while I work on this.
     
    Erramir likes this.
  10. Misty

    Misty Member

    Joined:
    Jun 22, 2016
    Posts:
    1,050
    Its sad but people really seem so delusional these days. Gamers will quickly hand over 60 dollars to any AAA company, but if a struggling indie dev just wants an honest wage for their work all of a sudden indie dev gets shamed, gets told they are a mercenary (as if that's somehow a bad thing?), and told they ought to work for free.

    IGameArt, I hope that you do not become homeless, it is always a shame when great-coders come upon hard times.
     
  11. IGameArt

    IGameArt Member

    Joined:
    Jun 21, 2016
    Posts:
    145
    Thanks a bunch Misty!

    Now back on topic, I managed to make some good strides and have doors and switches working, with sound effects also being played straight from the wad file!

     
    Joe Ellis likes this.
  12. JaimitoEs

    JaimitoEs Member

    Joined:
    Aug 9, 2016
    Posts:
    175
    So cool Man! Keep the great work! If your work is good, pay some popcorns it´s not a problem!
     
  13. IGameArt

    IGameArt Member

    Joined:
    Jun 21, 2016
    Posts:
    145
    Hey thanks for the support @JaoimitoEs!

    Got switches to actually change their textures properly. haha!

     
    Joe Ellis, TheSnidr and JaimitoEs like this.
  14. TheSnidr

    TheSnidr Heavy metal viking dentist GMC Elder

    Joined:
    Jun 21, 2016
    Posts:
    474
    This project is so amazing! Will pay attention for that Patreon. What you have already is something I've not seen done in GM before.
     
  15. IGameArt

    IGameArt Member

    Joined:
    Jun 21, 2016
    Posts:
    145
    Thanks @TheSnidr That really means a lot coming from you. I really enjoy pushing the bounds of what's possible in GM, much like yourself.

    I think you'll probably notice, also, that I changed the name of the thread, and also the engine. Deimos is cool I guess, but I didn't have much attachment to the name and I think you'll agree the new one is much better:
    [​IMG]
     
    Joe Ellis likes this.
  16. Joe Ellis

    Joe Ellis Member

    Joined:
    Aug 30, 2016
    Posts:
    991
    Looks nice, I get that reference too lol
     
  17. IGameArt

    IGameArt Member

    Joined:
    Jun 21, 2016
    Posts:
    145
    Hah, nice. I'm still working on the logo design. Decided to put some of my illustration background to use and get that fish all cute n ****. Lmao
    [​IMG]
     
    Last edited: Dec 4, 2019
    TheSnidr and Joe Ellis like this.
  18. IGameArt

    IGameArt Member

    Joined:
    Jun 21, 2016
    Posts:
    145
    I've gotten a lot of really strong feedback on the change from Deimos to DopeFish, so I decided to go back to the drawing board and try making a new Deimos logo, what are your thoughts? [​IMG]
     
    xygthop3 likes this.
  19. Yal

    Yal GMC Memer GMC Elder

    Joined:
    Jun 20, 2016
    Posts:
    3,938
    This project is amazing, one of GM's flaws is lacking a good 3D level editor... and being able to use all the tools available for Doom is an oddly fitting choice, given GM's raw limited 3D access and how one of the official tutorials stole Doom sprites for years :p
     
    Morendral likes this.
  20. IGameArt

    IGameArt Member

    Joined:
    Jun 21, 2016
    Posts:
    145
    Does anybody else remember this? :p
    [​IMG]
     
  21. xygthop3

    xygthop3 Member

    Joined:
    Jun 20, 2016
    Posts:
    116
    Gadget 3D
     
  22. IGameArt

    IGameArt Member

    Joined:
    Jun 21, 2016
    Posts:
    145
    Haha yeah I remember completely butchering that code and getting it to produce results like this:
    GlitzandGizmosscreenshot15035.JPG Glitzandgizmosshot4.JPG

    Anywho, back on topic. I've gotten a lot of feedback on the new logo lately so I figured I'd take a stab at doing some more concepts.
    [​IMG]
    [​IMG]
     
    Last edited: Dec 6, 2019

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice