• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Fishbreath

Recruit
52 Badges
Feb 28, 2011
7
0
  • Victoria 2: A House Divided
  • March of the Eagles
  • Semper Fi
  • Hearts of Iron III
  • For the Motherland
  • Victoria 2: Heart of Darkness
  • Arsenal of Democracy
  • Crusader Kings II
  • Stellaris
  • Cities: Skylines - After Dark
  • Mount & Blade: Warband
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Way of Life
  • Stellaris: Federations
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Crusader Kings Complete
  • BATTLETECH
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • BATTLETECH: Flashpoint
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Prison Architect
  • Stellaris: Ancient Relics
  • BATTLETECH: Season pass
  • Europa Universalis III Complete
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Europa Universalis III Complete
  • Divine Wind
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Pride of Nations
  • Magicka
  • Europa Universalis III Complete
  • Naval War: Arctic Circle
  • Sengoku
  • Sword of the Stars
  • Victoria 2
  • 500k Club
  • Cities: Skylines
  • Crusader Kings II: Holy Knight (pre-order)
Well, random enough to hopefully produce reliably distinct missions, but I can't say that for sure yet.

NWAC is an entertaining game, but I've always thought it would have greatly increased longevity with some mission generation functionality. After looking into the scenario format*, it seems eminently possible to whip one up with reasonable speed. I hope to put a few hours into it this weekend, and in a couple of weeks I might have a prototype to show off. I'll try to keep this thread up-to-date.

The current state of the project is thus: I'm building the infrastructure to generate scenarios, which includes some helper data files to specify for my code what a specific unit is and does, some other helper data files to define a location in which a random battle takes place, and code to take those data files, combine them with some simple user-defined settings about the sort of scenario desired, and spit out an XML scenario. At this point, I'm only planning on doing enough of the data file work for testing; the rest comes later. My estimate for this phase is one or two weeks, supposing I have a reasonable amount of after-work time to dedicate to it (which isn't necessarily a good assumption).

To roadmap this project a bit, once I'm done with that, I should have a very naive mission generator—it will probably build a very samey scenario southwest of Iceland that will hopefully be parsed correctly by the game. That will bring me to the second phase, in which I'll add support for objectives. I suspect that, at this point, I'll have to give the AI some clues about what to do. Right now, I can't really estimate what sort of time that'll take. It would probably be helpful if I could investigate some premade scenarios to see what sort of things they do, but that's getting ahead of myself.

The third and final phase will consist of adding data files to cover more of the map and the full roster of units. This is the easiest part to outsource to the community, so if you're interested in helping, that's when I'll need you.

* You developers reading this are awesome for using XML for scenarios, but it would have helped if you'd put your orthographic projection origin in a comment in the mission editor's files. :p Just to check my math: your origin is 0 longitude and the north pole (given as -90 so y/projected latitude counts up), right? I'm using 6371.0072 km for the radius of the Earth, but that yields ortho-projected values off by a kilometer or two when I check my work against the locations the scenario editor generates. That's close enough for government work, but if one of you could let me know what value you used for R, that would be great.
 
Last night and tonight, I wrote a ton of math helper functions to help me place things on the map and query about their relative locations. It's been interesting remembering all this computational geometry. I've also moved to 6371.1370 for my Earth radius, and that seems to have brought my orthographic projections more in line.

More excitingly, I'm in the middle of the code for picking start points, which works in open ocean but doesn't yet know how to avoid land (it shouldn't take me too long to get that done, though). At the moment I'm going to ignore special cases like oddly-shaped regions; those are going to require some hints to the generator. Southwest of Iceland is fine, though, because it's a square of open ocean. There are other special cases (requiring land-based airbases, mainly) that I'm considering, but I'm leaving those alone for now.

My near-term plan is to get a bare framework in place (the SW Iceland region, a few units) so that I can get the generator to come up with a plausible structure for a scenario. Once I've done that, I'll work on the XML, and once the generator can render its internal representation of a scenario into NWAC's XML representation, I'll fill out some more of the framework options.
 
Tonight I got start points to avoid land correctly. At the moment, there's nothing stopping them from ending up outside the defined bounding box for the region, but that's not a critical early feature.

Over the next week or two, I'm going to focus on groups, units, and formations. I need to fiddle with the scenario file I'm working off of before I can do that, since I'm trying to keep my code's structure roughly in line with the structure of the XML. Once I have that done, I can work on having my code actually create XML output. I suspect that's going to be a long and tedious process.