Tuesday, February 03, 2015

Back Again for a While...

I noticed today that this blog was no longer accessible.  It seems my gmail account was disabled and that took the blog with it.  Silly Google.  I may have to look into moving this into a more reliable provider.

In any event, I've been busy.  Personal update.  In 2014
  • I attained the Microsoft C# Specialist certification.
  • Wound down one scrum team at work, participated on another as a supplementary architect and then took over a third as primary architect.
  • Delivered presentations at work on Windows Phone 8 programming and Xamarin iOS programming.
  • Completed a Windows Phone 8 app and most of a port of the same to iOS using Xamarin.  Laundry timing utility.  Coming soon to the respective app stores.
  • Prepared for and survived a week long trip to Disney World with my family.

I'll likely keep this blog for personal comments, but I'm very likely to repoint coherentlite.com to a new blog if I use CoherentLite as a company name for the apps work.

My goals for 2015 are
  • Walk 10000 steps per day.
  • Work 4 hours per week on my apps and other interests.
  • Work 2 months (at 4 hours per week) on the PIC Guam AI proof of concept.

Labels: , , , , , ,

Sunday, April 08, 2012

And Then It Exploded

I'm working on the AI code for PIC-Guam. In the last few months I have been able to spend a few hours optimizing the fire combat AI. I was able to get it to work reasonably well by replacing or changing a lot of LINQ statements from my "hello world" version from last year. This included movement code based on locating the phasing side's unit for maximum combat effect.

It did not scale.

I got three Japanese units to execute defensive fire, movement, and offensive fire on successive turns until the eight US units were eliminated. This worked rather well, but I needed to try the US side, as this approach would work in the offense but not the defense. I added code to run the US or the Japanese side (or both) in the AI depending on a selection.

This blew up in a combinatorial explosion resulting in OutOfMemoryExceptions. Every time. Optimizing the code was not going to solve the problem. The algorithm sucks: for a given set of attackers with range of target units it is O(Attackers ** Targets).

I decided to separate the movement AI from the combat AI. I will move the HQ units relative to the local FEBAs and other friendly HQs. Based on this, I will move the units to stay uniformly distributed to the FEBA in their respective HQs' sectors. Artillery will probably congregate near HQ units. As the lowest echelon HQ units need to be within 6 hexes of the FEBA in order for subordinate units to be in supply, this means most (US) artillery units will range the FEBA.

I did a proof of concept this afternoon. I hard coded a FEBA and let the allocation code run a movement. This worked fine for the US. I then proceeded to try combat. Which exploded.

I fixed the explosion by adding code to bias the AI in favor of attacks against adjacent units. This reduced the number of potential fire allocations by a factor of 50. For the eight US units against 3 Japanese units, it runs in almost no time: .167 seconds for 1024 fire allocations.

I may have to revisit the performance as I scale to the full Orote scenario, and again as I scale to the full ORBATs.

Total time this weekend was 8.5 hours.

Next step is to add code to determine a local FEBA. I can review the Eylau AI for useful techniques, and I can manipulate the test database to try different scenarios. It's also a good time to complete the Orote scenario ORBAT.

Labels: , , , ,

Sunday, November 06, 2011

Game Development Status 11/6/11

I am continuing to work on the prototype for the AI and UI for PC PIC-Guam. This weekend I wrote the evaluation function for the Fire Combat AI, hooked the AI up to the game system, and got the Japanese to conduct a Defensive Fire. I'm filling in around the edges now. The UI is not displaying color overlays to indicate the target hexes of the AI's fire combats. I also have some additional testing to do to make sure the game phases out of AI fire phases OK. After that I need to make sure the AI moves execute, and then I will change the game to have the AI run the US side.

My backlog (from Evernote) looks like

