I've worked on the game, and it now transition between different screens (clicking on new game takes you to new game screen). I also modified the player options. Instead of having three dropdown menus per row, I combined two (human/computer and difficulty) into one, so it looks like this:
Human
Computer - Simple
Computer - Easy
Computer - Medium
Compuer - Hard
Computer - Impossible
One thing to note, it's possible to have more than one human in the list of races, which allows for hot seat multiplayer, or for you to control two or more races. Or you could even have only yourself in the galaxy (for testing an expansion strategy perhaps?).
I've also optimized the galaxy generation code so it creates a new galaxy a lot faster (about 1/28th the time it took previously). But it can still be optimized more, I may look into methods for that. But for now, it can generate a galaxy with about 2,000 stars in less than 5 seconds. I doubt anyone would play a galaxy that huge, but the option is there if they do want to.
I'm currently working on the galaxy screen, and optimizing the drawing process (I don't want to iterate through all 2,000 stars if I'm zoomed in and can only see 4 or 5 stars). I've discovered a method that will help speed up the process, which is the quadtree. It's kinda like a binary tree, but with 4 children per node. I'm also working on the galaxy setup when you click on "Start" after setting up the new game options, it populate the galaxy with races that you've selected.
After those are done, I'll re-import the old code I had before I started the whole refactoring process, which includes colonizing planets, fleet movement, planetary management, population migration, empire income/expenses, ship construction, exploration, supply range (fuel range) and maybe some other stuff that I forgot. Then I'll release that version for testing!
No comments:
Post a Comment