DoomLoader for Unity

Need one for Unreal lool, looking good.

Share this post


Link to post

It looks promising! Continue to develop the project. You are trying to create Unity-based level editor for Doom?

Share this post


Link to post

I imagine it is supposed to be a tool that let's lets you import Doom maps into Unity for if you are making a game with retro styled maps but don't want to actually use a source port. Of course being able to make changes and export back to a normal wad or PK3 would be a great addition as well but that is for later on down the road I guess

Edited by therektafire
1 person likes this

Posted (edited)

Share this post


Link to post

Woah! I've like *just* released my Unity-based Doom engine, haha! Coincidence :)

 

I see you used the Doombuilder code for the triangulation, did you have to do much work to it to get it to work with Unity? I didn't try to just copy it over myself, and instead rewrote it myself. (To not entirely perfect success)

Share this post


Link to post
14 hours ago, dmg_64 said:

Need one for Unreal lool, looking good.

 

Heh, long time since I've touched Unreal, so can't really say how easy it would be to even do. I think my codebase can prove to be a great case-study to help one implement WAD reading into various platform. Currently the code is pretty much undocumented as I'm pushing all the features in, constantly reworking the methods.

Once it stabilizes a bit I can document it, even perhaps make some tutorials on how this sort of toolset can be achieved in other platforms.

 

3 hours ago, StormCatcher.77 said:

It looks promising! Continue to develop the project. You are trying to create Unity-based level editor for Doom?

 

Not level editor per se. Idea is that you can use Doom level editors to create content for Unity. So basically it will act like a new engine Doom runs on. You can use it to make parts of your game, or true old school 2.5D shooter. There are many people who have become expert at making Doom-like maps as well as many who would want to port their years of hard work on mods to a newer platform. My personal goal is to make Hexen run in Unity so I can get to modding that :)

 

1 hour ago, therektafire said:

I imagine it is supposed to be a tool that let's lets you import Doom maps into Unity for if you are making a game with retro styled maps but don't want to actually use a source port. Of course being able to make changes and export back to a normal wad or PK3 would be a great addition as well but that is for later on down the road I guess

 

I don't plan to do much of level editing features, but Unity allows you to export FBX and OBJ files. Thus you can use the toolset to simply create parts of the content you like, or even use it just as an importer/exporter to create custom meshes prefabs. Quake level formats is something I can confidently say I would be able to do at some point in the future (thanks to them being fully documented with various open-source projects already existing.)

 

49 minutes ago, jmickle66666666 said:

Woah! I've like *just* released my Unity-based Doom engine, haha! Coincidence :)

 

I see you used the Doombuilder code for the triangulation, did you have to do much work to it to get it to work with Unity? I didn't try to just copy it over myself, and instead rewrote it myself. (To not entirely perfect success)

Nice! I think I might have seen your video already :D

 

No it was pretty much just copy-paste, although I don't like that there is now another class for Vector2 as a duplicate to the Unity's internal one, and there are some useless package that came along with it. I will clean it up at some point. Hey but it works now, so no need to fix it.

 

 

Thanks for the feedback and kind words!

After loading a map I played around with the Unity's lighting setup. Here are some sneak peeks on what you can achieve with the toolset. Running at >90fps, although I do have a beefy machine.

 

screenshot1.jpg.ed3157e14f83a4aa8784a4c8d1159f05.jpg

screenshot2.jpg.e4dfdc8b68c25e98165a4a5a3d88a1ca.jpg

screenshot3.jpg.8de56c09bb0c8140598f2d3e2a91c8d2.jpg

screenshot4.jpg.f8423b3986af4cb67e88f7b24400207f.jpg

screenshot5.jpg.7467f118b8e1b10042c1616ec3f05c70.jpg

screenshot6.jpg.ca70b70ae77ba26db99d084e54875fe3.jpg

 

By the way, the scene I have in the zip is made ready for deferred shading (if you do forward rendering you can get away with having only two cameras in total to get the skybox effect working.)

4 people like this

Share this post


Link to post

Very cool! I'm happy to hear it wasn't too difficult to copy over, makes me reconsider doing the same. It'd be nice to get a solution working without struggling with my own implementation any more :P

Share this post


Link to post

Version 2 is done. E1M1 and E1M2 are now feature complete, only thing missing is enemy behaviour and item pickups. 

Here's a list of the major changes:

  • Removed Vector2D struct and replaced all references with Unity's Vector2
  • Added first person weapon, created transparent billboard material and shader
  • Made mouselook and WSAD movement 
  • Implemented sounds for doors, weapon, enemies and linedefs
  • You can now shoot enemies and barrels dead
  • Created GameManager class and moved stuff from WadLoader into there
  • Removed the shader vertex transformation and went with classic gameobject rotation instead
  • Enemies now have the 5way sprite system
  • Added my AxMath library into the project
  • Mesher now has grid of triangle lists for quick querying for sectors
  • Removed my own ambient light parameter, the shaders now use Unity's Sky Ambient Light
  • Shaders in general are more cleaned up and parameter names are standardized
  • Thing's facing is now a separate quaternion decoupled from the object transform rotation
  • Homogenized linedef and sector controllers so they can be more easiely shared
  • All E1M1 and E1M2 linedefs are now done
  • Added a method to swap switch textures in TextureLoader
  • Made a fix for the sector 7 bug in E1M3
  • You can now unload maps and thus move from one map to another
  • Added a ground stick method to player object for smoother elevator movement

