Sunday, February 22, 2015

Week 6 - Trick Shots

This week I went back into the Nuke launch system as well as spruce up the goal orientation. Originally with the original Path-builder it was safe to create nukes from a specific area of the planet. This week I went back at made it possible to nuke from any location and it will avoid shooting  itself and is ready. However due to the ability to only move the first three node and the remainder go in that direction there are some slots it can never hit. So in future weeks I will need to go back and have some checks based off of the angle the missile would need to go at launch time. So technically if the angle from initial launch to the desired location would be about Pi / 4 or 45 degrees it wouldn't be able to make it if its to the right side of the planet. However that's an estimate, of course I would write something to figure that out at run time if the nodes would change and it can figure out where it can hit. Also I added in the faction upgrades this week and set the goal for being able to use those actives. Specifically to get it tested I put in the Ruskie chrome upgrade. For two reasons, one it just takes one turn to use its upgrade, and second its the only one in the game atm, the others are being programmed and implemented this upcoming week or two.

It works very nice except for the fact it cost nothing. Therefore as long one chromium drill is upgrade to that, it will cast on that turn. This has two effects. One it can always cast this event. Since currently we want the AI to use up all resources and possible events so it ends with as close to no resources as possible. Eventually before it ends it turn, since the goal it will only be able to shoot straight. I will have a modifier that checks if it is in a spot that will even hit the enemy planet. This will decrease the automatic uses, however it will also make sure something get hits. Currently it will go through the enemy planet, since its a drill it makes sense.

So for this week a neat thing the AI can figure out is a shot that goes up over a couple buildings than comes back. On a plus once it hit the command center perfectly which it would have missed if it went straight for it because it would have collided with another building first. However most of the time, it still does it sometimes even when there are no buildings and because it has a slight offset, it has also come turned around and gone all the way to its on planet and blown up its own command center. So for this shot that it can select its 1 win and 1 loss for its own nuke. Of course for this to work, it has to select the target and launch from a very specific rotation where it figures out the amount of turns is the right amount. Although it is still very neat it figured this out without any specific type of ray casting at the moment. Since we have no rigid bodies or anything unity related tied to the objects they are not on the ray casting layer. In the upcoming weeks, I will need to find a way to raycast and only set its planet on it. Since nukes only blow up enemy buildings or either planet. Players can shoot nukes through their buildings. However this will also take some ray casting which I will create this week. It will allow for better shots in less turns. Thus being more accurate as well as taking one or more turns less in order to get to a location.

No comments:

Post a Comment