|
Post by olmsted on Jun 26, 2017 18:56:50 GMT 1
This may have appeared elsewhere, but if so I can't find it. I thought it appropriate to put it here. Here is a guideline to the RMG:
Random Map Generator
All the components of the Random Map Generator are contained in the data.pak file found in the Blitzkrieg\Run\data folder. You will need to uncompile this if you want to work with the RMG. To do this, you will need to have installed a functioning copy of WinZip.
Right-click on data.pak. Click on "Open With..." Click on WinZip. When it asks you into which folder you want to place it, I created one called BKDataPak, or you can choose your own folder. Click on Unzip. It will take several minutes to enlarge the files, because the data.pak is quite big.
Inside your new BKDataPak folder you will find about 20 subfolders. The one that we are interested in that contains all we need to work on the RMG is called Scenarios. You can delete all the rest if you wish.
Inside Scenarios are more subfolders The ones we are most interested in are: Campaigns; Chapters; Containers; Descriptions; FieldSets; Graphs; Patches; Templates; TemplateMissions. These mostly work in pairs.
Graphs show how the maps will be laid out and which nodes and connections will be used.
Templates choose which graphs will be used - by random selection if there are more than one graph to choose from - and orient the graphs and their nodes and connections according to the direction you choose for your map.
Patches are little mini scenarios that correspond to the nodes in the graphs. They are the things such as towns and villages, intersections and river crossings, your starting point and the enemy's supply base. All troops that appear on a created map are found in the patches.
Containers manage the patches, choosing the proper one to fit into the appropriate node in the graph. There are up to 8 patches per direction per node. The container chooses randomly among the available patches of the appropriate direction.
Descriptions contain header and description files for the maps and chapters you can generate.
TemplateMissions contain the 1.xml files for the maps you generate.
Chapters contain the chapter description files and the context files that substitute troops and equipment of the appropriate nation and technological level on the maps for the units found in the patches.
Campaigns contain the campaign descriptions.
Fieldsets contain the information to generate random scenery for the areas between the nodes and connections of the graphs.
If you copy the Scenarios folder out of the BKDataPak folder and paste it into the Blitzkrieg\Run\data\maps folder, you will be able to modify all the files in the Scenarios and subfolders using nothing but the BK Map Editor (MapEd) and Notepad.
Patches are little mini maps that are 1x1, 1x2, 2x2 or 3x3. You can call them up with the MapEd. They appear the same as the mission maps, with grass/snow, trees, buildings and units. They have a set season, and I have never had any success using them in random maps after changing their season. It causes abortions. You can move all the objects around, remove them and add them, and change the ground cover, just like a full sized map.
You also have the option of saving it as an XML file. Then you can open it with notepad or an XML editor, then use search and replace to change multiple items. Save it again, then use MapEd to open it and save it in BZM format.
If you do make changes to the patches, there are some points you should be aware of as regards the military units:
- Keep them facing the same way. The patches are oriented to North, South, East and West, and the troops are facing to match;
- Check the Start Commands if you are going to replace a unit. Note down any Start Commands and give them to the replacement unit;
- The nationality of the units in not important. You can put British infantry, US trucks, German AT guns and Soviet tanks all on the same patch. The context files will replace them with the same type of unit of the proper time frame and nationality;
- Be aware of what type of unit you want when you are replacing or adding units. There are some 28 different types of units: Order....Type Name........................Example: 01........Squad Riflemans.................GB_Rifle_43 or any "rifle" squad 02........Squad Infantry*.................GB_Rifle_43 or any "rifle" squad 03........Squad Submachinegunners...GB_Bren_43, US_Bar_43 04........Squad Machinegunners........German_mg42 05........Squad AT Team.................German_at1, GB_ptrb_43 06........Squad Sniper.....................Any sniper/scout 07........Transport Carrier................Any truck or halftrack 08........Transport Support..............Any engineering truck 09........Transport Medicine.............Any medicine truck 10........Transport Tractor*.............Any truck or halftrack 11........Transport Military Auto........Willys_MB_US or any car or jeep 12........Transport Civilian Auto*.......Willys_MB_US or any car or jeep 13........Artillery Gun.......................Any AT gun 14........Artillery Howitzer.................Any light artillery piece up to 105mm 15........Artillery Heavy Gun..............Any heavy arty piece from 150mm up 16........Artillery AA gun...................Any AA gun 17........Artillery Rocket...................Any rocket projectile vehicle 18........Artillery Super*...................Any large artillery piece 19........Artillery Mortar....................Any mortar 20........Artillery Heavy MG...............Any heavy mg unit (not a squad) 21........SPG Assault.......................Brumbar, Stg III D 22........SPG Antitank......................Stg III F, M-10, SU-85 23........SPG Super .........................Ferdinand 24........SPG AAGun........................Wirbelwind 25........Armour Light......................PzKw II, BT-7, any armoured car 26........Armour Medium...................M4A4 Sherman, T-34, PzKw III 27........Armour Super.....................Konigstiger, JS-3, Maus 28........Armour Heavy....................Tiger * I suspect that these types of units are not really used.
The Type Name corresponds to the <Type>arm_medium</Type> listing in each unit's 1.xml file, if you want to be more exact.
The list of suggested units might be a little confusing. I have used units that mostly were the best known units of their class, even though they cover different parts of the war. The class definition changed as time went on. The PzKw IV was classed as a heavy tank at the beginning of the war, a medium tank by 1943, and was slipping into being considered a light tank by the end of the war. The Type Name corresponds to the <Type>arm_medium</Type> listing in each unit's 1.xml file, if you want to be more exact.
Some types can be substituted for other types. For instance most infantry units are pretty interchangable. However, I got some interesting and unpleasant results when I tried to substitute anti-tank guns for tanks.
- Check the Script ID's of units on any patches before you change them or add to them. There are 11 sets of "key" patches that have distinctive Script ID's for most or all of their units. Most of these key patches become objectives on the generated maps. There is a corresponding section of code that is incorporated in the script for each of these key patches. It checks the number of units on the map with that Script ID. When the number of units falls to zero, the objective is declared as achieved. The 11 key patches and their associated Script ID's are:
Asphalt Road Bridge - 10 Railway Bridge - 11 Wooden Road Bridge - 12 Village - 13 Town - 14 Supply Depot - 15 Artillery Position - 16 Railway Station - 17 Army - 18 Start Position - 1000 Friendly Defensive Position - 1014
In some key patches, not all units have the same Script ID. In some the mechanical units may have a significant ID, but the squads and/or transport will have an ID of -1. In some there are patrolling units to stop snipers and alert the defences. These have a Script ID in the 700's. There are also support units and counterattack units included in patches with ID of 2100 or 2101.
There are ways to improve the patches. Adding units is the easiest and obvious way. However, you could make the units already there more effective.
With the river-crossing bridges, you have infantry and tanks sitting around in the open on both sides of the bridge. A good idea is to concentrate the units on the side of the bridge away from the attacker. This way they won't get defeated in detail. You can provide trenches for the infantry and replace the tanks with antitank guns, which are often better in a fixed position. Using the Start Commands, you can give the infantry the "Use Spyglass" command to give more warning of an enemy's approach. The AT guns (or tanks) can be given the "entrench self" command as well.
The road/river crossing are unrealistic. How often do you see a road bridge across a river without a town around it? Putting some buildings onto the patch, and putting some squads into the buildings might look a lot better, but doesn't improve the defenses a great deal.
For the defense_position patches, trenches and "use_spyglass" on the infantry and "entrench_self" for the AT guns, machineguns and mortars improves things considerably. You might consider putting mines just at the forward edge of the patch as well. These will be just about the right distance forward of the defensive position to stop enemy tanks in picking-off distance from the AT guns.
There are 3-way and 4-way road intersections, usually with a squad of infantry standing around, some trees, and a small supply dump. I like to set them up with an inn complex or some farm buildings; looks more interesting. Then I garrison the buildings with a couple of rifle squads, an AT squad, and maybe a heavy machine gun crew. Then the intersection becomes a major annoyance instead of a minor inconvenience.
With the town and village patches, you can do as much as you like. Adding garrison troops to empty buildings, digging in AT guns, machine guns and mortars, putting trenches across roadways in, butting flanking ambushes in corners of the patch...there's lots of scope for ingenuity.
There are Army patches, that contain groupings of tanks and infantry. They seem to be intended as reaction groups if your troops come near where they are posted. All you can do for them is add more units.
There are artillery sites with 4 artillery pieces, with infantry and tanks to defend it. The artillery responds with shell fire whenever any enemy troops within range see your troops. The rest of the units are there to defend the artillery. Dig in the infantry. "Use_Spyglass;" exchange the tanks for AT guns if you wish, and dig them in just behind the infantry trenches. Make it a proper defense.
There is also the warehouse patch, which contains the main supply depot for the bad guys. This offends my sensibilities. It is a warehouse, surrounded by a brick wall, which is out in the middle of the country. The brick wall, the guard house, the entry gate, they all have to go. I added a farm house, some out buildings, some trees, and hope the warehouse will be mistaken for a barn. Defensively, digging in the AA guns is about all you can do.
For all the above patches, all the units must be Player 1.
Then you have the start patches, where the player's troops start. It's just as "ugly" as the warehouse. Brick wall, guard box, entry gate, out! Farmhouse, outbuildings, trees, in! Since the defense is now more numerous and better prepared, it is only fair to improve the player's starting forces as well. I made a point of adding a variety of items, not just more tanks and rifle squads. I added SMG and AT squads, mortars and hmg's, assault guns, SP AT guns, SP AA guns, and transport for the AA guns already there. I cut down on the artillery and added AT guns and a second armoured car.
The containers don't need to be changed if you are just modifying the existing patches. If you create new versions of existing patches to be added to the total number of patches of that type available, you can just add them to the appropriate container. If, however, you create entirely new patches, you'll need to create new containers for them.
Graphs can be viewed in the Graphs Composer in MapEd. They show up as grey areas divided up by white dashed lines into grids. The number of squares in the grid can be changed by moving a slide bar to the right of the graph. The number of squares on the graph represents the size of the map that will be generated. A 12x12 graph will generate a 12x12 map.
Scattered about the graph are numbered grey boxes, called nodes. These represent "containers." Containers determine which patches will be added to the map. If you put your pointer over a node, a line will appear just above the graph telling you what the node is. If you right-click-and-hold, you can move the node around. Let go of it wherever you want to place it. However, if you let go of it while it is even partially over another node, it will snap back to its original position. If you right-click on it, it will offer you a 2-choice menu box, "delete" and "properties." If you click "delete," the node and all related connections will disappear. If you click on "properties," you will be shown which container the node represents, with an opportunity to change it. If you move your pointer to the edge or corner of the node, it will give you a two-headed arrow, offering you the opportunity to resize the node. Right-click-and-hold, then drag the corner/side around.
- You will not be able to decrease the size of the node to smaller than the area of the container that the node represents.
- If you limit the node to the size of the container that it represents, it will most likely cause the RMG to abort when you try to generate a map from that graph. Apparently the RMG wants a little leaway when placing the patch on the map. Make the node at least 24% bigger than the container it represents. (Make a node that represents a 2x2 container at least 2-1/2 x 2-1/2 squares on the grid.)
- If you are placing a node at the edge of the graph, and you want to make sure the patch appears right at the edge of the map: move the node so that one side is right up against the edge of the graph; move the opposite side of the node as close to the first as you can; spread out the other two edges of the node so that they are at least twice as far apart as they should be, and possibly as much as 3 or four times. This is particularly important when the patch contains a road or river that "goes off the edge of the map."
The graphs as they come produce maps that are 8x8 up to 10x10. These maps are a little cramped, especially if you improve the defense and increase the size of the attacking forces. You will have no room to deploy or manoeuvre.
The graphs (and thus the resulting maps) can be enlarged. There is a slide bar just down the right side of the graph in the graphs composer itself. You can use this to enlarge or reduce the size of the graph showing. Note that the graph will only enlarge or reduce by a full square's value each time, and it will only reduce until it encounters (or approaches) a node. Also note that the graph can only be square. This is for simplicity's sake, mostly so that it can be turned 90 degrees without distortion.
If you enlarge an existing graph, you'll notice that the nodes stay in their original position in relation to the bottom right hand corner. If you run the map as is, you'll end up with empty areas along the top and right side of your map. Click-and-drag the nodes to new locations, spreading them out more proportionately. The connections will stretch to suit.
Depending on how many objects will be placed on the map, it can be enlarged to 12x12 or even 14x14 without causing abortions to the map generated or slowing down when the game itself runs. If you want to use the Fieldsets function to generate a map with minimal trees and bushes, you can get the map size up to as large as 24x24 without too many problems. That would be great for the wide open spaces of the Ukraine.
Connections: Joining many of the nodes on the graph are very light green lines. These represent the paths of rivers, railways and roads. If you hover your pointer over one where it is not over top of a node, the graphs composer will display what kind of a connection it is above the graph itself. If you right-click on a connection, it will give you a little two-choice menu box, "Delete" and "Properties." If you then click on Properties, you will have a chance to change the type of connection, its width, its visibility, and other properties.
To delete a connection, right-click and then click on "Delete." To change one, change the "Type" designation. You can use the "Browse" facility to look for a new type of connection, you if you know what you want you can type in the new entry. e.g., you can replace road_asphalt with road_grunt or road_track.
To create a connection, hover your pointer over a node, hold down the Alt button, and click-and-drag from one node to another, then release all. You should have a pink line joining the two nodes. Right-click on the line, click on "Properties," enter (or browse for) a new connection type, plus change any default properties you wish. When you close the menu, the connection should then turn green.
Note that connections have to join two nodes. There are patches that are nothing but short sections of river or railway or road. These are mostly used to run the river/roadway to the edges of the map, or to dramatically change the course of a river.
Context files:
Template to Graph Relation: Template # - Graph(s) # - Contents 00...01,07,05,04,02,08,00...Town, village, defense 01...01,07,05,04,02,08,00...Town, village, defense 02...00,07,05,04,02,01,08...Town, village, defense 03...03..........................................T own, village, defense, bridge 04...07,08,00,01,02,04,05...Town, village, defense 05...06,19....................................Town , village, river crossing and depot 06...08,05,04,02,01,00,07...Town, village, defense 07...00,05,04,02,01,07,08...Town, village, defense 08...09,20....................................Town , village, defence, railway 09...11........................................... .Village, ambush, defence, artillery, railway, station 10...12........................................... .Plain map with ambush, defence, artillery and river 11...16........................................... .Village, town, artillery and defence sites 12...13,15........................................ .Plain map with village, ambush and river 13...14........................................... .Busy map with village, ambush, river, railway and station 14...18........................................... .Plain map with town, river, and railway 15...hunt1,hunt2,hunt3,hunt4..................A simple map with town, depot and enemy counterattack assembly area 16...defend1,defend2,defend3...Bridge, town, enemy mobile group; you must attack a river crossing and then defend it against an counterattack 17...escort1,escort2,escort3,escort4...You must escort supply units through enemy mobile forces and defensive positions to a friendly defensive position 18...defend4,defend5.....................Escort supplies through enemy mobile units, counterattack group, defensive positions and depot to friendly defensive position
How to Get Randomly Generated Maps Working
You need to have WinZip installed and working.
You may have done this first part already. If so, skip to step 4.
1. Open Windows Explorer. Right-click on the Program Files folder. Click on New and Folder. Type "DataPak" in for the name of the new folder.
2. Click on Blitzkrieg\Run\data folder. Right-click on the Data.pak file. Click on Open using and WinZip. Click on Browse. Click on your new DataPak folder. Click Open (WinZip will now spend several minutes unpacking the contents of Data.pak into your DataPak folder.)
3. (Optional) There are now many folders and files in your DataPak folder. The only one you want is a folder called Scenarios. Delete all the rest.
4. Open the BK Map Editor and generate a random map. Just make sure you note: a) which season; b) which template, and c) which area (France, Germany, Russia, etc.) Give it a unique name, the name you want the final result to be called. This is rather important, as it is difficult to change the name afterward.
5. Check the list below to find out which descriptions and which templatemissions are associated with your map:
Summer Template 00.........SA_13_14_15............SecureArea00 Template 01.........SA_13_14_15............SecureArea00 Template 02.........SA_13_14_15............SecureArea00 Template 03.........SA_12_13_14_15.......SecureArea02 Template 04.........SA_13_14_15............SecureArea00 Template 05.........SA_12_13_14_15.......SecureArea03 Template 06.........SA_13_14_15............SecureArea00 Template 07.........SA_13_14_15............SecureArea00 Template 08.........SA_13_14_15............SecureArea01 Template 09.........SA_15_16_17............SecureArea04 Template 10.........SA_11_12_15_16.......SecureArea05 Template 11.........SA_13_14_15_16.......SecureArea07 Template 12.........SA_12_13_15............SecureArea08 Template 13.........SA_11_12_13_15_17...SecureArea09 Template 14.........SA_11_14_15............SecureArea06 Template 15.........Intercept00...............Hunt00 Template 16.........Defend_Area00...........Defend00 Template 17.........Escort00...................Escort00 Template 18.........Defend_Area01...........Defend01
Winter Template00.........SA_11_15...............SecureAr ea00 Template01.........SA_12_15...............SecureAr ea01 Template02.........SA_12_15...............SecureAr ea02 Template03.........SA_12_13_15_16......SecureArea0 6 Template04.........SA_13_14_15...........SecureAre a03 Template05.........intercept00...............hunt0 0 Template06.........defend_area00.........defend00 Template07.........SA_10_12_13_15_16...SecureArea0 4 Template08.........SA_13_15_17...........SecureAre a05 Template09.........escort00.................escort 00 Template10.........defend_area01.........defend01
Spring Template00.........SA_13_14_15............SecureAr ea01 Template01.........SA_12_13_14_15.......SecureArea 00 Template02.........SA_13_14_15............SecureAr ea01 Template03.........SA_13_14_15............SecureAr ea03 Template04.........SA_112_13_15_16.....SecureArea0 2 Template05.........defend_area00..........defend00 Template06.........intercept00...............hunt0 0 Template07.........escort00..................escor t00 Template08.........defend_area01..........defend01 Template09.........SA_15_16_17............SecureAr ea04 Template10.........SA_11_12_13_15_17...SecureArea0 5
Africa Template00.........SA_13_15_16...........SecureAre a00 Template00.........SA_13_15_16...........SecureAre a01 Template00.........SA_13_15_16...........SecureAre a02 Template01.........SA_13_14_15_16......SecureArea0 3
6. Using Windows Explorer, right-click on your Blitzkrieg\Run\data folder and click on New and Folder. Type Map-to-Pak in for the name of the new folder.
7. Right-click on Map-to-Pak and create a new folder with the same name as the map you generated. I will call mine TrialRun.
8. Right-click on the right panel of your map name folder and create two new folders called Maps and Scenarios. Right-click on the right panel of Scenarios and create a new folder called Custom. Right-click on the right panel of your Custom folder and create a new folder called Missions. Right-click on the right panel of your Missions folder and create a new folder with the same name as your map name.
9. Click on Blitzkrieg\Run\data\Maps. Copy TrialRun.bzm and TrialRun.lua and paste them into your new Maps folder.
10. Click on folders DataPak\Scenarios\Descriptions. Find the folder in there that is the same as the SA_ number that matches your template. Copy all the files in the folder and paste them into your TrialRun\Scenarios\Custom\Missions\TrialRun folder.
11. (Optional, but a good idea) Open Header.txt. Delete the contents, and type in the name of your map, or add the name of your map to the beginning of the text, with a colon in between.
12. Click on DataPak\Scenarios\TemplateMissions\All. Find the folder that most closely matches the season and area of your map. Click on it. Right-click the 1.xml file inside it, copy it and past it into your TrialRun\Scenarios\Custom\Missions\TrialRun folder.
13. Open the 1.xml file with an XML editor. Notepad will do just fine. Almost immediately in the listing you should find a line like: <HeaderText>scenarios\descriptions\SA_13_14_15\hea der</HeaderText> Carefully hightlight the part that says: \descriptions\ and the former name of the map. Do Ctrl-h. Put \custom\missions\ followed by the name of your map (example: \custom\missions\TrialRun) in the "Replace with:" box, then click Replace All. Find: <FinalMap>....</FinalMap> and replace "templatemaps...13" (or whatever is between the delimiters) with the name of your map. Save and close. (Example: <FinalMap>templatemaps\summer_france\securearea0 0</FinalMap> becomes <FinalMap>TrialRun</FinalMap>)
14. Click on TrialRun folder. In the right panel, click on Maps, then shift-right-click on Scenarios. Click on WinZip then Add to WinZip file. Click on Open, navigate to the Run\data folder. Type the name of your map into the "File Name" box followed by ".pak" (TrialRun.pak). Click Yes; click Load.
15. Close or minimize Windows Explorer. Run Blitzkrieg. Click on New Game, Custom Game and Custom Mission. Your mission should be listed there by its name, TrialRun or whatever you left in the header.txt file (see step 11)
16. Enjoy.
Notes:
Folders are underlined; Files and programs are italicized; Buttons are emboldened.
Items may appear With capital letters or without; Blitzkrieg is not case sensitive.
I'm still playing this game after all these years and have tried to dive back into modding. Right now, I am trying to make the random maps for the Summer Russia types look more like wide-open farmland and less like unoccupied wilderness. I think that means modifying the fieldsets, but I am not sure. Is there anyone around who can still help with this kind of stuff?
|
|
kaoz
General
inter faesces et urinam nascimur
Posts: 1,124
|
Post by kaoz on Jun 30, 2017 21:21:31 GMT 1
I'm still playing this game after all these years and have tried to dive back into modding. Right now, I am trying to make the random maps for the Summer Russia types look more like wide-open farmland and less like unoccupied wilderness. I think that means modifying the fieldsets, but I am not sure. Is there anyone around who can still help with this kind of stuff? It's been a long time since i experimented with this, so don't shoot me if something i say is not entirely correct.
Open the data.pak from run/data with 7zip or other. Go to scenarios folder and copy Containers, Fieldsets, Graphs, Patches, Settings and Templates folders to your data folder (you can place it anywhere as long as you remember where to browse to).
You should be able to open the patches bzm's in the MapEditor and you can change them to your liking.
Then, you can create or edit fieldsets (which is probably what you need). I recommend to create new so not messing up presets, but look at presets and learn from them how they are being set up.
Next, in containers you can set which patches need to be used. Again open preset to learn.
Next, in graphs, you can set the different containers upon the random map. Here you can add different graphs and thus different random setups of your containers (which contain the patches).
The space inbetween those containers will be filled with fieldsets. In settings you can list the fieldsets that need to used.
Finally, in a template you can set the mixture of graphs and fieldsets. In the end when you want to create a random map, you should be able to select your template, graph and setting from dropdown menu.
Containers, Fieldsets, Graphs and templates need to be opened or created in the MapEditor > Tools > Composer. Although all this sound like fun, it is very time-consuming and can be confusing. Again, best way is to learn from existing ones. Good luck!
|
|