Tanshaydar's Place
Currently nothing
Filed under: Featured, Game Development, Unity

Amnesia: The Dark Descent Remake Concept

A few months ago, I was having a discussion with a friend about what is more important: Lightning & shading quality? Or models and texture quality? We couldn’t have an agreement as I was pressing that shading and rendering system could make ordinary models look beautiful, even meet today’s exceptations. He wouldn’t have none of it. At that time I thought of creating an old game inside a modern engine, and wondered how it would look. I started to tinker with the idea.

I’ve updated the game. You can see the changelog at the end of this post.

Amnesia: The Dark Descent has its all models and textures under its game folders, and they are not packed like most of the games today. Therefore, I though what if I recreated the first level of Amnesia, how it would look? The idea was fascinating at the time. I’d blow away the cobwebs, and you know, rolling stone gather no moss. I’d also use some new HDRP and other features that I didn’t have chance to look at.

Then I went on and created a new project, naming it, Amnesia: The Dark Descent Remake like it was going to be a complete remake. I logged into Steam, downloaded Amnesia: The Dark Descent and opened its folders.

For so long Frictional Games was using Collada (.dae) as the model format and DDS as the texture format. I don’ really like either of them formats so I converted Collada files with Autodesk FBX Converter 2013 to FBX (.fbx) format, and DDS files to Truevision TGA (.tga) with nVidia’s DDS Utilities; and put all of them into the project and started to wait for import process.

And instead of sitting idly, I went ahead and downloaded and opened Amnesia Level Editor, which I never touched again for almost 9 years since White Night…

When you look at it, you’d think “well this is not much, it’d take one hour at most“…

When I saw the scene in the editor, I kinda started to understand what I’d need to convert to make it work:

  • First models & textures
  • Lights (point light, spot light, ambient light)
  • Decals
  • Particle systems

What I thought of being ‘one hour of work at most’ started to look like it’d take more than one hour. But, I thought to myself, the journey of a thousand miles begins with one step. If I move the first model to the scene, rest would follow… Right?… No. I realized that I’d need to create each material from scratch. Amnesia uses HPL2 engine, and the materials have .mat file extension, albeit with a different structure. Unity also uses .mat extension for materials, but cannot read them. Meaning I sat down and started to create materials from scratch.

It was a mostly boring process, but then I started to assign these new materials I’ve created with the textures I’ve converted to TGA, to the models I’ve converted to FBX. No lies here, at first the view was fascinating. Then I started to add all models one by one to the Unity scene, following their positions and rotations in the original scene.

Object name, position, rotating, scaling… All the needed information is there.

But then another setback…
The curse of the 3D world, is it Z or Y looking up, or is X positive to the right or left presented themselves to me here too. Yeah, both Unity and HPL2 uses Y upwards, but HPL has X in Unity as negative X. Furthermore, rotation is not in Quaternions, so I had to calculate Euler for each single object so that it’d fit. I mean, this is not a process that would be completed in an hour either.

In evenings after work and at weekends, especially with the pandemic all around, instead of having a smoke and tea in front of reddit and waste my time away, I started to work little by little, and pushed whatever I did to GitLab… Resulting:

Yes, single branch. You should also see my commit messages…

All the objects withour any regard to if they’re interactive or not, trigger area or not, were added to the Unity scene one by one. HPL’s Level Editor doesn’t have any hierarchy window either, which made things more difficult. I was using two monitor set up, with HPL showing in one monitor and Unity editor showing in another, it was more of a manual work than something needed critical thinking, but it was also relaxing. I was kinda happy.

Jokes aside, all the placement was done at a certain point:

When the lightning and effects are closed in the Scene tab, this is how it looks in Unity.

With the bulk of the work gone, I put the FPS Controller that came with the example scene and started to traverse. I can convert whole game like this, I started to think. But then I started to add lights, I realized that a game that was released in 2010, and not the best looking of its time either, wouldn’t hold up texture wise today. Man, my arguement was gone in a stitch! But to my luck, Amnesia: The Dark Descent Remastered Mod came to my resque. These people upscaled almost all of the textures of the original game with an impressive quality. So much so that, even the original Amnesia with this mod looks like it was released in 2015 or 2016, not an old game that was released with okay graphics in 2011. Excellent job guys. Render unto Caesar I thought and I credited them anywhere I could, and started to use some of their textures. Now I could work with lightning better!

