Författararkiv: semihparlayan

#8 Big Game Project | Final polish

Hello again, there is not much to write about because the final week consisted of polishing what was already there and removing alot of bugs.

  • I did some changes to the UI so that our spell icons where visible at all times.
  • I fixed a bug where our magnet worked inside the editor but not in a standalone build.
  • I made it so that our day and night manager also changed the ambient light on top of switching color on our directional lights.
  • I linked up a simple mainmenu scene with our game so that we could restart the game when neccessary.

And alot of more small fixes…


#7 Big Game Project | Diversity & Notification system

Hello again!

This week we have been working feedback and bugfixes, this will probably be the same case next week.

When I wasn’t removing bugs or corrections i was among other things working with implementing diversity. Our settlers can now randomize between women and male meshes,  randomize skin color and r
andomize color of their clothes. The system i created also matches a portrait with the gender and skincolor. This portrait is display in the popup panels showed in previous blog posts. Here is how it looks ingame:

Diversity

 


 

I’ve also been working on a notification system, this system will display a popup panel that slides in from the top. This panel can either be static or dynamic, meaning that it will be shown for a certain amount of time and then be removed automatically or it can be static which means that it will have to be removed manually. This is a pretty basic system that I would like to work more on because as it is now it can only display text. I would like to implement the ability to show whatever UI i decide, maybe I want to display sliders or something 😀

Here is how it looks, it slides out underneath the food supply:

Notifications


#6 Big Game Project | Abilities and loadout

Hello again!

During the past week I have mainly been working on abilities and a loadout building, I have also been tinkering with some smaller stuff like particle effects when shooting, cutting wood/stone.

In order to create the abilities in our game I had to redo our weapon system. Previously a settler was only assigned a role, either melee or ranged. And there was a set value of damage and range depending on which role. Now I have created a weapon system so that each weapon can be unique with range, damage, attack speed etc. Because our equipment in the game was not only weapon I counted everything as an Item and all the weapons were just an extension from that. Each item has an ability that can be activated. An example is our sledge hammer, it has an ability to slam the ground knocking back and damaging enemies.
So this week I’ve added abilities and functionality to four different weapons, machete which has a whirlwind, sledge hammer which has a ground slam, musket which has a cone shot of fire and lastly a mortar which fires a rain of large cannon bullets.
I’ve also added abilities to three different items. Our backpack which has a speed boost, our armor which gives the ability to taunt enemies in an area and our medpack which can heal a group of settlers.

You can activate an ability by targeting a settler and clicking his item in his inventory, when the ability is selected an area of effect where the ability will happen appears, the player can then aim and click one more time to execute the ability.

In order to equip different weapons and items we created a loadout building, this building is where the player enters to change which equipment a settler has before visiting the dangerous jungle.

 

Picture of me targeting the whirlwind ability, in the lower left i have chosen Märtas ability by clicking the machete icon above her portrait. The loadout building is also shown on the left.Ability.png


#5 Big Game Project |

This week has been all over the place. I’ve been working on alot of small things such as new HP bars for all entities. Only displaying the HP bars when necessary i.e settlers hp bar down in the jungle should not be displayed when the camera is above. I also added a simple lever so that the player can order the elevator to go up and down. There is one lever placed down in the jungle and one on top of the island.

I’ve also implemented a magnet to our settlers. The magnets purpose is to ease the process of collecting resources. Example: When a settler hits wood with his axe, the logs comes flying out and land on the ground. Instead of having the player pick each one up individually we have this magnet so that the settler can just run close to the resources on the ground. It works like a vacuum cleaner.

I’ve implemented flying resources to our UI. When a settler picks up resources via the magenet 2D sprites of the resources flies from the settlers position to the settlers inventory. This also happens when a settlers deposits resources to their base storage. The resources fly from the inventory to the storage inventory.

I’ve also added alert notifications when a settler gets damaged so that you are aware if a settler gets damaged if its not on your screen. I’ve also added some small hotkeys such as
SHIFT + Leftclick to select multiple settlers.

Lastly, I’ve implemented a new GUI compared to the last one. The biggest difference is that all the settlers in your colony are visible at all times. Each settler is displayed with a name. If a settler is selected more info will be displayed about the settler such as HP, inventory and equipment.

 


#4 Big Game Project | Refine System, Skill tree and building GUI

Hello again!
This week I’ve worked on alot of different stuff such as:

  • Canvas healthbars
  • Refining system
  • Implemented new building models
  • A turnip farm
  • A skill tree + GUI for it
  • Building GUI

