Weekly update #7 – Unit Selection & Capture Zones

The final weeks of the development process are closing in. Next week is the beta and we have a huge puzzle to put together. We have all the pieces that we want now. Some graphics are still temporary, some of the code has been made but only works in “single player mode”. By that I mean that it hasn’t been added to the multiplayer experience.

Henrik in my group finished programming the capture nodes, by that I mean that he completed what needed to be programmed in order for different zones on the map to be taken over. I continued on the task, but this time I needed to get in the nodes where the commander can raise buildings inside those nodes. Doing that took more time than I anticipated. Simply because there’s a lot of factors you need to take into consideration. When making zones that you can take over and zones, and once you get the zone your side can build on them, you need to take into account several things:

  • What happens if there are structures that have been built?
  • What happens if the nodes have been spawned already?
  • What happens if the structures are destroyed?
  • What happens if you destroy one building, is the node still in place or do you have to let the opponent destroy the rest of the buildings so that the new nodes can spawn again?
  • Will there be new nodes spawning if buildings have been built and you destroy a building?

Once those questions are answered you can continue, the problem is that you want to be able to test all of these things before deciding which approach to use. So how can we test this in a single player setting when this is a multiplayer only game?

The answer is, you can’t, we have to implement one variation, do some player testing, test out a new way this works and test some more, however we’re not there yet, so right now the best answer I can give is that you need to take a logical stance. If I were in the players shoes what would I expect would happen? How has other games done it?

What we have so far is that you can take over the nodes, so if there’s no nodes there or the enemies nodes are there, the existing nodes are replaced with the side that takes over the nodes. If there’s one or more buildings in the zone the side that had the nodes will still own the building and benefit from that building. Unfortunately the side that lost the zone can still build on it, that’s however a bug that I need to address.

Another challenge we faced was that the capture zones slowed the game down. Physics got overloaded, however there was a quick fix to that, it was just a matter of setting the capture zones on a different physics layer and add so that it doesn’t check for collisions towards anything else than champions and buildings. Reason why I chose buildings is that I’m using the capsule collider method to check if there’s a building in the capture zone, that’s how I figure out if there’s one or more buildngs built in that place.

Other than that it is now working fine, there was a bug that kept me away from testing and getting that detail fixed, but that bug has since been fixed so I can go back and finalize that detail. Here’s a screen capture of the capture nodes, unfortunately it doesn’t really say much. But basically the champion has taken over that node and the commander can then build on the nodes that spawn, because the capture zone didn’t have them already.

nodes-capturezones

Unit Selection

The other feature that I was working on was to create a selection box for the units, so that the commander can send units to a certain location. However in order to test this and to be able to work on this, I needed to create a scene to set up a single player commander. One reason for this is that when you’re making a multiplayer game in order to test you need to build the game, then set up several clients and then try it out. When creating a single player environment you can test what you want with just one client and the process of testing and making sure things work are much faster.

Anyway what I ended up doing with the selection box was to create a visual box which was drawn up by a rectangle that you form through the mouse click and dragging the mouse. The content of the box is filled with a solid which I change the material for to a transparent box. Once the units have been selected they are added to a list and if the user presses the left mouse button, the units are deselected.

At first I made each unit be aware that they were selected and it would have worked, but instead I decided that the units should be added to a list, the list would be cleared once the units are deselected. There were several reasons for making them into a list. One of the reasons was that I wanted to be able to save lists of units into different groups. That feature however will most likely not be implemented. Next week I will get the selection into the game and we’ll see how fast I can get that into the game. Next week is all about getting the stuff together and making a Beta and then it is all about polish.

Here’s a couple of screenshots showing the selection box and some of the units selected

unitselection

unitselection2