But lightning isn’t everything. I had to make carpets look like carpets, curtains look like curtains, metal look like metal. HPL2 materials only had specular maps aside from albedo and normal, and it’s nowhere near enough. I had to go through the materials to adjust them as metal, rock vs. and even went ahead and created new shaders for carpets and curtains (SilkHaydar.shadergraph) and assigned them.

When I was done with the lightning and basic effects, it started to look pretty nice. At that point I thought to myself, I have to make this playable!
Very smart…
In order to make this playable, aside from the 4 elements I listed above, I needed to add 4 more elements to the list:

  • Colliders and collisions
  • Interactables
  • Sounds, musics, effects
  • And finally level scripting

Collision was easy, right? Add a Collider, add a RigidBody and done, right? Eh, what about sound produced resulting a collision, considering the velocity and force, and like in original Amnesia, breaking… About interaction, opening doors, throwing objects, inventory and object interaction… Like, if I was to pick up a stone from the ground and threw it to a chandelier dangling from ceiling, the stone should make an impact sound and the chandelier should start to sway, with chain rattling…

I rolled up my sleeves… Wrote the code… Added the components… Run the tests… and this is the end result:

Reachign this point was maddening; but now that I’ve reached this point, why do I not push further? For example, what did the original game lacked? First thing to come to mind, having banners a little more alive.

At this point I had the doors open with mouse drag. It’s easy to write here, but until I made it work, did I not write code from scratch, did I not use plugins I already had, did I not hit my head to walls, did I not despair and attempt to delete the project…

Playing or watching the video is nice, but saying saying “nu-uh this didn’t work this time either“… is priceless…

This is static, this is dynamic; this is a shadow caster, this is an occluder; this has dynamic collision, this is static so put a mesh collider… And so on, I’ve added interaction to all interactable objects. Then I realized that if you interact with armour’s head it would go up sky high. I was investigating it, thinking that it was physics glitch, like you’d see on funny subreddits, like, you know, object is stuck and you touch and and it goes ballistic. No, that’s not it, because I can put the head down, and when it falls over it makes an impact sound.

Then I realized that there is 1.5 meters between the model and its pivot point….

What is this…

Solution is easy, put the pivot in center. There are a lot of ways to do that inside Unity, but you know what I did? I opened Blender, imported the FBX file, selected the head, put the pivot in center, and then exported… Works like a charm. Did I mention that I did in Blender? Yeah, Blender…

Let me tell you a memory of mine. Now, some people I talked to think that I was born knowing software, game development, and English. And while I was born, these were not mine but theirs, and I stole their skills. Like my soul was going to be sent to this earth, and while they were preparing me, they took others’ skills and put into me. But alas, I was born ignorant and crying…

After I finished high school and entered college exams, we went home for the summer vacation and I was keeping in touch with my friends from high school. This is summer of 2006, we were using MSN. It’s been 15 years and I’m not sure if she’d remember me, but a friend while we were talking on MSN asked me this: “Tansel, do you know how to use blender?“…

AND WHAT DID I ANSWER?
Yeah, I used it a few times, I made something like a smoothie with banana, strawberry and milk. But I’m no expert.
I wish I had a screenshot of that conversation so that it’d become the pinnacle of Not Enough JPEG. She told me “no not that, the modeling software” and never belittled me, but I was ashamed alright.
Now I’m putting a pivot to center in Blender for Amnesia Remake; but back then when they asked me “if I knew how to use blender” I’d answer about a food processor. A lot of things are like that, you learn it over the time, doing things, breaking things, experimenting…

But I digress. Interactions are now working, I created particle systems from scratch by hand, all audio files are straight from original Amnesia and it was becoming a whole working thing. I went further and used spatialization for some audio effects. Like the walls would occlude the sound, doors would make the sound faint, and if you open the door you’d hear it more. Things like you wouldn’t notice, but make your experience better.

Finally, it was time to converth the level scripting. Since I’ve created White Night, I already knew AngelScript that Amnesia engine HPL2 uses for level scripting.

A little bit of a problem here. 1300 lines of code, cannot be converted to Unity C# that easily.

