Bleh, I hoped to release a new version tonight where you could design ships and build them. But it's late, and I'm tired. Maybe this weekend I will finish it up. This screen is taking longer than I expected, there are so many parts to a ship design, and I didn't realize how intricate it was until I worked on it. But it's getting there! I've got a lot done today, more display information for the design screen, and space usage check. If you put in too many items so total space usage exceeds the available space, the "Confirm" button is disabled, preventing you from creating an illegal ship design.
Also notice that because the computer's efficiency with beam is 80%, it dropped the laser cannon's damage from 8 to 6, and accuracy from 80% to 64%. So it is critical for you to design a ship around its computer. A computer impacts every weapon that you use, and there are different computers with different strengths and weaknesses. Researching better versions of this computer reduces space usage, but not the efficiency of weapons for balance reasons. No more "Ultimate Ship Design", this will be more of "paper, rock, and scissors".
Now, here's a screenshot of what I've finished so far on the ship design:
Friday, April 29, 2011
Tuesday, April 26, 2011
More Progress on Ship Design
I changed all the dropdowns (except for size option) to button, so it brings up a "mini-screen" listing technologies in that area. The reasoning behind this is that it displays information before you have to select something. The dropdown only displays the name, but not space usage, or any other specifications, so it's not very useful.
I also finished implementing most of the remaining UI elements. The only thing left are scrollbars when having so many items that you can't see them all on one screen, to allow you to scroll through. Then the UI functionality are complete. The buttons you see on the screenshot below are all working. Note the first laser cannon having more damage than the same weapon below, this is due to increased mounts.
The other things left to do is displaying information, like space usage, specifications for the left fields, and the ship cost, then the ship design screen is complete. I would continue work on this, but I'm really tired. So I thought you'd like to see the progress on this :)
I also finished implementing most of the remaining UI elements. The only thing left are scrollbars when having so many items that you can't see them all on one screen, to allow you to scroll through. Then the UI functionality are complete. The buttons you see on the screenshot below are all working. Note the first laser cannon having more damage than the same weapon below, this is due to increased mounts.
The other things left to do is displaying information, like space usage, specifications for the left fields, and the ship cost, then the ship design screen is complete. I would continue work on this, but I'm really tired. So I thought you'd like to see the progress on this :)
Saturday, April 23, 2011
Design Screen Halfway Done!
I sketched up a rough draft of what the design screen should look like, and I liked it well enough to start programming it in.
This is what the draft looks like:
This is what I have so far:
One thing to note, all of those drop downs are listing actual technologies that it've loaded in from technologies.txt file. So this is the first evidence of technologies in this game :) Confirm Design and Clear Design is fully working, you can add ship designs now! Shield, Armor, Computer, Engine, and Size are all functional, and will be saved, as well as name (which is randomly generated at this moment).
The only UI elements left to implement is the "Add Weapon" to let the user select a weapon to add, and the weapon controls (more or less mounts/shots, and "remove" button). Then when that's done, I will add information display as shown in draft, then the design screen is done!
When this screen is done, I will go back to galaxy screen and add ship construction so you can build ships. When this is done, I will release that version.
This is what the draft looks like:
This is what I have so far:
One thing to note, all of those drop downs are listing actual technologies that it've loaded in from technologies.txt file. So this is the first evidence of technologies in this game :) Confirm Design and Clear Design is fully working, you can add ship designs now! Shield, Armor, Computer, Engine, and Size are all functional, and will be saved, as well as name (which is randomly generated at this moment).
The only UI elements left to implement is the "Add Weapon" to let the user select a weapon to add, and the weapon controls (more or less mounts/shots, and "remove" button). Then when that's done, I will add information display as shown in draft, then the design screen is done!
When this screen is done, I will go back to galaxy screen and add ship construction so you can build ships. When this is done, I will release that version.
Friday, April 22, 2011
Technology Data Structure Done, Working on UI, and some other comments
The technology data structure is organized and ready to go. How it works is in the technology.txt file, each line looks like this:
techType=beam|baseDamage=10|damageIncPerLvl=2|...
The character "|" separates each value, and the character "=" separates the key from its value.
So techType=beam would have the key of techType, and the value is "beam". I store each key with its value in a dictionary, and then after each line is loaded into the dictionary, I call the appropriate tech (Beam for beam type, etc) loading function. It will then attempt to set up a tech class with the values passed into it. If any value fails or is missing, it will add to list of errors specifying exactly which key is having problems (or missing keys) so you can easily fix it. Hopefully this format would be easy for users to modify.
Now with that set up, I can start on ship design screen. I will just give myself every technology already researched for now so I can focus on ship design, then when that's done, I will work on the research screen.
Now to ship design, here is how each component will work:
There will be different computers, each with its own advantages and disadvantages. One computer handles beam weapons better than particle weapons, for example, while another analyzes the enemy's ships' weak points and increases the weapon damage against them, and so forth. Improvements in research on a computer will improve that computer's advantages, but it won't improve the disadvantages. So if you want a missile boat, you want a computer that's designed for missiles (better guidance and better damage).
There are different shields and armors, designed to withstand against different types of weapons. If you're designing a missile boat, it's designed to stay out of direct conflict, so you want armor that does well against missiles/torpedoes.
There are also different engines. Older engines tend to take up less space, while this may not be realistic in real life, it makes you choose between faster ships that have less weapons, or slower ships that have more weapons.
There are four types of weapons:
Beam weapons have two variables that you can tweak: The amount of barrels, and amount of capacitors. The more barrels you have, the more damage it does in one shot (think of a minigun, but with all barrels firing at once). The more capacitors you have, the more times it fire. This gives you options between having a highly accurate computer so you can focus on increasing damage, or having inaccurate computer but spam "bullets" to make up. Each fire will hit at most one ship. So if your 100x barrel laser cannon fires on a group of small scouts with 10 hp each, doing 1,000 damage, you only kill one ship. You may want 10x barrel laser with 10x capacitors so you can fire 10 times and kill 10 scouts.
Particle weapons have the same variables as beam weapons, but the more barrels means it have higher rate of fire, so it fires more particles (slugs, bullets, whatever you call it). It does not increase the damage of each bullet, just the amount. However, particle weapons are good against missiles and shields, so that's their primary advantage.
Missiles have racks (how many missiles you can fire per turn), and reserves (how many missiles total you can fire in a combat). Missile's strength is in it's ability to avoid obstacles like other ships and asteroids that is not its target, and to inflict great damage against individual ships. Missiles are good against capital ships.
Torpedoes have capacitors (the more capacitors a torpedo have, the more damage it inflicts since it have more energy). Capacitors will require a turn to recharge. The disadvantage of torpedoes is that it's dumb, it won't avoid obstacles. But it explodes on contact, damaging nearby ships, not just its target. Torpedo also "carries over" damage, so if a torpedo does 100 damage, and there's 10 ships with 1 hp each, all ships will be destroyed. If there's two groups of 1 hp ships, torpedo will kill 10 ships in each group. If there are 5 torpedoes launched from a group of 5 ships, the damage is carried over, so if one does 100, it now does 500 damage.
Bombs are similar to missiles in terms of storage, but are similar to torpedoes in terms of dumb guidance. You can drop bombs from anywhere, and they continue on a direct course until it hits something. Torpedoes will detonate when they reach the designated spot automatically, but bombs just continue. You can even launch bombs against other ships, but if they move, the bombs will miss.
I'm thinking that there won't be "Special" field in this game, due to some items that can have special attributes (for example, ion cannon will decrease the target computer's performance as well as inflicting damage).
techType=beam|baseDamage=10|damageIncPerLvl=2|...
The character "|" separates each value, and the character "=" separates the key from its value.
So techType=beam would have the key of techType, and the value is "beam". I store each key with its value in a dictionary, and then after each line is loaded into the dictionary, I call the appropriate tech (Beam for beam type, etc) loading function. It will then attempt to set up a tech class with the values passed into it. If any value fails or is missing, it will add to list of errors specifying exactly which key is having problems (or missing keys) so you can easily fix it. Hopefully this format would be easy for users to modify.
Now with that set up, I can start on ship design screen. I will just give myself every technology already researched for now so I can focus on ship design, then when that's done, I will work on the research screen.
Now to ship design, here is how each component will work:
There will be different computers, each with its own advantages and disadvantages. One computer handles beam weapons better than particle weapons, for example, while another analyzes the enemy's ships' weak points and increases the weapon damage against them, and so forth. Improvements in research on a computer will improve that computer's advantages, but it won't improve the disadvantages. So if you want a missile boat, you want a computer that's designed for missiles (better guidance and better damage).
There are different shields and armors, designed to withstand against different types of weapons. If you're designing a missile boat, it's designed to stay out of direct conflict, so you want armor that does well against missiles/torpedoes.
There are also different engines. Older engines tend to take up less space, while this may not be realistic in real life, it makes you choose between faster ships that have less weapons, or slower ships that have more weapons.
There are four types of weapons:
Beam weapons have two variables that you can tweak: The amount of barrels, and amount of capacitors. The more barrels you have, the more damage it does in one shot (think of a minigun, but with all barrels firing at once). The more capacitors you have, the more times it fire. This gives you options between having a highly accurate computer so you can focus on increasing damage, or having inaccurate computer but spam "bullets" to make up. Each fire will hit at most one ship. So if your 100x barrel laser cannon fires on a group of small scouts with 10 hp each, doing 1,000 damage, you only kill one ship. You may want 10x barrel laser with 10x capacitors so you can fire 10 times and kill 10 scouts.
Particle weapons have the same variables as beam weapons, but the more barrels means it have higher rate of fire, so it fires more particles (slugs, bullets, whatever you call it). It does not increase the damage of each bullet, just the amount. However, particle weapons are good against missiles and shields, so that's their primary advantage.
Missiles have racks (how many missiles you can fire per turn), and reserves (how many missiles total you can fire in a combat). Missile's strength is in it's ability to avoid obstacles like other ships and asteroids that is not its target, and to inflict great damage against individual ships. Missiles are good against capital ships.
Torpedoes have capacitors (the more capacitors a torpedo have, the more damage it inflicts since it have more energy). Capacitors will require a turn to recharge. The disadvantage of torpedoes is that it's dumb, it won't avoid obstacles. But it explodes on contact, damaging nearby ships, not just its target. Torpedo also "carries over" damage, so if a torpedo does 100 damage, and there's 10 ships with 1 hp each, all ships will be destroyed. If there's two groups of 1 hp ships, torpedo will kill 10 ships in each group. If there are 5 torpedoes launched from a group of 5 ships, the damage is carried over, so if one does 100, it now does 500 damage.
Bombs are similar to missiles in terms of storage, but are similar to torpedoes in terms of dumb guidance. You can drop bombs from anywhere, and they continue on a direct course until it hits something. Torpedoes will detonate when they reach the designated spot automatically, but bombs just continue. You can even launch bombs against other ships, but if they move, the bombs will miss.
I'm thinking that there won't be "Special" field in this game, due to some items that can have special attributes (for example, ion cannon will decrease the target computer's performance as well as inflicting damage).
Sunday, April 17, 2011
Technologies
I've started work on adding technology data to the game, in the process of doing so, I realized that the way I set it up, I could easily implement racial technologies (technologies that are specific to races). Each empire have its own instance of "Technology Manager", and on game creation, those "Technology Manager" calls Load function that fills their own instance with data from a data file.
I originally planned to have all technologies be available to all races, but I thought, some people would love to set up racial technologies, even if I don't like it. So I'm going ahead and implement the ability of having racial technologies, even though the game won't have any by default. This will be how it works:
Technology Manager will first load in "Default Technologies" that all races will have. When it is done loading, it will call the load function again, but pointing to the race's technology file. It will not overwrite any existing technologies (it will give an error if two technologies have the same name), but rather, it will add to the list of technologies.
Each row of technology data will contain tags (techType, canSteal, canTrade, baseCost, levelsCanResearch, technology specific tags like amount of damage, etc) so you can add, modify, or remove technologies to either the defaults or race's data. If a row is invalid (missing some critical tags or invalid data like letters where numbers should be), it will display a list of invalid data rows after it've loaded, so you can make corrections.
I don't know how flexible this will be in terms of handling special technologies, like stargates, sub space teleporters, and other specials you can put on your ship, since each usually have their own effect. I'll try my best however, but most of the important technologies are in specific categories. So you can easily add a weapon (be it a torpedo, missile, beam, or particle), armor, shield, engine, etc.
My goal for this game is to make it moddable in terms of adding/removing races, technologies, and artwork. The gameplay mechanics will not be able to be modded however, since I'm not good with scripting. The AI will be hardcoded. Maybe in the sequel if this game prove popular enough, I'll research on how to do scripts so you can modify how the game works.
I originally planned to have all technologies be available to all races, but I thought, some people would love to set up racial technologies, even if I don't like it. So I'm going ahead and implement the ability of having racial technologies, even though the game won't have any by default. This will be how it works:
Technology Manager will first load in "Default Technologies" that all races will have. When it is done loading, it will call the load function again, but pointing to the race's technology file. It will not overwrite any existing technologies (it will give an error if two technologies have the same name), but rather, it will add to the list of technologies.
Each row of technology data will contain tags (techType, canSteal, canTrade, baseCost, levelsCanResearch, technology specific tags like amount of damage, etc) so you can add, modify, or remove technologies to either the defaults or race's data. If a row is invalid (missing some critical tags or invalid data like letters where numbers should be), it will display a list of invalid data rows after it've loaded, so you can make corrections.
I don't know how flexible this will be in terms of handling special technologies, like stargates, sub space teleporters, and other specials you can put on your ship, since each usually have their own effect. I'll try my best however, but most of the important technologies are in specific categories. So you can easily add a weapon (be it a torpedo, missile, beam, or particle), armor, shield, engine, etc.
My goal for this game is to make it moddable in terms of adding/removing races, technologies, and artwork. The gameplay mechanics will not be able to be modded however, since I'm not good with scripting. The AI will be hardcoded. Maybe in the sequel if this game prove popular enough, I'll research on how to do scripts so you can modify how the game works.
Saturday, April 16, 2011
Migration Done - Released!
I found the cause of bugs as described in previous post, and was able to fix them. The systems not being recongized was from me forgetting to use the star system's X,Y coordinates. So basically whoever controls the top left part of the galaxy (the first 4 grid cells on top left) can migrate to any star system. It's fixed
Here's the latest version (read previous blog posts about how to correctly set up the game): Beyond Beyaan - April 16 2011
Again, please let me know of any bugs or improvements I can do!
Here's the latest version (read previous blog posts about how to correctly set up the game): Beyond Beyaan - April 16 2011
Again, please let me know of any bugs or improvements I can do!
Friday, April 15, 2011
Migration (mostly) Done!
Migration code wasn't hard to do as I expected. It was pretty straightforward, but there's some bugs that I need to fix before I can release it:
It don't correctly recognize systems that are under full influence from an empire, so no migration occurs to any other systems. I think I know the cause of this, so this should be simple to fix.
Population grows to exceed the maximum population (for example, having 104 people on 100 limit planet). There are two formulas that calculate the growth, the normal growth formula, and food abundance formula. I will need to check those and modify them so they become one formula to avoid this problem. I do have some ideas on how, so this also should be simple to fix.
But other than that, it successfully finds planets (currently, only planets from home system) that it can migrate to, and moves people during migration calculations.
After the bugs are ironed out (maybe with some other bugs from issues list in google code page), I will release it either tonight or tomorrow. Then I can start work on something that I've been looking forward for a long time, technologies/research and ship design/construction. Booyah!
It don't correctly recognize systems that are under full influence from an empire, so no migration occurs to any other systems. I think I know the cause of this, so this should be simple to fix.
Population grows to exceed the maximum population (for example, having 104 people on 100 limit planet). There are two formulas that calculate the growth, the normal growth formula, and food abundance formula. I will need to check those and modify them so they become one formula to avoid this problem. I do have some ideas on how, so this also should be simple to fix.
But other than that, it successfully finds planets (currently, only planets from home system) that it can migrate to, and moves people during migration calculations.
After the bugs are ironed out (maybe with some other bugs from issues list in google code page), I will release it either tonight or tomorrow. Then I can start work on something that I've been looking forward for a long time, technologies/research and ship design/construction. Booyah!
Wednesday, April 13, 2011
Partial progress on migration
When I started work on migration stuff, I realized that I needed a feature implemented before I could do migration. The feature in question is the ability to find a path to a grid cell INSIDE a star. If you've noticed in the released version, when you hover above a star, you don't have a path leading to the star. This is because the grid cells in a star is "unpassable".
The migration need to check and see if a path exists from the origin system to the target system, using influence map as the "fuel range" (if the two systems aren't connected via influence, no migration occurs). In order to do that, I need to be able to just give it the system's X,Y coordinates. So I put some work into doing that, and am quite pleased with the result. I can hover over a star and the selected fleet will automatically pick the shortest path to that star. This will make selecting a destination much easier now.
There is a bug however, if you hover to where the path ends at the star, and above the star, sometimes you see different ETA time (the actual duration is the same, just that it reads in one node too many). I'm not quite sure why it's occuring, I've put in checks to prevent reading in unpassable nodes. I'm tired at the moment, so maybe tomorrow when I read the code, I'll hopefully go "Aha!"
Back to topic of migration. This is how it will work:
Planets with over 75% of planet's capacity can migrate. Planets with low population is more attractive than empty planets, up to 25% capacity. Planets between 25% to 75% will experience no migration in either direction.
It calculates population growth first, then grabs a list of planets that is over 75% capacity, and grabs a list of planets that can be migrated to. The planet with the highest amount of migrates will go first, and it goes through list of available planets, starting with the best planet to migrate to first. If a planet is unreachable through influence map, it skips that planet and checks the next planet. This continues until a planet is found, or list runs out. If a planet is found, the maximum amount of migrates is determined from the lowest of two (the migrate planet's amount vs the target planet's immigration limit), and the people are transferred. Both planets are then removed from the list. So it's one to one ratio. This continues until one of the two lists are empty. If no planets are reachable to the origin planet, that origin planet is removed from the list.
I should be done with migration code this week, then I will release the new version.
The migration need to check and see if a path exists from the origin system to the target system, using influence map as the "fuel range" (if the two systems aren't connected via influence, no migration occurs). In order to do that, I need to be able to just give it the system's X,Y coordinates. So I put some work into doing that, and am quite pleased with the result. I can hover over a star and the selected fleet will automatically pick the shortest path to that star. This will make selecting a destination much easier now.
There is a bug however, if you hover to where the path ends at the star, and above the star, sometimes you see different ETA time (the actual duration is the same, just that it reads in one node too many). I'm not quite sure why it's occuring, I've put in checks to prevent reading in unpassable nodes. I'm tired at the moment, so maybe tomorrow when I read the code, I'll hopefully go "Aha!"
Back to topic of migration. This is how it will work:
Planets with over 75% of planet's capacity can migrate. Planets with low population is more attractive than empty planets, up to 25% capacity. Planets between 25% to 75% will experience no migration in either direction.
It calculates population growth first, then grabs a list of planets that is over 75% capacity, and grabs a list of planets that can be migrated to. The planet with the highest amount of migrates will go first, and it goes through list of available planets, starting with the best planet to migrate to first. If a planet is unreachable through influence map, it skips that planet and checks the next planet. This continues until a planet is found, or list runs out. If a planet is found, the maximum amount of migrates is determined from the lowest of two (the migrate planet's amount vs the target planet's immigration limit), and the people are transferred. Both planets are then removed from the list. So it's one to one ratio. This continues until one of the two lists are empty. If no planets are reachable to the origin planet, that origin planet is removed from the list.
I should be done with migration code this week, then I will release the new version.
Monday, April 11, 2011
Influence Maps
The influence maps used for calculating migration/colonization is now mostly implemented. It works in calculating influence from systems and fleets, but I think it's a bit too strong at the moment. I will have to tweak it until it feels right.
Why is influence maps important? They serve many purposes, which I will list:
1. The highest two influences on one grid cell means those two empires are in contact. If no influence between the two empires overlap anywhere, then they're not in contact. You can get in contact by moving some ships near their influence, because your ships will extert some influence.
2. AI calculations. AI now can see if you're pushing against it, especially if you create a massive fleet which will have a lot of influence, and can plan accordingly.
3. Colonization/Migration. When an unoccupied star's grid cells are all dominated by an empire's influence, that empire can now have its people migrate to the system, provided that it's explored
4. Quick overview of your empire's terrority and nearby empires' terrorities.
Now that the influence map are mostly done (just need optimizations and influence strength tweaking, along with fixing the center of circles), the next item on agenda is the migration/colonization code.
Here's a screenshot of the influence map, it's a bit ugly at the moment. I'll have to figure out a way to make it look nice, but that's low on list of priorities. You can see some empires on top left that's close to each other, pushing against each other's influence.
Why is influence maps important? They serve many purposes, which I will list:
1. The highest two influences on one grid cell means those two empires are in contact. If no influence between the two empires overlap anywhere, then they're not in contact. You can get in contact by moving some ships near their influence, because your ships will extert some influence.
2. AI calculations. AI now can see if you're pushing against it, especially if you create a massive fleet which will have a lot of influence, and can plan accordingly.
3. Colonization/Migration. When an unoccupied star's grid cells are all dominated by an empire's influence, that empire can now have its people migrate to the system, provided that it's explored
4. Quick overview of your empire's terrority and nearby empires' terrorities.
Now that the influence map are mostly done (just need optimizations and influence strength tweaking, along with fixing the center of circles), the next item on agenda is the migration/colonization code.
Here's a screenshot of the influence map, it's a bit ugly at the moment. I'll have to figure out a way to make it look nice, but that's low on list of priorities. You can see some empires on top left that's close to each other, pushing against each other's influence.
Wednesday, April 6, 2011
Planets and Production
I've implemented population growth/dying processing. How it works is this: It calculates the normal population growth, factoring in remaining space, and current population. It then calculates any extra population growth from food surplus, or negative growth if food supply is lower than population count. It adds both (note, the population growth from food is higher on per-unit basis than normal growth, so starvation can easily outpace population growth), then add the total to population. If population drops below 0.1, the planet has died off and you lose control on the planet.
Now for pollution. If it's above the cleanup efforts, the planet's population capacity (i.e. max population of 100) will drop. You can fix this by increasing the cleanup so it exceeds the pollution. This slider will also act as terraforming when you get appropriate technologies. Pollution don't affect the planet's capacity right now however.
After some deliberating, I've decided to remove the infrastructure part of the planet. All output will be direct from population. So the more people you have, the better. This is similar to Master of Orion 2 where you allocate people to different fields. But there won't be any special buildings to build that enhances your output. There will be technologies that automatically increase your output however. This will make things simpler and less confusing, both on user's end and developer's end.
There's three more items that I would like to see completed before I release the next version. Those are:
Influence maps for computing which planets to migrate to
Migration code (calculating how much people migrate from a planet, and how much will arrive at a planet)
Ship construction UI/code
When the three items are done, then we'll be back at where I started refactoring. The old version had construction and colonization. Then I'll start focusing on research and ship designs :D
Now for pollution. If it's above the cleanup efforts, the planet's population capacity (i.e. max population of 100) will drop. You can fix this by increasing the cleanup so it exceeds the pollution. This slider will also act as terraforming when you get appropriate technologies. Pollution don't affect the planet's capacity right now however.
After some deliberating, I've decided to remove the infrastructure part of the planet. All output will be direct from population. So the more people you have, the better. This is similar to Master of Orion 2 where you allocate people to different fields. But there won't be any special buildings to build that enhances your output. There will be technologies that automatically increase your output however. This will make things simpler and less confusing, both on user's end and developer's end.
There's three more items that I would like to see completed before I release the next version. Those are:
Influence maps for computing which planets to migrate to
Migration code (calculating how much people migrate from a planet, and how much will arrive at a planet)
Ship construction UI/code
When the three items are done, then we'll be back at where I started refactoring. The old version had construction and colonization. Then I'll start focusing on research and ship designs :D
Subscribe to:
Posts (Atom)