As before. Just extract the contents to the /assets folder of an empty project.

DoomLoader_v2.zip

1 person likes this

Share this post


Link to post

This is awesome, I always wanted to test simple doom maps (=direct wad loading) with modern lighting engines (global lighting, probes, maybe normal maps, displace, etc...).
This makes it more feasible ^_^
Are the converted maps exportable in a standard 3D format? (such as fbx or obj)
Good job !

Share this post


Link to post
On 1/20/2018 at 2:17 PM, hidfan said:

This is awesome, I always wanted to test simple doom maps (=direct wad loading) with modern lighting engines (global lighting, probes, maybe normal maps, displace, etc...).
This makes it more feasible ^_^
Are the converted maps exportable in a standard 3D format? (such as fbx or obj)
Good job !

Yea in Unity you can export generated meshes into FBX and OBJ with just tiny bit of work.

Simplest way is to just use "AssetDatabase.CreateAsset(...);" and after that "AssetDatabase.SaveAssets();"

 

My main interest of making the Doom-like games to work with Unity is the ability to make better AI for the monsters. Stuff like pathfinding, waypoint navigation and areas of interest/danger (heatmap). After I have Doom 1 and 2 and Hexen running on the engine I try to form a small team to make a new game/total conversion.

 

Sorry for the lack of recent updates, had some real life happening and the next update is a big one. I'm currently making the enemies to combat you and navigate around the map. Already have the heatmap generation working and player breath so enemies can always walk towards you around obstacles and corners. Hopefully at Sunday you can fully play maps one, two and three of the shareware Doom, no compromises given.

 

Here you can see the heatmap and breath in action. Granted the breath (white lines) won't give the most interesting of path, but it is certain. Following a white line will always lead to player. This breath is also used for sound propagation. To make a more interesting walk path the monster checks the cells around himself and randomizes among the lowest cost breath values. This would be classic seek-and-destroy behavior. For pink demons that need to charge towards player there probably need to be a preliminary check to see if a direct line between player and the demon exists, and if so, then use that as movement vector. This should make them more dangerous than the vanilla demon AI in Doom that sometimes make some really weird and random movements. I will get to play around with monster behaviors at Wednesday or Thursday I think.

 

heatmap_breath_1.png

 

heatmap_breath_2.png

 

heatmap_breath_3.png.8a23abb2f805a31a3323696fd4034644.png

 

Edited by Risto Paasivirta
uploaded some images
2 people like this

Share this post


Link to post

First three maps are now fully playable.

Create a new Unity project and extract the zip contents into assets, open up the /assets/DoomLoader/test_scene.unity and hit play

 

DoomLoader_v3.zip

 

  •    - Went back to rotate sprites in shaders, billboards now keep y = up. Projectiles rotate omnidirectionally
  •    - Fixed AxMath.CartesianLineF to work when direction was true compass direction
  •    - Monsters and things are now in separate layers, as well as local player
  •    - Made it so you can no longer shoot yourself, don't know if this is a good thing
  •    - Added sectors and linedefs to the fast lookup cache, similar to triangles
  •    - Created TheGrid class for the caches, breath and pathfinding
  •    - Made AI class and heatmap calculation based on the grid data
  •    - Dynamic meshes now add Rigidbody component to avoid any problems or performance loss
  •    - Items can now be picked up. There's a PlayerInfo script that holds player inventory.
  •    - Keycard doors now require the correct key
  •    - Created hud to show player items
  •    - Added pain and pickup overlay to color the edges of the screen for a short time
  •    - Player plays sounds when poking, getting hurt or picking up items
  •    - Pokeable is now boolean to make player do the sound if the poke failed
  •    - There's a boolean to allow pokeable for monsters
  •    - Changed GameManager to refer to local player and made triggers to query for PlayerThing instead of localplayer
  •    - Player is now a monster-type thing, as well as demons
  •    - Made GameManager to skip frames after loading a map to stabilize Time.deltaTime 
  •    - Things now has unified gravity handling
  •    - Sectors have a property of being dynamic
  •    - Player casts breath that is used for making noise and generic pathfinding
  •    - Made physics collision matrix to optimize collisions and to disallow medikits to activate lifts
  •    - GameManager now handles loading of wads and maps
  •    - Zombies can now use common lifts and doors... monkaS
  •    - Monsters now have assigneable behavior that controls the intelligence
  •    - Renamed fivewaysprite to monstercontroller
  •    - Monster controller now refer to a common animation frame struct that holds the sprites for different rotations
  •    - Mesher, MapLoader, WadLoader and AI are now static classes
  •    - Damageable interface now has method for impules to make stuff be pushed by physical force. Only monsters use this atm
  •    - Shotgun and explosions now apply physical force to damageable objects
4 people like this

Share this post


Link to post

This is genius.

well done to you, this is something I will definitely use. I get the feeling this will be a big thing once more features are implemented making gzdoom obsolete in my opinion.

Share this post


Link to post

This is really cool, and I would love to use it if possible (that way I don't have to use the very unfinished Probuilder by Unity Technologies anymore), but there's only one problem... The files I copied over have errors. I simply copied over everything from the package, but even on a brand new project, it still broke. Could you help? I'm much better with coding stuff than taking the time to build everything...

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now