When I was working at a startup company back in 2013 or so, we got a software maintenance job from another company. It was 18 thousands lines of code, a huge monolithic PHP file… Let me burn my instructor Uğur Doğrusöz’s ears, “High Cohesion, Low Coupling“. 1300 lines of code is separated to smaller scripts and written in C# for Unity. Since it was nearly 10 years since I made White Night, I kind of forgot the documentation of AngelScript and took a look at HPL2 Engine Documentation, which was nostalgic.

To be honest, when you separate 1300 lines of code to 20 files, the amount of code I wrote in Unity was less than half of it. It’s more about knowing the engines, functions, and languages. But there was one more thing: Cinematics…

If you played the original game you’d remember that there was no actual cinematic system, everything was making the camera rotate, shake, and put a little bit post process. When I made an intro cinematic for White Night, people were shocked and it was one of the most well liked features of White Night. This time I had Unity, and rotating and shaking the camera wasn’t enough for me.

What did I do? The thing I love most: Full Body Character Controller. What is this, if you ask, when you look down you see your body, the character you play as is there fully. Most beautiful example of this, if you played it, is Mirror’s Edge. You’d see Fate while she was running and jumping at the top of buildings. I like this a lot. You can see it in the videos above.

But this should’ve also worked for cinematics. Especially, in the opening, when Daniel was running, you had to see how eccentric his movement was. And like I had no other job, I started to work on this. Result:

When I saw Daniel’s hand when he fall down, I was satisfied.

Of course, all of these movements need humanoid animations. There are a lot of humanoid animation pack around being sold, and less but still free animation packs. I created a 3D Daniel model with what I had in my hands and tried to make it look like a person in 1800s. Of course, it didn’t really look like the original concept arts of Daniel, because I neither had the jacket model nor the knowledge to create such a model. If I were to give this job to another person, then this project would become more than a ‘one man project’, and need financing. What started as an argument already became a tech demo, and I didn’t really want to push it further. I never intended this to become a commercial project or such. Then again, what did I start it for anyway?

Last thing I worked on was to create a smooth transition between cinematics and gameplay, which I had nearly no experience of. In Neon Town, while creating the game in top down 2D it was relatively easy; but not like that here. I’ve tried 5 or 6 different systems and finally found a level that was kinda satisfying. In the end, this is a few minutes gameplay with 3 cinematics.

Now that I am at this point of development, why not also create the main menu? I opened the same HPL2 Level Editor and loaded up the main menu scene. A lot less objects, zero interactables, easy work.

After everything I went through creating the Rainy Hall, creating the main menu scene was both fun and easy.

I think you should see the rest for yourself. Everything I explained until this point, I packed up and made playable and put on itch.io. For most of you, it’ll probably take more to download and less to play through it.


Lightning and shading is more imporant than model and texture quality was an argument that I’d defend and support with an hour of work is how I started it, and at the end of it there is something I shamelessly call “Amnesia: The Dark Descent Remake”. This all started at February 1st if the first commit on GitLab is showing the correct date. So this is nearly 1.5 months of work, with some evenings and weekends spent. If I were to spend this 1.5 month to myself, I believe nothing productive would happen. But this was a fun journey that I remembered a lot of things, learned new things, experienced new things and refreshed my knowledge. For the first time in a very long time, I was kinda happy.

If you could provide a little bit of a feedback, I’d appreciate it.
If Frictional Games comes and tells me “OK, this is nice, now go make rest of the game“, I swear I’d do it..


Changelog:

Version: 0.1.2
Date: 23/03/2021

  • Removed unnecessary debug info
  • Interactable objects has better collision detection
  • Breakable objects has better collision detection when broken
  • Wooden chair broken pieces are no longer interactable
  • Removed bright flash from display case
  • Rose petal particle optimization and timing updated

Version: 0.1.1
Date: 14/03/2021

  • Optimized particle systems for better visuals and performance
  • Added dynamic Depth of Field system
  • Lightning updated
    • Candles are not so bright anymore
    • Level is brighter
    • Light flicker effect updated with correct variables
    • Gallery event is now darker
  • Interaction prompt visuals updated
  • Door opening mouse movement reversal at each side of the door
  • Fixed gallery event where door wouldn’t close
  • Fixed Daniel’s head clipping into camera
  • Fixed an already lit candle still being interactable
  • Fixed some objects getting invisible when too close to camera
  • Fixed chandeliers not slowing down
  • Fixed fireplace collision

Verba Volant, Scripta Manent

This site uses Akismet to reduce spam. Learn how your comment data is processed.