Game Development Community

dev|Pro Game Development Curriculum

Warscale - Unit info (w/Screenshot)

by Guimo · 04/20/2008 (6:36 pm) · 2 comments

Hi to anybody reading this blog series!

The las week was a really busy one. At one moment I really thought I was going to fail m week objectives. The main problem being that while programming, I suddenly noticed the code required some refactoring in some places. In other cases, I noticed that the combat rules that I planned to use (based on the Dungeons and Dragons D20 system) were not going to work. Fortunately I managed to solve all problems and all my week objectives were finished.


So the plan for this week was:
a. Create the unit info area located at the lower left corner
Finished for now but incomplete. I feel that I managed to show all the appropiate info for a creature and to write all the code to make it easier to show new info. The problem is that Warscale has 3 basic unit types: Creatures, Sorceries and Artifacts. The unit info to display can be very different from one to the other because a unit can attack and move which an artifact or a sorcery cannot do. At least the layout has been created and it allows for a nice amount of information. I feel this task finished for now but will need to come back later when I start including the other unit types to the armies.

b. Automatically select the avatar when nothing is selected
Finished. The avatar is automaticall selected when you get the turn. The avatar info correclty shows also in the unitinfo area.

c. Allow selection of appropiate units only
Finished. You are allowed to select any unit which you control and is in play (which unfortunately is only the Avatar at this point).

d. Show unit information on mouse rollover
Finished. Again this magic was possible by the AFX library which handles unit rollover. It was a little hard to understand how this worked but on the end I managed to make everything work fine. So you can rollover the mouse over any unit and its information will show in the unit info. If you are not pointing at anything, the current selected unit information will show.

e. Show the actions for the avatar
Finished. If you see this week screenshot, you will notice some extremely ugly buttons out of place in the bar. This means the buttons are showing up. I really need to work a little to get appropiate icons for this. The nice part is that this should also work for other selected units.


New features not planned but programmed this week
a. Refactor the game creation
The server side code for the game creation procedure had a big problem. The procedure was different in the local server (the one used for single player games) and the one used for multiplayer. AI players were treated as an strange object and didnt really behaved like real players in the code. I dont know if sometimes you feel there is something strange in your code and you need to make it smooth. Maybe its a bad analogy but its not unlike when you wake up in the morning and try to comb/brush your hair (at least when I had hair to comb) and there is a knot somewhere that you have to straighten. Or when a grain of sand enters the ball bearings in your skateboard and you feel something there when you roll the wheels. Sometimes you just want to make things go perfect.
The problem is that in the IT world, a small difference means that in case of a bug, you will need to kill it in two different places and I dont like that.
So, I decided to create a common game object. The game object holds the players while the game havent started yet. It allows you to change the map and control players leaving the game before it starts. This will make easier to control game rooms.

b. Transmit more info on game start
I noticed that when game started, the client received all the players information from the server but it never received the starting position. This made really difficult to popsition the camera appropiately when game started. I included some extra bytes for the player info.

C. Player names on bars
Player names are now displayed in the player bars on the top of the screen.

d. Turn time counter
I want Warscale to be a fast game. One of the problems in Magic The Gathering is that the player can take a loooooong time to make a move. I just want to make it faster. So I decided to include a time counter in the game. This counter measures the time remaining before the turn is automatically passed to other player. A player receives 30 seconds to make a move. If he makes a successful move, then the counter is reset and he has 30 seconds again to make other move. He will eventually run out of moves so the turn will pass to the other player sometime. The point here is that if you keep playing you can make all the moves you can. But if you just decide to go to answer the phone while playing, you will lose your turn in 30 and the other player will get the turn and possibly crush you. This will prevent the player from going away while playing. I have played MTG Online and I really hate when the other player goes away and keeps me waiting.

e. Camera movement when mouse is placed in the screen border
I was handling camera movement by using keys. But the game is based on RTS games so I decided that the camera should move when the mouse reached the screen borders. I managed to do that by allowing the GUI controls to pass the onMouseEnter and OnMouseLeave events to the console an placing 4 invisible controls 1 pixel width in the borders. It works nice in full screen.

f. Change in the combat system
I also decided to drop my idea to use D20 for combat resolution. Making 2 level 0 characters is boring. I decided to go for the most efective Warcraft system when every hit is considered a success and the armor allows for damage reduction. This will make the game more active. I still would like a way to handle critical hits.

g. Movement points
I changed the movement system also. In my original idea, the units got 1 movement point and they were allowed to move a number of squares using that point. I changed that so that the units now get more points and can move up to 5' with a single point. (1.47 points are required to move diagonally). This allows any unit to move then attack, attack then move or move/attack/move or any combination while they still have attacks and moves remaining. I also included a single run point which means the unit may move twice its distance but not attack that turn. Of course a unit which has attacked wont be able to run.

SCREENSHOT!!!!!
This screenshot shows the unit info in the lower left corner of the screen. It also displays the timer and the player names can be seen in the plaer boxes at the top of the screen.
www.spritekin.com/warscale/wsascreen2.jpg
Now that the avatar information can be seen by rolling the mouse over the avatar, I wonder if I should still keep the health and mana icons in the bar. This may reduce the icons to just 3. I think I may get rid of the icons and just use simple text at the top of the screen like:

Belgar Hand:5 Dead:10 Army:25

This can make the interface less cluttered.

The plan this week
For this week I was really planning to go for creature summoning and moving it on the board but unfortunately the game dictates otherwise. This is a turn based game so moving from turn to turn should work flawlessly and that will be the focus this week. The end of turn requires to pass the turn to the AIPlayer but also to coordinate the end of turn event between players. Also there are some rules to apply on the end of turn. Some units will fire automatic events which need to be handled. And of course, there is the problem of the units in the player hand. In MTG when a player has more than 7 units in hand he should pick and discard one. Again this means for a player making a decision and its a game delay point. Instead of this, Warscale will pick the oldest unit in hand and discard it automatically. You may see this as... with time you forget everything. The point is that time will be saved so that game moves faster. Discarded units should go to the graveyard. In warscale, the graveyar will be located behind your hand units (those behind the avatar in the screenshot). I want the graveyard to be a collection of tombs and gravestones, crosses and the like. You will still be able to roll the mouse over the tombs in order to see the unit info and (if possible) a tomb dedication (Rest in pieces / He loved children with butter / We will never forgive you... etc etc etc).

a. Make the end turn button work.
This means the player should be able to press the end turn button to finish the turn. Of course turn will end automatically if player does nothing for 30 seconds.

b. Fire end of turn events.
Some units will be able to fire end of turn events. These should be handled appropiately on client and server.

c. Discard excess units.
Unless a game effect allows you for a higher limit (should program this property also), the game will discard any spell in excess of 8 from your hand.

d. Graveyard!
This one will be hard.

This will really be a hard week. I hope I can make this all work.

Luck with your projects!
Guimo

#1
04/22/2008 (2:14 am)
This is looking really cool.
#2
04/27/2008 (5:26 pm)
Good work Guimo! Excellent portrait GUI, btw!