Parsing game.map

Get some help with creating maps or modding.
Need a map editor or other tools, look here!
Post Reply
shutyaev
New user
Posts: 2
Joined: 05 Mar 2015, 21:52

Parsing game.map

Post by shutyaev » 05 Mar 2015, 22:10

Hi all!

I have a questions regarding parsing game.map file. I've found a wiki article here: http://developer.wz2100.net/wiki/MapFormat but it seems to be incomplete or outdated.

The map I've experimented with is 2c-highground from v3.1.2 distribution.

First there are first 8 bytes that are not mentioned in wiki. I've assumed that first 4 bytes is a constant - "map " and next 4 bytes is some int (10 in my case) - maybe format version. Anyway, after these 8 bytes everything seems to be as per wiki article. However when I've parsed the values I've got tile height values that seem invalid, e.g. 128 while in game even on hills I've never seen droid's z coordinate more than 2-3.

The questions:
  1. Is the wiki article up-to-date? Am I right skipping first 8 bytes?
  2. If so - how come the tile height can be 128? Does it use some other measures than droid coordinates?
  3. What is the order of tiles in file? Do they come per lines or per columns? If I have width=2, height=3 which of the following is the correct order in (x,y) form:
    1. (0,0)(0,1)(1,0)(1,1)(2,0)(2,1)
    2. (0,0)(1,0)(2,0)(0,1)(1,1)(2,1)
    I know I can always try both ways and plot in using some math tool to see which one is right, but just in case...
Thanks in advance

User avatar
NoQ
Special
Special
Posts: 6194
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Parsing game.map

Post by NoQ » 06 Mar 2015, 06:42

No, the wiki does not seem to be up to date. It misses, at a glance, the magic byte word and the version word for both map and gateways. The rest seems fine though, at least in the game.map section.

The easiest way to understand the map format is to read mapLoad() in map.cpp.

Map heights are integers in range [0..255] (where 255 is the highest possible), and coded with a single byte. Tiles are more complex bit masks of 2 bytes. Note that this is not the height of the tile, but the height of its north-west corner; and south-east corner of southmost and eastmost tiles has height 0 (but in fact map scroll limits are 1 tile wider for south and east, so these tiles aren't visible anyway). Seabed heights are generated automatically and hence not stored in game.map.

For x/y dilemma, it's ok to read the map as:

Code: Select all

for (y = 0; y < height; ++y)
    for (x = 0; x < width; ++x)
        map[x][y] = get_three_more_bytes();
Just curious - what are you trying to do? Maybe stuff in tools/map/ would be enough for your purposes?

shutyaev
New user
Posts: 2
Joined: 05 Mar 2015, 21:52

Re: Parsing game.map

Post by shutyaev » 06 Mar 2015, 15:40

Thanks for the answer!

Now that I have source code entry point, I guess I will be able to find everything I need easily.

Now what I'm trying to do. I want to build a bot. A very clever one with lots of advanced math inside :) It's just that I've always been looking for a project to put my education to use. Warzone was an ideal choice - because it has a quite simple idea and is hardware-friendly but still has very complex AI tasks inside. It certainly may be that I won't get far with this project, but currently I'm interested :) So the very first step I'm going to make is to create a math model of the map. So I require some tool to convert binary map files to javascript ones to be able to use them in my bot :) I know this may sound controversial but here are my reasons:

1. As far as I understood the javascript API lacks getZ(x,y) function
2. A human player has offline memory - he starts the game knowing what he will do in the beginning (that is if he knows the map) - so why can't a bot also have offline memory.
3. If the math used to calculate its decisions will be as advanced as I imagine it now - it will be very important to have as much pre-calculated values as possible. Just so the CPU won't fry itself :)
4. Yes, it means that this bot won't work on 3d party maps out-of-the-box - but hey! You want a clever opponent? Then help him learn! :)

User avatar
NoQ
Special
Special
Posts: 6194
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: Parsing game.map

Post by NoQ » 07 Mar 2015, 06:35

Oh that's a worthy thing to do. I'd love to be able to help (and also put my own education to use as well, though my ph.d. thesis was quite far away from artificial intelligence and machine learning).
____________

