Porting Dagon to Unity


Thanks, Agustin. I have book, GUI, liquid animation, and FX plugins on my wishlist, but want to see how Dagonity functions before purchasing anything.

I’m really looking forward to the alpha-release of Dagonity. I’m most anxious to see how just the basic shell of a room is set up. Using alpha maps on the cube faces, I can see how the skies could work with tweaking, but I have to admit that I’ve come up empty when trying to get water to work — and I have a lot of water. I thought that with the fixed camera position, I should be able to figure it out, but no. :frowning: I may have to resort to videos.

Best of luck at Gamescon!


Agustin, any chance of just a peek at Dagonity? Just a single room even? Got a three day weekend here…


I could give you access to the Github repo but I’m not sure what’s the current status. There’s not a tutorial for sure but I could help you to set up things from here. I’m still on the move and unfortunately it’s a pain to upload stuff :frowning:

At least the engine in the Github repo is up-to-date, but there’s no easy way to test it…


OK, you have access! I think you can try the following: this is a Unity project, so go ahead and load it with free Unity. Then copy your Adamantus assets in the Resources folder. Keep in mind that Rooms has to be renamed to Locations.

It probably won’t run as other things have changed, but I’ll try to help from here :slight_smile:


Thanks, Agustin! I’ve got a fairly good handle on Unity, so I’ll do my best to figure it out without bothering you further. Thank you. Thank you. :smiley:


I hope you get it working quick Imari, I’d like to know your first impressions :dancing:


Working on it… Just looking through the engines files and the layout. Just getting set up. I wouldn’t hold your breath. :stuck_out_tongue:


Okay, reporting back. I spent a lot of time looking at the structure and perusing the files to try to see where Dagon left off and Dagon in Unity begins. The biggest thing that I see is that the CS files that were formerly compiled into the Dagon.exe are now compiled by Unity’s editor. This seems to include most of the functions formerly performed by the Modules, but I’m no coder, so I can’t be sure of that.

