SimRetirement 2017 released

New features

For this release I added a bunch of new features to the program:
  • Singles or couples
  • Legacy planing
  • Medical expenses can be set to grow faster than inflation
  • Medicare replaces private insurance at age 65
  • Added equal lifetime payments to IRAs
  • Added annuities, pensions and HSA accounts
  • Added the ability to buy property during the simulation
  • Inheritance - benefactors have their own life expectancy model and you can set which member of the couple is the beneficiary
  • Calculates your optimal Social security start age - but starts early if you need the money
  • More control of how the external markets are modeled
  • More simulation outcomes - high wealth/success/success with reduced expenses/success with property sales/success with failed legacy goals or purchases/failures
  • Quick sim capability to make a tweak and get a quick result.
  • Stress test against historical scenarios
  • Better tax model - includes social security and the brackets and deduction amounts can be set on the GUI
  • Multiple save files.

Language and libraries

The original program was written in a mix of managed and native C++ using Mircosoft's C++/CLI platform. I've had issues over the years getting my code to build in the latest versions of Visual Studio, and I'm not thrilled with the level of support for C++/CLI from Microsoft (they are pushing Metro App development). But between the reuse codebase and the advantages of C++/CLI, I decided to stick with it. C++/CLI allows you to write either managed C++ that acts a lot like C# and gives you access to the .NET libraries, or native C++ where you manage your own memory, have access to STL and BOOST, and get the performance advantage of native C++. The drawback of this mix is that the managed C++ uses funky looking symbols (^ is roughly *, and % is roughly &, gcnew instead of new) and doesn't have good lambda function support. It is also a big pain moving data back and forth from managed data structures to native data structures. The GUI in my program is all built on the Windows.Forms part of the .NET library. So all the GUI is managed code. Since the GUI often directly manipulates the data model, the model that backs the GUI is mostly built on the .NET System.Data.DataSet class and is managed. But, I want the simulation to run fast, so that part is written in native C++. At the start of a run, the managed data model is copied into native C++ classes. Along with the hassle of managed C++, this was also the first C++ project that I have worked on for several years and I've really grown accustomed to the conveniences of C# and the LINQ extensions. Writing constructors, copy constructors, destructors and member accessors is a lot of code overhead that I'd gotten used to not having to write. I used the C++ library Boost for random number generation and the normal and student's t distribution. I also used the .NET charting library for all the plots and graphs.

Unity board games tutorial

I created a tutorial series on my personal blog and YouTube to help people create board game conversions in the Unity Game Engine. The best place to start is the blog. Or you can dive right in to the videos.

Programmatic use of windows search

I recently wanted to add a photo search capability to my Timeline program and discovered that you can open a windows explorer with a custom search. You can also type these searches directly into the address bar in a windows file explorer.

The key is the search-ms protocol. It allows programs (like windows explorer) to directly query the windows search index. The parameters to this command are somewhat obscure, but it is very flexible and it can be used to perform any search that you could perform with the graphical search function in the windows file explorer.

Continue reading at ChadWeisshaar.com

Open the same Unity project twice

The first time I wrote a networked Unity game I wanted to have one "client" Unity window and one "server" Unity window. Unfortunately, Unity doesn't support opening the same project twice. So I came up with this workaround.

  1. Create your project in Unity. Get everything setup the way you want it. Exit Unity.
  2. Copy the whole project directory: Use the GUI -OR- xcopy /e/h Game GameCopy
  3. Delete the Assets sub-dir In the new project directory: Use the GUI -OR- del /s GameCopy/Assets
  4. Link the original Asset directory to the new directory: (in an elevated command prompt) mklink /j GameCopy/Assets Game/Assets

More details at ChadWeisshaar.com

Microsoft Windows Text-to-Speech for Unity

I often would like for the game to prompt the players to do something, or to let the players know what just happened. One option is for me to record all the prompts and then have Unity play those. But sometimes the game has a lot of different prompts, or in some cases, I'd like the prompt to be programmatically built. There are a few Unity packages that will support text to speech, but they are not inexpensive.

But since I am just targeting the Windows OS, I could use the Windows built in text-to-speech capability. This capability is part of the COM system in Windows and is therefor not accessible from C# code. So I wrote a C++ wrapper library around the Speech API and then imported that library into my Unity project.

More details at ChadWeisshaar.com