Moon Nighter

This is a game about a little man that runs a magic shop. In order to up his stocks he has to traverse a dungeon with dangerous enemies that drop magical items. These can either be sold inside of the shop or you can try to combine some of them in order to get even better items.

I was one of the two programmer in this project. The things I were responsible for included the shop, inventory, dungeon generation and the enemies.

Dialogue System

Base dialogue system

The Tutorial is dividable in 2 parts, the UI dialogue, and the skull that is the one speaking.

The skull is mostly just a visual part to make the tutorial more interesting. The skull follows a point that is rotating around the player.
The skull has talking animations that will play on the right moment, and a sound clip will be played as well. After the tutorial, the skull will be sitting on a pedestal and you can interact with him to buy upgrades for your character.

The dialogue system plays trough a list that is in a scriptable object(more information about the scriptable object under this section).
The sentence will be split up in every character and plays trough it before displaying the full sentence.

There is also a list of unityEvents in case the dialogue needs to do something special for example: zooming in on a specific point.
The scriptable object will have the information about what event will be played

Dialogue scriptableObject

The dialogue information is made out of a constructor with a list of constructors.

The constructor has information about what the message is as well if the skull animation is over-exaggerated or not. it also has the information about how many rounds of sound clips it should play an the amount of animations, this is there in case it is a long sentence or not.

It also has 2 lists of ints of actions it should perform. 1 for the beginning of the sentence and 1 for the end of the sentence. the base script has information about what action it should perform. So for example, you want to zoom in on a specific point in the scene, the base script has the script of the action that should be performed. When the dialogue system is reading the scriptable object it will also do a check through all the actions and perform them

 

Marketing System

The market system consists of being able to place items on a table, a buyer ai that will take a look at the items and maybe buy them and to be able to do something with your earned money.

I started with the buyer ai that would interact with a placeholder table, you can give every buyer different stats that include the chance that they will look at an item, the chance to buy it, and the amount of time it will stay in the shop, when they spawn they will get a random characteristics profile. There is an area marked in the middle of the store where the buyers will idle, and check what their next action will be. If they are going to look at something they will walk to an item placed on a table, and then there is a chance he will buy it (if the price isn’t too high). When they are going to buy it they will walk to the cash register and buy the item, a particle will spawn and money will be added to your balance.

To make the table functional I needed to use the inventory system made by Jorrit Kornelis tweaked his script a bit to be able to check the last slot that was clicked. when interacting with a table the camera will zoom in on the table and the sells slots on the table will become interactable. when interacting with a pillow a UI panel will be opened and you will be able to put in the item and set the price.

When an item is picked up by a buyer the will keep the information about what item it has, and the price it was when he picked it up.

When he sells it the money will be added to your currency in your manager.

Dungeon Generation

When you load up the dungeon scene the room generation will generate a random layout. The dungeon generation has an amount of room it needs to generate. It has an amount given with him that will continue going in random directions, to make sure it doesn’t create a straight line it will select a random room and continue generating rooms from that point.

When a room is generated it will have a random room information selected from a list of possible options.

Inside of the room information is the information about the holes in the floor, the decorations of the room, the enemies inside of the room and the items that are spawned on the ground.

The floor is made up of planes. When the holes are created, it will delete all the tiles that are in the given hole areas. the decorations are spawned and are given the rotations that given with it.

the enemies will also spawn on their given locations, every room has a boolean for if it has been cleared or not, when all the enemies are killed you are allowed to leave the room and the room will be set to cleared and the enemies will not spawn.

XML Save Data

I made the base saving script to save the items you have in your inventory, the upgrades you have unlocked and to keep track of the tutorials you’ve had, The script has been changed by both me and Jorrit Kornelis to add certain information to the database.

changing the information inside of the database and getting the information out of is done by the scripts that need the information, this script is just for saving the information.