Finished fortifications.
Every cell in the game can have fortifications on each of its hexsides from level 1-10. However only forts up to level 3 can be built during the game, the other levels are reserved for major fortification systems built in peace time like the Maginot Line. These can only be built in the editor.
This following enhancements were made:
1) Enemy units invading an occupied hex across a hexside that has fortifications will automatically be fired upon by the forts. The forts increase both the hard and soft attack factors of the defending units. Forts can be reduced by enemy engineers.
2) A new brigade type was added, engineers. These are similar to infantry but they have some short range heavy weapons with anti-armor capability. They also have a number of special abilities including building fortifications, reducing enemy fortifications and bridging rivers (not yet implemented).
3) A new strategic command was added, build forts. Any time an unmoved unit that has brigades with this ability in a non-combat hex and has adequate supply and energy, it can attempt to increase the fortification level of one hexside up to a maximum of level 3. There is a percentage chance depending on the number of brigades involved but whether it works or not it will consume a large number of supplies and energy.
4) A new operational command was added, reduce forts. An invading unit with engineer brigades entering a fortified hexside can attempt to reduce it. This also has a percentage chance of success and will result in some casualties. This will also increase the recon level of the unit which will increase the likelyhood of future success.
Next up...
Victory conditions
Monday, July 16, 2012
Tuesday, June 26, 2012
Unit Production
Unit production is mostly complete pending a few tweaks. Here's a summary taken from the manual:
Unit production is handled in the Unit Production Toolbar. This can be activated by clicking the tank symbol on the main control toolbar:
The Unit Production Toolbar is divided into 3 areas:
1) Resource summary - This shows all of the available resources for building units (men, afvs, planes, etc.)
There are 4 lines:
2) Available units - This shows a summary of all the available units that can be built along with details as to their commanding unit, resources needed, earliest arrival turn, etc. Clicking on the categories above the units will toggle each type on and off. Clicking on the page up and page down arrows will page through them. Right clicking will go to the start / end of the list. Clicking on a header will sort by the data in that column.
Of special note is the Avail T (available turn) column. This column indicates the first turn that the unit will become available. Even if all the resources required to build a unit are on hand, it still will not be deployed until this turn so it is better to wait until you are close to the available turn of a unit before moving it to the production queue.
The unit name shows the HQ in parentheses after it. If the HQ is not currently on the map, it will also show an asterix. To create a unit, click on its name. The Unit Production Toolbar will temporarily close and the map will have all available deployment cities highlighted. Clicking on one of these cities will set that as the deployment city. The toolbar will reopen and the unit will be moved to the bottom of the ‘in production’ queue. Clicking anywhere else on the map will cancel the build and reopen the toolbar.
3) In Production - This shows a list of all units currently in production including their progress, arrival city, earliest build turn, etc. They are sorted in order of priority and will be filled with available resources in the order shown. The two numbers separated by the ‘/’ symbol indicate the number assigned / number needed to complete the unit. Units are filled at the beginning of each turn from available resources in the order they appear in this list. The Build T column indicates the number of remaining turns until the unit is ready to be deployed.
Units can be moved up and down through the list by clicking on the arrows in the Order column. Right clicking moves them to the beginning / end.
As with the available units, categories can be turned on and off by clicking on the category tag above the list and the page buttons will move up and down through the list. The deployment city is shown in the City column. Clicking on it will temporarily hide the toolbar and center the map on this city.
To cancel a unit, click on its name. This will move the unit back into the available queue. However, any resources assigned to the unit will be moved to the ‘in transit’ category and be unavailable for a turn.
Unit production is handled in the Unit Production Toolbar. This can be activated by clicking the tank symbol on the main control toolbar:
The Unit Production Toolbar is divided into 3 areas:
1) Resource summary - This shows all of the available resources for building units (men, afvs, planes, etc.)
There are 4 lines:
1) Prod Rate - This shows the number of new soldiers being trained each turn and the number of key equipment types being produced.
2) Reserved - This shows the percentage of each type being reserved for new unit creation (as opposed to reinforcement). Left clicking on the +/- buttons will increase/decrease the percentage by 1. Right clicking will increase/decrease by 10.
3) Available - This shows the number currently available for building units. They will be applied to units in the production queue at the beginning of next turn.
4) In Transit - When you cancel a unit that is in production, all men and equipment are considered ‘in transit’ for a turn. Also, when units are destroyed in combat, some soldiers will make their way to the in transit queue. Finally, disbanded units send their men and equipment to the in transit queue. They will be transferred to the available queue at the beginning of next turn.
2) Available units - This shows a summary of all the available units that can be built along with details as to their commanding unit, resources needed, earliest arrival turn, etc. Clicking on the categories above the units will toggle each type on and off. Clicking on the page up and page down arrows will page through them. Right clicking will go to the start / end of the list. Clicking on a header will sort by the data in that column.
Of special note is the Avail T (available turn) column. This column indicates the first turn that the unit will become available. Even if all the resources required to build a unit are on hand, it still will not be deployed until this turn so it is better to wait until you are close to the available turn of a unit before moving it to the production queue.
The unit name shows the HQ in parentheses after it. If the HQ is not currently on the map, it will also show an asterix. To create a unit, click on its name. The Unit Production Toolbar will temporarily close and the map will have all available deployment cities highlighted. Clicking on one of these cities will set that as the deployment city. The toolbar will reopen and the unit will be moved to the bottom of the ‘in production’ queue. Clicking anywhere else on the map will cancel the build and reopen the toolbar.
3) In Production - This shows a list of all units currently in production including their progress, arrival city, earliest build turn, etc. They are sorted in order of priority and will be filled with available resources in the order shown. The two numbers separated by the ‘/’ symbol indicate the number assigned / number needed to complete the unit. Units are filled at the beginning of each turn from available resources in the order they appear in this list. The Build T column indicates the number of remaining turns until the unit is ready to be deployed.
Units can be moved up and down through the list by clicking on the arrows in the Order column. Right clicking moves them to the beginning / end.
As with the available units, categories can be turned on and off by clicking on the category tag above the list and the page buttons will move up and down through the list. The deployment city is shown in the City column. Clicking on it will temporarily hide the toolbar and center the map on this city.
To cancel a unit, click on its name. This will move the unit back into the available queue. However, any resources assigned to the unit will be moved to the ‘in transit’ category and be unavailable for a turn.
Next up fortifications....
Friday, June 15, 2012
More optimization results
I created sort of a super scenario to test my optimizations. I've beefed up both sides by about 5x and France now has an army of 231 corps containing 924 divisions totaling over 11 million men! The actual French Army in WWII consisted of about 123 divisions so this mock up is approximately 7 1/2 times as large.
This is just to see if my supply system is large enough to handle a very large army.
Anyway, here's the timing logs before optimization:
111661852| 0|Supply Points to Units
111704450| 42598|Depots to Units
111727008| 22558|Depots to Units
111756022| 29014|Rail to Units
111773117| 17095|Cities to Depots
111775071| 1954|Depots from cell
The first column shows the clock, the second the time elapsed since the last log and the third a description of what happened. Note, the time for an action appears on the line AFTER the description. The total of the 4 highlighted actions is 111,265 milliseconds or about 1 minute 50 seconds. Total time for the complete cycle is about 2 minutes.
Here's the same timing log after optimization:
33627270| 0|Supply Points to Units
33627866| 596|Depots to Units
33628545| 679|Depots to Units
33628928| 383|Rail to Units
33637130| 8202|Cities to Depots
33639272| 2142|Depots from cell
We are now down to a very reasonable 9860 milliseconds or about 10 seconds. Total time for the complete cycle is now about 19 seconds.
This can be cut down even further and will probably have to be once Russia comes on board but for now its good enough to not get in the way of further development.
So I'm on to the next stage:
Unit production....
Wednesday, June 13, 2012
Some new screenies
I've completely reworked Spain and built out France as a complete nation. This was needed to support the new supply network, otherwise French troops ran out of supplies very quickly and were easily defeated by well supplied Spanish troops.
Here are some screenies:
Here are some screenies:
This shows the new peak layer which was surprisingly difficult to do. After trying various overlay techniques, I found that cloning the mountain layer to another layer with a bluish white overlay and a large bluish white outer glow provided the best effect. I also had to darken the mountains a bit to provide enough contrast.
This shows the peaks in the Alps.
Zoomed out view of France showing the large rail network and cities.
This is zoomed in a bit more to show the new look of the rail. Finally was able to get a double rail look by using a 5 pixel line followed by a 2 pixel eraser. The ties are a custom brush that had to be recreated after my hard drive disaster wiped out all of my photoshop brushes. Finally realized to take notes on all these effects and save off custom brushes as separate files so I can recover them next time.
Tuesday, June 12, 2012
Some optimization results
Well the first stage of my optimization has been a resounding success. I changed the way I check whether units are in range of their HQ at the begining of a turn. This determines command for the entire turn which has a wide range of implications including morale, organization and the ability to execute advanced commands.
I dropped the time it took to calculate the French side (3 HQ's and 31 corps) from 7.5 seconds to 0.4 seconds. If we assume about 600 Corps for the peak of the Soviet Army, we get about 7.7 seconds which is reasonable. The previous method would have been an excruciating 2 minutes and 25 seconds!
How did I get such an increase in efficiency? Well it was quite simple, I quit doing it the stupid way.
I have 2 basic functions that represent the core of the map navigation capabilities in my game:
1) GetPath - Given a unit, a target and a command (move, advance, air transport, sea transport, etc) it will return the most efficient path as a vector of cells.
2) GetCellsInRange - Given a unit, a command and a range, it will return a vector of all cells reachable with those constraints.
Interestingly enough, (2) takes approximately as long as finding a path to the furthest cell in the range. In fact, (1) can be implemented by first executing (2) and then walking back from the target cell to the starting cell by always going to the neighbor cell with the lowest total travle cost (this is essentially Dijkstra's Algorithm). It CAN be implemented that way, but it isn't because that would negate the efficiency of the A* algorithm which starts with Dijkstra's algorithm and adds a constraint that cuts down on the number of wasted cells that must be checked.
Before I optimized, I used the rediculously slow method of cycling through each unit and trying to plot a path back to its HQ. I switched this around and went to each HQ and found all cells within the HQ's command range and marked them. Then I simply cycled through each of the HQ's children and checked if that cell had been marked as in range. For the example above, this reduced the number of path checks from 31 to 3. But its even bigger than that because units that were far from their HQ would have been even more inneficient under the old system. And HQ's that happen to be in low mobility territory like mountain ranges would be extremely quick to calculate.
My next step is to apply the same idea to locating supply cities. Like before, I was cycling through each city and attempting to plot a rail path back to the capital. I will attempt to switch it around and use (2) starting from the capital to identify all supply cities.
Monday, June 11, 2012
Supply and reinforcement done... sort of
Supply and reinforcement is functionally complete but it is extremely slow.
I like the functionality and I've built out France to be a complete nation so that the French troops will have their own supply chain while they invade Spain in my mythical test scenario.
Normally, it is considered bad form to optimize prematurely. There are a lot of good reasons for this, the biggest being that you are likely to make changes down the road that will force you to re-optimize later.
However, I've decided to bite the bullet and tackle it now for a couple of reasons:
1) It is so slow that it will make testing everything painful. This will cause a development inefficiency as I have to wait every time I hit the new turn button.
2) It is slow even with the relatively small countries and armies of France and Spain. What happens when I get Russia built out with a 4 million man army??? If I can't make it fast now, I'm in big trouble when the complete game is done. Might as well find out now if my supply chain system is just flat out too slow and needs to be scrapped and re-written.
3) Most of the optimization should be doable by simply caching the previous supply chain and then having some sort of test to determine how much of it needs to be recalculated. This is fairly straightforward.
4) The supply chain code is fresh in my mind right now. If I come back to optimizing it in 3 months, I will need to bring myself back up to speed.
So, taking that all into account, I'm extending this release to include an optimized supply chain procedure...
I like the functionality and I've built out France to be a complete nation so that the French troops will have their own supply chain while they invade Spain in my mythical test scenario.
Normally, it is considered bad form to optimize prematurely. There are a lot of good reasons for this, the biggest being that you are likely to make changes down the road that will force you to re-optimize later.
However, I've decided to bite the bullet and tackle it now for a couple of reasons:
1) It is so slow that it will make testing everything painful. This will cause a development inefficiency as I have to wait every time I hit the new turn button.
2) It is slow even with the relatively small countries and armies of France and Spain. What happens when I get Russia built out with a 4 million man army??? If I can't make it fast now, I'm in big trouble when the complete game is done. Might as well find out now if my supply chain system is just flat out too slow and needs to be scrapped and re-written.
3) Most of the optimization should be doable by simply caching the previous supply chain and then having some sort of test to determine how much of it needs to be recalculated. This is fairly straightforward.
4) The supply chain code is fresh in my mind right now. If I come back to optimizing it in 3 months, I will need to bring myself back up to speed.
So, taking that all into account, I'm extending this release to include an optimized supply chain procedure...
Tuesday, May 15, 2012
Supply and Production
I had a catastrophic crash of my laptop. I re-installed the OS and drivers and downloaded all 85gig of my backup from Carbonite only to discover that my hard drive was bad. I've ordered a new one and continued development knowing that at any moment my laptop may crash and be unrecoverable.
Thank God for backups!
The one item lost was about 3 hours of map work in a Photoshop file that appears to be corrupted. In addition, I had about 3-4 days of downtime between when the trouble started and when I was able to get coding again.
I have made some progress on the next stage, supply and production.
From the manual:
At the beginning of each nation turn, the supply network is recalculated. It can be displayed by toggling on ‘RRS’ view (Rail / Resource / Supply) view with the ‘R’ key. All areas in supply will be highlighted in green or blue green as described below.
The supply system in Grand Strategy WWII consists of 3 parts:
By default it is the active capital. However, the user has the option of moving the supply root. This can be done from the control page of the cell details screen of the new supply hub location. Moving the supply root has a cost and should only be done as a last resort. Between 10% and 30% of each resource will be lost in this transfer. In addition, 2 entire turns worth of rail transport points will be consumed by the move making rail transport unusable for at least the next 2 turns.
Each Supply Point has a priority level which can be None, Low, Medium, or High. These determine how much supply and reinforcements will be routed to them each turn. This can be done from the control page of the cell details panel.
2) All manufacturing facilities will use supplies on hand to produce manufactured goods.
3) Manufactured goods will then be transferred to supply points based on their respective supply levels.
4) Supplies and reinforcements will then be transferred to mobile supply points based on their respective supply levels.
5) Supplies and reinforcements will then be transferred to units within range of the supply network based on need.
6) Supplies and reinforcements will be transferred from mobile supply units to units within their command and supply range.
7) Supplies will be transferred from mobile supply units to units within their supply range that are not in same command.
Here are some screen shots to illustrate:
Thank God for backups!
The one item lost was about 3 hours of map work in a Photoshop file that appears to be corrupted. In addition, I had about 3-4 days of downtime between when the trouble started and when I was able to get coding again.
I have made some progress on the next stage, supply and production.
From the manual:
At the beginning of each nation turn, the supply network is recalculated. It can be displayed by toggling on ‘RRS’ view (Rail / Resource / Supply) view with the ‘R’ key. All areas in supply will be highlighted in green or blue green as described below.
The supply system in Grand Strategy WWII consists of 3 parts:
1) Supply Root
The supply root is the central hub of the supply network. This is shown by a yellow border around the hex when in RRS view. This must be a city connected to rail or a sea port. The Supply Root is the central control location for all supply related activity. All supply flows through this location. It should be protected at all costs.By default it is the active capital. However, the user has the option of moving the supply root. This can be done from the control page of the cell details screen of the new supply hub location. Moving the supply root has a cost and should only be done as a last resort. Between 10% and 30% of each resource will be lost in this transfer. In addition, 2 entire turns worth of rail transport points will be consumed by the move making rail transport unusable for at least the next 2 turns.
2) Supply Points
Every city controlled by the nation that can trace a path through either friendly, undamaged rail and / or sea ports to the supply root constitute a Supply Point. These are displayed with a black border. The Supply Root is also a Supply Point. Each Supply point provides a transportation network to and from all of the cells within its supply range. All cells in range of supply points will be displayed with a green highlight. Clicking on a city while in RRS mode will highlight the specific hexes in range of that city.Each Supply Point has a priority level which can be None, Low, Medium, or High. These determine how much supply and reinforcements will be routed to them each turn. This can be done from the control page of the cell details panel.
3) Mobile Supply Points
Each supply unit provides mobile supply to the surrounding hexes within its supply range. These are shown as blue green highlights. Selecting the supply unit will highlight its specific cell range.Flow of Resources and Supply
1) All resources in supply range (green) will be transferred each turn to the supply network and from there to the various factories that use them.2) All manufacturing facilities will use supplies on hand to produce manufactured goods.
3) Manufactured goods will then be transferred to supply points based on their respective supply levels.
4) Supplies and reinforcements will then be transferred to mobile supply points based on their respective supply levels.
5) Supplies and reinforcements will then be transferred to units within range of the supply network based on need.
6) Supplies and reinforcements will be transferred from mobile supply units to units within their command and supply range.
7) Supplies will be transferred from mobile supply units to units within their supply range that are not in same command.
This shows the green and blue green areas which show main supply and mobile supply.
This shows the mobile supply area for the selected supply unit. This us useful when two or more mobile supply units areas overlap. Since combat units can only draw reinforcements from a mobile supply unit in the same command tree, it is important to know if you are in range of your mobile supply unit.
Here, units have been hidden to show the supply root (Madrid) shown with a yellow stroke and other supply points shown with a black stroke.
Subscribe to:
Posts (Atom)
.png)




.png)
.png)
