Tuesday, January 22, 2013

Functional Turrets

Turrets are now functional! I finished creating the dummy load script to bypass the trigger manager. The dummy script loads all of the data necessary to give a battlestar (or basestar) minimal functionality in the game. With this data loaded, I created quick workaround to manual set a battlestar's main target. With a main target set, the turrets turn and fire on the new target.
Here's a picture of the Aries Battlestar and the Cylon frigate:

Turrets still need alot of work. I need to add a system to target secondary targets. This portion of the code that I developed did not function properly. Turrets also need a method to check for a clear firing path. Turrets should never attempt to fire through it's own ship. Those are the next two features that I'll need create to complete turrets.

After the completion of turrets, I will create the AI routines for capital ships. Due to the inherent differences in the methodology of propulsion, I might have to break this feature in a battlestar and basestar AI routine. If I make sure that both routines utilize the same parameters, I might be able to keep both scripts accessing one table, instead of two separate tables. I'll have to flesh out AI in a future blog.﻿

2 comments:

I may have spoke too soon. The colonial turrets do turn to engage the cylons; however, the cylon turrets didn't return the favor. It had to do with the default facing of the weapon. I'll have incorporate that into the database load settings as a work around.

Another major issue involves the load times. When Cylons launch missiles, the game hangs for a second. That is unacceptable. I'll have to figure out a way around that.

I managed to fix the Cylon missiles. They wouldn't turn towards the target. I had to change the player flag to true on all missiles. This shouldn't be the case to make a missile home onto a target; however, it works for now. I'll look into the correcting this problem in the future.

Cylon turrets now face in the correct direction. Basically, I put the initial facing to zero. When the turret data loads, I reset the facing to the middle of the cutout zone. The turrets now function properly. In the future, I plan on adding a facing field to the turret data. This field will reset the initial facing to the correct facing instead of calculating the average of the cut out zone.

In addition, I fixed the lag issue. I staggered missile launches over a period of time. A cylon basestar can only fire one missile per second at this point. I can't see a way to cut out unneccesary routines to decrease the computing load... I'll keep thinking about the issue; there has to be a way.

With these issues resolved, I can get back on track with completing the capital ships and fully integrating them into the game system.