| |
The WIP topic, part 2
Littlink |
|

hip 2b square
![Super Happy Heart Badge [*]](https://archive.mfgg.net/html/badges/shappyheart.gif) ![Sprite Comp Winner Badge (2) [*]](https://archive.mfgg.net/html/badges/scg2.gif) ![Sprite Comp Runner Up Badge (1) [*]](https://archive.mfgg.net/html/badges/scr1.gif) ![Minigame Comp Winner Badge (1) [*]](https://archive.mfgg.net/html/badges/mcg1.gif) ![Minigame Comp Third Place Badge (3) [*]](https://archive.mfgg.net/html/badges/mct3.gif)
![Music Comp Third Place Badge (1) [*]](https://archive.mfgg.net/html/badges/uct1.gif) ![Secret Santa Badge [*]](https://archive.mfgg.net/html/badges/present.gif)

Group: Members
Posts: 5146
Member No.: 2010
Joined: 11-April 06
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
 Cool.
 Ba-dump.
 Aw yeah.
 Oh hell yes.
--------------------
|
|
|
Xgoff |
|

<):|
![Super Happy Heart Badge [*]](https://archive.mfgg.net/html/badges/shappyheart.gif) ![Sprite Comp Winner Badge (1) [*]](https://archive.mfgg.net/html/badges/scg1.gif) ![Drawing Comp Winner Badge (1) [*]](https://archive.mfgg.net/html/badges/dcg1.gif) ![Drawing Comp Runner Up Badge (1) [*]](https://archive.mfgg.net/html/badges/dcr1.gif) ![MFGG Awards 2006 Winner [*]](https://archive.mfgg.net/html/badges/award06.gif)
![MFGG Awards 2007 Winner [*]](https://archive.mfgg.net/html/badges/award07.gif) ![Forum Event Badge [*]](https://archive.mfgg.net/html/badges/event.gif)

Group: Members
Posts: 52341
Member No.: 24
Joined: 13-October 03
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
RS don't look
| CODE | MPUZ Level (.mpl)
MPUZ's level format is a modular tag-based format; with each tag possibly carrying its own format. Most tags, however, simply contain dumps of a table's keys and values.
Note that all >1 byte values are stored as little-endian. In the tables, offsets are relative to the first byte of the tag itself. A capital 'X' denotes a value that can vary or is otherwise unknown. '#s' and '#e' signs indicate the start and end of a section that repeats itself some number of times (generally said table dumps), offsets are not specified as they are not always known, but each repeated section immediately follows the previous.
-- List of tags; those marked with an asterisk are optional: ** LST: list of offsets where the first bytes of tags reside [must be first tag after header] ** THM*: thumbnail block ** <snip> ** <snip> ** IDX: object index table ** OBJ: list of object instances ** <snip> ** SCR*: level script -- Description of tags; those marked by asterisks have special notes, see end of list: HEADER: The format header, of course, is the very first part of the file, and starts with one of the following string: 'MPUZ_XLEV' or 'MPUZ_PLEV'. The former specifies an 'unlocked' level that can be modified, while the latter specifies the level data is salted and verified with a hash upon loading. In total, the header is 128 bytes long.
(Unprotected) Offset Length Description Default Data ----------------------------------------------------------------- 0x00 9 File ID MPUZ_XLEV 0x09 2 Version 01 0x0C 117 (for future exp, nulled) (NUL) (Protected) Offset Length Description Default Data ----------------------------------------------------------------- 0x00 9 File ID MPUZ_PLEV 0x09 2 Version 01 0x0C 32 Hash data 0x2D 85 (for future exp, nulled) (NUL) TAG LIST (LST): Immediately following the header, this tag contains a list of offsets where other tags reside. However, it only stores offsets, not the tags associated with those offsets.
Offset Length Description Default Data ----------------------------------------------------------------- 0x00 3 Tag ID LST 0x03 4 Byte length (incl Tag ID) 0x07 2 Tag count #s 4 Offset value (first byte) #e THUMBNAIL (THM) [optional]: The thumbnail image is a portion of the level captured by the level editor upon level export. Typically a PNG file, it should be 384 pixels in height and width (basically the same as the game window size). Though this is an optional tag, it is probably a good idea to include it.
Offset Length Description Default Data ----------------------------------------------------------------- 0x00 3 Tag ID THM 0x03 4 Byte length (incl Tag ID) 0x07 X Thumbnail data <snip> <snip> OBJECT INDEX TABLE (IDX): This table contains a list of all of the objids used or referenced in the level. The OBJ block references this table instead of storing the objids explicitly.
Offset Length Description Default Data ----------------------------------------------------------------- 0x00 3 Tag ID IDX 0x03 4 Byte length (incl Tag ID) 0x07 2 Entries #s 2 objid index 1 objid length (bytes)* X objid string #e LEVEL SCRIPT (SCR) [optional]: Levels can include an optional Lua script, which is generally useful for cutscenes or other level events that don't make sense being stored in object code. Like thumbnail data, level script data is dumped directly into the level; whether or not it's compiled depends on the option selected in the level editor; as Lua can automatically detect if a script is compiled or not, that state is not specified.
Offset Length Description Default Data ----------------------------------------------------------------- 0x00 3 Tag ID SCR 0x03 4 Byte length (incl Tag ID) 0x07 X Script data OBJECT INSTANCES (OBJ) [optional]: All object instances are stored under one tag. The instances themselves do not have their objids explicitly stated; instead, they reference id numbers in the IDX tag.
Offset Length Description Default Data ----------------------------------------------------------------- 0x00 3 Tag ID OBJ 0x03 4 Byte length (incl Tag ID) 0x07 2 Entries #s 2 objid reference id 2 Number of object vars #s 2 Var name index length (bytes)* X Var name index string 2 Var value length (bytes)* X Var value string #e #e
<snip> NOTES: * with these values, the most significant bit determines whether the value should be interpreted as a string or integer. 0: integer, 1: string |
i believe i am planning stuff out ahead of time now oh wait i still need to write level import/export scripts so i can test them
oh but lua+ is crashing again, just wonderful!
This post has been edited by Xgoff on Jan 18 2009, 12:52 AM
--------------------
 DISCLAIMER: by sending me (xgoff) a private message, you agree to the directives and their terms specified henceforth: DIRECTIVE 1 (APPLE): i may or may not reply promptly or at all; and there are no guarantees to the usefulness of the reply. i may not acknowledge whether i have even received your private message DIRECTIVE 2 (CHILE CON CARNE): as per my view, "private" applies only to the initial transaction, and the material of your message may or may not be made public at my discretion; as this will more than likely be a post in the CCC or IRC, you may not be able to view it DIRECTIVE 3 (FEATHER DUSTER): you must address me (xgoff) as "Sir Master Xgofficus his Highest and Most Awesome the Third"; failure to comply with this term may invoke one or both of the above directives, and i will leave a burning bag of **** on your doorstep DIRECTIVE 4 (BOOTSTRAP): if you have read this disclaimer, please private message me promptly, in compliance with the above terms, so i can ensure you are capable of following directions you idiot this concludes the test of the emergency disclaimer system, your scheduled programming will now continue. satisfaction guaranteed, and 100% cash back available under certain circumstances; restrictions may or may not apply within your place of residence NOTICE: these directives and their terms may change at any time, without notice; as a private message transaction to myself assumes an understanding and full compliance of the above, you should ensure you are fully aware of the above terms at any point before sending a private message; any message received is assumed to have been sent in compliance with the above| QUOTE | (5:25:58 PM) Mikau: xgoff (5:26:00 PM) Mikau: guess what (5:26:04 PM) Xgoff: chicken butt (5:26:09 PM) Mikau: **** you |
|
|
|
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
[ Script Execution time: 0.1803 ] [ 13 queries used ] [ GZIP Enabled ] [ Server Load: 1.98 ]
| |