For what it’s worth, here’s the step-by-step for what I did to set-up Adamantus in Dagonity:

  1. Downloaded engine from Github (Got access from Agustin.)
  2. Made an Empty folder , !ADAMANTUS-DAGONITY
  3. Dropped in the contents of the Dagon-Unity Master folder to the new !ADAMANTUS-DAGONITY folder.
  4. Dropped my old Dagon (version 0.6.5) Resources folder into the Assets> Scripts folder.
  5. Deleted the TEX files in the Nodes folder and added in the six PNG files per node (no alphas in them yet). [Note. Cube faces were converted to PNG files from TGAs. I used XNConvert, doing a batch conversion with a default PNG compression of 6, which has resulted in color skewing. The patches, already in PNG format, no longer match the cube faces. I’ll need to hand convert the cube sides, I think. I also will add alpha to the PNGs when skys are to be used and will need to work on a water shader.]
    6 Changed the name of the Rooms folder to Locations and dropped into Assets> Scripts> Dagon folder. (Should it be the Assets> Scripts> Resources> Scripts> Dagon folder?)
  6. Didn’t know what to do with my previously altered MODULES in the Modules folder, but put the folder into Assets> Scripts> Dagon and was prepared to let the fur fly.
  7. Opened free Unity (version 4.5.3f3) and loaded the project. Unity imported the assets. (It took 47 minutes!) [Note: The Unity scene file is Environment.unity (found in the Dagon-Unity Master> Assets> Scenes folder.)

Problem: Unity did not like several PNG files, which worked previously in Dagon. This seemed to be due to alpha in the files.
Solution: My errors. I remade the PNG files and Unity seems to have accepted them.

Problem: OGV video files won’t run in free Unity. Multiple messages about my videos. :frowning:
Solution: Pro Unity needed… or a work around.

Problem: An issue with the node.shader - "WARNING: Shader Unsupported: ‘Dagon/Node’ - Setting to default shader."
Solution: I don’t know. Possibly another Pro Unity issue? The file does not include a fog element, though it does reference zDepth. There is a Fallback “Transparent/Unlit” at the end of the shader file, which seems like it should work for free Unity. (I don’t know.)

Problem: A compile error -
"Unhandled Exception: System.UnauthorizedAccessException: Access to the path “D:\DAGONITY!ADAMANTUS-DAGONITY\Temp\Assembly-CSharp-firstpass.dll.mdb” is denied."
Solution: This was an issue with McAfee. I had to turn off “Real Time Scanning” temporarily until Unity reloaded the project.

Anyway, that’s as far as I’ve gotten.

I’m not seeing a loaded room, which I thought from reading through the CS files, might be automatic. (The cube is just a Pepto-Bismol pink :P) I assume that’s because of the problem with the node.shader not being recognized. Or, do I need to start loading the components and hand adding in the textures to the cube faces?

I’ll continue to fiddle. It is informative to see the components of Dagonity and how everything’s arranged, as we just caught a glimpse of it in Pablo’s Spots demo.


Great report Imari

I don’t think I’m going to pursue the integration, for me its just to many steps… but as you know I have been waving on doing game development for a while now

I hope you get it working! and have fun doing so :wink:


Thanks, Nige. I’m about to try a new project with just one or two rooms to see if I can get a room working. I think the node.shader is going to be the issue, but maybe if I simplify, I can figure it out. I also need to find how to make Dagonity recognize the first room. Hopefully, I just need to dig deeper.

Okay, I made a new project, imaginatively named TEST_ROOMS, and dropped the Dagon-Unity master files into it.

  1. I added the Location folder as before in the Assets> Scripts> Dagon folder, but with only one room file. The room file contained just three nodes, did not connect to any other rooms, and did not use spots or videos. It did contain audio for the background sound and steps, but that’s all.
  2. I made a stripped down Main.lua file that contained only cursors, font, the start room and a switch to the start room. I put it first in the Assets> Scripts folder and when that produced nothing, I put it in the Assets> Scripts> Dagon folder —also without results.

So, no progress really, except that I did not get any error messages this time. Not even for the node.shader.

Poking around – The Dagon components are accessed easily from a drop down menu on the top tool bar Component> Scripts> Dagon> or from the Add Components button in the Inspector panel (same path). Each adds up a fill-in-the-blanks to the item selected on the stage. Among them are controllers for audio, cutscenes, effects, doors, links, nodes, spots, etc. So, it looks as though you could add in your resources and then script the rooms from the Unity Editor.

Going to try that next, I guess… tomorrow. I’m sorry that I’ve not been able to offer more. :-[


You seem to have made quite a bit of progress, though! Like I told you, things aren’t very intuitive and there’s some specific behavior related to Unity (i.e.: the need to manually reload modified scripts) that need to be clearly documented.

I’ve brought this topic to Francisco’s attention, who may have a look at it as soon as he has time. I’m afraid that I won’t be able to review everything in depth until next week :frowning:


Thanks for weighing in, Agustin. I know that you said that the engine was not ready to be used and I appreciate you allowing me to experiment with it anyway. :slight_smile:

Your team is working with the “fleshed out” version of the engine with the Asylum assets. The “stripped down” version of the engine on Github, does not have the assets (textures, room scripts, prefabs, etc.), so I thought it might be helpful if I provide some feedback, so that you’ll know what’s “missing” and the barriers, which I encountered.

I tried numerous things without success this morning, including individually hand importing all of the scripts as you had suggested and moving my old Dagon files and folders (main.lua, Locations folder, Main.lua, etc.) around in Dagonity. I tried adding in the old DLL files and the CFG file too. I also started the 30 day trial of Pro Unity to see if that made any difference, but it did not. :’(

So… first it would be helpful to know where exactly the components of a Dagon game should be placed within the Dagon-Unity structure and which files should not be moved over (like Dagon.cfg?, Main.lua?, etc.). Knowing the correct paths for the organization of the game in Dagon-Unity would save a lot of confusion.

I tried to figure out why just a single node would not load into the scene. The current version of the Dagon-Unity Master on Github is missing the meshes and textures (prefabs?) for the Atmosphere (Atmosfera), Sun (Sol), and Sky sections of the Scene. At least, those sections are all in a red font and the Inspector for the items reads “missing.” The GameController is missing the text asset for Game Data JSON. (I had to look up JSON. :-[) Lots of other missing mono script, missing texture, missing avatar messages throughout.

In the Inspector panel for the node.shader, I get the errors – “Variable ‘n’ used without having been completely initialized” on line 95 and warning symbols labeled “implicit truncation of vector type” for lines 91 & 95. In the Inspector panel for the WithFog.shader, I get the error – “incorrect number of arguments to numeric-type constructor” on line 42.

I hope this is of use to Francisco when he’s setting up the engine for release. I did learn a lot and am looking forward to trying out Dagon-Unity again. Can’t wait to play with the components to add spots, links, doors, etc. Once set up, it looks as though the engine should be easy to use. :smiley:


Great write up Imari! Very clear and comprehensive. Assume you have a machete in hand chopping away at the Unity jungle? :stuck_out_tongue:

From the sounds of it, a very simplistic test project that works in free Unity would come in handy (something similar to the test room that came with SCream engine all those moons ago) - just 2 or 3 nodes, a zoom close up and a few simple interactions. Nothing fancy.

@Nigec - Don’t give up just yet! Have to admit I’ve drifted away for a bit but this has got me quite excited again. :nod:


Hi Finn! Yes, I do think it’s exciting. Soon as I can, I’ll try to make some of the “missing” items and see if I can flesh out the bones a bit. I think this is going to be great. :smiley:

And yeah, we need to work on Nige. Maybe sneak up on him when he’s not looking and whisper, “game.” :secret:

And yeah, we need to work on Nige. Maybe sneak up on him when he's not looking and whisper, "game." :secret:

I’d probably have a heart attack :stuck_out_tongue: :)) :)) :o


