So, continuing on from last week, I’m going to talk further about the Amnesia: The Dark Decent level editor and my experiences therein. After learning the basics of the level editor and setting up my dev environment, as explained here, I dove right in and tried to make a very simple level. A map with a floor, four walls, a ceiling, and a light source. I always like to do the most basic thing I can when trying something new just to prove to myself that it works. My experience in the past has been if you do a lot of work up front and then try and test it, you’ll have more headaches then you can deal with. Start small, work your way up...the standard programmer’s motto. Also, should you try to set up your own development environment, I highly recommend backing up the “main_settings.cfg” file before you get started. On my first attempt at configuring the file, I messed up something and I could not figure out what it was. I simply reverted to my backed up copy of the cfg file and I was good to go.
When I first loaded up my trial map, I spawned in complete darkness, I could not seem to move, and then I heard the “crumple up and die” sound effect with the death screen shortly to follow. After re-examining my level I realized that my light source didn’t have enough of a radius (in fact it had no radius), so there was no way to see how my completely non-threatening room was killing me. After giving the area some well needed illumination, I tried to load up my map again. Turns out I was falling past my floor because the protagonist spawned outside the room, and then just plummeted into darkness until he hit the bottom of the map and died.
|Oh, the humanity!|
Clearly, my player spawn entity was not working the way I had hoped (i.e. not dropping me into the abyss of the map). According to the tutorial I was following, you can make any “entity” object a start point as long as the name starts with “_start”. I double checked my entity, and everything seemed to be fine. While trying to debug my falling though the floor problem, I noticed that in the user_setting.cfg file had a “StartPos” property in the <Map> element that was left blank.
Hoping this may be the solution, I took the name of the player start object and placed it into the configuration file. Sadly, when I loaded up the map again, I was still falling to my doom. Reading further, the “StartPos” property is used to set a different player start position if you don’t want to use the first one you have defined. So, if my understanding is correct, leaving it blank should force the map to spawn me at my current start position, since it was the first one I created and there are no others on the map.
Finally, after some experimentation, I found that the “Area” tool can create a “PlayerStart” cube. After creating an actual starting position and placing it in my room, I stopped falling to my death and appeared in my room as I had intended.
So, after some playing around and a few mistakes, I’ve gotten my very basic level up and running. Now all I have to do is make it interesting. Design the level, put in difficult but engaging puzzles, make lighting effects to keep with Amnesia’s wonderful and creepy atmosphere...you know, the easy stuff.
While making a full custom story interests me, what I plan to do with my little sandbox level is try out the scripting language. Frictional Games has a full api listed here of all the functions that you can use in the levels. Most of the functions seem self-explanatory just by their names. I think I’ll make my next post less of a rant and more of a demonstration of the functions as I try them out. Perhaps I’ll create a level with a series of bland rooms, each one demonstrating some function or combinations of functions.