-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmapnotes.txt
85 lines (66 loc) · 3.28 KB
/
mapnotes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
Current map format
Old map format
This map file format is no longer implemented anywhere. It is left in
this document for educational purposes only.
Objective:
maps are layers, and have entities initially on them.
Maps have obstruction and zone data.
Maps have a default VSP, and a render string.
Layers have tiles.
Current limitations:
All entities inhabit the same layer. There is but one obstruction layer, and one zone layer. Obstructions are still tile based. (no vectors, potential for enhancing the tile scheme, however)
--------------------------------------------------
Types
u32 a 32 bit unsigned integer. Takes up 4 bytes.
byte a 8 bit integer, signed or not. I don't care, it's used for ASCII strings and booleans
typedef STRING
u32 length
byte[length] data
end
typedef COMPRESSED_BLOCK
some stuff we don't really care about, as my File class handles it all transparently
end
---------------------------------------------------
byte[6] signature "MAPù6\0"
STRING Default VSP name
STRING Default music
STRING Render string
u32 map width (in tiles)
u32 map height (in tiles)
u32 start x postion (not used by the engine, but exposed to the scripter)
u32 start y position (ditto)
bool nonzero if the map is "round" (ie, it wraps around and junk)
u32 layer count
u32 pmultx,pdivx
u32 pmulty,pdivy
COMPRESSED_BLOCK tile data, width*height in size, one u32 per tile
COMPRESSED_BLOCK obstruction data (width*height, in chars)
COMPRESSED_BLOCK zone data (width*height, in u32's)
u32 Different zone types
STRING zone name (purely for the users benefit)
STRING description (also purely for the users benefit()
STRING event name (called when the zone is activated by the player)
STRING event name (called if any nonplayer entity steps upon the zone)
u32 Chance that the event will be activated when stepped upon. (chance out of 100)
u32 delay (in steps) before the event is activated
byte Adjacent activation flag. Nonzero if the event is to be activated a la entities, and not stepped upon
u32 Number of entities on the map
STRING name
u32 x position
u32 y position
u32 direction
u32 speed
byte if nonzero, the entity is obstructed by the map
byte if nonzero, the entity is obstructed by other entities
byte if nonzero, the entity obstructs other entities
STRING CHR filename
byte nonzero if the entity is to be activated immediately when it collides with the player (as opposed to when the player activates the entity normally)
STRING script to be executed when the entity is activated
u32 state (scripted, etc....)
STRING movement script
u32 wander steps
u32 wander delay
u32[4] wander rectangle
STRING wander zone
STRING chase target
u32 chase distance