Adding a Map Element manually
Select messages from
# through # Forum FAQ
[/[Print]\]

Close Combat Series -> Modding Workshop

#1: Adding a Map Element manually Author: vonB PostPosted: Sun Aug 01, 2010 9:28 am
    —
Not that I am actually thinking of doing that for real  Wink , but I want to be able to create an Application that is able to add/modify a Map Element, so I effectively need to know how to do this manually in order to be able to Code it.

In order to do that, I need to know how to identify the entry(s) in the TXT file.  Obviously the Map Tools already do this, but I am trying to produce an Application that can do this for a few specific elements (possibly only one), and that is Minefields.  This is not a Map Tool I am working on but a specific feature of another program.  Let us say that it is an extension to the Saved Game File Handler and the Operational Game.

I am not familiar practically with Map making (yet), though I do know the principles.

For example, let's say I want to add a Minefield at a specific location (x,y) on the Map, and want to add the entry manually, how would I go about it?

Is there any documentation that explains the format of the TXT file in detail?

#2: Re: Adding a Map Element manually Author: papa_whisky PostPosted: Sun Aug 01, 2010 1:03 pm
    —
I imagine you have already thought of this, but here goes anyway......I suggest creating a scenario play it twice, one where you have altered an element, such as firing a powerful HE weapon into an element creating a big crater , and one without keeping all other things equal as near as you can. Compare the two saved game files and look for the difference.

#3: Re: Adding a Map Element manually Author: MafiLocation: Germany PostPosted: Sun Aug 01, 2010 3:00 pm
    —
vonB wrote (View Post):
For example, let's say I want to add a Minefield at a specific location (x,y) on the Map, and want to add the entry manually, how would I go about it?

Is there any documentation that explains the format of the TXT file in detail?


Hi vonB,

CC2Guide-TxtfMapLosRoof-v5.pdf

via
http://closecombat2.fortunecity.com/GuideList.html
http://cc2revival.npage.de/
or here at CCS.net

You can use MS-Excel for editing manually. Please look at the end-of-line delimiter of YOUR MS-Excel version, it might be not compatible...

The terrain elements are listed in the file "Elements.txt" (or the same ADB file of CC4/5/M).

Cheers
Mafi

#4: Re: Adding a Map Element manually Author: vonB PostPosted: Sun Aug 01, 2010 3:44 pm
    —
Thank you for the suggestions!  I will take time to study these, and hopefully it answers my need!  If not, I'll be back...  Wink

#5: Re: Adding a Map Element manually Author: MafiLocation: Germany PostPosted: Mon Aug 02, 2010 4:16 pm
    —
Hi vonB,

perhaps this littl addendum might be usefull:


