Master Mapper and developer L Lee Saunders has been working on a random city generator for City Designer 3 for a while now. It’s a tough nut to crack – it’s hard to make human(?) environments which look plausible. But we are ready to release the latest version, the first public beta of the Random City Generator. To get the generator, which requires City Designer 3

  1. Go to the ProFantasy registration area, and login in or register
  2. Register your CD3 if you need to
  3. Download the Random Generator and install as Adminstrator
  4. Launch CC3 and start a new map based on a city template
  5. Type CITY at the command prompt and press Enter

Please give us feedback and new feature suggestions.

 

When Simon and I discussed how to fully integrate the city creator, code named “Map Invoker”, the idea of it working like a Wizard surfaced. 

With a wizard like interface, each layer of objects (Waterways, Roads, Walls, etc.) would each be generated by a different page on the wizard.  A “generate” button would draw the objects directly in CC3.  If the results were not what the user wanted, the user could press the “generate” button again and the old objects would be removed and the new ones drawn.  Once the user liked the output, the “next” button would take the user to the next wizard page.

Now this sounded like a great design to me.  But …. I had some technical issues to overcome and some design work to make life a little easier.

The main technical issue was that the built-in dialog system was not made to ever run custom code and call XP functions while the dialog was still visible.  This was solved by using C# to write the Dialog code and communicating with CC3 via a simple callback class and a delegate.  I will go into this solution in depth in a later post.  Right now I want to go over the design work I did to make life easier passing data back and forth between C++ & C#.

Here is the diagram of my classes thus far.  They are simple value classes, with no behavior.  In a previous experiment, I created a REAL object (data & behavior) but because of the fact that a real class crosses native and managed code, it worked great in a all C++/cli environment, but I could not use it in C#.  So I decided to split data and behavior into two separate dlls.  The cc3objects.dll, a C# set of value classes and cc3actions.dll, the C++/cli dll that implements the behavior.

diagram

Now, what this does is let me create an entire object, or set of objects that can be directly converted to native CC3 objects.  So, I actually build my objects in C# then pass them to my C++/cli XP dll.  Plus, once I get done with this project everyone will be able to use these dlls.

As I sit here in this cozy little room talking quietly with my wife’s family, as her mother lies sleeping in her medical bed, I began to think about the broader meaning of family and community. I’ve always realized in a cursory way, that the Campaign Cartographer community was in many ways a family. But, until recently I had not fully grasped the true meaning of that fact.

Let us back up about a year. I had recently approached Mark and Simon about producing a city generator for them. We had determined that an April/May timeframe for completion would be just about right and I happily went about the task of creation.

Then my wife’s mother’s cancer returned in March. At first we didn’t realize it was the cancer but all of a sudden, my wife was busy taking care of her mother. Off to the doctors, taking over her bills and doing all of the household chores her mother used to do for herself but could no longer do them. I, of course, being the good husband, started doing all the little things that she no longer had time to do.

That seriously cut into my evening coding, especially in the middle of spring lambing season!

Well as you can guess, the month of May flew by and I felt embarrassed that I had missed my deadline. “I had given my word!” I never forgot my obligation, it was just that every day I would tell myself after getting all the chores done, maybe after driving back from the city where I picked up my wife from her mother’s house and took her out to dinner, that I could rest today and tomorrow would not be so hectic and I could get back to programming. And, since I was going to get it done, there was no need to tell Mark or Simon about my difficulties.

Here is my point about family and community. Unlike the rest of the world, you pull family and community closer to you in times of trouble. To the wide world your troubles are your own and since everyone has troubles, you just keep them to yourself. But, for family and community – to keep them in the dark on your troubles is not fair to them. They need to know so they can help.

So I screwed up my courage and finally contacted Simon explaining why I had not only missed the deadline but feared that I would not be finishing the program anytime soon. Now, you have to understand that ProFantasy is a business. It lives and dies by the products it makes and the reputation it has with its user base. They had announced that I would be creating such a tool for them and since then I had failed to finish it. In my mind, I had done them some amount of harm.

I should not have been worried. Simon not only told me not to worry about it, but asked if there was anything they could do.

Family, I should have known.

So that is why I am writing this to you now. After a second failed round of Chemotherapy/Radiation and now hospice, I wanted to tell the greater Campaign Cartographer community that I’ve not forgotten my promise to you. I may not get back to it soon, my wife will need a lot of help cleaning up and organizing the estate, but I promise I’ll finish when I can.

And I know that you will understand. Like I said, Family.

As Simon mentioned in a  previous post here, I am working on an application, which I am developing under the code name “Map Invoker”. It will generate random towns, from small little hamlets to large walled cities. I’ve been concentrating on the algorithm side and am truely quite a ways towards a “feature complete” logic set.

So Simon was correct in stating that “He’s gone beyond proof of concept”. Soon I will be turning from generation to the interface so that all the parameters that I’ve included in the algorithms are exposed to the user so that the user can create an incredable range of different towns.

Once the parameter inputs are down and tested, then we will be looking into adding all the “garnish” that makes programs like this come alive.

So if you have any ideas, practical or “pie in the sky”, I’d love to here them. Either post your idea or email me at: SAUNDERL (at) HOTMAIL (dot) COM.

L Lee Saunders is working on a random city generator for CC3. Lee has worked with ProFantasy for many years, producing features such as the fractal path and text around a curve. He has an excellent development blog for people who want to create CC3 add-ons, which he will mirror here.

The Random City Generator will be included in a future version of Campaign Cartographer or City Designer, or be available as a separate product. He’s gone beyond proof of concept – here is a screen shot. It already does basic CC3 import using the House command, and we’ll be reporting on its progress regularly.

Random City Generator