Dungeon Domain
Stanislav Belogrivov
- Playable version, Windows 64-bit only
- Repository link
Description
The goal of this project is for to get a better understanding of how Unreal Engine 4 works. For that, I am going to make a game (called "Dungeon Domain"), which is inspired by Crypt of the Necrodancer, a game made by Brace Yourself Games. Since I am not that fluent in the engine and this is a one-person project, the result is expected to be more simplified than the "inspiring original". Crypt of the Necrodancer (CotN or Necrodancer for further reference) is a rythmic dungeon crawler game, which means that the whole environment takes turns every beat, which depends on the song playing. This includes the player.
Dungeon Domain (for now) will simplify this scheme to making turns after player input - player presses "move left", this triggers a turn, all game entities make turns. The map is not "free to move", but is a 2D grid with tiles. The game is intended to be 2.5D - player can move on a 2D axis, but the objects in the game will be 3D.
Plans and Goals
In total, I am planning to achieve a couple of goals for this project during the semester. In the following list I will describe the functionality and, sometimes, which features are a must and which could be achieved, should I finish the "core feature" ahead of time:
- Player movement - obviously, the game is boring if your character cannot move. Planning to implement movement
- via keyboard (a must)
- via controller (if there is time during milestone 6)
- Player actions - there will be items that the player can use in-game. The following should be implemented:
- Healing item(s) - 1 item is a must. Either potion or foods. "Either" since implementing more items based on one that already works will be a matter of time to draw sprites, which may take time.
- Useable item(s) - 1 item is a must. Aside from punching/slashing your enemies, there must be other ways to deal with threats! First item is intended to be "bomb".
- Maps/Levels - self-explanatory. Every game needs an environment. Each level consists of 3-5 rooms (number to be reviewed) - starting room, 2-3 "filler" rooms, boss room
- Hardcoded map - a must
- Randomly generated map - optional
- Enemies - dungeon crawlers need challenge.
- Basic movement - a must. Enemies try to move towards the player at all times. For fairness, they move "shortest path", which ignores the terrain - they will bump into walls.
- Advanced movement - a must. Enemies can take more than 1 turn to move.
- Bosses - a must. At least one boss monster. Initially, will have more health, higher damage.
- Aggro range - optional. Enemies will not try to move at you if you are outside of their range. This may be triggered by entering rooms (if you enter room A, all enemies in room A will become hostile and move at you). Leaving rooms will not make them stop pursuing you.
- Enemy difference - optional. Enemies with different health and attack values. And looks.
NOTE: These "optional" points are what I believe I can finish, however they are not in the "minimum to-do" scope. Obviously, I could expand the list almost indefinitely of the "what I could do if I had infinite time".
Tools
- Unreal Engine 4 - programming and everything
- Blender (?) - 3D modelling
- Paint.NET - drawing, since I don't like Photoshop.
Milestone 1 (08.03)
- Read Unreal Engine 4 manuals and other materials about 2.5D in the said engine.
- Make some sketches to find the best main character design.
- Look into how (if possible) to animate sprites in UE4.
- (optional) Start with setting up the project. (Depends on how task 1 goes)
Estimated time - 7-10 hours
Milestone 1 results/report
- Read/watched through several UE4 tutorials (Youtube, Epic Games Forums, other forums). Gained general understanding of how to do the project start.
- Downloaded a bunch of demo projects that describe how tile-based movement works in UE4.
- Found several free assets and made 2 test sprites for characters (main character and enemy). Original idea came from Overlord. Comparison images are below. Final decision - will try to use my own sprites as much as possible, however, for environment and such will try to look for free sprites if possible.
late addition, derpy skeleton:
Used references:
- Top Down Grid-Based Movement Prototype
- Unreal Engine Forums - Unit movement
- Unreal Engine 4 Tutorial: Randomly Generated Levels by shaunbanshee
- Unreal Engine Answers - Ways to generate tiled map/grid data?
- Unreal Engine Forums - Tile-based-movement
- Paper 2D #1 - Tilemaps - Unreal Engine 4 by Game Dev Renn
- Unreal Engine Forums - Map Generator 2.0 Please Critique! by Zeustiak
Milestone 2 (22.03)
- Integrate tile-based movement with keyboard control.
- Turn the two sprites into 3d models
- Sketch the "dungeon map".
- (optional) Integrate the map into the project.
Milestone 2 results/report
Demo video:
- Player can move using WASD keys.
- Implemented regeneratable grid with specifiable size.
- Implemented 3 tile types - wall (impassable), ground (passable), ice (player slides in the same direction).
- Made the dungeon sketch and started implementing it in the project game. I settled on using donjon's dungeon layout generator
- Finished main character 3d model
Milestone 3 (05.04)
- Implement Trigger tiles (traps).
- Implement 1 item.
- Fix rotation issues for player (rotates in 4 directions, only needed 2).
- Implement drawn map.
- (optional) implement SOME sort of animations.
Milestone 3 results/report
- Currently the trap tile works simply - if stepped on, the actor is destroyed.
- Added a torch item. It can be toggled if necessary. Torch toggling will be removed later, but "toggling" items is a feature that will be used for other items, thus it was kept as a proof of concept.
- Actor can visually rotate only in two directions - up and down (though the image looks like left and right due to the actor position face towards the player).
- Map was implemented.
I also added a bunch of helper scripts and tried to optimise the blueprints as much as possible. This led to an issue with player being able to glitch "sliding" (movement on ice tiles), now resolved.
I experimented on how to implement torches. Initially I made a "torch tile", which was intended to work as a "pick-up" place that would act as a regular tile if triggered. Issue was, I wanted to be able to "add" items on any tile in the game. Making so many variations proved to be useless and ineffective. Current solution utilizes "attaching" an item to a tile. Thus, if the item pickup event is triggered, that item is simply detached from the tile and tile acts as a regular tile.
Milestone 4 (12.04)
Since the task milestone timeline is only 1 week, I am allocating a bit less tasks for this one:
- Implement healing item
- Implement one usable item (since a torch should not be toggle-able).
- Review existing code for potential improvements.
- (optional) Make at least one enemy model for milestone 5.
Milestone 4 results/report
- Implemented player stats - Health, Max Health, Attack and Defense Parameters.
- There exist healing items, can be used by a button press. Currently can "overheal" - increase player's maximum HP if healing goes over his max HP.
- Light is now bound by "emission" value of player. Allows tile-based light system.
- Player can only carry 2 items. If third item is picked up, player drops the "oldest" item.
- As such, 3 item type presets - "affect on pickup", useable (pots), equippables (will be torches, armor and such)
- Items now have uses - player can use an item as long as its number of uses does not fall to zero. If value is -1 - infinite item.
I spent most of the week studying Dynamic Material Instances. Took a while to implement. Dynamic materials allow value changes on the run, allowing me to make all the tiles "unlit" (not affected by any light). Resulting sample attached below. I also went too far and started pulling out game logic from the player to a separate actor... Kinda messed up a lot of stuff, I think - having framerate issues, might have to look at event dispatchers.
"Light" example. Tiles around the player are lit, but the other are dimmed as they are "invisible".
Player stats template. Current Health is stored on the actor, since this allows more flexibility (i think)
Milestone 5 (03.05)
- Finally implement 2 enemy models (skeleton and boss)
- Finish the implementation of turn processing
- Implement enemy AI
- (optional) traps, animations, and anything else that comes to mind
Milestone 5 results/report
- I further refactored the code to make it more asynchronous. Now most of game logic happens "independently". Additionally, made minor opitimizations - i.e. changed some calculation logic to Math Expressions, which allows using more complex math.
- Made Enemy logic code. It is triggered by game turn processor. It is really simple - it checks the distance from each of the 4 potential directions to the player tile, then tries to move there. If the "shortest distance" is through a wall, it just bumps into a wall and does nothing. No interaction with the player yet.
- Implemented both models for Enemies.
- Added health bar for potential UI.
Known bugs:
- Some weird issues with NPC rotation, not sure why they appear.
- NPC has it's own turn processing on ice (fixed)
Sources:
- Event Dispatchers - HTF do I? Event Dispatchers in Unreal Engine 4
- Event Dispatchers - Unreal Engine Forums - Event Dispatchers explained - Finally!
- Math Expression nodes - WTF Is? Math Expression Node in Unreal Engine 4
Images
Skeleton
Boss
Milestone 6 (17.05)
- Fix boss enemy materials and implement into the game
- Introduce a bomb (explodes in a + pattern)
- Introduce "interaction" between NPCs and player.
- Anything else that comes to mind, since this should round up all goals.
Milestone 6 results/report
- Boss works.
- "Collision" implemented
- Player-NPC and NPC-NPC interactions implemented
- Bomb
- Introduced a UI to display player HP.
- Added models for potions, bombs
- Fixed torches to just increase view distance.
For some reason, my game controller is called twice per turn (still don't know why). Therefore, bomb damage events are not called.
Project Expo (24.05)
- Fix bombs, if it is even possible...
- Fix Enemy health bars
- Upload Repo link (?)
- Upload compiled project
- Make a video