Development Update
I spent this week reorganizing my battle system code. In the early version, I had hard-coded 2 ship participants: (1 human, 1 ai ship), but now it supports fleet versus fleet.
I also cleaned up my configuration code so that it's much easier to build different hull types, and configure them how you like. Currently the only equipment I have are weapons (laser or cannon), but I like the organization of this code and the related unity game objects.
The hull game object contains variously sized cubes that make up the physical model of the ship. Empty game objects are positioned where various ship equipment will attach such as weapon components and have a SlotController script attached to it that specify the supported SlotType and have variables to hold the currently configured ShipComponent. The positioned slots serve as anchor points for any physically visible ship components such as weapon turrets.
Here's a video showing a scout and destroyer configured with lasers. Versus a computer controlled scout and destroyer configured with cannons.
Having multiple ships exposed an issue with my cannon shells. The bullets ignore the ship they're firing from, but everything else is fair game. So if a bullet misses the first ship in it's path, it might keep traveling and hit the ship behind it. That's not too bad and could even be passed off as a feature, but I think my bullets are applying their damage each time they pass through a different cube of the same ship. It definitely warrants more investigation.
Another strange issue I noticed is when I played my game on my wife's computer. The mouse's world position seems to be offset by 1 in the Y direction. You can see it when I'm moving the ships and the ghost ship isn't right on top of the mouse pointer. The gui system seems offset vertically as well. But on my computer it runs just fine both in the editor and if I build a separate executable to run it. I have no idea why it's acting wonky. :/
I think my battle system is enough of a place holder so that I can move to other game elements. Next week, I'm going to work on some "overland" travel. I want to be able to control a ship going from planet to planet. Between travel destinations, I'd like to roll for a random encounter chance and trigger my battle system. I may also put some time into a GUI system. The stuff I have now is hacky, hard-coded nonsense.
Tip from your Uncle Eck:
Be sure to allocate time to refactor your code, especially in the early stages of development. Think about where it's painful to add features or make simple changes. Figure out why, and design something better. If you don't do this, your poorly designed codebase will drag you down like a boat anchor.
Be sure to allocate time to refactor your code, especially in the early stages of development. Think about where it's painful to add features or make simple changes. Figure out why, and design something better. If you don't do this, your poorly designed codebase will drag you down like a boat anchor.
Looking good. I still like how great your ship destruction looks. You could probably solve the bullet problem by moving them to another layer once it's determined they've missed. (Some ignore all collision layer, or at least all ships)
The 1 pixel thing is definitely strange. Is her machine at a different aspect ratio or DPI?
(And your updates always inspire me to update my journal and game link...I'll have to get on it)