Map Database  •  FAQ  •  RSS  •  Login

The passability byte in the old map format

<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 12 Jul 2009, 20:30

The passability byte in the old map format

Remember the file that says
0 = Can?t walk, can?t build
150 = Can walk, can?t build
255 = Can walk, can build
?

Well it's a lie. Ok not really a lie, but it's misinformation. Untrue. Nonsense.
Especially the 150, which is a completely random number that doesn't make sense in any way. 127 or 128 would, but not 150. Maybe it just happened to work.

It's a bit switch. We haven't figured it all out yet, but there are bits for "walkable" "buildable" "farmable" and some weird things related to trees.

So far:
bit 0 = walkable
bit 1 = unknown??
bit 2 = buildable
bit 3 = farmable
bit 4 = south west of tree*
bit 5 = north west of tree*
bit 6 = north east of tree*
bit 7 = south east of tree*

* doesn't seem to make much sense does it? could be something about diagonal passability.

We'll keep you posted.
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 13 Jul 2009, 09:39

A2re you s2ure it's2 functiona2l in Ka2M this2 wa2y? Ma2ybe it's2 the sa2me thing as2 pa2ttern.da2t that2 is2 unus2ed?

In Remake we use own pa2s2s2a2bility forma2t which is2 14 bits2witches. The thing is2 ca2lcula2ted on the fly cos2 it ma2kes2 little s2ens2e to keep it s2ta2tic.

PS222.2. S2orry for typos2, my keybord is2 a2cting weird :(
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 13 Jul 2009, 14:30

I have not tried changing it, but the original maps stick to the format.
Anyway, pattern.dat really has to be different, since it has no trees on it. (so the diagonal passability makes no sense, but those bits are different sometimes anyway)


That's an odd thing going on with your keyboard btw..
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 15 Jul 2009, 19:36

As for trees it makes sense to forbid trees to grow/be planted too close to each other. Lewin made similar thing in Remake few days ago in fact :)

P.S.
I spilled glass of beer on it :D
After drying it was mostly ok, but after weekend '2' symbol started to act all weird and appear after every key press.
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 16 Jul 2009, 05:08

Harold wasn't talking about spacing trees, he meant the passability. In KaM you can't walk diagonally through trees, stumps, etc.

This is something that needs adding to the Remake, hopefully before the demo. I would guess that one of the bitswitches in trees.dat tells us that it can't be walked through diagonally. Unfortunately it probably won't fit in well with our path-finding routine.
Lewin.
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 16 Jul 2009, 05:40

Diagonal passability, thats interesting, it never occured to me before..

I'm not sure if this feature will be in Demo, but luckily thats all in one function so it will be easier to fix..

EDIT: Feature included :) Was easier than I thought it would be. Now we just find that flag for objects canWalkThroughDiagonaly.
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 16 Jul 2009, 16:44

<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 16 Jul 2009, 16:52

Bit 4 where exactly?
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 16 Jul 2009, 17:25

Remember this?
  Code:
array[254] of {    short[30] Animation;    short Count;    int X, Y;    Boolean Choppable;    Boolean UnWalkable;    Boolean Unknown;    Boolean Vineyard_or_Cornfield;    Boolean Growable;                        <--- it's this one    Boolean PreservePlantingDistance;    sbyte TreeTrunk;    Boolean Buildable; }[/quote] For some reason unknown to everyone except the original developers they are entire bytes, so calling it bit4 was a bit confusing sorry :)
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 16 Jul 2009, 17:42

Are you sure it's this way?

I have it a bit different:
  Code:
  MapElemQty:integer=254; //Default qty   MapElem:array[1..512]of packed record     Step:array[1..30]of smallint;               //60     Count:word;                                 //62     Properties:array[TMapElemProperties]of cardinal; //94     u2:shortint;                                //95 //Something to do with falling trees, -1, 25..64     CanBeRemoved:word;                          //97     u4:word;                                    //99 //Always 0   end;[/quote] Where TMapElemProperties is 8 booleans: [code]    mep_u1=1,           //Always 0     mep_u2,             //Always 0     mep_CuttableTree,   //This tree can be cut by a woodcutter     mep_Double,         //Draw two sprites per object (grapes) but only if mep_Quad=1     mep_AllBlocked,     //All passibility blocked. Can't walk, build, swim, etc.     mep_Quad,           //Draw multiple (4) sprites per object (corn)     mep_u7,             //Unknown     mep_u8);            //Unknown[/quote]
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 16 Jul 2009, 17:51

I'm not sure actually

But I don't have the code to test it really, it seems like you do, so would you mind testing it?
<<

Krom

User avatar

Knights Province Developer

Posts: 3280

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 16 Jul 2009, 18:20

I borrowed your layout and it fits perfectly :)
  Code:
  //Trees and other terrain elements properties   MapElemQty:integer=254; //Default qty   MapElem:array[1..512]of packed record     Step:array[1..30]of smallint;               //60     Count:word;                                 //62     MoveX,MoveY:integer;                        //70     CuttableTree:longbool; //This tree can be cut by a woodcutter     Double:longbool;       //Draw two sprites per object (grapes) but only if mep_Quad=1     AllBlocked:longbool;   //All passibility blocked. Can't walk, build, swim, etc.     Quad:longbool;         //Draw multiple (4) sprites per object (corn)     u5:longbool;           //Unknown     u6:longbool;           //Unknown            //94  that is 6 longbools 4bytes each     Stump:shortint;                             //95 Tree stump     CanBeRemoved:longbool;                      //99 //Can be removed in favor of building house   end; [/quote] But.. neither u5 nor u6 doesn't look like diagonal passability :( Both have true and false for bigger trees and vinevields and stones.. Neither does 'Double', which is I'm 90% sure is command to draw two sprites per object (grapes) but only if mep_Quad=1 I'm out of ideas..
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 16 Jul 2009, 21:02

Odd.. maybe the information is only in the map? that would be stupid, but, it's possible..
But how can that be true? I never noticed anything odd with trees on edited maps, and I'm pretty sure that they don't do that diagonal passability thing (it wasn't known back then so how could they?)
Maybe it's hardcoded in the exe?
<<

JBSnorro

Barbarian

Posts: 106

Joined: 20 Nov 2007, 23:00

Post 16 Jul 2009, 21:34

We seem to disagree on the meaning of the boolean you call "Double", and I call "Unwalkable".

These are all the trees for which that bool(or rather byte) is nonzero. If you check this image and its validity, you will probably reconsider :P

And we seem to disagree on the meaning of the bool you call "Quad". It is not only nonzero for the cornfields, but also for the vineyards. I'd rather think of this bool as "flagging an exception-mapelement"(either the cornfield or vineyards).
So if "Quad" is true for vineyards as well, it shouldn't be called "Quad" :P
And if there is no boolean "Quad", there will probably be no boolean "Double" either....
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 17 Jul 2009, 04:33

I think you are right JBSnorro. Actually it was me who named the Double and Quad. See, we haven't made a tool to export all images of the same value like you have, so I was just taking specific examples and I noticed that grapes all have that value set. Judging from your exported image it looks like the diagonal passability flag. It wasn't Krom's fault though. So grapes vs corn must be decided based on the object ID not a flag?

Would it be possible for you to post an image of all of the objects for which each boolean value is 1? (Like you have been, but for all of the boolean values) That would probably help us clear up the confusion.

Also, what is PreservePlantingDistance for?

Return to “Other Creations”

Who is online

Users browsing this forum: No registered users and 13 guests