As of now, my game’s combat system is functional. I can (and did, for quite some time) sit here and run the ticker over and over, watching the test fleets attack and defend each other. I certainly wouldn’t venture to say it was the best possible way I could have written the combat system, but there are major advantages. Even at worst possible run time, it’s nowhere near O(n), with n being the number of ships in combat. In fact, it will generally run much closer to O(y), with y being the number of fleets involved in combat. It will actually be a multiple several times this number, but on a much smaller scale than the total number of ships.
Well, it’s around quarter of three in the morning now. Probably a good time for me to get some sleep. Or maybe I’ll go watch a few more ships destroy each other.
0 Responses to “Captain, we’ve engaged the enemy”