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...
Monday, June 11, 2012
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.
Sunday, May 6, 2012
Version 0.1.4.7 Completed
Sound.
I got some very good advice from an industry insider about the proper way to implement sound in a strategy game. I decide to go ahead and implement that right away in case there were some issues with the game library I'm using. It was pretty straightforward and I implemented both movement and combat sound.
Now I can get back to production and supply....
I got some very good advice from an industry insider about the proper way to implement sound in a strategy game. I decide to go ahead and implement that right away in case there were some issues with the game library I'm using. It was pretty straightforward and I implemented both movement and combat sound.
Now I can get back to production and supply....
Saturday, May 5, 2012
Version 0.1.4.6 Completed
Fixed a few minor display issues. Most importantly some layout issues with the unit placement panel.
Key changes:
Added command highlighting.
Clicking on an HQ will show all units within command range with green highlight and those outside of command range as grey. Clicking on a unit will show its command unit in red and siblings in blue. Clicking on an HQ and pressing the 'D' key will show the command range of the HQ as yellow for 5 seconds.
Added supply corps under HQ.
This corps acts as the supply / reinforcement center and moves independently of the HQ. All supplies and reinforcements will go through this unit to the individual corps.
Added HQ effects.
Units in HQ range will now get a boost to organization and morale at the beginning of each turn. Those outside of command range will not. This can be a deciding factor in combat and allows retreating and broken units to recover.
Added HQ specific command matrix.
This adds the ability to add commands that are specific to an HQ. The first one added is combined arms which allows the sharing of recon between units in command that are participating in a combined arms assault. Requirements also include at least one armor / mech and one infantry unit.
Added Entrench command.
This command allows units that don't move to 'dig in' for better defensive ability. Happens automatically to a point for a unit that doesn't move. Can be increased further by explicitly entrenching. Uses up all available movement.
Fleshed out Cell Details panel.
This is now a two page panel consisting of an Overview and a Production page. The overview contains all pertinent cell details while production is a placeholder for the production model. Also added more cell details to the combat panel.
Key changes:
Added command highlighting.
Clicking on an HQ will show all units within command range with green highlight and those outside of command range as grey. Clicking on a unit will show its command unit in red and siblings in blue. Clicking on an HQ and pressing the 'D' key will show the command range of the HQ as yellow for 5 seconds.
Added supply corps under HQ.
This corps acts as the supply / reinforcement center and moves independently of the HQ. All supplies and reinforcements will go through this unit to the individual corps.
Added HQ effects.
Units in HQ range will now get a boost to organization and morale at the beginning of each turn. Those outside of command range will not. This can be a deciding factor in combat and allows retreating and broken units to recover.
Added HQ specific command matrix.
This adds the ability to add commands that are specific to an HQ. The first one added is combined arms which allows the sharing of recon between units in command that are participating in a combined arms assault. Requirements also include at least one armor / mech and one infantry unit.
Added Entrench command.
This command allows units that don't move to 'dig in' for better defensive ability. Happens automatically to a point for a unit that doesn't move. Can be increased further by explicitly entrenching. Uses up all available movement.
Fleshed out Cell Details panel.
This is now a two page panel consisting of an Overview and a Production page. The overview contains all pertinent cell details while production is a placeholder for the production model. Also added more cell details to the combat panel.
Tuesday, April 24, 2012
Here is an update on version 0.1.4.5
Adding combat caused a lot of problems with playback. These have been fixed along with adding combat summary for each battle.
2 new strategic commands were added: defend and delay. These allow a player to plot a retreat path for a unit so that it can make an orderly withdrawal from combat before being forced to make a hasty retreat.
The difference between the two is the moral threshold that needs to be reached in order to trigger the withdrawal.
Next up is rail movement which includes a lot of infrastructure to be used for all transport types (rail, ship, amphibious, air, airborne).
Rail movement is allowed along connected paths of rail hexes that are all controlled by the units alliance and are not damaged.
The unit may embark and disembark from any rail hex (does not need to be a city). However, the level of infrastructure in that hex will directly impact the number of movement points consumed by the unit. It will be much more efficient to load and unload in a major metropolitan area than out in the middle of nowhere. All units will take an organization hit when they disembark which is again dependent on the level of infrastructure in that cell.
Each city has a rail capacity that is shared across the rail network. The nation's total rail capacity is the sum of these. As a nation loses cities, it will also lose rail capacity. Units using rail transport will consume the nation's rail capacity every time they embark, disembark and move by rail. The cost in terms of rail capacity depends on the sum of the cost of each brigade. HQ's are almost free while mechanized units are much more expensive. Once a nations capacity reaches 0, no more rail movement will be allowed that turn. However, units will still be able to disembark at this point but it will consume next turns rail capacity. This means its possible to start a turn with less than full capacity remaining or even in extreme cases negative rail capacity. In the latter case, no rail movement would be allowed that turn.
Any unit that ends its turn still in rail transport mode is vulnerable to attack by an enemy unit. If any enemy combat unit enters the hex, the rail unit will be forced to immediately disembark with a major hit to organization and a smaller hit to moral and a situational awareness level of 0. This will leave the unit very vulnerable to attack. The nations rail capacity will also be affected.
The next big development task will be HQ's.
I will be adding the following brigades to each HQ that travel with it:
1) Staff brigade - this represents all of the officers and their staff.
2) Fuel depot
3) Ammo depot
4) Supply depot
5) Reinforcements (Men)
6) Reinforcements (AFV's)
Here are some recent screen shots showing the latest release in action (0.1.4.5):
The scattered Spanish forces are using rail to rush to the front indicated by the dark grey arrows. The rail symbol over the unit indicates that it is currently using rail transport. Rail is limited and both the size of the unit and the distance it travels use up the nation's rail allotment. Each city has a rail capacity and the nation's total rail capacity each turn is determined the sum of the cities it controls. Note the HQ for this unit is highlighted in red and its siblings in blue. This makes it easier to keep HQ's with their forces. The yellow caution sign shows damaged rail under repair. This is currently unusable for rail transport.
This shows the editor in unit placement mode. The last of the French units are being assembled for invasion. The number in the upper left hand corner indicates the size of the stack with a maximum of 6 units. The tab key cycles through the stack.
The play button has been pressed and the game is starting with the French crossing the frontier into Spanish territory. The yellow arrow indicates this unit is advancing through enemy territory which is slower and uses more resources than advancing through friendly territory.
The Pyrenees Mountains are impassable in the center. Most of the units are heading through the passes in the north but one infantry unit is circling around to attack Barcelona from the east. The green arrow indicates friendly territory.
The scattered Spanish forces are using rail to rush to the front indicated by the dark grey arrows. The rail symbol over the unit indicates that it is currently using rail transport. Rail is limited and both the size of the unit and the distance it travels use up the nation's rail allotment. Each city has a rail capacity and the nation's total rail capacity each turn is determined the sum of the cities it controls. Note the HQ for this unit is highlighted in red and its siblings in blue. This makes it easier to keep HQ's with their forces. The yellow caution sign shows damaged rail under repair. This is currently unusable for rail transport.
This shows one of the 5 pages of unit data. They are overview, combat, status, supply and transport. The color coding allows a quick view of the status. Green is 100% and it changes to yellow, orange, red and finally black as you drop down to 0. The same color coding is used on the units. The bottom left indicates overall strength while the lower right indicates supply.
This is a zoomed out view (there are 7 zoom levels) with the grid enabled.
This shows the aftermath of a battle. The French have taken control of the hex and the retreating Spanish 6th Infantry Corps is in bad shape. One of its brigades is shattered and several more are retreating causing the entire corps to retreat to safety. Even one of the supporting artillery units has been overrun and severely damaged. The combat summary is shown at the top of the combat results and you can scroll down through the pages of detail to get a blow by blow description of the events. FOW is set to none so enemy units in a combat hex can be seen in detail.
Turn 3 and the French have cleared the mountains and begun to put a lot of pressure on the Spanish. The river provides some protection and the Spanish are attempting to assemble a defensive line behind it but will eventually have to fall back all the way to Madrid where the final battle will inevitably take place.
Sunday, April 22, 2012
Version 0.1.4.4 - Combat is almost completed. Here are some key concepts relating to the combat model:
1) Situational Awareness
Each brigade has a situational awareness level that determines its ability to detect the enemy during combat. Whenever a unit moves to a new hex, its SITA drops to a level determined by the owning nation and control of the new hex. If a unit moves into a hex belonging to the enemy and controlled by the enemy, its SITA will be much lower than if it is a friendly owned / controlled hex. This is to reflect regional familiarity and support of the locals.
Every turn a unit remains in the same hex, its SITA will increase. Dedicated recon missions will also increase SITA. When combat begins, the relative SITA of each side will determine who shoots first and is also used in the combat effectiveness calculation. Because of the high lethality of the weapons systems, the first side to fire will often gain the upper hand in an otherwise even battle.
2) Form Up Position
When units enter an enemy hex, they do not immediately engage in combat. Instead, they move to a Form Up Position or FUP. This is a position just outside direct contact with the enemy from which various operational missions can be launched. A unit in this position is considered committed to combat and will pay a penalty in movement points for withdrawing back into the cell from which it entered known as the withdrawal hex. In game terms, the unit is shown in the combat hex with a pointer showing the hex 'edge' that it occupies.
When a combat hex is clicked on, the Combat Panel appears with a blown up view of the hex along with all invading and occupying units shown in their respective positions. Occupying units do not have a specific edge but are considered to be spread around the perimeter to engage any enemy units in a FUP.
The command button is pressed and a list of all valid commands for the current hex appears. After clicking the command, you may select one or more units and then click the execute button. At that point, 1-10 rounds of combat will take place depending on user selection (set by typing keys 1-0). Each round will use approximately 25% of available units from each selected corp which are rotated to the front on a least recently used basis. The standard setting is 4 rounds per execution which will generally use every brigade in each selected corp once. However, as brigades are degraded due to lack of supplies, casualties, drop in morale or simply run out of movement points, etc, it may effect the actual number of participating brigades.
The unit details screen shows the last combat round that each brigade has engaged in and can be used to determine which units are likely to be selected next. Units whose morale drops below a certain threshold will retreat or break and immediately withdraw from combat. If either side loses all combat units from a hex, the other side will immediately take control of the hex and combat will be completed. Any leftover non combat units (usually HQ's) will be forced to perform a hasty withdrawal or captured / destroyed if there is nowhere to run.
Only 3 units may occupy a single edge at a time which allows a total of 18 units to engage in the invasion of a single hex at one time. The defending side may have up to 6 combat units and any number of non combat units. Units in a FUP may only withdraw to the hex from which they entered, this is the withdraw hex. If an enemy unit enters the withdraw hex the unit is cutoff and force to make an immediate hasty withdrawal to any available friendly controlled hex with penalties in casualties and moral. If no friendly hex is available, the unit is destroyed.
3) Strategic / Operational Commands
There are two basic types of commands: strategic and operational. Strategic commands span multiple map cells. So moving from one cell to another, patrolling a group of cells or bombing a cell would all qualify as strategic commands.
All commands executed from within the same cell are considered operational commands. Recon, assault and artillery bombardment would be examples of operational commands.
Here is a quick example of the combat model in action:
A lone Spanish militia corp is defending a small town in clear terrain against an attack by 2 French infantry corps and a French armored division. The militia corp has no artillery support, no long range weapons and is of lower morale and training than the invading forces making this a very one sided battle.
The invaders are attacking from 2 sides forcing the defending unit to split their forces in half to cover the front. Since the invaders have just entered their FUP's they have very low situational awareness so the defender gets to fire first.
However, since the attacking infantry corps each have 4 division containing an artillery brigade each the first action is a round of bombardment by the artillery. And since this is clear terrain and non urban infrastructure, the armored division is able to attack at long range allowing 2 rounds (artillery barrage and long range high caliber direct fire) of attack before the militia unit is able to respond.
Once these rounds have completed, the attacking units close the gap and engage the militia at close range. At this point the militia unit is able to fire first but its far too little too late and the responding short range fire by the attacking units aided by the shock value of the armor overwhelms and breaks the militia unit which immediately executes a hasty retreat. This hasty retreat results in more casualties, some captured units and a complete collapse of morale.
The armored unit which still has plenty of movement points can continue to pursue this retreating unit or engage in other operations elsewhere.
Here is the final battle summary:
You can also scroll down through the detail to get a blow by blow description of the battle.
Subscribe to:
Posts (Atom)
.png)
.png)









.png)