1 min
Crusade progress
This is the final game of the yera to be made in the ASGE C++ framework and is the second to be done as part of a group. The difference with this one is that it requires the use of a networking library to allow two different clients to play together in a turn based combat game using a server to send data between the clients. We started off by planning what sort of game we wanted to make and decided to go with an old fashioned turn-based game whereby for each player, they can use one move for all of their five characters before ending their turn. The game mixes the turn based combat with a sort of chess-like gameplay in the way that different characters have movement / attack ranges which are all different sizes. This means that some characters can hit enemies from further away, and others will have to be much closer to their target. As the game is two-player, the data from characters moving and attacking has to be sent between the two clients for them to locally display what has happened.
My progress My own work on this project was more towards the setup of the game board components and the actual gameplay of how all of the states would work together when different click combinations have been made. This
1 min
Birdman progress
This is the third game to be made in the ASGE framework. The task is to make a game as a group project, based on the movie Birdman. Over the last several weeks, our group has made some good progress on the game and we are now into the final week of development before hand in. The game we are making is a stealth based game in which the player must navigate their way across a map without being seen in the nude by citizens. Along the way to the end of the level, the player must pick up his clothes before reaching the end.
My progress
My work has consisted of developing the environment for the game. As we want a randomly generated environment with buildings and other obstacles placed, it has required quite a bit of work to get working. I currently have the environment generating set up for the obstacles, and now just need to set up the probability settings for spawning the right amount of obstacles. On top of that, I am currently working with another team memeber to try and properly implement the AI into the environment so that it has all of it’s collision detection working and so it can correctly find a path to the player’s position.
1 min
Since the last update, we have now been working on the game to improve the theme and re-design some of the components we need to change. The first thing we decided on was a new theme as we had been told that selling alcohol on the black market was too non-realistic for the specification. We brainstormed some different ideas from looking at recent news articles and trying to think of something interesting. One of the suggestions I came up with was the idea of the deeb web. This is something that has always been interesting to me and I wondered if it is something that we could make work. After discussing this theme and how the game mechanics would work, we decided that it would require changing a lot of the game mechanics to properly implement. So we went back to thinking of another theme. After some more ideas were thrown about, we eventually settled on the idea of political independence. This is because when browsing news sites, we noticed there always seems to be articles nowadays talking about some independence referendum whether it be Brexit or the recent state of Catalonia declaring it’s independence from the rest of Spain. These are always controversial and well talked about issues that are constantly in the media, so we thought it would be a good theme to stick with. After we settled on this, we then made a list of the different game mechanics we currently had and decided with each one, A if we could make it fit with the new theme, and B how we would have to change the mechanic for it to make sense in the context of the theme.
One of the mechanics we decided to get rid of was negotiations. The reasoning for this is that we just felt it wasn’t an interesting a component as some of the others, as well as the fact that it didn’t really fit with a theme of independence. Even though we got rid of negotiations, we kept the way in which they worked in the game. So the new action cards that the players have will have two components to them. They have an action that can be used to effect the gameplay and they also have an alternate ‘attack’ action that can be used instead in order to knock somebody else’s score down.
Another mechanic we got rid of was Auctioning. So in Black Liquid, auctioning was used for upgrading the equipment of the player so that you could increase how much profit you make for selling alcohol each turn. We thought with the context of political independence, this wouldn’t really work the way we intended, so decided to get rid of this and stick to the other many mechanics we still had left over.
After settling on which mechanics we were going to keep, we then just started adapting them over time, through several tests of how they would all work. For example, there are a few action cards that were being used in the earlier tests of the game, which we later decided to get rid of due to them not having much of an effect on the gameplay. We also had to decide how many of different action cards we were going to have. We settled in the end of having four of the same action cards. This way there was one to fit with each different policy type in the game. One of the other things we decided when making the cards was how the attack value would be worked out for each of the cards. We eventually decided that the more valuable the action of the card was, the higher attack value you could use it for on another player. This then means that players may save their good card so rather than using it for the action, they can save it to use as a big attack on another player later on in the game.
1 min
Endless Runner First Brainstorming
This is the second game to be made in the ASGE framework. Much like the snake game, it will require different classes for controlling the different aspects of the gameplay. I did a good job in Snake of managing to spread out the game into several classes. The problem I had was trying to get access to the renderer where needed. However, after completing Snake, I am now aware of how to get around this issue.
The endless runner is going to be quite different in how it works. I need to understand Procedural Level Generation and how to have it run throughout the gameplay. This makes me think that there will be a class dedicated to generating the environment. This will have to constantly run whilst the game is playing so that there continues to be more environment to play in. The generation of the environment will happen randomly off of the screen space, and as it is made, will then be moved into the window view. So it starts the generation off-screen and moves it to where it can be seen.
Gameplay I think for the runner I am going to have a classic running to the right style gameplay, but with some interesting additions to the gameplay, as mentioned below. The movement in the game will be automatic and the player will likely control only the ability to jump over obstacles in the way. There will be collectables to grab and the score will consist of the distance travelled with bonuses from the collectables.
Vectors
Unlike with previous projects, I have now started learning about the use of Vectors instead of dynamic arrays. Vectors are really great becuase they handle the memory management of your software for you. This means that I don’t have to worry about using new and delete so much, which will be a great help. Vectors work in the same way as dynamic arrays, just without the user controlled memory management. They also have their own built in functions that allow you to place elements into the array and resize whenever needed, as opposed to normal arrays that have a fixed size and need to be reinstantiated when resized. This should make it much easier to control what is happening for any places where I need an array.
Possible Game Additions
Different types of obstacles, powers that can affect the game
First work As you can see from the above image, I have come up with a basic idea of how the environment generation will work. There will be a variable holding the current height of the floor piece. When spawning a new column of environment, it will use this value and randomly choose which type of piece to use from an enum class holding environment values. Once it has chosen, if it is an incline or decline piece, then it will adjust the floor_height variable accordingly. It then needs to fill the space between this value and the ceiling with blanks or obstacles. After it has filled in the column, it will then move the environment into the displayed area.
1 min
Vectors are sequence containers that represent an array which can change its size. Vectors use contiguous storage locations for their elements. Unlike arrays, they can change their size dynamically with their storage handled automatically by the container. Vectors do not reallocate the array each time an element is added to the container. Instead, they allocate extra storage to accommodate for any possible growth. Therefore they can have a capacity greater than the storage strictly needed to contain its elements. Compared to arrays, vectors consume more memory in exchange for the ability to automatically manage storage and grow dynamically in an efficient manner. Containers use different iterators for deciding how to navigate the array.
Because we want to be able to use memory dynamically but not have to worry about accidentally creating leaks in memory.
#inclue <vector>
int size = 10;
std::vector<int> vector_array(size); //make room for ten ints and initialise them
for (int i =0; i<size; i++)
{
array[i] = i;
}
When declaring a vector, you put the type inside <> and you can put a default size in the () following the name of the vector.
begin = Return iterator to beginning, end = Return iterator to end
size = Return size, max_size = Return maximum size, resize = Change size, capacity = Return size of allocated storage capacity, empty = Test whether vector is empty, reserve = Request a change in capacity
assign = Assign vector content, push_back = Add element at the end, pop_back = Delete last element, insert = Insert elements, erase = Erase elements, swap = Swap content, clear = Clear content
1 min
I have recently begun work on my Level Design assignment, which requires me to design a full playable platformer level. There are different requirements for this, including having different upgrade abilities spread throughout the course of the level. As such, I have designed some images for what these pickups might look like in the level. This is for part of the level design document I am currently working on.
The first image here is the powerup of double jump. You will find on the page details of how the pickup will look as weel as the design for the pickup icon.
The next powerup is a melee weapon that will allow the player to break weaker obstalces in the level. This will help them to reach the end.
The following two images feature details on how the gun will work which will allow the player to both push objects away, and pull them towards themselves.
The final picture here is some details on the context of the level.
1 min
The first portfolio game, “Snake” has now been completed. I am quite happy with the end result of this project, although it didn’t go as well as I had expected. The main problems experienced with this came from the fact that it was a new framework that I hadn’t used before. Planning out the project was going quite well, and I didn’t receive too many problems until later on into development, after I’d already set up most of the structure of how the code was going to work. However, after I’d implemented the code for creating the board and some other bits of setup, I wanted to try get something displaying before I moved onto the gameplay aspects of the snake moving. This is where I fell behind with the project. I wanted to try and have the rendering working in the individual classes of code, to make it more object oriented. But it took a long time to discover how to access the renderer in files that weren’t the core source file. By the time I managed to find how to do it, through looking at the other project “DungeonDeath”, I didn’t have much time left to finish the game. This meant that in the end I didn’t manage to fully implement everything I wanted to. I had the game running and working before I tried to implement a menu system that would allow the player to change settings, have a game over screen etc. This was going to use different game states that would set up the scenes based on what state you were in. I added in all of the code for this, but it didn’t seem to be displaying anything and just didn’t work. I eventually took it out and added some final changes to the main gameplay before trying to re-implement the menu near to the end of the project. This was unsuccessful and ended causing runtime errors everytime I tried. This was dissapointing because as far as I could see, the system should have been working. I put in debug messages in places to make sure it was running through the menu, and it was getting into the main menu scene, but just wasn’t displaying.
If I had more time, there are a few things that I would add to the game. The main one being a menu system that would allow the player to replay the game and have an end-game screen with their score displayed. I would also like to look into using sound with the ASGE in order to make the game more interesting. Perhaps with some backing track and noises when you pick up the food. One of the plans I had from the start which I never ended up implementing was an animation state so that when you eat a piece of food, the snake would open it’s mouth with some sort of eating animation. Overall I didn’t manage to get as much done for this game as I had hoped, but I still have a full functioning core game that displays the score for a player. At least for the second project, I will now be better prepared for getting it setup as I now know how to properly access things like the renderer in different classes.
After the feedback 1-1 I now know what I need to improve on for the next game. My main points to improve on are: Meeting the full deliverables (creating a menu), Dynamic memory management, and making use of delta time instead of sleeping threads. The first point is something I have already mentioned and to improve on that, with the next game I am going to try get the basic parts of a menu system implemented at the beginning, before making the game. Memory management was another thing I struggled with in Snake because I didn’t make good use of deallocating the memory I had used in loops. This is something I will look more carefully at for the endless runner. The best way to do this is to have deallocation of memory put in everytime I use some new memory. The final point was about the fact that I used the (sleepfor) command for slowing down the game rather than the proper way of doing it, which is built into the framework through the use of delta time.
1 min
Over the last few weeks me and my group have been meeting up and designing our Board game concept “Black Liquid”. This has been a really interesting project and I have really enjoyed the idea of working as a collective team to create a new game concept. Creating a board game is quite different to designing a piece of software, as you have to think about the fact that every component that you design for the game, is going to be something actually experiences by the players themselves. This is different to software, where there is a lot of logic work going on in the background that is not seen by the user to create the result of what they are experiencing.
We started the design process by coming up with a concept and setting of what it would be based around. We knew that we had to base it around a current cultural, political or economic issue. With this in mind, we began researching news websites, looking at what’s been in the news recently. We came across an article talking about setting a minimum price upon alcohol products in Wales. This was quite an interesting story and so it made us start to think about the theme of alcohol, and how we could base a game around that. After a few different ideas, Liam came up with the idea of the Government placing an entire ban on alcohol and making it illegal to sell or purchase. This was an interesting idea that quickly sparked more ideas from it. We quickly thought about the potential of the players being part of a gang for the “black market of alcohol”. We stuck with this idea of a theme and quickly started thinking about how the game would be played.
With the idea of you being part of a gang, we first thought that you would be playing against the government, trying to work to make as much money as you can from illegally selling alcohol. We soon thought that the game would be more interesting if there was more competitiveness to it against the other players as oppose to you all working together. So we decided that each player would be part of a different black market gang and they would all be fighting for the most control over the black market for their gang. We then thought about how you would individually have more control over the market than other players. This was decided to be whoever has the most money when the game is over. There would be event cards that are drawn at the beginning of each round. These would have an effect on that current round. This would also be how the end of the game was decided. With all of the different events that can take place, there would be one card in the deck that states the government has unbanned alcohol, ending the game at the point of this being drawn. To make sure the game lasts for a decent amount of time, this card will always be placed somewhere in the back half of the deck. The further back this card is, the more rounds of play there will be. We also implemented in some other features like the ability to trade with other players in the game by using their player cards which have a value for trading. These can also be used to double cross someone you are trading with and steal their trade. During the process, I also came up with the idea of using machinary as an item for the players which will effect their production in terms of how much alcohol they produce per turn. The more machinary upgrades you have, the more production you will have.
After doing a concept presentation of the game, we have discovered that the theme we have chosen seems to draw too far away from a current reality, when in fact we need it to be relevant to modern day issues. Based on this feedback, we have decided to change the whole theme for the game from the idea of banning alcohol, to something new. The first best step towards doing this, we felt was to write down all of our different mechanics from the current game, and then decide if any other theme we choose would still allow these mechanics to work with it. I think from a first look, we have decided to potentially get rid of the idea of having workers that do actions in the game for the player. We have also decided to get rid of the end game event card, meaning we will have to come up with some other way to end the game.
The next step is to now come up with some other theme ideas and try fit them with what we believe to be some good game mechanics. One idea we have had so far is perhaps the idea of cyber-security and hacking.
References http://www.bbc.co.uk/news/uk-wales-41682666
1 min
Snake Game Progress I have nearly finished the core loop of the snake game and am currently in the process of getting my sprites to display inside the ASGE before adding the finishing touch of movement. I have several different classes that helps separate out the project into specific areas. There is a snake class and a class for the snake segments. Each segment piece will hold several types of details including it’s own current direction it’s facing in, the type of piece it is (Head, body or tail), and details of what segment is in front of it and behind it to help it with moving around corners. This is done through the use of pointers for each segment that get passed to the next one along so that each one will know the details of the segment in front of itself. This means that then each segment will be able to work out how it has to reposition itself in accordance with the position and other details of the segment in front.
Currently I am having a few issues with the engine in trying to get objects to actually display. However I believe that once I’ve sorted this issue, it should be easy to just implement in the movement for the snake. Below you can see the pseudocode for some of the functions I have already created.
This is the general pseudo for how the game will set up the border around where the game is played. For each of the positions, it will assign an enum value that will later be assigned to the correct sprite.
for loop from i=1 to height-2 (down the rows excluding corners)
{
(0,i) = Pipe_vertical
(width-1,i) = Pipe_vertical
}
for loop from j=1 to width-2 (across the columns excluding corners)
{
(i,0) = Pipe_horizontal
(i,height-1) = Pipe_horizontal
}
left top corner -(0,0) = top left sprite
right top corner - (width-1,0) = top right sprite
left bottom corner - (0, height-1) = bot left sprite
right bottom corner - (width-1,height-1) = bot right sprite
This function is used for checking whether there is food at a given co-ordinate location. Will likely be used for checking the position in front of where the head currently is.
Passed in parameters of (x,y)
if x = food_x_coord and y = food_y_coord and current_type != NONE
return true
else
return false
This function will be used for general collision and may be used in multiple situations. It returns the contents of the cell in front of where the head is currently positioned and where it is facing.
Find where the front of the snake is using the segment pointer that is part of the class (pointing to the head of the snake)
head_x = head->getSegCoordX
head_y=head->getSegCoordY
head_dir=head->getSegDirection
switch (head_dir)
case UP
(head_x,head_y-1)
coord_to_check_x = head_x
coord_to_check_y=head_y - 1
case DOWN
(head_x,head_y+1)
coord_to_check_x = head_x
coord_to_check_y=head_y
case LEFT
(head_x-1,head_y)
coord_to_check_x = head_x
coord_to_check_y=head_y
case RIGHT
(head_x+1,head_y)
coord_to_check_x = head_x
coord_to_check_y=head_y
Board::coordContents(coord_to_check_x, coord_to_check_y)
returns contents of cell in front of character
1 min
Snake Game First Class Plan This is my plan for one of the core classes I will be using in the snake game. The segment class which will be responsible for the snake behaviour and updating of length. It includes plans for different enum types to help with sprite creation and for technical ideas of how to update the snake.
Enum Types Segment type - head, body or tail Direction - up, down, left or right
Class Variables local x and y co-ordinates
Plan for class The first idea I have is that there will be a pointer for checking the segment in front of the current piece, and a pointer for the piece behind. The pointer for the piece in front will hold the segment type and direction which will be used for updating where the current piece will be on the next frame. It will therefore know what sprite to use when it updates to it’s next position. The pointer for the segment behind will be used to run through the while loop that updates each segment. It will know it has reached the end of the snake when it reaches a nullptr for the end.
Adding onto the snake will occur one frame after the food has actually been eaten. This is because there could be a problem with doing it immediately. If you were going up a wall and you turn away from that and keep moving till you grab a piece of food, if the tail of the snake is then touching the wall piece it is going to add on and hit into the wall. Therefore by waiting one frame before adding the piece to the snake, it will stop the chance of this happening completely. There may only be a slight chance of this happening during gameplay, but it is better to eliminate anything that could ruin the gameplay experience for the player. For this to work, there will need to be a variable that checks whether a piece needs to be added to the snake or not.
Possible Gameplay Additions One potential change I could add would be that the snake gets longer automatically over time if food is not eaten quick enough. The speed at which this happens could be set by the difficulty the game is running in. Other additions I though of are for the food specifically. The food could change in size based on the difficulty playing on. For example, if you were on the easy difficulty then the food could be bigger making it easier to reach. I could also make it so that the food dissapears after time which could be indicated as about to happen by the snake segments flashing. This gives the player incentive to reach the food as quickly as possible.
1 min
Snake Game First Brainstorming
The snake game will be made using the ASGE, written in C++. It will require the use of different classes for different aspects of the game such as a class for the snake, a class for the movement of the snake and classes for other core parts. There will need to be positioning variables for the snake including default positions for the game to start on and other such variables as the current size of the snake which will effect the array holding it. The snake will be represented using a dynamic array that will be updated as the score is increased. It will need to allow for the movement across the board in different directions, keeping the back positions of the snake in the correct place until they have also moved along the trail. As the snake grows, the elements that were previously unused, will now be filled with an extra part of the snake. You will probably use a variable for storing the current size of the snake which will hold how much of the array is currently in use as part of the snake.
The food that appears on the map will have to be calculated to appear in a random spot that is not one of the positions currently taken up by the snake. In order for the snake to show in the correct direction that it is moving, I will need a condition that checks where the tail point of the snake currently is and the direction it is moving in, and it will have to add a new bit onto the correct position with the correct facement.
Need to think about the game co-ordinates in comparison to the screen pixel co-ordinates.
Arrays
There will be a few different arrays in this game that will represnet different things. There will need to be an array for the empty game board where everything will take place and there will need to be arrays for the different things that could take up co-ordinates on the game board (part of the snake, food, walls, empty movable space). The different options for what a cell may currently be could be done through the use of enums for the different options. So for example, an enum for “cell state” that could include within it the different states a co-ordinate on the board can be in. Think about how with the array containing the snake and how much will be displayed, at the beginning you are only going to have maybe 3 elements of the array currently filled in. The rest of the array will be blank until it is required to be expanded when some food has been eaten.
Possible Game Additions
Adding random wall pieces around the map that add increased danger to the movement. Having different levels to the game which may increase in difficulty, having lives, some sort of AI (perhaps in the end game screen there could be an automated version of the snake game playing).
1 min
In today’s tutorial for “Play and Games”, we spent the time in our groups playing the popular board game “Ludo” and coming up with some possible variations to the gameplay to try and make it more of a skill-based games as oppose to being all chance based.
The basic rules behind the game of Ludo is that there are one to four players who each have their own corner on the board and have four pieces that they muct move all the way around the board, and back into the centre squares for each of their pieces, using dice rolls. If another player rolls a number that causes their piece to land on yours, your piece will be sent back to the starting point where you will have to roll a six again to be able to start that piece once again. You cannot pass somebody else’s piece that is in front of you unless you roll the right number to take that piece.
The variation we came up with for this was to add in new paths to each corner of the game board, that would take longer to get around, but would mean you are able to move your piece down there if there is another piece blocking the path of the main route. Along with this, we invented a system of there being given spots on these new paths which, if landed upon, would mean you have to draw a card that has an effect on the game. We decided that these should be mostly negative cards that will have a bad effect on you playing, and a small chance that you would pick a card that could help you in the game. In this first variation, we simply did this with a dice roll as oppose to having actual cards, so different sides of the dice would cause different effects to the game. These included having your piece sent back to the last piece on the board, taking it’s spot and sending that piece back to home, missing your next turn, having your piece immediately sent back to home, having to go back the number of spaces you roll on a dice, and the positive of being able to remove somebody else’s piece from the board without effecting your own.
These new effects proved to make quite an intesresting change to the game, if only a slight change to the main gameplay. For example, the effect which would sent you back to the last piece on the board could be seen as good and bad. It is bad for you as you could potentially end up moving quite far backwards. However, you are also screwing over the player who’s piece was in that location, as theirs will get sent all the way back to home.
This was just a first time design change we came up with in an hours session that I think could be further polished to make some potentially fun and challenging changes to the Ludo game. However, at the end of it we realised that although making the game slightly more intesresting, the rules we had implemented hadn’t really changed the core gameplay much from being chance-based to skill-based. It perhaps made a slight difference to this scale, but not as big as we had hoped.
1 min
Snake is the first game that we will be making outside of the practical sessions each week. We have been given a framework to work with that I need to start looking through and trying to understand the different components of it. After I have learned the framework, I can then begin to start planning out how I will go about making the snake game in conjunction with the marking scheme. We are using the Awesome Sauce Game Engine (ASGE) to create all of the games for this year’s work.
The deadline for this first game is Wednesday 8th November at 1:59PM
1 min
Dynamic Memory is the use of memory during runtime. It is dynamic in that the compiler is unable to ascertain the exact amount of memory its allocation will require. This differs from static allocation where its size is determined at compile time and its location in memory is the stack. When objects are dynamically allocated they use a special region of memory called the heap. Let’s look at those differences.
1 min
C++ offers several simple and easy ways to loop. Loops can be used to process the same logic a number of times. The most common is the for loop, followed by while and the do-while. These loops are known as conditional because they continue to loop until a specific condition is met.
1 min
Networking is quite rightly known for being one of the most difficult areas of gameplay to implement. In this post we’ll look at some of the common techniques and technologies used to create multi-player experiences, both over WAN and LAN.
Subscribe to this blog via RSS.
Blog 4
Blog (4) Networking (1) Development (3) Code-snippets (1) Low-level programming (10) Nothing interesting (1) Snake game (5) Board games (3) Game adaptions (1) Play & games (2) Assignments (1) Level design (1) Endless runner (1) Birdman game (1) Group work (2) Networking game (1)