The format of the map data files (Map### / *.txt) are a representation of the CC-engine’s own internal logic. CC1 is a computer game inspired by a board game ("Advanced Squad Leader (ASL)!" by Avalon Hill). A board game has usually it’s "battlefield" splitted into "tiles". Such tiles can be of squared shape or hexagonal shape ("ASL!" used hexagons). Since CC1 the CC-engine is using squared tiles. In CC1 it was used the way that such a "tile" had the size of 40x40 pixels, with a common terrain and elevation description and predefined graphic for the entire tile. Since CC2 such a tile is divided into 16 identical shaped "elements", squared size 10x10 pixels. Since CC3 until today such an element is the smallest terrain and elevation description within the game. CC2 had a slightly different format, using 16 terrain elements and 1 elevation description for the entire tile (like in CC1; in the early days of CC2-modding we called such a 40x40 pixel tile an "elevation tile"). For a better pre-battle description, a CC-map is also divided into larger "deployment tiles" = "Mega tiles" of the size 120x120 pixels. The "Mega tile" logic has no effect upon the format of the map data files (Map### / *.txt). Map sizes are (and should be) a multiple of "Mega tiles“.

The internal ordering of the tiles ("elevation tiles") is from left to right, top to down, counted from zero. That means "tile #0" is the 40x40 pixel area in the upper left corner of a map. The internal ordering of the elements (10x10 pixels) is also from left to right, top to down, counted from zero, within such a tile. That means for example, that "element #11, tile #0" has it’s upper left edge at the pixel coordinate "x=30, y=20".

The header info of the map data files (Map### / *.txt) contains therefore width and height counted in "tiles". Example: map size 4800x3600 pixels will show entries in the map data file’s header "120 X Max" and "90 Y Max". For CC-modders (and map dada editor programs) it became common to talk about the map’s size in "Mega tiles", but this has no effect upon the entries to be made within the map data files (Map### / *.txt).

The tile descriptions within the map data files (Map### / *.txt) starts after the line beginning with "&". For each tile there is a separate ASCII line in the map data file. The tile’s index number will be the first entry within such a line. The following 16 numerical values (separated by TAB-chars, ASCII #9) are the terrain values of the "elements" #0 to #15. CC2 map data files have then a single numerical value to follow, representing the "tiles" elevation. CC3-or-newer map data files have then 16 numerical values to follow, representing the "elements" elevations. Negative values are not allowed, neither for the index number, nor for terrain description nor for elevation.

It might be strange that the map data files contains index numbers for the tile entries. But this was necessary for CC2 to allow the map data files to contain additional tile entries at the end representing the status of only few tiles after "Bailey bridge placement" on the map.

A picture will illustrate the tile/elements concept. This picture shows a very small map of 12x6 "tiles". The red grid lines are the borders of the "tiles", the light blue grid lines are the borders of the "elements":



TheCCMapDataTileConcept-small.jpg
 Description:
 Filesize:  119.73 KB
 Viewed:  7720 Time(s)

TheCCMapDataTileConcept-small.jpg



#6: Re: Adding a Map Element manually Author: papa_whisky PostPosted: Tue Aug 03, 2010 1:43 am
    —
So a change in the state of an element in the saved game file will be given by the tile and element within it?

#7: Re: Adding a Map Element manually Author: MafiLocation: Germany PostPosted: Tue Aug 03, 2010 4:55 am
    —
papa_whisky wrote (View Post):
So a change in the state of an element in the saved game file will be given by the tile and element within it?


Hi Papa_Whisky,
no idea what will be stored in saved game files. Depends on the CC-version? Perhaps the Saved-Game-file contains only the tile number and 16 element values ? No idea.

Cheers
Mafi

#8: Re: Adding a Map Element manually Author: vonB PostPosted: Tue Aug 03, 2010 8:10 am
    —
That 'little' addendum is spot on!

#9: Re: Adding a Map Element manually Author: Stwa PostPosted: Tue Aug 03, 2010 8:23 pm
    —
Can anyone explain the meaning and usage of column A6 in Mafi's Excell file Map diagram above.

#10: Re: Adding a Map Element manually Author: schreckenLocation: Sydney, Australia PostPosted: Tue Aug 03, 2010 8:35 pm
    —
A5     map weather - 0 = clear, 1 = mud, 2 = deep mud, 3 = light snow, 4 = heavy snow
A6    map density - 0 = open, 1 = mixed, 2 = dense.

Map Weather doesn't do anything except decide whether to use snow uniforms and winter-equipped affects (for 3 or 4).

Map density is used by the AI to decide how to deploy on the map. "Open" means spread troops out more, "Dense" means pack them closer together. "Mixed" is in between.

#11: Re: Adding a Map Element manually Author: Stwa PostPosted: Tue Aug 03, 2010 9:01 pm
    —
Thanks Schreck !!

#12: Re: Adding a Map Element manually Author: papa_whisky PostPosted: Tue Aug 03, 2010 11:50 pm
    —
Curious about the map density - 0 = open, 1 = mixed, 2 = dense, the map maker decides whether it is open mixed or dense, what is the decision process for this? Has anyone really played with this to see what the effect is?

#13: Re: Adding a Map Element manually Author: schreckenLocation: Sydney, Australia PostPosted: Wed Aug 04, 2010 3:56 am
    —
Yes, I've run tests on one of the explanations of what it means.

Explanation #1.  How the AI places the teams at deployment


Explanation #2. A Flag on the maps that will attract the Straegic AI... It will send Armoured BG's to OPen and Infantry to Dense maps.


In the pic below Red had the whole map to deploy in apart from Blues entry in the top left.

This pic is a fair representation of many, many tests using WaR as a base.



Density Test.jpg
 Description:
 Filesize:  311.61 KB
 Viewed:  7651 Time(s)

Density Test.jpg



#14: Re: Adding a Map Element manually Author: vonB PostPosted: Wed Aug 04, 2010 8:51 am
    —
Good intel.  Interesting that the only one really very different is Density 2.

This kind of info would be very useful for any battle design (Map/VL/Battle Group), but would need to be based on a large (ish) set of trials to get any 'average' or common indicators.

Also, does this get moderated if the battle is attack/defend/meeting, or size of map etc.

#15: Re: Adding a Map Element manually Author: schreckenLocation: Sydney, Australia PostPosted: Wed Aug 04, 2010 9:34 am
    —
I never tested explanation #2

But did quite a bit with explanation #1  and the above results are indicative.



Close Combat Series -> Modding Workshop


output generated using printer-friendly topic mod. All times are GMT

Page 1 of 1