For a project of scale so large, you would inevitably need to take (or, better, compile) nightly builds of the game and implement your own script API functions in them when needed. In fact, API functions are introduced in an "on demand" manner quite regularly; but they're not getting into the stable release very quickly.

For example, here's the function you requested that returns map height of a tile; it's quite easy to implement:
Usage example:

Code: Select all

for (var y = 0; y < mapHeight; ++y) {
    str = "";
    for (var x = 0; x < mapWidth; ++x)
        str += ("00" + groundHeight(x, y).toString(16)).slice(-2);
    debug(str);
}
Sample output:

Code: Select all

cccca4baaea69a8c8cfefefefe8c6464fefefefefefefefefefefefe8c8c8cfefefefefefefefefe8c8cfefefefefefefefe3636fefefebcbcfefefeb8b8b8b8
fefee6e6fea6ded8c2eafec2fe904a645a7058ecfefe6e6afefefef48c8c8cfefefefefefee442425270fefefefefefefefe3636e6fed290bcfefefeb8b8b8b8
defec0e6fefefefedcd8d04c3a766c768c764a6a68627074e8fe6a828c8c8c8c7efefefe8c6a5a5a484430d8fefeeefedcfe3636eafed2d2fefefefeb8b8b8b8
f8fefefefedef4f4d2b64c32343c6a6246386a6a66568c7498706a6e8c72a2928cfefe7246425a5a52343640e4e85252e0d23a3a1edee6e6fedcdcfeb8b8b8b8
fefee2dcfedaecbe0e14425c34564a565c726a8c567264588c8c623c2e368c8c8c544e6a3a48706c462e3a3c504a52344c3c3a3a3434c0c2c8cedcfeb8b8b8b8
fefed2caceb6dc02164c406a7e7876845442204c6460608c8c6e36340200668c8c8c44623a5c846c3a4e2246564a362e5a4652443434c6c6a4cee4feb8b8b8b8
fefefcdabce8d8e61044323c587c7662161616161616745a684c28180204228c8c8c8c8c52445e361a1a2c501a182638385a52504efefefedadafefeb8b8b8b8
fee0fcbe88eeccf6204e1e5c64665816161616161616748c8c563218000422588c8c8c726c4e4a2c140e1a1e4e36022840483e40d4fefefefeeafefeb8b8b8b8
f2caf2f41006141af220f03e161616161616161616166e8c8c54060000080a52626a3e4e3a32261000101c121a02122c3c223a40eefefcfee8f2e0e0b8b8b8b8
f20e1a1e2e1410ee16161616161616161616161616163e7248f63e00000808284e5630322620201c1c221a16161212001c44323e3840d2eac2c2e0e0b8b8b8b8
400a2c325a365c161616161616161616161616161616383c424400020400201c2e24201c1c161c1c2a2c1c1002040420123a381c0a0808c8fefefefee6b8b8b8
402c546838241216161616161616161616161616061c1c1c1c080002121218000a0e0e0a0c1e2c444036261800000408003a2616080808e8fefefefadcdcdcfe
56564866381612121216161616161616161616161c1c1c1c1c000a18a0260000101e1e342634405250482e24060008081a000c0a1034fefefebecec8a4a8d6fe
5656344c1e061212121616161616161616161616281c1c1c1c1c1c1cc6dc1e182a2a3c4662606866645e502e0a0400000006e4100000fefefebebedadafefefe
8c66605a3a1c121212161616161616161616161616fa1c001c1c0a1cee0c18f2e8465c6e7c828888888a82481c0a000000e4e4041c000cd6fefefefefed2d6b6
8c60602a4e3612121216161616161616161616163a1c3400000a282602022c14f85c6c708888888888888868381e1a0000e4e4de08060a0adafefec0dcfeb6cc
fe6a7a8c5e4c1616161616161616161616161646141c1c1022000000c8022c1c405e688088868688888888786024200000e4e4d2f0020a0a48cefec0e8fefefe
fefe4c6e5e2816161616161616161616161616d8f6f8eace2e00000018262e383e3e5a7488868688868688825c22080000e4e4ca0c2c264848f6fefefefefefe
fefe64646e2c16161616161616161616161606c0fc1ce0c02400000612000a1e3a46646c8888888886868880684a1602001c585006545a482a48e0fefefefefe
fe68686a8c4e1616161616161616161616160000fcfcceb200000c000200061222364c6e888888888888888876461a140024243c6c568c303836d4fefefefefe
fea49c8c8a1616161a1616161616161616160002c0f2f2280c081a1a12000e121a3054708888888888887a6c5c3e1a00000e0e244478768c5c4ee8fefefefefe
fe78747c981616161616161616161616160a0204baf2f21e18223c3e4e2212122032586e828688888e886a5a441c0000000000141458848a8c60dcfefefefed8
fefe8c8c765e34161616161616161616162c242adafcfcb21e284c6020182e26304a5c72768e908e7e765e4a423008000000002850a6c6aaa082fcdcdac81c1c
fefeea8c7882606e1616161624161616162224e0fcfcfc242c30282816162838464e667e848c9092766c5648443426000000000034dce4ce8c8cccc6c4b21c1c
fedcfef466707a4c1616161624262a2a0c0c2ad8fcfcfc2432322c2e1616323c52646e74767a8c846c524644341e22000002020e40d0e28c668c849ab8481e1e
fefef0da6c8c8c7c7272727226262a2a0c0c2a1cb4fcfcfc38384a6c0606163e4256606c707478645c483e362624140c0002200e9cbac28c626a8c8c8c5a0222
fe9ceafe8c8c768c72727272787824240c0c0c12bcbcfcfcfc42488e06061258424a4e5a4a585850443230361e343e2000305a8caabab48c8c3e8c8c8c663622
78eaeafeea8c788c141478787878242414141010bcbcfcfc0060565c1616525852423c463e44484a2c1e201a00422c3e224a82aa9a9c9e628c5e606c66502222
78eaeaeafef4668c2c4c787824242424141410183034fcfc00f06032522c5252523c384838363c2a121002305a6864a442588094946a8c8c8c8c8c6c4c2a2222
78eaeaeaeaea6c72766c884838283a2c16142234425cfcfc50365456485c525216503242201a22020a0602007c7c648e5e628c86868c8c8c8c8c8c6e22222222
feeaea8c78708c5a7e647e5e202020202020202020a6ca02404e2e5c6068845a5a523af4201212060000000c367c4a5a40485e6ea88c8c8c8c8c8c8c22222222
feeaeaf4667848203c42262a20202020202020365080de12444e2efe36365a5a5a7a582624120a100000041a06462a3a28262c6672748c8c8c8c8c8c22222222
dceaeaea6c50303a3a3a3a2820202020202020325086d414445a604236365a5a5a58581a56203800000004000cfc181e3a3a2c106a6a788c8c8c8c8c46222222
fe4e82708c74163a3a3a3a3a2020201414202020426ed8285278243224362a584e180e1a30d6e81000001430c61c2e1a2424262a2a6a7a8c8c8c8c8c8c682222
9c1e708c8c66261e443a3a3a3a202014142020202020482858683c0616f64444202016082a1aee2600000cf21c262a36202c4252529eb8a08c8c8c8c8c7c2222
8c8c8c8c8c7a3e6a5a2e3a382020200a0a202020202050845a4e0240283c4444202012e01a203c0a00002000402412121c5260b2b2b8b88c8c8c8c8c8c702222
fefe8c8c6c6c8c8c783c3a1e20202020202020202020425c88082a242a3212120e0e08fefe04f60a00000030101030363e64a0b2aaaac48c8c8c8c8c70222222
fefefefe8c6c608c7e00000012c8deca202020202020121212121c12182212120e0eb8fefef2e400000000305a581c3a38628a84949c76646e968c8c8c442222
fefed2fee07e8c8c88000000303e1a00202020203a3a12121212120000000000001a2ec4c4dc1a1a0000121826202e3a184c6676667c8c4c385a7a806e222222
fecafefefee648628c7a0e206e786e1e20201a2002401212121c140c001a1600001c2e2630322a240000061606020800320844626060645c5c328688786050fe
fefefefefee062627e7e7a6e96968c20202020201c4a543a320a120e0020160400060a304614121a00000606001c12000000222c4e3876582c2c5c828c6664fe
fefe28fee0384ebeb07e82766c8c8c42202020202026563e3e201a16101a040400000a303204141400000c1830020200000022263a9a502a2a2c60848082fefe
fe2016002a62607c7c8c8c72608c8c8c202020207e3a5656422c2e041c00161600000c1c1a18140000000002280c141200000028444e562a2a2e2e568c86fefe
f81af8102a62604a4a70523e4c8c8c7c202020207c3c56565a362e1a2a000202001400001008020c00000a0a0e181412001616221c28241c002e2e62868cecfe
f8c036203e402624161010101a2a768c202020205c82a4a48c4850562a1c1028161a10080e02020000000a0a1200000000161602120224122e5c7e98928c8cfe
fcfc4820280000042a10101010103a44202020205e8c9c888c8c706858623c4a5c666e520a18140000000c0c08000000000000020216243066868680766668fe
fcd816304a000002101010101010103a20202020527a767676748caa70787e7a583232604c2810240000040c0c180000000416121a3c4a665e7452686c68708c
541a1e0ae0fc240410101010101010103a1010223a30203c585896bec4828c885612464a4244342c000010100000001e1e20261e22608c8c5a5a5e6868424242
58e0cee0e0f0100006121016101010000000000000000000145874a88ca88c64002e1c284858123000001a100000001e1e0e10165c8c8c888c8c8c6868424242
4a4a9c76462c1c1c1c080a1010101000000000000000000002385a627292685c26080214423afa3600000a1a1c100016160e2a3a6e749aa09c8c8c6894424242
102c505224081c000008001010101000000000000000000000003c3c48422e261e00002022464028000000144018024438324e5c6470788c8a928c6894424222
02101e1a000000000000001010100000000000000000000000000000000000100e100a0008081206000000001a203cfe3a5656665e506c7c94a08c2a28282222
0404000000000000000000000000000000000000060606000000000000000000000000000808060606000000021a14285470785c5c48728c8c8c8c3e28222222
00000000000000000000000000000000000000001c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1a1a0e101c1c000004061e425c828c5c5c72728c8c8c5c3e3e222222
0000000000000000000000000000000002020202260000000a18000000001600001636281a1a18160c1808061a00385e728e8c928c70688c8c8c30485e222222
1010002408000c0c000000000000000002020202000012123632000000161000ceaa66606448342e02121a2e165230627c74728c7476668c8c8c604848222222
26260a58642806000800060000000a000202020200001246ecea000000201616ced4c686622a4640020c1e1a00243436705e5044788c8c8c8c7e7e6262222222
00284c828c780e4446160a0216102228020202020000fed2f02e00000004cedcdce2e2dcdc4e4e4e3a0a30020206284c5240600030568c8c786a7e8c5e222222
00006e8c8c5a5060585a140412163c26202020200032160c0ce6e6cececececef8ecdcf0f04e4e4e4e182c2e363e1a3e1a223a86befe5e8c78788c8c5e222222
eaea8c8c5e26bec6a0920000fae00020202020200000fa0c0ceaeaeacececece2e20dae2e23c4e4e4e00284838380000000c0c78c400525a5a5a5a8c8c222222
5656504214260c100206fc182e1e60321e322e3e46c2c0ceceeaeaeacece7e867e5866cecef24e4e4e4e3ca2a2a20000000c005cc6104e5a5a5a5a8c8c222222
4a4a321002ea182e2630223c5854eaca1e321e3e56b8c0cececececececeacacb69e90cece4e4e4e4e4ea2a2a2a2a2a210160084a2085062546e6e5c52563622
feec3290fa0808122650505e5e54f8d01e16202c48cec4ceeaeae464a5a5acacbcacface064e4e4e4e4ed8d89eb2a2a2a2a2a2a2a2742446282e3e2c22404a42
fefefed2a6f8c0f626505024582af01e0202120202aac4b6eaeae268a5a5acacbcacdaf6f24e4e4e4edcd8d8b2b2a89aa2a2a2a2a27242282e2e0e0404444442
fedcdcfeb6eafa423a2e4824586a02ea02022e020200aebab0d8e6fc84acacacacacc0c04e4e4e4e4e4ec8c8b2b2b2b2b2a2a260604a422828caca1010fec6fe
fedcdcfef4fec6cc5c4e485c5e5c1cfe0000080000009a9aa2be00c0c0325858c0c0c0c04e4e4e4e4e4ec8e2e2e2dcb2b29e8c6060564242fecacafefeecfafe
fec2c2bed8e6fee246685e28443a462e2e2e0000000034523c02cec0c0d8d8d8c0c0c0f6f64e4e4e4e4e5abce2d6c2cc94b89c78624a4afefefefefcfcececfe
fec2b2fcfefeec40446e8a8a662e3e2e2e2e00003602023a0e0202cec0d8d8d8c0c01adcdc4e4e4e4e223428282828a85e7c9c848c8cfefefefefefcfefefefe
fefeeefcfcfc1a3c3a6680806c0e2e2e2a4a20203002020a000202cec0c0d8d8c0a0061e1e004e4e4e2c50505010103a2c7c928c8ca2fefefefefefefefefefe
fefefcfcdcc232082460806a4a18262e324e2a401400000000001e3cde0a2008e81c162a2a2a4e4e4e383030383e3a1a0c027290948c8cfefe7070fefefefefe
fefefefc0cd8f22836466044441832266a94727a000000000000142a2a6a0e0a181e2a2a2a2a4e4e4e4ad6da50501a1a0014327a8c8c8c8c8c7070fefefefefe
feeaeafec6c6d60226565024342848546880667c0800000000001a122442421a1a2a2a2a2a2a4e4e38562a22e2381a1a1a0008226a8c8c8c8c8c8ce4e4fefefe
feeaeafec6c6fa1e48585e3a4e284a7e6680807a1048201a00000000000c12223a442a2a2a2a4e4e50fa2a2af4501a1a1a1a22226c8c76768c8c90e4e4fefefe
fefefed8d800362a38423e3e405c8c9a485864341c060c0002020202020202344242404c2a2a4e4e505050d268501a1a384a28287c8c76768c8ce6e6fefeeafe
fefefed8d8003250383c3e3e265c70786a5846083c06100002020202020202202020202020204e4e50505050502e1a1a2828282848488c8c8c8ce6d2eaeaeafe
fefefefe181a183e002626001e6a78786a7212001c16120000000000020202202020202020344e4e50505050641a1a28282828281a488c8c8ceaeaeaeaeaeaea
fefeda484a2e181e00140000302e545a525800001818220000000000020202202020202020344e4844504c4c4e5472281e1e282828286868fefeeaeaeaeaeafe
fefef6f64c664c4c4406041006301e3e58040000462e260000000800000016062e2020202034343632444638283830282828062828285e5efefe8ceaeaeaeafe
fee0f6f6626242462c001c1c1c1c304e2804000040400002002020201616162020202020203434342236160a0a0a0a28282828281c2856568c8c8cfefeeaeafe
fee0f66662624232f8261c1c1c000028280000000000000000200020060606202020202020342c281210000a0a0a0a0a282828282828564e848c8cfefeeaeafe
fefee85e8c8c38160c341c1c1c0000000000000000001c1c1c2020201c1c1c1c1c1c1c1c1c1c1c1c121e00100a0a0a0a642828282842665e848c8ceaeafefefe
fefe8c8c8c8c0ee00c341c1c1c1c000000000000001c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c0e0000002a200a0a3a58567a66586c708c8ceaeafefefefe
8c8c8c8c8c660c443a22141c1c1c000000000000000a18000000001600161616161634160c0c18180e0008000a100a0a0a1e204636688c8c8c8ad4eafefefefe
8c8c8c70708c0c42362a2e1c1c00000000000012001832000000161000161616161616160202121202000000000000000a0a16163450ac8c8c8ac2eafefefefe
8c668c70708c665240403800001418000000001228ceea000000201616ced4d41616161606020c0c0200100000000000000e1616348c8c8cd4be9898fefefefe
fec68c748c8c8c4a405e3800000c0c18140000fec2c2c200000004cedcdce2e2dcdc161600160a04101a1e00181400000e0e16168c8c8c8cd47c6c988cfefefe
fefefeec607a5e5e6044822c160c0c00000016a6c2c2c2e6cececececef8ecdcf0f0ce00001604040c0e00002224000004062c2c8c8c8c8c8cc0c08c8c8c8c8c
fefefecc6c8c5e5e8866661212180400000000a6c29e9e9eeacececece3620fafae20c0604040000000000002a3c2004042a2c60609878728cc0a26e58588c5c
feced0e6e08c8c8c726666661228002c1c1cc2c0ce9e9e9eeacece7e86684efafacece1212020202000000001212000004122a60609a78708cba9c6e58588c5c
fefee6fee84c7e8c9a6666664e4400369c9caec09e9e9e9e9e9e9e9eac8c62f8f8ce0a1e1e160a080808008c8c8c00000020768c8c8c6e768cbabaacac8c8c8c
fefefee0e874727e6c4a78583636002e9c9caac49e9e9e9e9e9e9e9eacac9c02d6d2d22e161616140808008c8c8c00000028568c8c8c64646e8c7896ac8c8c5e
fefefe5c5c7a8c808082704e220c0c1c1c1c9cc4b6ea9e9e9e9e9e8eacbcacdaf6d2d29a524e16140a121c8c8c000016121a52a810668052187076768c8c8c5e
fefed2400e6e7a70acaca274340c0c1c1c0000aedaced8e6fc849a9aacacacc0c0d2d492564816100e242c2c000000000000369c02687c24241c588c8c8c8c8c
fefe62543438448c724c4c803434000000000014dcdcce00c0c03e6458c0c0c0c0f6d65a5a16020212160000002e000002083c8e0a747a242418184c68685266
fefe6220403450305c4c4c207658000036360022000202cec0c0d8d8d8c0c0c0f6f612123838161414200200000000000004428a1c5e762e2e18184668126666
ecececdaac523c465c5c42587e7c58262636000022020232cec0d8d8d8c0c01af6f6121238382220241c0200000000000000f61c564e4e3250503a584e666666
fefefed0be163c3a445050525c5c661e1e3000000a000028cec0c0d8d8c0a006f6f6080828282c2a26260606000000000000ec4c46463256405050444e666666
fefefe040430402a2460785e749a6e7c1e1400000000001e3cde0a2008e81c16000008082828383426260606000000ecececececec02fe1c625e1a5464666666
d4d40c0c204434523c3a62607a9a723e16000000000000142a2a6a0e0a181e3a1e00001228384a4226261414000000ecfcfcf8f8ec2c021c1c3c28566c669666
d4a20c0c323c502e3c724060906c5238340800000000001a122442421a1a2a2e1212081e2e3856502626141400001cecfcfcf8f83402003cbcf8969696969696
624a3c2254325c2e0600000438422800222400000000060c120c06060e1a2a0000081a243c4e606042320000000000feececec120000000004366c9636504c66
6262625272522606020604041000401a1800000000060c2a443c061214182a0af6f6122e405c6a684a2a161200100cececec1a00000000002636365252666666
8c8c622654628c343a34080800000a00000000000024443646462a2c141400f6f6f64042565a7070502a14ecec1400ecececec0000001826264e683838666666
8c6a8c4e8c8c8c8c485c08080000041c00000000283c52324844401414141434f66c6c4654707070701eec24240000ec2828ecec0000ec5e8292683e3e36485e
fefe8c8cb0ca8c8c4a2e5a403a26144028001e24546c727a8c725a1414141414f6f6f6f6707070707070ec24240000ec28280808ecec163c82d8f6dcae603e3e
fee2749c92a04a8c565640404a4a0a22042232143c620404fc981c1414141414f6f60000706e6e6e6e70ececec64640404ec0808ece61c509ad8f6a49ec87676
fefefefe628c4e588c8c6c484a4a66661032463024600404fc141c14141414263af600006c6e6e6e6e70ececec6464040464646464d6fc4aa0c0c06e6ec0c0c0
fefefee2688c8c8c8c76566ca8a89292565a381818040404040404040000123a3a787e766c6c767670705658646464646464646464d6d698c0c0c0c0c0c0c0c0
fefefefefe688c8c645a768ca8a89292fc28284454f6040404222204f608e80c0c6464646464647664646464646464646464646464d6d6a8c0c0c0c09c9c8282
fefee2e2fed2588c726a6c8c8c8c8c5c28284836366804040422220404c6d2e80c6464646464646464646464646464444664646464d6ecc0c0c0c0c09c9c8282
fefee2e2fefef2666430404c48663a2224462062620404202004040404040c203a3464646464646464646464646464484c6464646456d6c0c0363636363636c0
fefefee2e2fefef8f864605c482c482222163846eaea0420200404d4d4040c3242426464646454585a646464646464645f5f5cd6fa0a08c0c036fee8f4fed0e6
36fefee2e2fefefef83848622824000002023c40eaea040404e8e8b8b404042a304264646464646464646464646464645f5f5a82b6bcc0b0a836fef8fee6e6e6
36fefefed0d0fefe50702e2e361a0000000c32606060040404e6e6e8e8fc180404646464646464646464646464646464645a5a7eaa86887e96363636fee6e6e6
36fefefed0d0fefe6c4a5c3016d2421200003272727202020200e6e8e8fc180404646464646464646464646464645f5f5f5a5a5a52582e14284a563636363636
36fefefee8fefefefeec481016e242143400547272720202020204e8e804046464646464646464646464646464645f5f5f5a5a5a44363614284a364a4a363636
fefed6d4cebae0e0f0e412041c12121c3e2e4e727272020202020404ecec046464646464646464646464646464645f5f5f5a5a5a363636363636363636363636
fefec8ccfefee0bccc1a003632121248040430441850020202020404d0d0e8e864646464646464646464646464646464643c3636363636363636363636363636
fefed0fefefefedadaf8d0fe261662521e28402e3850160000204ee8e8e8e8e864646464424242626262626262646464643636363636363636fee6e6fe363636
fcfefefefefefefefefe06e40808364800003e505a083e12224c12e8e804046464646464424242626262626262684436043636363636363636fee6e6fe363636
fcfcfce4e4fefefefefe06cebce8ec1e16163012422e684a2e5a404028563664646464644242426262626262624e803e2a363636363636363636363636363636
fefefce4e4fefefefefedccecebeb4e2d2ec303c54744a5854544040522e56543c3e64646464244a566464647a4e9a704a36fee6e6fe36363636363636402236
fefefefefefefefefeb6b6be8adedeeed2eab0b81e384252566840403c1822442af0646464643e5a3664641c22f6222c1836fee6e6fe366e4208fc0a3eee1c36
fefefefefebcbcfefea0a0d0dee0eeee9ed0d2c21c1a34523038fed806f40a3a282a646478645c70606464d2ea04eaeae03636363636366e6ef6f6ec08120606
fefefefefebcbcfefee8e8fee0e094b4d0d0feecec281640142afefefef4f4142a346666527070708a826ed2d2bcfeeae00e0000d218544e34340836dae60608
fefefefed4d4fefefafacacafefeb4b4c6c8d8ececfee4caf82afee2e2fe402a4a5864543c3a2e2e2e2e4c0cd6bcbc90b40e00001818e6fe343408e0fefecc34
fefefefed4d4fefefafacacafefefefcc6c8fefefefefefeacc4fefefefefe2230263c522e2e2e2e2e2e4c0c0ce0e0b4b4b89cee1818fefee0e0e0cccce0fefa
fefefefefefefefefefefefefefefefefefefefefefefefec4c4fefefefefedafe3c0e2a404040402e2e1c32e0a8a8e0fcfce6e6fefefefefefefeeaeae0fefe
____________

Saving script learning data across many games is another idea that is long discussed, but nobody yet went far enough to implement. It is easy to see how it would work though: probably we just need to allow saving and restoring JSON objects into a single database by script-specific keys.
____________

Also, when making your AI rely on extra map-specific data, it's quite possible that you already have everything you need: map labels. Labels are stored inside the map (labels.ini or now labels.json) and mark arbitrary locations or areas or objects or groups of objects on the map. They are also edited in the map editor in a wysiwyg manner. The script can access labels by string names.

Labels were designed for two things: make visual markup of campaign levels easier, and make AI hints. The latter was not yet implemented in any AI, so no particular convention is so far imposed on label names to make them understandable by all AIs, and you can easily come up with your own.

There's also an old mechanism for map markup, called gateways; it marks chokepoints around the map to let the AI know where to build defenses. Many maps have gateways, but this approach is probably too restrictive.

Post Reply