Among theese the more complex ones were the refine system and skill tree.

Refine System

The refine system converts a raw resources into a refined one.
Examples:
Log -> Planks
Iron ore -> Iron Ingots
Stone -> Bricks

The settlers in our game can refine the raw resources in different buildings such as sawmill, masonry and smeltery. These buildings all work with the same mechanic. You assign a settler to work in that building. After a set amount of time the action is complete and the refined resources are recieved. The settler then needs to be reasigned in order to refine more resources.

Skill Tree

Each settler has three different skilltrees, combat, gathering and medic. Each settler will have a set amount of skillpoints to spend between theese three skill trees so the player can choose to be mediocre at all skill trees or specialize in one. I set up the skill tree inside of Unity and connected each button to certain skills. There were passive skills such as movementspeed, attack damage and carry capacity but there were also more specialized skills that was more specific to that tree.

 

Here is a picture of the game with building GUI and healthbars.BuildingGUI_Healthbars.png


#3 Big Game Project | Construction & Loadout

I’ve continued on the project since last time and this is what I have done:

Construction

I have made it so our settlers can place and construct different buildings. For now there is only one house available but there is functionallity for multiple houses.
In order to build a house the player will need to have a certain amount of resources and when the building is placed the player can order a worker to construct it. This is how i looks:

constructionsite.png

 

Gear/loadout selection

When our settlers enter the elevator to visit the dangerous jungle they get to chose which weapons and armor to wear. They can choose one out of three different things to have equiped in their hands (Tools, Sword, Musket) and the same goes for the armor (Backpack, Med-kit, Body armor). These will decide how the settlers are played. A settler with tools equiped cannot attack enemies and vice versa with weapons to gather.

The gear selection panel still has alot of placeholder art and may change in design but this is how it looks right now:gearselection.png

Each settler is displayed with their name and can choose which gear and weapon to equip before sending down the elevator to the jungle.

I’ve also done some small fixes here and there and put together a prototype with my team members this week.


#1-2 Big Game Project | Behaviour Trees vs Finite Statemachines

So I’ve started a new game project, the game is developed during the course Big Game Project at my university and I’m developing the game together with five other team members.

The first week started off with us creating a backlog and setting up a new Unity 5.0 project and linking it to a new repository. We decided what we wanted to prototype first and came to realize that in order to prototype anything we would need to implement behaviour trees in our game.
Our game is played similar to an RTS. You select settlers and order them to do different stuff such as gathering or combat. I thought that in order to test these actions we had to implement the behaviour trees first. We could have a combat behaviour, a gathering behaviour and more. After implementing a basic version of behaviour trees and testing it out I realized that behaviour trees maybe wasn’t the right choice for us. Behaviour trees are more or less a complex AI. This is not really what we want because we are constantly ordering our settlers what to do, they don’t really have to think for themselves.

After some discussion we came to the conclusion that what we needed in our game was finite statemachines. It felt like I had wasted too much time on behaviour trees to just let them. I took the day after our discussion to implement statemachines, I redid what we currently had in behaviour tree form to statemachine form.

Now that we have finite statemachines instead it feels like the right choice, we can implement some features more simply and I think this will save us some time in the future.

At the end of week two we had a working prototype which included gathering, combat and some environment. We did a small playtest and tried to figure out what to change and complete for week three which i will write about next week.

 


Game Development – Nr.6 | Magic Writer

Hello everyone!

This weeks post will be related to the last post. The last post was about me creating a power up bar that loads up and lights power up icons when they are ready to use.

Since last time we have redesigned the power up bar. The last example was draw by me (programmer art) and was not very pleasant to look at. We want to avoid static HUD as much as we can, this means that we do not want to incorporate for example a HUD frame that show the current score or a HUD bar that show when power ups and their cooldown on them. We want to display these things in a way that we can show inside the game world. As an example we show the current score that the player has written into the sand. So we redesigned the old power up bar, it is now shown by having small buoys connected on a rope that goes out into the water. We have two of these ropes in the game. One on each side of the screen, the left one represents the power up bar and the right one represents health points.

background

This is how it looks right now

The white buoys represents how much the power up bar is loaded. As you can see it is half way to reaching the top. It has passed the first power up icon and it is shown by making the icon light up, the second and third is still darkened out. To show the player how to use the power up we have bigger buoys next to each icon which represents which key the player is supposed to press. The bigger buoys will switch from red to green when they are ready to use, showing even more that the player can press the numbers shown on the buoys to activate the power up.