Finish the prototype
Write the Eval method
11/6/11 - 2 hours
Hand-calc the stat avg values
this was not necessary, as it is possible to calculate the values.
Write the allocation selection code
11/6/11 - 1 hour
Write code to apply the selected fire allocation and resolve the attacks
11/6/11 - 1 hour
Test to confirm that attacks occur and make sense: phase, AI runs, game resolves fires from selected allocation, player reviews results, phase again and results no longer display
Write code to move the AI's units.
Change the code to play the US side
Test the movement part of the code
Remove assault and reorg phases
Test to confirm that AI and player phase the game and that each phase has something real happening
Write code to detect victory conditions and display a victory message (turns/duration date of victory, victory conditions)
Add the full orbat for the first scenario
Test the first scenario
do I need to remove other (unused) phases ?
Write an installer including a EULA with full disclaimers
test on home laptop and dawn's laptop: install, uninstall, BVT (run 1 turn), full game to include victory conditions

Labels: , , , , , ,

Tuesday, June 15, 2010

Ready, Fire, Aim (Oops)

I'm working on the fire combat model for the PIC-Guam prototype. I added a FireCombat class to contain the information about the combat. I added a Turn class with lists of FireCombats for the US and Japanese fire phases, and added a list of Turns to the Game class. Then I got down to work. I added a bunch of code to support combat results table (CRT) processing. FireCombatResolution, OddsRatio and FireDieRollModifier are all enums. I also added FireCombatCRT and FireModifier classes, and nonserializable static lists of same to the main FireCombat class. Finally, I added a constructor to FireCombat and a couple of methods to setup the lists of FireCombatCRTs and FireModifiers.


And that was my 49 minutes for today.

Labels: , , , ,

Saturday, June 05, 2010

PIC-Guam Game Development Status 6/5/10

This is my first blog post using Windows Live Writer.  It may take me a while to get the formatting right…

I’m continuing to make progress on the prototype for PIC-Guam.  In May I spent over 26 hours working on the game.  I have better momentum now that I’ve had since the last Origins trip for PC Eylau in 2005.

My post last October was quite optimistic in a couple of areas.  I underestimated the amount of work to be done to produce a viable prototype, and I overestimated the amount of time I would have over the 2009 holiday season to work on the game.

I only really got a clue when I finally created a coordinating task for the prototype that listed everything I wanted to accomplish.  Here’s the text from my notes:

a    perform task PG-100515=1:
        Guam Prototype Coordinating Task

        this sets the agenda for completing the Guam prototype

        notes 5/15/10: 0810..0842
            planning
done            figure out what is missing
done            mark as P3I tasks not part of the prototype
done            add P3I's to P3I list
done            derive or locate a task for each missing item

        plan
            what is missing from the prototype (Orote scenario)

PG-100515=2     movement (UI, DB, game system)
PG-100528=1:    turn sequence
PG-100515=3     fire combat 
                     defensive (UI, DB, game system)
                     offensive (UI, DB, game system)
PG-100515=4     assault (UI, DB, game system)
                     P3I: movement after assault
PG-100515=5     complete the Orote data
PG-100515=6     head to head play mode
PG-100515=7     AI play mode 
                     P3I: AI plays both sides
PG-100515=8     UI hex window
PG-100515=9     UI unit window
PG-100515=10    UI fire attack window
PG-100515=11    UI assault attack window
PG-100528=2     Game Status window
PG-100515=12    UI game messages window
PG-100515=13    victory conditions - no NME units left
PG-100515=14    present the prototype to Chris

PG-100515=16    release the game as a CTP to the Beta group
PG-100515=17    make a Guam Release Coordinating Task 
                    

So far I have completed most of movement and enough of the turn sequence to move forward.  I documented my progress in the recent demonstration video posts.  I’ll continue to do so as I complete new features.  The tasks above fall into 4 categories: game system, AI, UI, and coordinate (with Chris and the Beta group).  I plan to do them in roughly that order.  I estimate this will take 100-200 hours to complete, or 4-8 months of notional calendar time.  Assuming my estimate is not too far off (yeah, right!), I think the prototype may be complete by Christmas and available to the Beta group in early 2011.

Labels: , , , , , , , ,

Wednesday, June 02, 2010

PIC-Guam Movement Demo Video

Labels: , , , ,

Saturday, May 29, 2010

First PIC-Guam Video

I've started making some videos that demonstrate features of the prototype of Pacific Islands Campaign - Guam.

The first one covers phasing of the game turn.

The next one will cover basic unit movement in the prototype.


Labels: , , , ,