Imari, do you have any more news to share? This is going to be a terribly busy month, I’m afraid, but we’re not ruling out the possibility of releasing the Asylum playable to backers next month. That should give you some solid ground to keep experimenting with Dagonity :slight_smile:


I didn’t have any real progress to report.

I didn’t find any sphere or clouds objects in the Dagon-Unity package that I downloaded. So I assume that they are missing at present. In Unwrap3d, I made a sphere, reversed the normals, and applied spherical mapping (Y Axis, Seam Rotation 180, spaced poles, and no additional scaling). I made a Models folder in Assets/Scripts/Resources folder and added in the SkySphere.3ds file. Imported it into Unity and created a SkySphere_prefab, since I will have several changes of sky. I wasn’t sure what size or format to save the spherical sky maps, but I chose 4096 x 2048 PNG files. I was just working on making and rendering them now — with and without clouds.

Honestly, without knowing exactly where to place the old file folders and whether or not I’m actually missing scripts and objects, I’m just marking time. Sorry. :frowning:

P.S. - I definitely understand about the “busy month” and realize that the pressure is really on to finish Asylum. I probably shouldn’t have initiated my free trial for Unity Pro, just yet. :stuck_out_tongue:

P.P.S. - For the skies, I’m rendering a sky background with sun/moon (that I assume will be fixed) and then a cloud layer with transparency, which I assume will rotate. The size I’m saving is 4096 x 2048. Is this right?


We’re not forcing any size (as far as I recall) so 4096 x 2048 is more than fine. Should retain all the detail in HD.

Again, I want to get back to you with more info and assistance, especially when it comes to the new folder setup. I’ll try to be here as soon as I can :slight_smile:


May I have a clear, unambiguous statement on this:

Will Asylum be 100% playable with Dagon++, minus nice visual effects?


Hi turtleman,
I’m possibly misunderstanding your question.

Are you making a game with the Dagon engine and asking if the game, which you are creating, will move seamlessly into Dagon for Unity? If so, the answer is that your game will mostly move over, but will need some modifications.

If you are asking if you need a separate engine (Dagon ++) to just play the game Asylum, then the answer is “no.” Asylum, the game, is being made now with the module Dagon in the Unity engine. It will not require that you have the Dagon engine or the Unity engine separately.

Did that answer your question?