1 Blob Wars : Metal Blob Solid
2 Copyright (C) 2004-2011 Parallel Realities
3 Copyright (C) 2011-2015 Perpendicular Dimensions
4 Licensed under the GNU General Public License
6 Last Updated: August 2015
8 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
14 3) The FileData Object
22 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
24 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
26 Contained within are pieces of information to do with the game, the map structure
27 and the structure of the pak file that is used in BW:MBS. I have created this
28 document for educational purposes.
30 This document is completely unsupported.
32 Thank you in advance for understanding.
34 To build the game without needing to recreate the PAK file each time to can
35 build using the following command,
39 The binary created will load files from the directory it resides within (so it
40 will look for data, sound, gfx and music in the local dir). When building the
41 game without using the PAK file you will get debug information to the console
42 and an FPS counter. You may also use the following additional command line
45 -map <filename> Start the game using the specified map
47 -skill <skill level> Start the game using the specified skill (0, 1, 2, 3)
49 -showsprites Show the sprites that have been loaded. Use in conjunction with
50 a map file for best results
52 -hub Jump directory to the hub. Will automatically load the first available game
54 -randomscreens Takes random screenshots and dumps them into a directory called
55 screenshots. You might not want to use this(!)
57 -nomonsters Does not add monsters to levels (does not affect Boss missions)
59 -credits Show the credits
64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
68 The PAK file used in BW:MBS differs from the one used in Project: Starfighter where
69 as it is compressed and contains a lot more metadata making it a lot more effecient.
70 The format is as follows,
72 NB: All binary data is little endian
74 <variable length data> (char)
75 <varibale number of binary strutures> (FileData)
76 <offset of FileData structures> (unsigned long)
77 <number of file data structures in archive> (unsigned long)
79 BW:MBS will open the pak file, seek to the end, two back two unsigned longs and read
80 them. It then have information regarding the file structure and can read in all the
81 FileData objects that exist. These are stored in memory for the duration of the
82 program and stepped through when a file needs to be loaded from the PAK.
85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
86 +++ The FileData Object
87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
89 The FileData object holds the metadata for each file in the PAK archive. The object
90 itself has the following format,
92 NB: All binary data is little endian
99 Filename is the filename of the file (including the path). It is limited to 56 characters
100 since it is loosely based on the original PAK file spec for Quake. This could obviously
101 be changed if more characters were required.
103 cSize is the compressed size of the data. All the data in the PAK file is compressed using
104 zlib compress at a strength of 9. This number is used to tell uncompress how much data there
105 is and also used by CPak.cpp when loading the data from the pak file into a buffer in
108 fSize is the full uncompressed size of the data. This is used by uncompress and also when
109 allocating a memory buffer save uncompress the data into.
111 location is the offset of the data within the PAK archive. When a match for the filename
112 has been found in stepping through the filedata array, the PAK file is opened and then
113 seeked to the appropriate location. The appropriate amount of data is then read.
115 When working with big endian machines it is neccessary to convert the values in the FileData
116 object o little endian so they may of proper use.
119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
123 The maps are BW:MBS are plain text. They contain the data for the map, the objectives,
124 enemies, doors, and pretty much everything else you see during the game. Sprites and
125 new enemies can also be configured within the map data.
127 The map data beings with a large set of numbers. 400 columns and 300 rows allowing for
128 very large maps. This, in hindsight, was overkill. But the reason this was because the
129 map blocks used to be 16 x 16 pixels whilst they are now 32 x 32 pixels. After these
130 rows the entity data starts.
132 The map entities take the following format,
134 <skilllevel> <entityname> <entity arguments>
136 Skill level is required and should contain a combination of E, M or H to represent
137 whether that entity should appear on Easy Medium or Hard. Pretty much all the entities
138 appear on Hard. For example,
140 MH ENEMY "SpiderBlob V1.0" 1000 1000
142 This will place a Spider Blob enemy at 1000, 1000 on the map on difficulities Medium
143 and Hard, but not Easy.
145 Comments can be represented with C++ still slashes,
149 Note: Bosses are hard coded. They do not live in the map data.
152 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
154 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
156 STAGENAME <"stagename">
158 The stage name of the map. Must have within quotes.
161 BACKGROUND <filename>
163 The filename of the background to be used in this level.
168 The music to be used in this level.
173 The path to the tiles to be used in this level.
176 REQUIRED_MIAS <initial number to rescue>
178 The initial number of MIAs required to complete the stage.
181 MIA <"name"> <x> <y> <type>
183 Defines an MIA for this level. The type of MIA is either MIA_NORMAL or MIA_AQUA
188 Determines where Bob will initially start on this level. Ignored when returning to a
192 CLIPPING <x1> <x2> <y1> <y2>
194 Determines the scroll limit for the map. The map will not scroll further than the
195 specified coordinates.
198 AMBIENCE <sound file>
200 The sound effect that will be played in the background to represent the ambient sound
201 in the level (like the bubbling sound in the Caves levels).
204 ALPHATILES <variable length list>
206 Tile numbers that should be made transparent. Ideally this should have been in the tileset
207 directory. Numbers should be seperated by spaces with -1 to determine the end of the list.
210 OBJECTIVE <"description"> <"target"> <requiredAmount> <optional>
212 Defines an objective for the level.
215 ITEM <type> <"name"> <x> <y> <sprite>
217 Creates an item of given type, name and sprite at the given coordinates. Types 0 - 4 are
218 used for weapons. 5 - 7 for cherries and 8 - 14 for points pods. Types 100 and 101 are items
219 that can be picked up and carried in the inventory. Items are type 101 are not shown in
220 the inventory (for example, Crystals and Cherry Plants).
223 ENEMY <"name"> <x> <y>
225 Places the specified enemy (via their name) at the specified coordinates.
228 SPAWN_POINT <name> <x> <y> <type> <subtype> <min wait> <max wait> <active / inactive>
230 Used to spawn an item / entity at a random interval. For example, the lava balls that jump
231 out of the lava in Inner Cave Network, Part 1 are spawned by having a type of SPW_HAZARD
232 and a subtype of HAZARD_LAVABALL. They appear every 1 to 10 seconds. The type and subtype
233 are dealt with in defines.h and processed in spawnPoints.cpp. x and y coordinates are also
234 supplied to tell the game where the item should be spawned. The only exception to the rule
235 are enemies. They have an x and y as -1 and -1 since they simply teleport in around the
239 TELEPORTER <name> <x> <y> <destination x> <destination y> <on / off>
241 Simply sets up a teleporter with an origin and a destination. Can be on or off by default.
244 LINEDEF <"type"> <related object> <"message"> <x> <y> <width> <height> <active / inactive>
246 Sets up a line that is actived when the player crosses it. Common types can be of "Checkpoint",
247 "Message, "Exit". "Exit" will prevent the player from crossing until it is the last required
248 objective remaining on the level.
251 SWITCH <"name"> <target object> <required item> <"message"> <switch type> <x> <y> <active / inactive>
253 Creates a switch that can be triggered by the player (or other entities depending on the type)
254 to toggle activate an object. Possible switch types are,
263 Note that for switches that reset Obstacles the obstacle name should
264 be placed into the "message". SWT_RESET switches are timed by default. Also, SWT_NORMALs become SWT_USEDs
265 when they are activated. This is to aid in the persistence of the level.
268 TRAIN <name> <start x> <start y> <end x> <end y> <wait time> <start location> <active / inactive>
270 Creates a train (a moving platform) with start and end locations as specified. The wait time states
271 how long the platform will wait (in 60ths of a second) at each end before changing direction. Start
272 location specifies which end the train will start at (either TR_AT_START or TR_AT_END). Note that
273 end locations must be the same value as or greater values than the start locations.
276 DOOR <"name"> <type> <open x> <open y> <closed x> <close y> <open / closed>
278 Creates a door with the specified open and close coordinates. Available door types are,
291 As their names suggest the doors are either normal doors, locked or require a certain key to
292 open them. Locked doors can be in conjunction with switches and other triggers in order to make
293 them open. Like trains, the closed x and y coordinates much be greater than or equal in value to
294 the open coordinates.
297 OBSTACLE <"name"> <x> <y> <sprite>
299 Sets up an obstacle with the given name and sprite than can be pushed. The name of the obstacle
300 can be used in conjunction with reset type switches to return them to their original location.
303 TRAP <name> <type> <damage> <speed> <startX> <startY> <endX> <endY> <wait1> <wait2> <sprite> <active>
305 Creates a trap in the location specified by start X and start Y. For traps such as the swinging ball
306 and spikes, the end X and end Y specifies the second location to move to. Wait 1 and Wait 2 tell
307 the trap how long to wait for each state (the energy beams have off and on times for example). Trap
318 SPAWNABLE_ENEMY <"name">
320 Only ten of these may be defined. Used with enemy spawn points this list details which enemies
321 can be spawned on the map.
324 SPRITE <name> <frame name> <wait time> * 8
326 Can be used to define a new sprite to be used specifically on this level. It supports up
327 to 8 frames and wait times. When there are no more frames to be read, @none@ -1 is used
328 to denote no more reading it required.
331 DEFENEMY <"name"> <left sprite> <right sprite> <death sprite> <"weapon name"> <health> <score> <flags>
333 Create an enemy. Flags should be from the ENT_* flags are defined in defines.h
338 Specifies the water level within the level. Use in conjunction with water level switches to
339 raise the water level
342 TIME_LIMIT <minutes> <seconds>
344 The time limit for this level when playing on Extreme Mode.
347 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
349 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
351 Q. Can you give me some help modifying the source?
353 A. Unfortunately I have other commitments, mainly in the real world, that would prevent me
354 from setting aside the time the do so. In the time I do have spare I prefer to work on
358 Q. Why package up all the data into one file instead of leaving it loose?
360 A. Three reasons - 1) It takes up less room on disc ; 2) It's easier to deal with one large
361 data file rather than lots of file scattered all over the place ; 3) It stops people
362 digging around in the data and potentially spoiling the game for themselves.
365 Q. How long did the game take to make?
367 A. About 18 months from beginning to end.
370 Q. Why did so much change during the game, like the saves becoming incompatible around 0.91?
372 A. Metal Blob Solid was very much a make-it-up-as-you-go-along game. It was only decided later
373 on that the levels should be kept within a persistant state so as to not force the player
374 to reopen doors, redo puzzles, etc. This in itself was a bit of a headache and due to a
375 small cockup when creating the persistance data the game would crash if you returned to a
376 previous level, left, saved, quit the game and reloaded.
379 Q. Why can't you see all the game or fight the bosses on Easy?
381 A. It's easy mode(!) The bosses aren't exactly a walk in the park and bits of the game (such as
382 battling Galdov for the Reality Crystal) are part of the game's plot. Because on Easy there
383 is nothing to do except rescue MIAs, it was decided that you should get an ending, but not
384 *the* ending after finishing the game on Easy. Also, a hell of a lot of work went into the
385 bosses, other objectives, cutscenes, etc so it also has to do with appreciation.
388 Q. Are there any secrets in the game?
390 A. No. If you finish the game on Normal or Hard you see everything the game has to offer.
391 Although you do unlock Extreme mode which is the whole game again but with a time limit on
395 Q. Are you going to make any other games?
397 A. There are plans, but nothing set in stone. Again, real life commitments can change
401 Q. Will there be a sequel to Metal Blob Solid?
406 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
408 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
410 Metal Blob Solid was fun to make more often than not. There was some hair pulling and
411 frustation involved in making the game, but that's natural in any project. In the end
412 I grew quite fond of the bandana wearing Blob and decided to give his adventure more
413 meaning, which was why the plot suddenly appeared, along with the bosses and cutscenes.
415 I hope you've all enjoyed playing the game and I hope to bring you some more games in the