Beta and bugs – Big Game Project

This has been a long and hectic week as we have had to finish a beta build and work on the feedback we had gotten from that beta testing session. There has been a lot to fix as this was the first time other people got to test the game and we noticed a lot of bugs we hadn’t noticed before. Besides a lot of bug fixing, I have also started working on a rulebook for the table top version, added two new cards and some needed features such as checking my and the opponents discard piles.

The most important feedback we got from the beta testing session was that it was hard for new players to know what was going on due to the fact that a lot of actions happened automatically in the background. There was almost no visual feedback of was what happening. There were also some game breaking bugs that are important to fix.

Checking the opponents discard piles was a problem I had trouble fixing at first as I needed to send a list of gameobjects to the other player. But instead I fixed it by sending different RPCs, depending on what was in my pile, and let a script which handles all the network code, add gameobjects to its own separate list, which it then could copy to the other player.

NewBoard

Cards – Big Game Project

For the majority of my time this week, I have been working on implementing a lot of different cards for the game and I made twelve cards in total. These are the cards people can buy for resources and then use to play them when they draw the cards. There are different cards in different categories. Some help you gain resources or cards; some help you manage your deck and some are used to sabotage your opponent in some way. Some cards have been easier than others to implement. The cards that I had most trouble with creating were the ones that had a lot of interaction with the enemy player and other cards. An example is a card called “Wiretap” and it says: “Reveal this when your opponent buys a card. Gain a copy of that card. Place it in the discard pile.” That card also has a mechanic we call stealth. It is similar of how trap cards work in Yu-Gi-Oh in the way that they are placed faced down and are revealed and activated when the opponent has met certain conditions. A player can have a maximum of three stealth cards, so if a player has three wiretaps in play, a player can earn three cards in one round. There is a lot the game must send to the other player such as if a player is wiretapped or not, how many wiretaps are in play and what cards are being bought. Because I’m not very experienced in networking, I have made a lot of different functions that sends what card a player buys if they are wiretapped. This is not optimal and the code can be hard to read, so that I something I might fix in the future.

The easier cards to implement were the ones that didn’t do very much other than drawing cards or giving resources. Take “Junk Treasure” for an example. It says “You gain two temporary resources. You gain a NULL card. Place it in your hand.” The hand is a list of cards, so a NULL card object is added to that list and the resources is just an integer which is increased by two. The only networking for this card is to show the other player that I played this card.

board

More Networking! – Big Game Project

So this week, I got a lot of work done. I had trouble with the networking part of our game last week, but after getting some tips on how I should go about solving it, I fixed what I worked on for half a week in just one day instead. There is now a Game object called controller which has a controller script attached to it that handles all the RPCs that are sent to the other players. Instead of the player scripts sending actions to the other person, the actions are sent to the controller which tells all players that this actions happens.

Players are able to purchase cards during game play in our game and then play with those cards when they are drawn. Purchasing and playing cards are the other things I have been working on a lot this week. An example of how purchasing a card works is that if I am player one and it is my turn, I can click on any pile I want if I have the resources for it. One of the cards I can buy is “Strong Stuff” which increases my resources by one and makes me draw a card. If I click on that card and I have the money for it, the game object “Strong Stuff” alongside the cards in my hand will be added to my list of discarded cards. This will also be sent to the controller script so that the other player knows what action I did and then end my turn and enable the other players turn. The process is almost the same for when playing cards but instead of checking the cost there are other conditions. There are now six other cards excluding “Strong Stuff”.

I also got to build and test the game on an android tablet late this week. The only problem that occurred was that the texture atlas we used for all the cards was to big for the tablet to handle. I had not thought of this before so the texture we used was 4096×4096 in size but all the cards came out completely black. We will have to use smaller atlases for the tablet version as we want the game to work on as many different types of tablets as well. This probably should not be a problem but it can be worth keeping that in mind in the future for other projects while working on multiple platforms.

Purchase cards

Multiplayer Gameplay – Big Game Project

I have been working on fixing basic multiplayer gameplay this week. What this means is that I wanted to make so two players can join a server, take turns to do actions, update each others hands and what they play. I had a lot of trouble getting the hand to update properly at first and the cards were stacking on top of one another and you had to drag them to fix it instead of it automatically sorting themselves. At first I thought I had some wrong settings in the inspector, but it turned out that all I had to do was call a function called Reposition on the grid of cards whenever the players drew cards.

The next major problem I had, was that old instantiated cards would not destroy when players drew new cards and on the next turn they would have ten cards instead of five. I had made a script called “destroyCard” that would destroy the game object every time a new hand is drawn, but I do not know what went wrong because a random amount of cards would be destroyed every time. Instead I made a script that would destroy all the child objects of a parent object. The cards are part of a game object grid which is the parent of the cards. I would then loop through the children of the grid (the cards) and destroy them one by one.

Then I came to the part which still is not fixed. I do not want players to play simultaneously, but in turns. Right now, the player who joins the server first is the one who gets to go first. At the end of a players turn, I do an RPC (Remote Procedure Call) which should set the second players turn to true and the first players turn to false but these variables will not change for some reason. I have gotten a lot of different errors because I have tried to solve the problem in a lot of different ways suggested by people on the Unity forums. When I think I have solved the problem I get a new error. If this problem persists I may have to try to solve it in a different approach from what I’ve done now, but I do not know how yet and therefore I will have to think about it under the weekend.

cards