By representing the HUD inside of the game as props i think it makes the game look a lot better and cleaner. We can get rid of these sticky HUD bars and numbers but there is also a risk with doing it this way. The player may think that the props are just that…. props. I think it is important to have them dynamic, constantly changing to make the player understand the meaning of them. Both the power up bar, the bigger buoys and score in the sand is constantly changing.


Game Development – Nr.5 | Magic Writer

Hello everyone!

This week i have continued working on the previous project Magic Writer. This week has mostly been about polishing everything in the game. There is not many new mechanics to implement anymore so i have been working a little bit on everything. I will talk about the ”biggest” artifact of this week even though I have mostly been working on small artifacts/polishing.


The power up bar

The main purpose of this power up bar is to give a visual representation of when the player can use a power up. It works by having a bar constantly grow upwards and eventually reaching different steps on the way. The power up bar is divided into three sections which each have a step marked on the bar. Each section represents a power up and when the bar reaches the sections step the power up can be used by the player. Each time a player enters a word without mistyping, the bar will increase even more. When a power up is ready to be activated an icon next to the bar lights up to show the player that the power up is ready to be used. Each icon displays what the power up will when used. Because the power up bar increases and reaches three steps on the way we had to sort the three power ups in order of which one is the best. We decided that the pierce power up was the less powerful and that the freeze power up was the most powerful. So the first step in the bar is connected with pierce, the second step is connected to the bounce power up and the third step is connected to the freeze power up. This gives the player different options when choosing to activate a power up. He could maybe be able to activate the first power up but choose to wait until the second one is ready to be used. This creates a much more interesting mechanic than to just have each power up on a separate cooldown,

This is a picture displaying each step and their icons, the numbers show what key is used to activate a power up. This is not the final art for the power up bar, the icons are complete but the bar and frame will be changed.

Featured image

When a power up is activated the amount of cost is removed from the bar. Example: If the player would use number one in above case, the bar would remove the one ”step” from the bar.


Game Development – Nr.4 | Magic Writer

HighscoreManager

This week i have been working on updating a previous version of our high score system. The first version of the system worked in three steps. The first step was to load a .txt file and read different scores such as ”1000” etc. The second step was to sort all of the scores with the highest score first. The third step was to add a new high score and check if the new score mad e it to the high score list.

The new system works similar but with some different results.


The new system works by connecting a score to a name. By having a struct called ScoreEntry i could easily connect a name and a score. This is how the struct looks like:

struct ScoreEntry
{
      //Stores the users name
      std::string name;

      //Stores the users score
      int score;

      //Returns a string that connects the name and score as one string
       std::string GetText()
       {
            return (name + " " + std::to_string(score));
       }
};

So the highscore works by having a vector (a list) that holds X number of these ScoreEntry structs. The first element in the vector is equal to the player with highest score. By having them sorted in the vector it gets easier to draw all the user scores in score order later on.


Loading the highscores
When the game starts the old high scores are loaded by opening a .txt file where the previous scores are saved. Then i read a name and a score from the file and connecting them by creating a ScoreEntry struct and then adding he struct to the vector which holds all the other entries.

 while (!file.eof())
 {
      ScoreEntry entry;
      file >> entry.name;
      file >> entry.score;

      m_entries.push_back(entry);
 }

Adding a new high score
When adding a new high score i check each existing high score in the vector and compare the new score with the score in the loop. If the new score is greater than the current one in the loop i add the new entry at that index in the vector which results in pushing each other index down in the list. What this means is that the score sorts itself when adding a new score. I don’t have to sort the whole vector using bubblesorting or something similar.

This is a short example of how this works…. (Not the full code for writing)

 for (int i = 0; i < m_entries.size(); i++)
 {
      //Compare new entries score and the old ones
      if (entry.score > m_entries[i].score)
      {
           //Add new score one step above the last score
           m_entries.insert(m_entries.begin() + i, entry);
      }

      //Write entry to file
      file << m_entries[i].name;
      file << " " << m_entries[i].score;
 }

Displaying the scores
As i said before, the list automatically sorts itself. So when i loop through all the entries i can easily just draw them in their index order to draw the with the highest score at place 1 and the next one on place 2 and so on.
I use the index as the number of which the player is on the highscore list. The user at index 0 will have a ”1.” next to its name and so on…
Example: ”1. David 5731”

 for (int i = 0; i < m_entries.size(); i++)
 {
      m_text.setString(std::to_string(i + 1) + ". " + m_entries[i].GetText());
      m_text.setPosition(m_position.x, m_position.y + i * 45);

      drawManager->Draw(m_text, sf::RenderStates::Default);
 }

The result is this

highscore