Archive for June, 2014

Switching to Multiplayer

Sunday, June 1st, 2014

I just finished my remaining tasks that I wanted to complete before switching to multiplayer code. The game is in a very good state so it is time to finish the rest of my multiplayer code. I did a bunch of preliminary work a few years ago before creating my prototype. That’s because most of the code is a combination of Pursuit of Power 1 and my RPG “Birth of Shadows.” The main differences involve the fortresses and zealots, with a few challenging components. I will explain the details in a future post. Now onto the things I just finished…

I finally combined all of my resource code with spawn points. I can optionally set any resource to be a spawn point. The number of spawn points determines the maximum number of simultaneous players for that board (up to 10 max). Those available spawn points are randomized for players at the start of a new game. The editor has a bunch of ways to interact with the resources and spawn points. I added a list that shows all resources on the map along with their spawn point status.

Leaders now regenerate health when not attacking. This is important since I want to encourage players to use their leaders for attacks on enemy fortresses. Leaders can teleport to safety when low on health. I added code to the computer AI to flee (teleport) before dying if enough power exists. This was necessary since I also added code to teleport to the first attacking banner zealot that reaches the enemy fortress. This should mean that the attack is successful and therefore a good time to exploit the advantage.

In order for the leader to be effective, I had to add code that is able to find good targets for AoE abilities. I came up with a pretty flexible design that can find the best AoE location for each goal. For example, a goal could be to find the area with the most enemies for damage abilities. I can then determine the best goal, although right now I use a fixed priority of damage, debuff, and cure. I will add more intelligence and additional goals to this scheme in the future. The leader is definitely very capable now during attacks.

While playing with the leader abilities, I determined that I should make the target areas more obvious. Therefore, I added a box around the target area to clearly show which units are hit by the ability. I increase the duration of the visual effect too. The target box fades over 2 seconds. I use this same box for human players when an ability is selected. I make it semi-transparent and only show the target box for valid locations. This really helps with targeting. Once selected, the original target box is replaced by the AoE box, so it goes from faded to fully opaque, before fading out. It looks pretty good.

I created a new target graphic using beveled corners and made it white. This way I can use the vertex color to make it whatever I want. So local players are gold, enemies red, and allies blue like I do for tier icons, units, and other effects. It looks much better in my opinion. I decided to always show a semi-transparent selection box under all troops to make it easier to determine friend from foe. I switch the local player to orange when selected, just like it has always been. With all of those changes, it is much easier to tell what is happening during a battle.

Other than that, I just made some various tweaks. Computer players now use the number of portals they own to determine how many banner zealots to send to their current attack target. That helps press their advantage during a game. I also added a display bar to banner zealots to show the refresh for guardian abilities. I will add some more status icons to them in the future once I decide how I am going to implement those abilities (e.g. possibly upgrades). Plus other random stuff.

Once again, next up is the remaining multiplayer coding so I can play some network games with friends. That’s when I really start getting a feel for the game. I will play test a new 2-player skirmish board that I made today. I want to see how good the computer player is after my recent changes. In addition, I will be adding new artwork within the next few weeks. Lot’s more to discuss… please visit again to see my progress :)