Jump to content

Interest in a Random battle generator?


SlapHappy

Recommended Posts

I've been thinking about ways this could be accomplished with the game tools available.

There are a couple of things that need to be understood to envision how such a thing might work.

Firstly there are two file types which influence your mission:

The Mission.xml file which stores the data for the actual units and the maps used in the game.

And the trigger.ini file which handles all the scripting for events that happen during the game.

Firstly, it would be possible to form a limited random battle code by generating troops "on the fly" by using function calls such ReinforcementLand and CreateUnitByRect. The problem is the units still have to be defined in the mission.xml file. In addition, the particular map file used is defined in mission.xml. Since random maps and troop types are at the very heart of a "random battle generator", it would be necessary for the relevant troop and map definitions to be passed to the mission.xml file via another code type which would have the generation tables. These would generate the variables and then pass the values to the mission.xml file to "construct" it. I suppose any type of programming language that supports a randomize function and can work well with XML files would be suitable. I have heard of "actionscript" used in some examples I've seen on-line. Perhaps plain old Java would work as well as anything else.

Another potential problem is that troop starting positions are also defined in mission.xml. What might be perfectly reasonable for one generated map, might not work quite so well for another and figuring out how to generate the right start points could be problematic. Perhaps the first iteration might be more workable if enemy troops enter the map from the "opposing side" in a meeting engagement type of operation.

Is there any interest from some person(s) in a collaborative effort to bring this to life?

It might be also possible to develop some generalized and global scripting routines which can be plugged into any trigger file to handle retreating conditions as well as a possible surrender option. Since such scripts can be applied at the "Army" level it's seems do-able.

Link to comment
Share on other sites

OMG Deja Vu...

Having just written my own random battle generator for Panzer Command Kharkov, that does pretty much everything you wanted (+ a little more smile.gif ) may I suggest the following

Write it in javascript as part of a MS HTA (HTML application).

The advantage of this is that you can use the power of dhtml for UI elements and the ease of javascript for the core logic. Given that the MS xml tools are built in, it makes it oh so simple. I managed to write one from initial idea to finsihed product in about 7 days including all of the UI elements. The HTA part allows you to wrap it all up as a nice application. The only downside is that IE must be installed on the target machine, but who doesn't have this?

All you need is notepad!

Oh I used the concept of a template to get the whole thing to work. Essentially a template is tied to each map. The template designer sets out the potential positions of a multitude of platoons on each map in such a way that they make tactical sense (eg infantry in tenches, tanks behind a ridge line, ATG in trees etc). Then the generator engine picks randomly from each template platoon (varying squad #s and unit types) to a user selected points total. If you have an enourmous number of platoons with which to choose from initialy, then you will never see the same game randomly generated game twice smile.gif Anyway it worked well for my purposes for PCK.

[ July 09, 2007, 11:56 PM: Message edited by: Laryngoscope ]

Link to comment
Share on other sites

I would love to see a random battle generator. For someone like me with little computer skill it would be great.I can only make very basic scenarios as I don't understand the scripting much.What I miss is the unexpected I used to get with CMBB and CMAK where I used to put in an artillery observer with a very small chance of appearing who could bring down a barrage on my units when I was least expecting it.Stuff like that. :rolleyes:

Link to comment
Share on other sites

The real trick is the triggers which have to be created on the fly then complied and are needed for all Air/Art/victory/reinforcements/locations/etc. then there's the AI which has to be created for each mission.

Your time might be better spend creating new campaigns.

Link to comment
Share on other sites

×
×
  • Create New...