Dungeon crawler / hack'n'slash
In our sixth game project at The Game Assembly we were told to make a dungeon crawler game with Diablo 3 as our reference game. During our previous project most of the time went into building a engine from scratch so we were only able to make the basics for our engine such as loading in models, play sounds, PBE. During this project "Spite" we decided to focus on the engine and make it a script focused engine which caused our game to suffer a bit but it was worth it in the end.
My mindset going into this project was that I want to learn as much as I can. Because of this I took the duty of implementing a third party animation code and merge it with our engine.
When I finally got animations to work with our engine I decided that I needed to make script nodes for it. I did this because our game was going to be 100% scripted except the menus as they were a safe layer for fixing scripts when they are crashing.
The picture above shows the "play animation node". It takes a ID of a mesh component and plays a animation which is picked from our indexpicker. You can also choose the speed of the blend that this animation will have.
Next I decided to add callbacks so our animators can choose which frame of a animation will trigger other nodes. This was done by having the animators add bones to their animations called event_name and make the bone move on the frame they want to trigger the event. When we load the animations it will loop through the bones and see if there is a bone which starts with "event" and add that to a vector of std::functions. While looping through the bones we also add the events to our indexpicker. This way of handling events was a hassle for our animators so I changed it in the beginning of the next project, our FPS.
I was in charge of audio as well. I had implemented FMOD in our previous project and now I had to adapt it to the new systems we were using. I made audio components so we could let the component system handle the audio instead of just calling it directly from the audiosystem. I had to make it so that the audio system wouldn't compile if a macro called "USEAUDIO" was set to false. In order to do this I used a postmaster that we use to send messages such as play sound or stop sound.
Above is a image of our AudioManager and a struct for audioinstance.
4. Menus and UI
I made the functionality for the menus. It was made using components such as button component and a switch button component which was a button with to states, for example, on and off. I exposed every buttons coordinates and pictures in a json file for the graphical artists. The artists could add as many pictures as they wanted and it would loop through all of them and add them to the menu. There was also functionality for parallax but there wasn't enough time to add it.
Above is a gif of our main menu and its diffrent tabs.
Above is a image of the json file for the mainmenu.