This video demonstration highlights key mechanics and gameplay of our end of 2nd year group project: Iron Realms.
Showing posts with label James Brooks. Show all posts
Showing posts with label James Brooks. Show all posts
Tuesday, 10 May 2016
Tuesday, 19 April 2016
Inventory System Progress
Over a period of a month and a half I attempted to create an inventory system. It would work by instantiating GUI prefabs, most of which were buttons and I would be able to click and place images, which would have the item information stored in code and when placed within GUI slots the associated item would be instantiated on the player (if it were an item like a weapon) or stored in a menu that the player could access.
(Figure 1.)
I had errors with this for such a long time because I couldn't figure out how to properly store different item information, make them relevant and instantiate the game object within the scene. The furthest I got with the system can be seen in Figure 1.
I managed to store info on the dice within Figure 1, but I then struggled to figure out how to click and place items A. between menus, to transfer over to the player's inventory. B. between different item slots.
I managed to make basic statistics for the dice items but the amount of time it had taken to reach the culmination of Figure 1. (the culmination of the 1 and a half month time period I spent on this) had taken me too long to believe that I could complete the inventory system.
To improve for the further I believe I could implement a system to check if a slot is filled, and within an if statement I could call a stored game object within the code and make the set active boolean value to true to bring the item into the scene and be intractable by the player. Any statistics this item may affect within the game I would be able to interact with and manipulate like I did within my Level Up script to improve the player's HP and Damage Output.
Camera Controls
The idea with the camera controls would be that the main camera would have a target to track and the camera would be able to rotate around the position of said target should the player click and hold the Right Mouse Button (RMB). It would do this with a line of code transform.RotateAround with the position being set as the target. To allow this action to be smooth, rather than allow the camera to jump between positions, I multiplied the speed of the camera rotation by Time.DeltaTime.
Player UI and Enemy UI
We wanted the UI for the player to be represented both by text and a bar that would decrease and increase.
In the code, in Prem's Health Manager script, I added a field to place the health bar and stamina bar. Using a float and calling the local scale of the GUI image game object I was able to reduce the width of the game object on the local scale proportionate to the amount of health and stamina the player currently has. This will also increase should the player recover HP and/or stamina.
(Figure 1.)
The buttons on the main menu all act as on and off switches. To create the main menu system I created all the GUI buttons and input fields we would need to progress the main menu. On Click() the button pressed would set active (true or false) the boolean value of the game object attached depending on the context of the button. For example with the New Game button it switches on the text fields and input fields for the character creation work, the Back and Start Game buttons and switches off the exit game button; clicking on the Start Game button activates a script which loads the game level using the name space using UnityEngine.SceneManager; and then typing into the appropriate function Application.LoadLevel and then the appropriate level within () brackets.
Prem added to the character creation system the ability to store and save the text inputed into the character name and bio text fields which could be stored and accessed later onion the game proper and be displayed on the character sheet option, seen in Figure 1.
Level-Up Mechanic
We wanted to amp up the gameplay within our game by including a level up system.
Changes to the game objects related to the player character, so from D6 to D8 is done through if statements. I create public game objects and assign the appropriate models to the variables. In the if statement, when the appropriate level is current the game objects contextual to the level will have their set active booleans set to true and false. For example at level 2 the D6 that the player starts with is turned off and the D8 is turned on and within the if statement the max dice roll value increases from 6 to 8.
All changes within the code work within if statements. I have access to the combat manager script and the health manager script made by Prem and with those references I can call the damage output for the Heavy and Light attack options, the max and current health values of the player and the random.range values to change the max dice roll value. Every level the base attack values of Heavy Attack and Light Attack (which start as 5 and 2 respectively) increase by 1 and 2 respectively.
I also attempted to add perks within our game, the only perk I managed to implement was a health regeneration perk. Using if statements, from level 5 onward the player will regenerate hp over time, essentially every second. We realise that this may break the game in terms of balancing but we have rationalised that this being a vertical slice/demo we will allow the player this imbalance. For a full game release would limit this to only regenerate a set amount of hp every turn in combat.
above is where I have edited Prem's script to add the max dice roll value. This allowed me to change the int value of the max dice roll variable when I called it in my if statements in the level up script.
Character Creation/Main Menu
The updated/finalised main menu/character creation system made use of buttons which, when clicked would access assigned game objects and turn the boolean value of being set active either to false or true; contextually to what the button does. For example the New Game button turns off the New Game and the Exit Game buttons, whilst turning on the Back and Start Game buttons and subsequently the input fields for the player to input a name and bio for their character.
The information written within the input field is saved and stored within a save manager script made by Prem. This is accessed later and the text stored is presented on the character sheet GUI within the game.
(Save Manager Script; Credit: Prem)
Monday, 18 April 2016
Mini-Map
As Iron Realms is an RPG we felt it important to include mechanics that liken our game to an RPG. One such mechanic is the use of a Mini-Map.
The way I chose to make the Mini-Map was rather simple. I made a secondary camera within the scene and placed it directly above the player. Within the script which accompanied this new camera I simply made a public Transform target, which would be set as the player game model. Then the line of code I made within the LateUpdate function would move the camera: transform.position. And move the camera to the x, y, z coordinates of the target, which was the player. As this was in the Update function the Mini-Map would constantly follow the player as they moved, providing a real time Mini-Map.
Subscribe to:
Posts (Atom)

















































