https://moddingwiki.shikadi.net/w/api.php?action=feedcontributions&user=T-Squared&feedformat=atomModdingWiki - User contributions [en-gb]2024-03-29T09:50:36ZUser contributionsMediaWiki 1.35.1https://moddingwiki.shikadi.net/w/index.php?title=Main_Page&diff=9339Main Page2021-01-06T01:24:50Z<p>T-Squared: /* Current projects */</p>
<hr />
<div>__NOTOC__ <!-- Hide the 'table of contents' box --><br />
<big>'''Welcome to the DOS Game Modding Wiki!'''</big><br />
<br />
The goal of this wiki is to assist people wishing to modify DOS games (typically those released for the PC in the early 1990s) to create entirely new games. The wiki attempts to document all the file formats used by each game to assist programmers writing editing tools, as well as listing any existing tools that can already be used to modify the game.<br />
<br />
<table border="0" width="100%" cellspacing="10"><br />
<tr><td align="center"><br />
[[Image:icon-games.png|link=:Category:Game Intro Page]]<br/><br />
[[:Category:Game Intro Page|Games]]<br />
</td><td align="center"><br />
[[Image:icon-mods.png|link=:Category:Mods by game]]<br/><br />
[[:Category:Mods by game|Mods]]<br />
</td><td align="center"><br />
[[Image:icon-settings.png|link=:Category:File Formats]]<br/><br />
[[:Category:File Formats|File formats]]<br />
</td><td align="center"><br />
[[Image:icon-info.png|link=:Category:Tutorials]]<br/><br />
[[:Category:Tutorials|Tutorials]]<br />
</td></tr><br />
</table><br />
<br />
=== About ===<br />
<br />
The wiki is structured so that each game has its own summary page, which in turn branches out to other pages explaining things in more detail such as file formats and instructions for using modding tools.<br />
<br />
If you find anything missing, incomplete or inaccurate among these pages, please fix it! To help prevent spam, you'll need to [[Special:Userlogin|log in]] before you can edit pages - if you don't have an account, it's easy to [[Special:Userlogin|create one]]. Have a quick look at the [[ModdingWiki:Contributing|editing guidelines]] before your first edit so you know what we're expecting.<br />
<br />
Don't forget that this site will only become a useful reference if all the modders out there lend a hand and contribute what they know! If you've got some info about modding a DOS game that's not yet listed, please create a new page for it!<br />
<br />
=== Help ===<br />
<br />
If you are looking for help with a mod you are working on, or if you need assistance reverse-engineering a game, please drop by the [http://www.classicdosgames.com/forum/viewforum.php?f=25 Modding section of the RGB Classic Games forum] and we'll try to help.<br />
<br />
=== Current projects ===<br />
<br />
* [[User:T-Squared|T-Squared]] is creating a mod for [[Cosmo's Cosmic Adventures]] called "HUMANIZED!!!". Take a look at [[User:T-Squared|T-Squared's user page]] for more info.<br />
* [[User:Eros|Eros]] is remaking the original [[Catacomb]] for Windows and Linux in OpenGL. Visit the [http://code.google.com/p/cataclone/ Google Code project page].<br />
* [[User:Malvineous|Malvineous]] is working on a cross-platform modding tool called [[Camoto]], which can edit a number of different games.<br />
* [[User:Nyerguds|Nyerguds]] is constantly expanding his [[Engie File Converter]] and [[Westwood Font Editor]], adding graphics formats from increasingly more non-[[:category:Westwood Studios|Westwood]] games to them, and upgrading his [[Librarian]] tool to put the edited results back into the game archives they came from.<br />
* [[User:TheAlmightyGuru|TheAlmightyGuru]] has decoded most of the [[Family Feud]] formats.<br />
* Scott Smitelli has reverse-engineered the original .EXE binaries of [[Cosmo's Cosmic Adventures]] to produce a [https://github.com/smitelli/cosmore 96%-accurate reconstruction]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure&diff=9338Cosmo's Cosmic Adventure2021-01-06T01:22:07Z<p>T-Squared: </p>
<hr />
<div>{{Game Infobox<br />
| Title = Cosmo's_Cosmic_Adventure.gif<br />
| Levels = Edit<br />
| Tiles = Edit<br />
| Sprites = Edit<br />
| Fullscreen = Edit<br />
| Sound = Edit<br />
| Music = Edit<br />
| Text = No<br />
| Story = No<br />
| Interface = No<br />
}}<br />
'''Cosmo's Cosmic Adventure''', also known simply as Cosmo, is a three part series chronicling the adventures of Cosmo, a small, green sucker-handed alien boy who is seeking his parents after a comet collision forces them to land their ship on a dangerous and uncharted planet.<br />
<br />
The Cosmo engine was later updated and used for [[Duke Nukem II]], so the two games share a number of file formats.<br />
<br />
In 2020, the source code was reverse-engineered by Scott Smitelli, and is currently hosted on Github, under the name CosmoRE. (See below)<br />
<br />
== Tools ==<br />
<br />
{{BeginFileFormatTools|Type=game}}<br />
{{FileFormatTool<br />
| Name = [[Camoto]]<br />
| Platform = Linux/Windows<br />
| grp = Edit<br />
| map = Edit<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosedit.zip CosEdit]<br />
| Platform = DOS GUI<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [https://dl.dropbox.com/u/3940020/COSGRAPH-working.zip Cosgraph]<br />
| Platform = Windows GUI<br />
| grp = Read<br />
| map = No<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = Edit<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosmedit10.zip Cosmo Edit]<br />
| Platform = DOS console<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/textract.zip TExtract]<br />
| Platform = DOS console<br />
| grp = Read<br />
| map = No<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [[Wombat]]<br />
| Platform = Windows GUI<br />
| grp = View<br />
| map = View<br />
| gfx = View<br />
| mus = View<br />
| sfx = View<br />
| txt = View<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{EndFileFormatTools}}<br />
<br />
== Game Engines ==<br />
*[https://github.com/yuv422/cosmo-engine Cosmo-Engine] - An open source game engine for playing Cosmo's Cosmic Adventure on modern systems.<br />
*[https://github.com/smitelli/cosmore CosmoRE] - a 96% reconstructed/reverse-engineered source code from the original .EXE binaries, created by Scott Smitelli.<br />
<br />
{{BeginGameFileList}}<br />
{{GameFile<br />
| Name = *.mni (32,000 bytes)<br />
| Format = [[Raw EGA data#Planar|Full-screen planar EGA]]<br />
| KnownFormat = Yes<br />
| Desc = 320&times;200 full-screen images (in four planes: blue, green, red, intensity)<br />
}}<br />
{{GameFile<br />
| Name = *.mni (4,000 bytes)<br />
| Format = [[B800 Text]]<br />
| KnownFormat = Yes<br />
| Desc = Text screens shown at exit<br />
}}<br />
{{GameFile<br />
| Name = actors.mni<br/>bd*.mni<br/>cartoon.mni<br/>masktile.mni<br/>players.mni<br/>status.mni<br/>tiles.mni<br />
| Format = [[Cosmo Tileset Format]]<br />
| KnownFormat = Yes<br />
| Desc = Tilesets with 8&times;8 tiles<br />
}}<br />
{{GameFile<br />
| Name = tileattr.mni<br />
| Format = [[Cosmo Tile Attributes]]<br />
| KnownFormat = Yes<br />
| Desc = Tile properties<br />
}}<br />
{{GameFile<br />
| Name = cosmo*.stn<br/>cosmo*.vol<br />
| Format = [[VOL Format]]<br />
| KnownFormat = Yes<br />
| Desc = Archive file storing the game data<br />
}}<br />
{{GameFile<br />
| Name = a*.mni<br/>bonus[12].mni<br />
| Format = [[Cosmo Level Format]]<br />
| KnownFormat = Yes<br />
| Desc = Levels<br />
}}<br />
{{GameFile<br />
| Name = m*.mni<br/>(except masktile.mni)<br />
| Format = [[IMF Format]]<br />
| KnownFormat = Yes<br />
| Desc = Background music - see [[#Notes]] below<br />
}}<br />
{{GameFile<br />
| Name = sounds*.mni<br />
| Format = [[Inverse Frequency Sound format]]<br />
| KnownFormat = Yes<br />
| Desc = PC speaker sound effects<br />
}}<br />
{{GameFile<br />
| Name = cosmo*.sv*<br />
| Format = [[Cosmo Savegame Format]]<br />
| KnownFormat = Yes<br />
| Desc = Saved games. <tt>cosmo?.svt</tt> is a temporary save written at the start of each level<br />
}}<br />
{{GameFile<br />
| Name = *info.mni<br />
| Format = [[Cosmo Tileinfo Format]]<br />
| KnownFormat = Yes<br />
| Desc = How to lay out the actor tiles into complete frames<br />
}}<br />
{{GameFile<br />
| Name = prevdemo.mni<br />
| Format = [[Cosmo Demo Format]]<br />
| KnownFormat = Yes<br />
| Desc = Game demo format<br />
}}<br />
{{GameFile<br />
| Name = cosmo*.cfg<br />
| Format = [[Cosmo Config Format]]<br />
| KnownFormat = Yes<br />
| Desc = Game configuration format<br />
}}<br />
{{EndGameFileList}}<br />
<br />
== Notes ==<br />
<br />
* Graphics limitations and glitches:<br />
** The masktile graphics can be corrupted by a buffer overflow by the addition of a large enough IMF music file to the [[:Category:Group Files|group file]] (usually around 40KB). (That is, the music goes over it's intended memory boundary.) This is not permanent, and will only occur until the offending file is removed or a smaller or less-complex file is imported in its place. <br />
** Actor graphics can be corrupted by a self-contained arithmetic overflow by the addition of too many sprites. (that is, it writes to the end of the allocated block, then back around to the beginning, where it overwrites the header data.) Again, this is not permanent unless the user does not change the data in the group file.<br />
** If an actor (a good example would be Cosmo himself) is behind a masked tile with the foreground bit set on it, any transparent regions of the tile overlapping the actor will remove those regions on the actor, showing the background instead.<br />
<br />
*Directory miscellany:<br />
** The game reads from the VOL and STN archive files in preference to the current directory, but will read from the current directory if the archive files are not present. Any game files in the current directory will not be read while the VOL/STN files are present. To modify a file, it will either need to be imported back into the VOL/STN, or the VOL/STN should have its entire contents extracted into the game folder and then be removed or renamed.<br />
** A directory path (relative to the current directory) can be given on the command line. Any files that the game writes (saved games, high scores, etc.) will be written to this folder instead. This is probably to allow running the game directly from read-only media like a CD.<br />
** The <tt>*.stn</tt> files appear to be for "standard" data common to all episodes, as the files are identical between all three games. It is a curiosity that there are three identical STN files, rather than a single <tt>cosmo.stn</tt> shared amongst all three episodes.<br />
<br />
*Game Engine Glitches:<br />
**In editing levels, if two or more blue moving platforms collide, the tiles that overlap will disappear. Furthermore, if Cosmo stands anywhere on any one of these platforms when they collide, he will literally be deleted from the level, and the game engine will treat him as if he had died or fallen off the bottom of the screen, restarting the level over again.<br />
**If a player actor is not specified in a level file, a unique event can occur. The level coordinates of the player from the previous level (or any level, if using the warp cheat) carry over, meaning that the player can enter the level in a very different spot than what was intended before, even entering the level trapped inside a wall!<br />
<br />
[[Category:Apogee]]<br />
[[Category:Sidescroller]]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=9337User:T-Squared2021-01-06T01:18:11Z<p>T-Squared: </p>
<hr />
<div>Welcome to my User page.<br />
<br />
I'm working on the first true Cosmo Mod: "Cosmo's Cosmic Adventure 2: HUMANIZED!!!", but I can't do this alone. I need people to help me bring this idea to life. (I know that sounds cheesy, but I really think this idea can happen as a real mod. :D<br />
<br />
Here's what I've been working on: [https://www.dropbox.com/sh/ul8gsihslzh11op/ypJGwVA1O0 COSMO II MAIN DIRECTORY]<br />
<br />
If you wish to contribute to the project, here's a list possible levels (Look for the ones marked [LOCK], because those are the ones which are strongly suggested to appear in the game: [https://www.dropbox.com/s/fja42ahkiuvlu9k/Levels%20for%20Cosmo%202%20%28UPDATED%2BSPOILERS%29.docx?dl=0 LEVEL LIST]<br />
<br />
UPDATE: (4-2-2014): The entire story is complete! If you wish, you can take a look at it and critique it, but '''BE WARNED. THIS WILL SPOIL THE ENTIRE GAME MOD FOR YOU!''': [https://www.dropbox.com/s/8t8vumbwt3fkcb8/Cosmo%20II%20Complete%20Story%20%28SPOILERS%29.rtf?dl=0 COMPLETE GAME STORY]<br />
<br />
UPDATE: (1-5-2021): GOOD NEWS! WE HAVE A 96% RECONSTRUCTION OF THE SOURCE CODE, which means that we can continue with original AND new ideas with the game! I have also slowly worked on graphics and story. I am not well-versed in MS-DOS Turbo C, (I need people, or an individual, who are/is.) but I have had limited success in adding new story pages, new actor ideas, and new gameplay mechanics. (Although the logic involved to make the game objects and enemies work is beyond my skill.) Thank you, Scott Smitelli! <br />
<br />
Reconstructed Source Code: https://github.com/smitelli/cosmore<br />
<br />
My Edits to Cosmore Source Code: https://www.dropbox.com/sh/wx9k5d0rujwbxxp/AAA2xHL6FZuwBN-rOgkcNYLpa?dl=0</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=6714User:T-Squared2015-11-12T21:26:57Z<p>T-Squared: Updated hyperlinks to Level List and Complete Story</p>
<hr />
<div>Welcome to my User page.<br />
<br />
I'm working on the first true Cosmo Mod: "Cosmo's Cosmic Adventure 2: HUMANIZED!!!", but I can't do this alone. I need people to help me bring this idea to life. (I know that sounds cheesy, but I really think this idea can happen as a real mod. :D<br />
<br />
Here's what I've been working on: [https://www.dropbox.com/sh/ul8gsihslzh11op/ypJGwVA1O0 COSMO II MAIN DIRECTORY]<br />
<br />
If you wish to contribute to the project, here's a list possible levels (Look for the ones marked [LOCK], because those are the ones which are strongly suggested to appear in the game: [https://www.dropbox.com/s/fja42ahkiuvlu9k/Levels%20for%20Cosmo%202%20%28UPDATED%2BSPOILERS%29.docx?dl=0 LEVEL LIST]<br />
<br />
UPDATE: (4-2-2014): The entire story is complete! If you wish, you can take a look at it and critique it, but '''BE WARNED. THIS WILL SPOIL THE ENTIRE GAME MOD FOR YOU!''': [https://www.dropbox.com/s/8t8vumbwt3fkcb8/Cosmo%20II%20Complete%20Story%20%28SPOILERS%29.rtf?dl=0 COMPLETE GAME STORY]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure/Cheats&diff=6214Cosmo's Cosmic Adventure/Cheats2015-09-04T21:20:58Z<p>T-Squared: </p>
<hr />
<div>== Full-Inventory Cheat ==<br />
<br />
*Hold down '''C''', '''0''' (zero), and '''F10''' to fill up your health, and bomb inventory.<br />
<br />
== Activating F10 (Debug) Cheats ==<br />
<br />
*Hold down '''Tab''', '''F12''', and '''Delete''' to activate cheat mode.<br />
<br />
=== F10 Cheats ===<br />
<br />
* '''F10-G''' will activate God Mode. This means that Cosmo cannot be harmed by enemies or hazards. He can, however, die by falling off the bottom of the screen.<br />
* '''F10-W''' will bring up a window where you can type in which level you would like to go to. <br />
* '''F10-M''' will bring up a status window showing how much memory (in kB) is free, how much total memory is being used, how large the level is, and how many actors (Cosmo, enemies, objects, and obstacles) are in the level.<br />
* '''F-10-E-N-D''' will skip to the end-of-episode cutscenes.</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure/Cheats&diff=6213Cosmo's Cosmic Adventure/Cheats2015-09-04T21:19:04Z<p>T-Squared: Created the Cosmo's Cosmic Adventure Cheat page</p>
<hr />
<div>== Full-Inventory Cheat ==<br />
<br />
*Hold down '''C''', '''0''' (zero), and '''F10''' to fill up your health, and bomb inventory.<br />
<br />
== Activating F10 (Debug) Cheats ==<br />
<br />
*Hold down '''Tab''', '''F12''', and '''Delete''' to activate cheat mode.<br />
<br />
=== F10 Cheats ===<br />
<br />
** '''F10-G''' will activate '''God Mode'''. This means that Cosmo cannot be harmed by enemies or hazards. He can, however, die by falling off the bottom of the screen.<br />
** '''F10-W''' will bring up a window where you can type in which level you would like to go to. <br />
** '''F10-M''' will bring up a status window showing how much memory (in kB) is free, how much total memory is being used, how large the level is, and how many actors (Cosmo, enemies, objects, and obstacles) are in the level.<br />
** '''F-10-E-N-D'' will skip to the end-of-episode cutscenes.</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=5185User:T-Squared2014-04-03T00:46:22Z<p>T-Squared: Added one new link, and updated another.</p>
<hr />
<div>Welcome to my User page.<br />
<br />
I'm working on the first true Cosmo Mod: "Cosmo's Cosmic Adventure 2: HUMANIZED!!!", but I can't do this alone. I need people to help me bring this idea to life. (I know that sounds cheesy, but I really think this idea can happen as a real mod. :D<br />
<br />
Here's what I've been working on: [https://www.dropbox.com/sh/ul8gsihslzh11op/ypJGwVA1O0 COSMO II MAIN DIRECTORY]<br />
<br />
If you wish to contribute to the project, here's a list possible levels (Look for the ones marked [LOCK], because those are the ones which are strongly suggested to appear in the game: [https://www.dropbox.com/s/x704z9n0acf1b77/Levels%20for%20Cosmo%202%20%28UPDATED%2BSPOILERS%29.docx LEVEL LIST]<br />
<br />
UPDATE: (4-2-2014): The entire story is complete! If you wish, you can take a look at it and critique it, but '''BE WARNED. THIS WILL SPOIL THE ENTIRE GAME MOD FOR YOU!''': [https://www.dropbox.com/s/sp8bvcxn05bndzw/Cosmo%20II%20Complete%20Story%20%28SPOILERS%29.rtf COMPLETE GAME STORY]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure&diff=5184Cosmo's Cosmic Adventure2014-03-29T01:21:17Z<p>T-Squared: /* Notes */ New glitches found! (also edited an old</p>
<hr />
<div>{{Game Infobox<br />
| Levels = Edit<br />
| Tiles = Edit<br />
| Sprites = Edit<br />
| Fullscreen = Edit<br />
| Sound = Edit<br />
| Music = Edit<br />
| Text = No<br />
| Story = No<br />
| Interface = No<br />
}}<br />
'''Cosmo's Cosmic Adventure''', also known simply as Cosmo, is a three part series chronicling the adventures of Cosmo, a small, green sucker-handed alien boy who is seeking his parents after a comet collision forces them to land their ship on a dangerous and uncharted planet.<br />
<br />
The Cosmo engine was later updated and used for [[Duke Nukem II]], so the two games share a number of file formats.<br />
<br />
== Tools ==<br />
<br />
{{BeginFileFormatTools|Type=game}}<br />
{{FileFormatTool<br />
| Name = [[Camoto]]<br />
| Platform = Linux/Windows<br />
| grp = Edit<br />
| map = Edit<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosedit.zip CosEdit]<br />
| Platform = DOS GUI<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [https://dl.dropbox.com/u/3940020/COSGRAPH-working.zip Cosgraph]<br />
| Platform = Windows GUI<br />
| grp = Read<br />
| map = No<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = Edit<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosmedit10.zip Cosmo Edit]<br />
| Platform = DOS console<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/textract.zip TExtract]<br />
| Platform = DOS console<br />
| grp = Read<br />
| map = No<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [[Wombat]]<br />
| Platform = Windows GUI<br />
| grp = Edit<br />
| map = View<br />
| gfx = View<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{EndFileFormatTools}}<br />
<br />
{{BeginGameFileList}}<br />
{{GameFile<br />
| Name = *.mni (32,000 bytes)<br />
| Format = [[Raw EGA data#Planar|Full-screen planar EGA]]<br />
| KnownFormat = Yes<br />
| Desc = 320&times;200 full-screen images (in four planes: blue, green, red, intensity)<br />
}}<br />
{{GameFile<br />
| Name = *.mni (4,000 bytes)<br />
| Format = [[B800 Text]]<br />
| KnownFormat = Yes<br />
| Desc = Text screens shown at exit<br />
}}<br />
{{GameFile<br />
| Name = actors.mni<br/>bd*.mni<br/>cartoon.mni<br/>masktile.mni<br/>players.mni<br/>tiles.mni<br />
| Format = [[Cosmo Tileset Format]]<br />
| KnownFormat = Yes<br />
| Desc = Tilesets with 8&times;8 tiles<br />
}}<br />
{{GameFile<br />
| Name = tileattr.mni<br />
| Format = [[Cosmo Tile Attributes]]<br />
| KnownFormat = Yes<br />
| Desc = Tile properties<br />
}}<br />
{{GameFile<br />
| Name = cosmo*.stn<br/>cosmo*.vol<br />
| Format = [[VOL Format]]<br />
| KnownFormat = Yes<br />
| Desc = Archive file storing the game data<br />
}}<br />
{{GameFile<br />
| Name = a*.mni<br />
| Format = [[Cosmo Level Format]]<br />
| KnownFormat = Yes<br />
| Desc = Levels<br />
}}<br />
{{GameFile<br />
| Name = m*.mni<br/>(except masktile.mni)<br />
| Format = [[IMF Format]]<br />
| KnownFormat = Yes<br />
| Desc = Background music - see [[#Notes]] below<br />
}}<br />
{{GameFile<br />
| Name = sounds*.mni<br />
| Format = [[Inverse Frequency Sound format]]<br />
| KnownFormat = Yes<br />
| Desc = PC speaker sound effects<br />
}}<br />
{{GameFile<br />
| Name = cosmo*.sv*<br />
| Format = [[Cosmo Savegame Format]]<br />
| KnownFormat = Yes<br />
| Desc = Saved games. <tt>cosmo?.svt</tt> is a temporary save written at the start of each level<br />
}}<br />
{{GameFile<br />
| Name = *info.mni<br />
| Format = [[Cosmo Tileinfo Format]]<br />
| KnownFormat = Yes<br />
| Desc = How to lay out the actor tiles into complete frames<br />
}}<br />
{{EndGameFileList}}<br />
<br />
== Notes ==<br />
<br />
* Graphics limitations and glitches:<br />
** The masktile graphics can be corrupted by a buffer overflow by the addition of a large enough IMF music file to the [[:Category:Group Files|group file]] (usually around 40KB). (That is, the music goes over it's intended memory boundary.) This is not permanent, and will only occur until the offending file is removed or a smaller or less-complex file is imported in its place. <br />
** Actor graphics can be corrupted by a self-contained arithmetic overflow by the addition of too many sprites. (that is, it writes to the end of the allocated block, then back around to the beginning, where it overwrites the header data.) Again, this is not permanent unless the user does not change the data in the group file.<br />
** If an actor (a good example would be Cosmo himself) is behind a masked tile with the foreground bit set on it, any transparent regions of the tile overlapping the actor will remove those regions on the actor, showing the background instead.<br />
<br />
*Directory miscellany:<br />
** The game reads from the VOL and STN archive files in preference to the current directory, but will read from the current directory if the archive files are not present. Any game files in the current directory will not be read while the VOL/STN files are present. To modify a file, it will either need to be imported back into the VOL/STN, or the VOL/STN should have its entire contents extracted into the game folder and then be removed or renamed.<br />
** A directory path (relative to the current directory) can be given on the command line. Any files that the game writes (saved games, high scores, etc.) will be written to this folder instead. This is probably to allow running the game directly from read-only media like a CD.<br />
<br />
*Game Engine Glitches:<br />
**In editing levels, if two or more blue moving platforms collide, the tiles that overlap will disappear. Furthermore, if Cosmo stands anywhere on any one of these platforms when they collide, he will literally be deleted from the level, and the game engine will treat him as if he had died or fallen off the bottom of the screen, restarting the level over again.<br />
**If a player actor is not specified in a level file, a unique event can occur. The level coordinates of the player from the previous level (or any level, if using the warp cheat) carry over, meaning that the player can enter the level in a very different spot than what was intended before, even entering the level trapped inside a wall!<br />
<br />
<br />
<br />
[[Category:Apogee]]<br />
[[Category:Sidescroller]]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Tile_Attributes&diff=5126Cosmo Tile Attributes2014-02-22T00:02:03Z<p>T-Squared: Found another interesting idea with the slope bit!</p>
<hr />
<div>The structure of Cosmo's tile attribute format is very similar to the format used in the [[Duke Nukem II CZone Format]], only this one uses [[UINT8]] values instead of [[UINT16LE]] values.<br />
<br />
The attribute data consists of 2000 [[UINT8]] values (settings for the solid tiles), followed by another 5000 [[UINT8]] values (five [[UINT8]]s for each masked tile). It seems like only the first [[UINT8]] for each masked tile is actually used by the game.<br />
<br />
Bit | Description<br />
----+------------<br />
7 | can grab wall<br />
6 | sloped* (auto-descend)<br />
5 | in-front<br />
4 | slippery<br />
3 | block right<br />
2 | block left<br />
1 | block up<br />
0 | block down<br />
<br />
<br />
= Footnotes =<br />
* *Any tiles set with this bit will affect only adjacent tiles, not the slope-set-tile itself.<br />
= Credits =<br />
<br />
This file format was reverse engineered by [[User:K1n9_Duk3|K1n9_Duk3]]. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)<br />
<br />
<br />
[[Category:Cosmo's Cosmic Adventures]]<br />
[[Category:File Formats]]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure&diff=5124Cosmo's Cosmic Adventure2014-02-15T03:57:48Z<p>T-Squared: It was a comet, not a meteor. :P (Says it in the story)</p>
<hr />
<div>{{Game Infobox<br />
| Levels = Edit<br />
| Tiles = Edit<br />
| Sprites = Edit<br />
| Fullscreen = Edit<br />
| Sound = Edit<br />
| Music = Edit<br />
| Text = No<br />
| Story = No<br />
| Interface = No<br />
}}<br />
'''Cosmo's Cosmic Adventure''', also known simply as Cosmo, is a three part series chronicling the adventures of Cosmo, a small, green sucker-handed alien boy who is seeking his parents after a comet collision forces them to land their ship on a dangerous and uncharted planet.<br />
<br />
The Cosmo engine was later updated and used for [[Duke Nukem II]], so the two games share a number of file formats.<br />
<br />
== Tools ==<br />
<br />
{{BeginFileFormatTools|Type=game}}<br />
{{FileFormatTool<br />
| Name = [[Camoto]]<br />
| Platform = Linux/Windows<br />
| grp = Edit<br />
| map = Edit<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosedit.zip CosEdit]<br />
| Platform = DOS GUI<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [https://dl.dropbox.com/u/3940020/COSGRAPH-working.zip Cosgraph]<br />
| Platform = Windows GUI<br />
| grp = Read<br />
| map = No<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = Edit<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosmedit10.zip Cosmo Edit]<br />
| Platform = DOS console<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/textract.zip TExtract]<br />
| Platform = DOS console<br />
| grp = Read<br />
| map = No<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [[Wombat]]<br />
| Platform = Windows GUI<br />
| grp = Edit<br />
| map = View<br />
| gfx = View<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{EndFileFormatTools}}<br />
<br />
{{BeginGameFileList}}<br />
{{GameFile<br />
| Name = *.mni (32,000 bytes)<br />
| Format = [[Raw EGA data#Planar|Full-screen planar EGA]]<br />
| KnownFormat = Yes<br />
| Desc = 320&times;200 full-screen images (in four planes: blue, green, red, intensity)<br />
}}<br />
{{GameFile<br />
| Name = *.mni (4,000 bytes)<br />
| Format = [[B800 Text]]<br />
| KnownFormat = Yes<br />
| Desc = Text screens shown at exit<br />
}}<br />
{{GameFile<br />
| Name = actors.mni<br/>bd*.mni<br/>cartoon.mni<br/>masktile.mni<br/>players.mni<br/>tiles.mni<br />
| Format = [[Cosmo Tileset Format]]<br />
| KnownFormat = Yes<br />
| Desc = Tilesets with 8&times;8 tiles<br />
}}<br />
{{GameFile<br />
| Name = tileattr.mni<br />
| Format = [[Cosmo Tile Attributes]]<br />
| KnownFormat = Yes<br />
| Desc = Tile properties<br />
}}<br />
{{GameFile<br />
| Name = cosmo*.stn<br/>cosmo*.vol<br />
| Format = [[VOL Format]]<br />
| KnownFormat = Yes<br />
| Desc = Archive file storing the game data<br />
}}<br />
{{GameFile<br />
| Name = a*.mni<br />
| Format = [[Cosmo Level Format]]<br />
| KnownFormat = Yes<br />
| Desc = Levels<br />
}}<br />
{{GameFile<br />
| Name = m*.mni<br/>(except masktile.mni)<br />
| Format = [[IMF Format]]<br />
| KnownFormat = Yes<br />
| Desc = Background music - see [[#Notes]] below<br />
}}<br />
{{GameFile<br />
| Name = sounds*.mni<br />
| Format = [[Inverse Frequency Sound format]]<br />
| KnownFormat = Yes<br />
| Desc = PC speaker sound effects<br />
}}<br />
{{GameFile<br />
| Name = cosmo*.sv*<br />
| Format = [[Cosmo Savegame Format]]<br />
| KnownFormat = Yes<br />
| Desc = Saved games. <tt>cosmo?.svt</tt> is a temporary save written at the start of each level<br />
}}<br />
{{GameFile<br />
| Name = *info.mni<br />
| Format = [[Cosmo Tileinfo Format]]<br />
| KnownFormat = Yes<br />
| Desc = How to lay out the actor tiles into complete frames<br />
}}<br />
{{EndGameFileList}}<br />
<br />
== Notes ==<br />
<br />
* Graphics limitations and glitches:<br />
** The masktile graphics can be corrupted by a buffer overflow by the addition of a large enough IMF music file to the [[:Category:Group Files|group file]] (usually around 40KB). (That is, the music goes over it's intended memory boundary.) This is not permanent, and will only occur until the offending file is removed or a smaller or less-complex file is imported in its place. <br />
** Actor graphics can be corrupted by a self-contained arithmetic overflow by the addition of too many sprites. (that is, it writes to the end of the allocated block, then back around to the beginning, where it overwrites the header data.) Again, this is not permanent unless the user does not change the data in the group file.<br />
** If an actor is in front of a masked tile with the foreground bit set on it, any transparent regions of the tile overlapping the actor will remove those regions on the actor, showing the background instead.<br />
<br />
*Directory miscellany:<br />
** The game reads from the VOL and STN archive files in preference to the current directory, but will read from the current directory if the archive files are not present. Any game files in the current directory will not be read while the VOL/STN files are present. To modify a file, it will either need to be imported back into the VOL/STN, or the VOL/STN should have its entire contents extracted into the game folder and then be removed or renamed.<br />
** A directory path (relative to the current directory) can be given on the command line. Any files that the game writes (saved games, high scores, etc.) will be written to this folder instead. This is probably to allow running the game directly from read-only media like a CD.<br />
<br />
*Game Engine Glitches:<br />
**In editing levels, if two or more blue moving platforms collide, the tiles that overlap will disappear. Furthermore, if Cosmo stands anywhere on any one of these platforms when they collide, he will literally be deleted from the level, and the game engine will treat him as if he had died or fallen off the bottom of the screen, restarting the level over again.<br />
<br />
[[Category:Apogee]]<br />
[[Category:Sidescroller]]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure&diff=5123Cosmo's Cosmic Adventure2014-02-04T04:12:01Z<p>T-Squared: /* Notes */ Whoops. Forgot a small bit of info regarding the new glitch.</p>
<hr />
<div>{{Game Infobox<br />
| Levels = Edit<br />
| Tiles = Edit<br />
| Sprites = Edit<br />
| Fullscreen = Edit<br />
| Sound = Edit<br />
| Music = Edit<br />
| Text = No<br />
| Story = No<br />
| Interface = No<br />
}}<br />
'''Cosmo's Cosmic Adventure''', also known simply as Cosmo, is a three part series chronicling the adventures of Cosmo, a small, green sucker-handed alien boy who is seeking his parents after a meteor collision forces them to land their ship on a dangerous and uncharted planet.<br />
<br />
The Cosmo engine was later updated and used for [[Duke Nukem II]], so the two games share a number of file formats.<br />
<br />
== Tools ==<br />
<br />
{{BeginFileFormatTools|Type=game}}<br />
{{FileFormatTool<br />
| Name = [[Camoto]]<br />
| Platform = Linux/Windows<br />
| grp = Edit<br />
| map = Edit<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosedit.zip CosEdit]<br />
| Platform = DOS GUI<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [https://dl.dropbox.com/u/3940020/COSGRAPH-working.zip Cosgraph]<br />
| Platform = Windows GUI<br />
| grp = Read<br />
| map = No<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = Edit<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosmedit10.zip Cosmo Edit]<br />
| Platform = DOS console<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/textract.zip TExtract]<br />
| Platform = DOS console<br />
| grp = Read<br />
| map = No<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [[Wombat]]<br />
| Platform = Windows GUI<br />
| grp = Edit<br />
| map = View<br />
| gfx = View<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{EndFileFormatTools}}<br />
<br />
{{BeginGameFileList}}<br />
{{GameFile<br />
| Name = *.mni (32,000 bytes)<br />
| Format = [[Raw EGA data#Planar|Full-screen planar EGA]]<br />
| KnownFormat = Yes<br />
| Desc = 320&times;200 full-screen images (in four planes: blue, green, red, intensity)<br />
}}<br />
{{GameFile<br />
| Name = *.mni (4,000 bytes)<br />
| Format = [[B800 Text]]<br />
| KnownFormat = Yes<br />
| Desc = Text screens shown at exit<br />
}}<br />
{{GameFile<br />
| Name = actors.mni<br/>bd*.mni<br/>cartoon.mni<br/>masktile.mni<br/>players.mni<br/>tiles.mni<br />
| Format = [[Cosmo Tileset Format]]<br />
| KnownFormat = Yes<br />
| Desc = Tilesets with 8&times;8 tiles<br />
}}<br />
{{GameFile<br />
| Name = tileattr.mni<br />
| Format = [[Cosmo Tile Attributes]]<br />
| KnownFormat = Yes<br />
| Desc = Tile properties<br />
}}<br />
{{GameFile<br />
| Name = cosmo*.stn<br/>cosmo*.vol<br />
| Format = [[VOL Format]]<br />
| KnownFormat = Yes<br />
| Desc = Archive file storing the game data<br />
}}<br />
{{GameFile<br />
| Name = a*.mni<br />
| Format = [[Cosmo Level Format]]<br />
| KnownFormat = Yes<br />
| Desc = Levels<br />
}}<br />
{{GameFile<br />
| Name = m*.mni<br/>(except masktile.mni)<br />
| Format = [[IMF Format]]<br />
| KnownFormat = Yes<br />
| Desc = Background music - see [[#Notes]] below<br />
}}<br />
{{GameFile<br />
| Name = sounds*.mni<br />
| Format = [[Inverse Frequency Sound format]]<br />
| KnownFormat = Yes<br />
| Desc = PC speaker sound effects<br />
}}<br />
{{GameFile<br />
| Name = cosmo*.sv*<br />
| Format = [[Cosmo Savegame Format]]<br />
| KnownFormat = Yes<br />
| Desc = Saved games. <tt>cosmo?.svt</tt> is a temporary save written at the start of each level<br />
}}<br />
{{GameFile<br />
| Name = *info.mni<br />
| Format = [[Cosmo Tileinfo Format]]<br />
| KnownFormat = Yes<br />
| Desc = How to lay out the actor tiles into complete frames<br />
}}<br />
{{EndGameFileList}}<br />
<br />
== Notes ==<br />
<br />
* Graphics limitations and glitches:<br />
** The masktile graphics can be corrupted by a buffer overflow by the addition of a large enough IMF music file to the [[:Category:Group Files|group file]] (usually around 40KB). (That is, the music goes over it's intended memory boundary.) This is not permanent, and will only occur until the offending file is removed or a smaller or less-complex file is imported in its place. <br />
** Actor graphics can be corrupted by a self-contained arithmetic overflow by the addition of too many sprites. (that is, it writes to the end of the allocated block, then back around to the beginning, where it overwrites the header data.) Again, this is not permanent unless the user does not change the data in the group file.<br />
** If an actor is in front of a masked tile with the foreground bit set on it, any transparent regions of the tile overlapping the actor will remove those regions on the actor, showing the background instead.<br />
<br />
*Directory miscellany:<br />
** The game reads from the VOL and STN archive files in preference to the current directory, but will read from the current directory if the archive files are not present. Any game files in the current directory will not be read while the VOL/STN files are present. To modify a file, it will either need to be imported back into the VOL/STN, or the VOL/STN should have its entire contents extracted into the game folder and then be removed or renamed.<br />
** A directory path (relative to the current directory) can be given on the command line. Any files that the game writes (saved games, high scores, etc.) will be written to this folder instead. This is probably to allow running the game directly from read-only media like a CD.<br />
<br />
*Game Engine Glitches:<br />
**In editing levels, if two or more blue moving platforms collide, the tiles that overlap will disappear. Furthermore, if Cosmo stands anywhere on any one of these platforms when they collide, he will literally be deleted from the level, and the game engine will treat him as if he had died or fallen off the bottom of the screen, restarting the level over again.<br />
<br />
[[Category:Apogee]]<br />
[[Category:Sidescroller]]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure&diff=5122Cosmo's Cosmic Adventure2014-02-04T04:04:47Z<p>T-Squared: /* Notes */ Found a new, provable glitch!</p>
<hr />
<div>{{Game Infobox<br />
| Levels = Edit<br />
| Tiles = Edit<br />
| Sprites = Edit<br />
| Fullscreen = Edit<br />
| Sound = Edit<br />
| Music = Edit<br />
| Text = No<br />
| Story = No<br />
| Interface = No<br />
}}<br />
'''Cosmo's Cosmic Adventure''', also known simply as Cosmo, is a three part series chronicling the adventures of Cosmo, a small, green sucker-handed alien boy who is seeking his parents after a meteor collision forces them to land their ship on a dangerous and uncharted planet.<br />
<br />
The Cosmo engine was later updated and used for [[Duke Nukem II]], so the two games share a number of file formats.<br />
<br />
== Tools ==<br />
<br />
{{BeginFileFormatTools|Type=game}}<br />
{{FileFormatTool<br />
| Name = [[Camoto]]<br />
| Platform = Linux/Windows<br />
| grp = Edit<br />
| map = Edit<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosedit.zip CosEdit]<br />
| Platform = DOS GUI<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [https://dl.dropbox.com/u/3940020/COSGRAPH-working.zip Cosgraph]<br />
| Platform = Windows GUI<br />
| grp = Read<br />
| map = No<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = Edit<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosmedit10.zip Cosmo Edit]<br />
| Platform = DOS console<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/textract.zip TExtract]<br />
| Platform = DOS console<br />
| grp = Read<br />
| map = No<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [[Wombat]]<br />
| Platform = Windows GUI<br />
| grp = Edit<br />
| map = View<br />
| gfx = View<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{EndFileFormatTools}}<br />
<br />
{{BeginGameFileList}}<br />
{{GameFile<br />
| Name = *.mni (32,000 bytes)<br />
| Format = [[Raw EGA data#Planar|Full-screen planar EGA]]<br />
| KnownFormat = Yes<br />
| Desc = 320&times;200 full-screen images (in four planes: blue, green, red, intensity)<br />
}}<br />
{{GameFile<br />
| Name = *.mni (4,000 bytes)<br />
| Format = [[B800 Text]]<br />
| KnownFormat = Yes<br />
| Desc = Text screens shown at exit<br />
}}<br />
{{GameFile<br />
| Name = actors.mni<br/>bd*.mni<br/>cartoon.mni<br/>masktile.mni<br/>players.mni<br/>tiles.mni<br />
| Format = [[Cosmo Tileset Format]]<br />
| KnownFormat = Yes<br />
| Desc = Tilesets with 8&times;8 tiles<br />
}}<br />
{{GameFile<br />
| Name = tileattr.mni<br />
| Format = [[Cosmo Tile Attributes]]<br />
| KnownFormat = Yes<br />
| Desc = Tile properties<br />
}}<br />
{{GameFile<br />
| Name = cosmo*.stn<br/>cosmo*.vol<br />
| Format = [[VOL Format]]<br />
| KnownFormat = Yes<br />
| Desc = Archive file storing the game data<br />
}}<br />
{{GameFile<br />
| Name = a*.mni<br />
| Format = [[Cosmo Level Format]]<br />
| KnownFormat = Yes<br />
| Desc = Levels<br />
}}<br />
{{GameFile<br />
| Name = m*.mni<br/>(except masktile.mni)<br />
| Format = [[IMF Format]]<br />
| KnownFormat = Yes<br />
| Desc = Background music - see [[#Notes]] below<br />
}}<br />
{{GameFile<br />
| Name = sounds*.mni<br />
| Format = [[Inverse Frequency Sound format]]<br />
| KnownFormat = Yes<br />
| Desc = PC speaker sound effects<br />
}}<br />
{{GameFile<br />
| Name = cosmo*.sv*<br />
| Format = [[Cosmo Savegame Format]]<br />
| KnownFormat = Yes<br />
| Desc = Saved games. <tt>cosmo?.svt</tt> is a temporary save written at the start of each level<br />
}}<br />
{{GameFile<br />
| Name = *info.mni<br />
| Format = [[Cosmo Tileinfo Format]]<br />
| KnownFormat = Yes<br />
| Desc = How to lay out the actor tiles into complete frames<br />
}}<br />
{{EndGameFileList}}<br />
<br />
== Notes ==<br />
<br />
* Graphics limitations and glitches:<br />
** The masktile graphics can be corrupted by a buffer overflow by the addition of a large enough IMF music file to the [[:Category:Group Files|group file]] (usually around 40KB). (That is, the music goes over it's intended memory boundary.) This is not permanent, and will only occur until the offending file is removed or a smaller or less-complex file is imported in its place. <br />
** Actor graphics can be corrupted by a self-contained arithmetic overflow by the addition of too many sprites. (that is, it writes to the end of the allocated block, then back around to the beginning, where it overwrites the header data.) Again, this is not permanent unless the user does not change the data in the group file.<br />
** If an actor is in front of a masked tile with the foreground bit set on it, any transparent regions of the tile overlapping the actor will remove those regions on the actor, showing the background instead.<br />
<br />
*Directory miscellany:<br />
** The game reads from the VOL and STN archive files in preference to the current directory, but will read from the current directory if the archive files are not present. Any game files in the current directory will not be read while the VOL/STN files are present. To modify a file, it will either need to be imported back into the VOL/STN, or the VOL/STN should have its entire contents extracted into the game folder and then be removed or renamed.<br />
** A directory path (relative to the current directory) can be given on the command line. Any files that the game writes (saved games, high scores, etc.) will be written to this folder instead. This is probably to allow running the game directly from read-only media like a CD.<br />
<br />
*Game Engine Glitches:<br />
**In editing levels, if two or more blue moving platforms collide, the tiles that overlap will disappear. Furthermore, if Cosmo stands on any one of these platforms when they collide, he will literally be deleted from the level, and the game engine will treat him as if he had died or fallen off the bottom of the screen.<br />
<br />
[[Category:Apogee]]<br />
[[Category:Sidescroller]]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Level_Format&diff=5121Cosmo Level Format2014-01-31T02:49:13Z<p>T-Squared: /* Level Flags */ Found another missing feature in COSMO1.EXE!</p>
<hr />
<div>{{Map Infobox<br />
| Type = 2D tile-based<br />
| Layers = 3<br />
| Tile size = 8&times;8<br />
| Viewport = 304&times;144<br />
| Game1 = Cosmo's Cosmic Adventures<br />
}}<br />
<br />
== File format ==<br />
The file is in this basic layout:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iFlags||Flags indicating music, backdrop and other stuff<br />
|-<br />
|UINT16LE iMapWidth||Map width in tiles<br />
|-<br />
|UINT16LE iActorSize||Number of UINT16 values in the actor block<br />
|-<br />
|ACTORDATA actorData[]||Variable-length array of all the actors in the level<br />
|-<br />
|BYTE bgLayer[65528]||The map data for the background layer<br />
|}<br />
<br />
The iMapWidth values in the original Cosmo levels is either 64, 128, 256 or 512. The "view window" in the game is 304x144 Pixels, so the minimal map width would be 38. However, the width must be a power of 2 to work (from 32 to 2048).<br />
<br />
The iActorSize values are reliable for all the original Cosmo level files (Version 1.20).<br />
<br />
The map data is actually sized 65528 Bytes or 32764 Words. Each entry in this block is divisable by 8 (see [[#Mapping cell values to tiles]]).<br />
<br />
=== Level Flags ===<br />
<br />
The structure of the bits in the iFlags value is as follows:<br />
<br />
[ mmmmm | ppp | yxr | bbbbb ]<br />
<br />
m: music index<br />
p: palette animation type<br />
y: y-scrolling backdrop<br />
x: x-scrolling backdrop<br />
r: rain<br />
b: backdrop index<br />
<br />
The indices for music and backdrop refer to an array of filename strings stored in the executable. You can find them by searching for the first filename in each array. For backdrops, the first filename (index: 0) is <tt>BDBLANK.MNI</tt>, for music it's <tt>MCAVES.MNI</tt>. Note that some backdrop files are not used by the games. The complete list is:<br />
<br />
{|class="wikitable" style="float: left;"<br />
! Backdrop<br/>value !! Filename<br />
|-<br />
| 0 || bdblank.mni<br />
|-<br />
| 1 || bdpipe.mni<br />
|-<br />
| 2 || bdredsky.mni<br />
|-<br />
| 3 || bdrocktk.mni<br />
|-<br />
| 4 || bdjungle.mni<br />
|-<br />
| 5 || bdstar.mni<br />
|-<br />
| 6 || bdwierd.mni<br />
|-<br />
| 7 || bdcave.mni<br />
|-<br />
| 8 || bdice.mni<br />
|-<br />
| 9 || bdshrum.mni<br />
|-<br />
| 10 || bdtechms.mni<br />
|-<br />
| 11 || bdnewsky.mni<br />
|-<br />
| 12 || bdstar2.mni<br />
|-<br />
| 13 || bdstar3.mni<br />
|-<br />
| 14 || bdforest.mni<br />
|-<br />
| 15 || bdmountn.mni<br />
|-<br />
| 16 || bdguts.mni<br />
|-<br />
| 17 || bdbrktec.mni<br />
|-<br />
| 18 || bdclouds.mni<br />
|-<br />
| 19 || bdfutcty.mni<br />
|-<br />
| 20 || bdice2.mni<br />
|-<br />
| 21 || bdcliff.mni<br />
|-<br />
| 22 || bdspooky.mni<br />
|-<br />
| 23 || bdcrystl.mni<br />
|-<br />
| 24 || bdcircut.mni<br />
|-<br />
| 25 || bdcircpc.mni<br />
|-<br />
| 26-31 || ''Unused''<br />
|}<br />
<br />
{|class="wikitable" style="float: left;"<br />
! Music<br/>value !! Filename<br />
|-<br />
| 0 || mcaves.mni<br />
|-<br />
| 1 || mscarry.mni<br />
|-<br />
| 2 || mboss.mni<br />
|-<br />
| 3 || mrunaway.mni<br />
|-<br />
| 4 || mcircus.mni<br />
|-<br />
| 5 || mtekwrd.mni<br />
|-<br />
| 6 || measylev.mni<br />
|-<br />
| 7 || mrockit.mni<br />
|-<br />
| 8 || mhappy.mni<br />
|-<br />
| 9 || mdevo.mni<br />
|-<br />
| 10 || mdadoda.mni<br />
|-<br />
| 11 || mbells.mni<br />
|-<br />
| 12 || mdrums.mni<br />
|-<br />
| 13 || mbanjo.mni<br />
|-<br />
| 14 || measy2.mni<br />
|-<br />
| 15 || mteck2.mni<br />
|-<br />
| 16 || mteck3.mni<br />
|-<br />
| 17 || mteck4.mni<br />
|-<br />
| 18 || mzztop.mni<br />
|-<br />
| 19-31 || ''Unused''<br />
|}<br />
<br />
{|class="wikitable" style="float: left;"<br />
! Animation<br/>value !! Use !! Description<br />
|-<br />
| 0 || most levels || no palette changes<br />
|-<br />
| 1 || A4 || random lightning (with thunder soundeffect)<br />
|-<br />
| 2 || C8-C10 || cycling: red -> yellow -> white<br />
|-<br />
| 3 || A7 || cycling: red -> green -> blue<br />
|-<br />
| 4 || A8, B3, B4, B7 || cycling: black -> grey -> white<br />
|-<br />
| 5 || C6, C7 || flashing: red -> magenta -> white<br />
|-<br />
| 6 || C1 || replace dark magenta with black,<br/>no animation unless triggered by a bomb actor.<br/>(ONLY PRESENT IN COSMO3.EXE AT THE MOMENT.)<br />
|-<br />
| 7 || None || {{TODO|Unknown}}<br />
|}<br />
<br />
<br style="clear: both"/><br />
<br />
=== Background Layer ===<br />
<br />
The <tt>bgLayer</tt> block contains the grid/cell data:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iMapData[32764]||Actual map data<br />
|}<br />
<br />
Each "element" in <tt>iMapData</tt> refers to the foreground and/or background tile used in a single grid cell. The grids are arranged left to right, top to bottom, so the index can be calculated by this formula:<br />
<br />
int iIndex = (y * iMapWidth) + x;<br />
iMapData[iIndex] = <new value to set at x,y><br />
<br />
The map data in the original Cosmo level files is a constant 32764 UINT16LE cells long (65528 bytes), and the engine will never read more than 65535 bytes. However, the game calculates the map height by dividing the width in bytes by 65536:<br />
<br />
int iMapHeight = 32768 / iMapWidth;<br />
<br />
Since the width of the map is always a power of 2 (min. 64), you can see that each file is "missing" 8 Bytes (or 4 Words). That means the last line of the map will always be missing the last 4 tiles. The game ignores that last, incomplete line. However, in one level (A8.MNI), there is an actor placed in that last line. Since actors are saved as individual structures instead of a grid, that actor will still be loaded by the game. But for editing a level, you should make sure the last line is visible, so that it's possible to place actors in that line or remove them from there.<br />
<br />
==== Mapping cell values to tiles ====<br />
<br />
The method of mapping elements in the <tt>iMapData</tt> structure into tiles is fairly straightforward. Each cell value is a pixel index into the tilemap. Imagine the tileset laid out left to right all on the one row. Since each tile is 8x8 pixels, at 16 pixels into the image, the third tile will begin (x = 0 for first tile, x = 8 for second tile, x = 16 for third tile.) The cell value is essentially a pixel x-coordinate into the tileset.<br />
<br />
Note that in the tileset file, the solid tiles are made up of 2000 4-plane (16-colour) images, and these are followed by 1000 5-plane images (16-colour + transparency.) Although separate images, they appear to be concatenated when the game loads them, as the cell value will be zero for the first solid tile, it will be eight for the second solid tile, it will be 15992 for the last solid tile, and it will be 16000 for the first masked tile.<br />
<br />
This means that if the solid and masked tiles have been treated as separate images, a check will need to be performed so that any cell value below 16000 is loaded from the solid tileset, and any value larger than this is loaded from the masked tileset (after subtracting 16000 from the cell value, to put it at zero for the first masked tile.) However, for some reason the values for the masked tiles are at multiples of five tiles (tile #0 (x=0) is the first tile, tile #5 (x=40) is the second tile.) This formula can be used to convert the values into tile numbers once they stray into the masked tile area:<br />
<br />
#define COSMO_TS_SOLID_NUMTILES 2000 // 40x25<br />
#define COSMO_TS_MASKED_NUMTILES 1000 // 40x4<br />
<br />
tile = cell_value / 8<br />
if (tile > COSMO_TS_SOLID_NUMTILES) {<br />
// Once we're in the masked tileset it counts up in multiples of five planes<br />
tile = COSMO_TS_SOLID_NUMTILES + (tile - COSMO_TS_SOLID_NUMTILES) / 5;<br />
}<br />
// Now 'tile' will be between 0 and 2999 inclusive<br />
<br />
As an example of a few tile values:<br />
<br />
{|class="wikitable"<br />
! Cell value !! Tile number !! Tileset !! Index !! Comments<br />
|-<br />
| 0 || 0 || N/A || N/A || See through to map backdrop<br />
|-<br />
| 8 || 1 || Solid || 1 || First solid tile, note increment of 8<br />
|-<br />
| 16 || 2 || Solid || 2 || Second solid tile, increment of 8 again<br />
|-<br />
| 15992 || 1999 || Solid || 1999 || Last solid tile<br />
|-<br />
| 16000 || 2000 || Masked || 0 || First masked tile<br />
|-<br />
| 16040 || 2001 || Masked || 1 || Second masked tile, note increment of 40<br />
|-<br />
| 16080 || 2002 || Masked || 2 || Third masked tile, increment of 40 again<br />
|-<br />
| 55960 || 2999 || Masked || 999 || Last masked tile<br />
|-<br />
| 56000 || N/A || N/A || N/A || Should never get a value this size or larger<br />
|}<br />
<br />
Note that while the cell value cannot be out of range for the solid tiles/background layer (since any values larger than 16000 will be loaded from the masked tileset) the cell values for the masked tileset have no such restriction. (Although obviously out of range tiles will not be drawn correctly by the engine!)<br />
<br />
==== Gotchas ====<br />
<br />
* The first tile in the solid tileset is used as a transparent tile. It will appear completely black if drawn (e.g. in a map editor) however the game does not draw this tile, so any cells with this as the background cell will be where the map backdrop shows through. If you wish to draw the map with the backdrop in-place, remember not to draw tile #0 over the top of the backdrop.<br />
<br />
=== Actor data ===<br />
<br />
The <tt>actorData</tt> block is in the following format:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iType||Type of actor<br />
|-<br />
|UINT16LE iX||X-coordinate of actor (in tile units)<br />
|-<br />
|UINT16LE iY||Y-coordinate of actor (in tile units)<br />
|}<br />
<br />
Because the <tt>iActorSize</tt> value in the header is in UINT16s and there are three UINT16s per actor, the number of actors can be obtained quite simply:<br />
<br />
iNumActors = iActorSize / 3<br />
<br />
This is assuming <tt>iActorSize</tt> is reliable - the original specs from Dave Bollinger indicate this is not always the case for DukeII, but no examples are known at the moment.<br />
<br />
==== Mapping Actor Types to image indices ====<br />
<br />
For the ActorTypes from 32 to 296 (inclusive), you can get an image index from ACTORS.MNI and ACTRINFO.MNI like this:<br />
<br />
ImageIndex = ActorType - 31<br />
<br />
However, this does not work for every ActorType. Some share the same images (e.g.: normal stars and falling stars), some use flipped versions of other images (like the pink eye plants) and some are invisible in the game. In either case, the index in the ACTRINFO.MNI will contain no data. You will either have to include hard-coded info to draw these, or just draw something else (like the actual ActorType as text).<br />
<br />
==== List of Actor Types ====<br />
<br />
This is a list of all the actor types that can be found in the original levels of the three episodes. There might be more ActorTypes that work in the game. For example, 69 is probably the (falling) "Cyan Fruit" item as you can guess by looking at the numbers 62-68.<br />
<br />
0 PLAYER: Cosmo (Starting position facing right)<br />
1 moving platform (fixed path)<br />
2 PLAT/HAZARD: mud fountain 1 (small)<br />
3 PLAT/HAZARD: mud fountain 2 (normal)<br />
4 PLAT/HAZARD: mud fountain 3 (big)<br />
5 PLAT/HAZARD: mud fountain 4 (huge)<br />
6 BRIGHTNESS: left border of light<br />
7 BRIGHTNESS: light source (top center)<br />
8 BRIGHTNESS: right border of light<br />
<br />
22 ??? (only in A8.MNI, doesn't seem to be doing anything)<br />
<br />
32 BONUS: Star (200)<br />
33 PLAT: Floor Spring<br />
34 HAZARD: Extending Arrow Spear (from right to left)<br />
35 HAZARD: Extending Arrow Spear (from left to right)<br />
36 HAZARD: Plasma Fireball (from right to left)<br />
37 HAZARD: Plasma Fireball (from left to right)<br />
38 Blue Switch (on ceiling)<br />
39 Red Switch (on ceiling)<br />
40 Green Switch <br />
41 Yellow Switch<br />
42 Blue Door<br />
43 Red Door<br />
44 Green Door<br />
45 Yellow Door<br />
<br />
47 OBJECT: Blue Mobile Trampoline Car<br />
48 HAZARD: Non-Retracting Spikes<br />
49 HAZARD: Retracting Spikes<br />
<br />
51 HAZARD: Big Saw Blade<br />
<br />
56 HAZARD: Green Pruny Cabbage Ball<br />
<br />
59 BONUS: Power Up (health/12800)<br />
60 BARREL: Power Up (health/12800)<br />
<br />
62 CRATE: Green Tomato<br />
63 BONUS: Green Tomato (falling)<br />
64 CRATE: Tomato (200)<br />
65 BONUS: Tomato (falling)<br />
66 CRATE: Yellow/Cyan Fruit<br />
67 BONUS: Yellow/Cyan Fruit (falling)<br />
68 CRATE: Cyan Fruit<br />
<br />
70 OBJECT: Exit Sign (ends level on touch)<br />
<br />
72 HAZARD: Spear (coming down from ceiling)<br />
73 HAZARD: Leaking Green Acid<br />
74 HAZARD: Dripping Green Acid<br />
75 ENEMY: Plasma Energy Sprites (Blue Flame-like creatures)<br />
76 HAZARD: "Two Tons" Weight going down & up<br />
77 ENEMY: Jumping Bulletheads<br />
78 ENEMY: Stone Heads (Only drops when Cosmo is close by)<br />
79 ENEMY: Big Yellow Spike on ceiling<br />
80 ENEMY: Big Yellow Spike on ceiling (falling down)<br />
81 ENEMY: Big Yellow Spike on ground<br />
82 ENEMY: Ghost<br />
83 CRATE: Green thingy<br />
<br />
85 ENEMY: Angry Moon (blue floating characters)<br />
86 ENEMY: Small Red Plant<br />
87 BARREL: Bomb (100)<br />
88 BONUS: Bomb (100)<br />
<br />
90 OBJECT: switch (1) (Activates moving platform(s))<br />
<br />
92 OBJECT: switch (2) (Activates Question Mark Block Wall Generator)<br />
93 OBJECT: Question Mark Block (Generates a wall when activated by switch)<br />
94 HAZARD: Ground Claw Spikes<br />
95 OBJECT: Rubber Wall (can blow it up, throws Cosmo backwards when touched)<br />
96 ENEMY: Mini Ghost (jumps)<br />
<br />
100 CREATURE: Green Roamer Worm<br />
101 PIPE TRANSIT DIRECTION: Arrow Up<br />
102 PIPE TRANSIT DIRECTION: Arrow Down<br />
103 PIPE TRANSIT DIRECTION: Arrow Left<br />
104 PIPE TRANSIT DIRECTION: Arrow Right<br />
105 ENEMY: Egg Head (special?) -- only 1x: in B2.MNI<br />
106 ENEMY: Egg Head<br />
<br />
109 ENEMY: Robotic Spike on ground<br />
<br />
111 ENEMY: Robotic Spike on ceiling<br />
112 CRATE/BONUS: Burger<br />
<br />
114 ENEMY: Blue/Red plant<br />
<br />
116 BONUS: Purple Grapes (800)<br />
117 ENEMY: Blue Ball<br />
118 ENEMY: Spikes (on left wall)<br />
119 ENEMY: Retracting Spikes (on left wall)<br />
120 ENEMY: Spikes (on right wall)<br />
121 ENEMY: Robot with Blue Vertical Electric Arc<br />
122 PLAT: Blue Platform (splits open when standing on top)<br />
123 ENEMY: Spark<br />
<br />
125 BONUS: Cyan Dancing Mushroom (400)<br />
126 DECO: Pink Eye Plant<br />
127 DECO: Pink Eye Plant (hanging upside down)<br />
<br />
132 ENEMY: Big Red Jumper (MAY ONLY WORK IN COSMO2 & COSMO3.EXE. APPEARS TO BE FROZEN IN COSMO1.EXE)<br />
133 ENEMY: BOSS (Purple Alien in Spike-bottomed ship)<br />
<br />
135 PNEUMATIC PIPES: Exit<br />
136 PNEUMATIC PIPES: Entrance<br />
137 ENEMY: Suction-Cup-Legged Alien<br />
138 OBJECT: Teleporter A<br />
139 OBJECT: Teleporter B<br />
<br />
142 ENEMY: Cyan Spitting Plant (on left wall)<br />
143 ENEMY: Cyan Spitting Plant (on right wall)<br />
144 ENEMY: Blue Turret Alien<br />
145 PLAT: Hoverboard<br />
146 CRATE: pile of green balls<br />
<br />
148 BARREL: Saxophone-like thing<br />
149 ENEMY: Red Chomper Alien<br />
150 CRATE: Salad<br />
151 switch (3) (Possibly deactivates Actors 153 & 154; Energy Beams)<br />
152 switch (4) (Possibly activates lights, if actors 6,7, & 8 are present in level.)<br />
153 HAZARD: Vertical Energy Beam (Deactivated by Switch)<br />
154 HAZARD: Horizontal Energy Beam (Deactivated by Switch)<br />
155 CREATURE/HAZARD: Pink slug/Worm (Turns to bubbling goo when jumped upon)<br />
156 HINT: "These hint globes will help you along your journey. Press the up key to reread them."<br />
157 ENEMY: Silver Robot (pushes player around)<br />
158 ENEMY: Security Robot (shoots flashing bullet, can act as moving floor spring)<br />
<br />
160 PLAT/HAZARD: Dragonfly<br />
161 Crate/Box (can only be destroyed with bombs)<br />
<br />
165 BONUS: Bottle with red liquid<br />
166 BONUS: Green thing<br />
167 BONUS: Blue thing<br />
168 BONUS: Salad?<br />
169 BONUS: Pile of green things<br />
170 BONUS: whatever..<br />
<br />
172 BONUS: blue thing<br />
<br />
174 DECO/BONUS: Satellite<br />
<br />
176 ENEMY: Green Plant<br />
177 BONUS: 5 Yellow Grapes (800)<br />
178 BONUS: Headdress-like object<br />
179 CRATE: with item 178<br />
180 DECO: Jaws & Tongue<br />
181 invisible exit marker (go right to exit)<br />
182 small flame<br />
183 ENEMY: Big Red Plant (spitting Blue Balls/catapult)<br />
<br />
185 BONUS: Blue Crystal (on ground)<br />
186 BONUS: Red Crystal (on ground)<br />
187 BARREL: Red/Green Gem<br />
188 BARREL: Blue Crystal<br />
189 BARREL: Red Crystal<br />
190 BONUS: Green Tomato<br />
191 BONUS: Tomato<br />
192 BONUS: Yellow/Cyan Fruit (200)<br />
193 HAZARD: Clamp Trap<br />
194 PLAT: Blue Cube (falls down when you walk off)<br />
195 MESSAGE: "What's happening? Is Cosmo falling to his doom?"<br />
196 MESSAGE: "Is there no end to this pit? An what danger awaits below?!"<br />
197 Level End Object?<br />
198 CRATE: Root (400)<br />
199 BONUS: Root<br />
200 CRATE: 4 Brown Berries (400)<br />
201 BONUS: 4 Brown Berries<br />
<br />
203 BONUS: Potato-like vegetable<br />
204 BARREL: Green Gem<br />
205 BONUS: Green Gem<br />
206 BARREL: Diamond (3200)<br />
207 BONUS: Diamond<br />
<br />
217 ENEMY: Alien-Eating Space Plant (Exits the current level)<br />
218 ENEMY: Blue Bird<br />
219 OBJECT: Rocket<br />
220 BONUS: Invincibility Cube<br />
221 PLAT: Destructible Pedestal 1 (14 tiles high)<br />
222 PLAT: Destructible Pedestal 2 (20 tiles high)<br />
223 PLAT: Destructible Pedestal 3 (26 tiles high)<br />
224 BARREL: Diamond 2<br />
225 BONUS: Diamond 2 (falling)<br />
226 BARREL: Red Berry<br />
227 BONUS: Red Berry (falling)<br />
228 BARREL: Crystal (800)<br />
229 BONUS: Crystal (falling)<br />
230 BARREL: Blue Gem<br />
231 BONUS: Blue Gem (falling)<br />
<br />
233 DECO: Rocket Exhaust<br />
234 EXIT: Teleporter<br />
235 HINT: "Bump head into switch above!"<br />
236 HINT: "The ice in this cave is very, very slippery."<br />
237 HINT: "Use this shield for temporary invincibility."<br />
238 HINT: "You found a secret area!!! Good Job!"<br />
239 HINT: "In hight places look up to find bonus objects."<br />
240 HINT: "Out of Order..."<br />
241 HINT: "This might be a good time to save your game!"<br />
242 HINT: "Press your up key to use the transporter."<br />
243 HINT: "(1) FOR..."<br />
244 BONUS: Diamond 2<br />
245 BONUS: Red Berry<br />
246 BONUS: Crystal<br />
247 BONUS: Blue Gem (800)<br />
248 PLAT: Ceiling Spring<br />
249 BARREL: Headphones<br />
250 BONUS: Headphones<br />
251 BONUS: Headphones (falling)<br />
252 OBJECT: Frozen Duke NukUm<br />
<br />
254 BONUS: 3 Bananas (800)<br />
255 CRATE: Alien Raisin<br />
256 BONUS: Alien Raisin (400)<br />
<br />
258 CRATE: Brown Pear<br />
259 BONUS: Brown Pear<br />
<br />
261 CRATE: Alien Chili Pepper<br />
262 BONUS: Alien Chili Pepper (400)<br />
<br />
264 DANGER: Flame (<-)<br />
265 DANGER: Flame (->)<br />
<br />
267 HAZARD: Leaking Red acid<br />
268 HAZARD: Dripping Red Acid<br />
269 HINT: "(2) EXTRA..."<br />
270 HINT: "(3) POINTS,..."<br />
271 HINT: "(4) DESTROY..."<br />
272 HINT: "(5) HINT..."<br />
273 HINT: "(6) GLOBES!!!"<br />
274 HINT: "The Clam Plants won't hurt you if their mouths are closed."+Clam Sprite<br />
<br />
278 DECO: Big Mouth (end of E1/start of E2)<br />
279 DECO: Normal Smoke Rising<br />
280 DECO: Big Smoke rising<br />
281 EXIT: Horizontal Exit Marker (Invisible)<br />
<br />
283 BONUS: Red Crystal on ceiling<br />
284 HINT: "Collect the STARS to advance to BONUS STAGES."<br />
285 HINT: "Some creatures require more than one pounce to defeat!"<br />
286 HINT: "Cosmo can climb wall's with his suction hands."+CosmoWallSprite<br />
<br />
294 BONUS: Power Up Module (falling) (health/12800)<br />
295 BONUS: Star (falling) (200)<br />
296 end of episode 2 trigger?<br />
<br />
The hint texts are the messages you get in episode 1, the other episodes have different (and less!) messages. The later hint globes probably don't work in those episodes.<br />
<br />
== Credits ==<br />
<br />
This file format was reverse engineered by [http://www.geocities.com/dooknookimklassik/ Dave Bollinger]. Most of this info came from the [http://www.geocities.com/dooknookimklassik/dn2specs.txt Duke II specs on his website], with [[User:Malvineous|Malvineous]] working out which bits to remove to read Cosmo maps. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure&diff=5112Cosmo's Cosmic Adventure2014-01-10T21:16:03Z<p>T-Squared: /* Notes */</p>
<hr />
<div>{{Game Infobox<br />
| Levels = Edit<br />
| Tiles = Edit<br />
| Sprites = Edit<br />
| Fullscreen = Edit<br />
| Sound = Edit<br />
| Music = Edit<br />
| Text = No<br />
| Story = No<br />
| Interface = No<br />
}}<br />
'''Cosmo's Cosmic Adventure''', also known simply as Cosmo, is a three part series chronicling the adventures of Cosmo, a small, green sucker-handed alien boy who is seeking his parents after a meteor collision forces them to land their ship on a dangerous and uncharted planet.<br />
<br />
The Cosmo engine was later updated and used for [[Duke Nukem II]], so the two games share a number of file formats.<br />
<br />
== Tools ==<br />
<br />
{{BeginFileFormatTools|Type=game}}<br />
{{FileFormatTool<br />
| Name = [[Camoto]]<br />
| Platform = Linux/Windows<br />
| grp = Edit<br />
| map = Edit<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosedit.zip CosEdit]<br />
| Platform = DOS GUI<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [https://dl.dropbox.com/u/3940020/COSGRAPH-working.zip Cosgraph]<br />
| Platform = Windows GUI<br />
| grp = Read<br />
| map = No<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = Edit<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosmedit10.zip Cosmo Edit]<br />
| Platform = DOS console<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/textract.zip TExtract]<br />
| Platform = DOS console<br />
| grp = Read<br />
| map = No<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [[Wombat]]<br />
| Platform = Windows GUI<br />
| grp = Edit<br />
| map = View<br />
| gfx = View<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{EndFileFormatTools}}<br />
<br />
{{BeginGameFileList}}<br />
{{GameFile<br />
| Name = *.mni (32,000 bytes)<br />
| Format = [[Raw EGA data#Planar|Full-screen planar EGA]]<br />
| KnownFormat = Yes<br />
| Desc = 320&times;200 full-screen images (in four planes: blue, green, red, intensity)<br />
}}<br />
{{GameFile<br />
| Name = *.mni (4,000 bytes)<br />
| Format = [[B800 Text]]<br />
| KnownFormat = Yes<br />
| Desc = Text screens shown at exit<br />
}}<br />
{{GameFile<br />
| Name = actors.mni<br/>bd*.mni<br/>cartoon.mni<br/>masktile.mni<br/>players.mni<br/>tiles.mni<br />
| Format = [[Cosmo Tileset Format]]<br />
| KnownFormat = Yes<br />
| Desc = Tilesets with 8&times;8 tiles<br />
}}<br />
{{GameFile<br />
| Name = tileattr.mni<br />
| Format = [[Cosmo Tile Attributes]]<br />
| KnownFormat = Yes<br />
| Desc = Tile properties<br />
}}<br />
{{GameFile<br />
| Name = cosmo*.stn<br/>cosmo*.vol<br />
| Format = [[VOL Format]]<br />
| KnownFormat = Yes<br />
| Desc = Archive file storing the game data<br />
}}<br />
{{GameFile<br />
| Name = a*.mni<br />
| Format = [[Cosmo Level Format]]<br />
| KnownFormat = Yes<br />
| Desc = Levels<br />
}}<br />
{{GameFile<br />
| Name = m*.mni<br/>(except masktile.mni)<br />
| Format = [[IMF Format]]<br />
| KnownFormat = Yes<br />
| Desc = Background music - see [[#Notes]] below<br />
}}<br />
{{GameFile<br />
| Name = sounds*.mni<br />
| Format = [[Inverse Frequency Sound format]]<br />
| KnownFormat = Yes<br />
| Desc = PC speaker sound effects<br />
}}<br />
{{GameFile<br />
| Name = cosmo*.sv*<br />
| Format = [[Cosmo Savegame Format]]<br />
| KnownFormat = Yes<br />
| Desc = Saved games. <tt>cosmo?.svt</tt> is a temporary save written at the start of each level<br />
}}<br />
{{GameFile<br />
| Name = *info.mni<br />
| Format = [[Cosmo Tileinfo Format]]<br />
| KnownFormat = Yes<br />
| Desc = How to lay out the actor tiles into complete frames<br />
}}<br />
{{EndGameFileList}}<br />
<br />
== Notes ==<br />
<br />
* Graphics limitations and glitches:<br />
** The masktile graphics can be corrupted by a buffer overflow by the addition of a large enough IMF music file to the [[:Category:Group Files|group file]] (usually around 40KB). (That is, the music goes over it's intended memory boundary.) This is not permanent, and will only occur until the offending file is removed or a smaller or less-complex file is imported in its place. <br />
** Actor graphics can be corrupted by a self-contained arithmetic overflow by the addition of too many sprites. (that is, it writes to the end of the allocated block, then back around to the beginning, where it overwrites the header data.) Again, this is not permanent unless the user does not change the data in the group file.<br />
** If an actor is in front of a masked tile with the foreground bit set on it, any transparent regions of the tile overlapping the actor will remove those regions on the actor, showing the background instead.<br />
<br />
*Directory miscellany:<br />
** The game reads from the VOL and STN archive files in preference to the current directory, but will read from the current directory if the archive files are not present. Any game files in the current directory will not be read while the VOL/STN files are present. To modify a file, it will either need to be imported back into the VOL/STN, or the VOL/STN should have its entire contents extracted into the game folder and then be removed or renamed.<br />
** A directory path (relative to the current directory) can be given on the command line. Any files that the game writes (saved games, high scores, etc.) will be written to this folder instead. This is probably to allow running the game directly from read-only media like a CD.<br />
<br />
[[Category:Apogee]]<br />
[[Category:Sidescroller]]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Talk:Cosmo_Level_Format&diff=4993Talk:Cosmo Level Format2013-10-22T18:56:01Z<p>T-Squared: </p>
<hr />
<div>While working on my level viewer, I put together a rough list of ActorTypes and what they do in the game. You can get most of that together by viewing the levels with that program and pressing TAB to display the ActorTypes, but if you think that should be added here, let me know. --[[User:K1n9 Duk3|K1n9 Duk3]] 01:06, 1 February 2011 (GMT)<br />
<br />
: Certainly if it would help someone else to write a level viewer/editor, please include it here! -- [[User:Malvineous|Malvineous]] 08:55, 6 February 2011 (GMT)<br />
<br />
I think this section needs to be expanded upon with examples, because I am having problems trying to quantize (match up) the data with what is labeled.--[[User:T-Squared|T-Squared]] ([[User talk:T-Squared|talk]]) 18:56, 22 October 2013 (GMT)</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Talk:Cosmo_Level_Format&diff=4992Talk:Cosmo Level Format2013-10-22T18:55:44Z<p>T-Squared: </p>
<hr />
<div>While working on my level viewer, I put together a rough list of ActorTypes and what they do in the game. You can get most of that together by viewing the levels with that program and pressing TAB to display the ActorTypes, but if you think that should be added here, let me know. --[[User:K1n9 Duk3|K1n9 Duk3]] 01:06, 1 February 2011 (GMT)<br />
<br />
: Certainly if it would help someone else to write a level viewer/editor, please include it here! -- [[User:Malvineous|Malvineous]] 08:55, 6 February 2011 (GMT)<br />
<br />
I think this section needs to be expanded upon with examples, because I am having problems trying to quantize (match up) the data with what is labeled.--[[User:T-Squared|T-Squared]] ([[User talk:T-Squared|talk]]) 18:55, 22 October 2013 (GMT)</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=4991User:T-Squared2013-10-21T19:12:35Z<p>T-Squared: Finally got all of my stuff together in one spot so people who visit my user page can contribute to the project if they so wish.</p>
<hr />
<div>Welcome to my User page.<br />
<br />
I'm working on the first true Cosmo Mod: "Cosmo's Cosmic Adventure 2: HUMANIZED!!!", but I can't do this alone. I need people to help me bring this idea to life. (I know that sounds cheesy, but I really think this idea can happen as a real mod. :D<br />
<br />
Here's what I've been working on: [https://www.dropbox.com/sh/ul8gsihslzh11op/ypJGwVA1O0 COSMO II MAIN DIRECTORY]<br />
<br />
If you wish to contribute to the project, here's a list possible levels (Look for the ones marked [LOCK], because those are the ones which are strongly suggested to appear in the game: [https://www.dropbox.com/sh/ul8gsihslzh11op/i1i-L8nPiW/Levels%20for%20Cosmo%202.docx LEVEL LIST]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User_talk:K1n9_Duk3&diff=4652User talk:K1n9 Duk32013-06-30T18:46:45Z<p>T-Squared: </p>
<hr />
<div>Hi K1n9 Duk3 - just a request when you're documenting file formats to use the data types listed in [[File format data types]] instead of generic terms like "word" - a word can mean two bytes, four bytes or [[wp:Word (computing)|any number of other values]], and it doesn't explain whether it's little endian or big endian. I know you can figure it out from the DOS platform, but it's a bit easier if every page is consistent! -- [[User:Malvineous|Malvineous]] 22:35, 9 March 2011 (GMT)<br />
<br />
: I thought a word was always two bytes in size. Even the Windows Calculator implies that. Anyway, I changed the data types in my last edits. --[[User:K1n9 Duk3|K1n9 Duk3]] 08:37, 10 March 2011 (GMT)<br />
<br />
:: Thanks for that. I think a word is usually two bytes on Intel machines but there's still no reminder that it's little-endian. Best to be clear given that we're aiming to be a reference source for this stuff! -- [[User:Malvineous|Malvineous]] 11:38, 10 March 2011 (GMT)<br />
<br />
Hi K1n9 Duk3 - another small request. When you name pages with new file formats, can you use a more descriptive name? Things like [[MBG Format]] don't really say much, and chances are only one game will ever use that format so I think naming it after the file extension is of limited use. I have been trying to use more descriptive names, like [[Realms of Chaos Map Format]] (you can see this on the [[Monster Bash]] page.) I've only been using the former for well known file formats, like [[MID Format]] or [[IMF Format]], which are widely used outside of games. -- [[User:Malvineous|Malvineous]] 09:42, 1 April 2013 (GMT)<br />
<br />
<br />
Hey K1n9 Duk3 - I need to know if I'm reading the descriptions for the format of the Cosmo's Cosmic Adventure tile attribute file correctly: http://www.shikadi.net/moddingwiki/Cosmo_Tile_Attributes <br />
Are the bit values mixed into one byte? Like, $12 would yield a tile that is both slippery and blocks Cosmo from falling through from the top? (that would be "00010010" in binary.) -- [[User:T-Squared|T-Squared]] 18:46, 30 June 2013 (GMT)</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User_talk:K1n9_Duk3&diff=4651User talk:K1n9 Duk32013-06-30T18:45:25Z<p>T-Squared: </p>
<hr />
<div>Hi K1n9 Duk3 - just a request when you're documenting file formats to use the data types listed in [[File format data types]] instead of generic terms like "word" - a word can mean two bytes, four bytes or [[wp:Word (computing)|any number of other values]], and it doesn't explain whether it's little endian or big endian. I know you can figure it out from the DOS platform, but it's a bit easier if every page is consistent! -- [[User:Malvineous|Malvineous]] 22:35, 9 March 2011 (GMT)<br />
<br />
: I thought a word was always two bytes in size. Even the Windows Calculator implies that. Anyway, I changed the data types in my last edits. --[[User:K1n9 Duk3|K1n9 Duk3]] 08:37, 10 March 2011 (GMT)<br />
<br />
:: Thanks for that. I think a word is usually two bytes on Intel machines but there's still no reminder that it's little-endian. Best to be clear given that we're aiming to be a reference source for this stuff! -- [[User:Malvineous|Malvineous]] 11:38, 10 March 2011 (GMT)<br />
<br />
Hi K1n9 Duk3 - another small request. When you name pages with new file formats, can you use a more descriptive name? Things like [[MBG Format]] don't really say much, and chances are only one game will ever use that format so I think naming it after the file extension is of limited use. I have been trying to use more descriptive names, like [[Realms of Chaos Map Format]] (you can see this on the [[Monster Bash]] page.) I've only been using the former for well known file formats, like [[MID Format]] or [[IMF Format]], which are widely used outside of games. -- [[User:Malvineous|Malvineous]] 09:42, 1 April 2013 (GMT)<br />
<br />
<br />
Hey K1n9 Duk3 - I need to know if I'm reading the descriptions for the format of the Cosmo's Cosmic Adventure tile attribute file correctly: http://www.shikadi.net/moddingwiki/Cosmo_Tile_Attributes <br />
Are the bit values mixed into one byte? Like, $12 would yield a tile that is both slippery and blocks Cosmo from falling through from the top? (that would be "00010010" in binary.)</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure&diff=4650Cosmo's Cosmic Adventure2013-06-30T05:27:43Z<p>T-Squared: /* Notes */ Tidying up some motes I added 4 years ago. :P (and added a new problem)</p>
<hr />
<div>{{Game Infobox<br />
| Levels = Edit<br />
| Tiles = Edit<br />
| Sprites = Edit<br />
| Fullscreen = Edit<br />
| Sound = Edit<br />
| Music = Edit<br />
| Text = No<br />
| Story = No<br />
| Interface = No<br />
}}<br />
'''Cosmo's Cosmic Adventure''', also known simply as Cosmo, is a three part series chronicling the adventures of Cosmo, a small, green sucker-handed alien boy who is seeking his parents after a meteor collision forces them to land their ship on a dangerous and uncharted planet.<br />
<br />
The Cosmo engine was later updated and used for [[Duke Nukem II]], so the two games share a number of file formats.<br />
<br />
== Tools ==<br />
<br />
{{BeginFileFormatTools|Type=game}}<br />
{{FileFormatTool<br />
| Name = [[Camoto]]<br />
| Platform = Linux console/GUI<br />
| grp = Edit<br />
| map = Edit<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosedit.zip CosEdit]<br />
| Platform = DOS GUI<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [https://dl.dropbox.com/u/3940020/COSGRAPH-working.zip Cosgraph]<br />
| Platform = Windows GUI<br />
| grp = Read<br />
| map = No<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = Edit<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosmedit10.zip Cosmo Edit]<br />
| Platform = DOS console<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/textract.zip TExtract]<br />
| Platform = DOS console<br />
| grp = Read<br />
| map = No<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [[Wombat]]<br />
| Platform = Windows GUI<br />
| grp = Edit<br />
| map = View<br />
| gfx = View<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{EndFileFormatTools}}<br />
<br />
<br style="clear: both;"/><br />
<br />
== File formats ==<br />
<br />
This section lists the major file formats used in the game.<br />
<br />
{|class="wikitable"<br />
!Use!!Format!!Details<br />
|-<br />
| Backgrounds || [[Raw EGA data#Planar|Full-screen planar EGA]] || 32,000 byte <tt>*.MNI</tt> files are 320x200 full-screen images (in four planes: blue, green, red, intensity). <tt>TITLE1.MNI</tt> is the image on the right, which is in this format.<br />
|-<br />
| Exit screen || [[B800 Text]] || 4000-byte <tt>*.MNI</tt> files are text screens shown at exit (e.g. <tt>NOMEMORY.MNI</tt>)<br />
|-<br />
| Graphics || [[Cosmo Tileset Format]] || <tt>ACTORS.MNI</tt>, <tt>BD*.MNI</tt>, <tt>CARTOON.MNI</tt>, <tt>MASKTILE.MNI</tt>, <tt>PLAYER.MNI</tt> and <tt>TILES.MNI</tt> are all tilesets<br />
|-<br />
| Tile attributes || [[Cosmo Tile Attributes]] || Format of the <tt>TILEATTR.MNI</tt> file<br />
|-<br />
| Group || [[VOL Format]] || group file storing the game data (both the <tt>*.VOL</tt> and <tt>*.STN</tt> files are in this format.)<br />
|-<br />
| Levels || [[Cosmo Level Format]] || <tt>A*.MNI</tt> are game levels.<br />
|-<br />
| Messages || - || Text is contained in the executable in all episodes, but in Cosmo 1 & 2, the executable is compressed by [[LZEXE]], and can be uncompressed with [[UNLZEXE]].<br />
|-<br />
| Music || [[IMF Format]] || Most of the <tt>M*.MNI</tt> files are music files, e.g. <tt>MHAPPY.MNI</tt>) - see [[#Notes]] below<br />
|-<br />
| Sounds || [[Inverse Frequency Sound format]] || <tt>SOUNDSx.MNI</tt> files are in this format, there are three per episode<br />
|-<br />
| Saves || [[Cosmo Savegame Format]] || <tt>COSMOx.SVx</tt> are saved games. <tt>COSMOx.SVT</tt> is a temporary save written at the start of each level<br />
|-<br />
| Tile info || [[Cosmo Tileinfo Format]] || How to lay out the actor tiles. <tt>ACTRINFO.MNI</tt>, <tt>PLYRINFO.MNI</tt> and <tt>CARTINFO.MNI</tt> are in this format<br />
|-<br />
| Actor attributes || [[Actor Attribute Format]] || {{TODO|Research!!}} Attributes for actors hardcoded in the executable. (i.e. hitpoints, what spawns from it, how many points it gives to the player.) <br />
|}<br />
<br />
== Notes ==<br />
*Graphics overflow problems:<br />
**The masktile graphics can be corrupted by a buffer overflow by the addition of a large enough IMF music file to the [[:Category:Group Files|group file]] (usually around 40KB). (That is, the music goes over it's intended memory boundary.) This is not permanent, and will only occur until the offending file is removed or a smaller or less-complex file is imported in its place. <br />
**Actor graphics can be corrupted by a self-contained arithmetic overflow by the addition of too many sprites. (that is, it writes to the end of the allocated block, then back around to the beginning, where it overwrites the header data.) Again, this is not permanent unless the user does not change the data in the group file.<br />
<br />
* The game reads from the VOL and STN files in preference to the current directory. Any game files in the current directory will not be read while the VOL/STN is present. To modify a file, it will either need to be imported back into the VOL/STN, or the VOL/STN should have its entire contents extracted into the game folder and then be removed or renamed.<br />
<br />
* A directory path (relative to the current directory) can be given on the command line. Any files that the game writes (saved games, high scores, etc.) will be written to this folder instead. This is probably to allow running the game directly from read-only media like a CD.<br />
<br />
[[Category:Apogee]]<br />
[[Category:Sidescroller]]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Level_Format&diff=4606Cosmo Level Format2013-04-06T21:09:35Z<p>T-Squared: Undo revision 4604 by T-Squared (talk) Never mind, I think I understand the idea now.</p>
<hr />
<div>{{Map Infobox<br />
| Type = 2D tile-based<br />
| Layers = 3<br />
| Tile size = 8&times;8<br />
| Viewport = 304&times;144<br />
| Game1 = Cosmo's Cosmic Adventures<br />
}}<br />
<br />
== File format ==<br />
The file is in this basic layout:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iFlags||Flags indicating music, backdrop and other stuff<br />
|-<br />
|UINT16LE iMapWidth||Map width in tiles<br />
|-<br />
|UINT16LE iActorSize||Number of UINT16 values in the actor block<br />
|-<br />
|ACTORDATA actorData[]||Variable-length array of all the actors in the level<br />
|-<br />
|BYTE bgLayer[65528]||The map data for the background layer<br />
|}<br />
<br />
The iMapWidth values in the original Cosmo levels is either 64, 128, 256 or 512. The "view window" in the game is 304x144 Pixels, so the minimal map width would be 38. However, the width must be a power of 2 to work (from 32 to 2048).<br />
<br />
The iActorSize values are reliable for all the original Cosmo level files (Version 1.20).<br />
<br />
The map data is actually sized 65528 Bytes or 32764 Words. Each entry in this block is divisable by 8 (see [[#Mapping cell values to tiles]]).<br />
<br />
=== Level Flags ===<br />
<br />
The structure of the bits in the iFlags value is as follows:<br />
<br />
[ mmmmm | ppp | yxr | bbbbb ]<br />
<br />
m: music index<br />
p: palette animation type<br />
y: y-scrolling backdrop<br />
x: x-scrolling backdrop<br />
r: rain<br />
b: backdrop index<br />
<br />
The indices for music and backdrop refer to an array of filename strings stored in the executable. You can find them by searching for the first filename in each array. For backdrops, the first filename (index: 0) is <tt>BDBLANK.MNI</tt>, for music it's <tt>MCAVES.MNI</tt>. Note that some backdrop files are not used by the games (and therefore are not not included).<br />
<br />
The palette animation types indicate the following:<br />
<br />
%000: (most levels) no palette changes<br />
%001: (A4) random lightning (with thunder soundeffect)<br />
%010: (C8-C10) cycling: red -> yellow -> white<br />
%011: (A7) cycling: red -> green -> blue<br />
%100: (A8, B3, B4, B7) cycling: black -> grey -> white<br />
%101: (C6, C7) flashing: red -> magenta -> white<br />
%110: (C1) replace dark magenta with black, no animation unless triggered by a bomb actor. (present in Episode 3, Level 1 of Cosmo.)<br />
<br />
=== Background Layer ===<br />
<br />
The <tt>bgLayer</tt> block contains the grid/cell data:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iMapData[32764]||Actual map data<br />
|}<br />
<br />
Each "element" in <tt>iMapData</tt> refers to the foreground and/or background tile used in a single grid cell. The grids are arranged left to right, top to bottom, so the index can be calculated by this formula:<br />
<br />
int iIndex = (y * iMapWidth) + x;<br />
iMapData[iIndex] = <new value to set at x,y><br />
<br />
The map data in the original Cosmo level files is a constant 32764 UINT16LE cells long (65528 bytes), and the engine will never read more than 65535 bytes. However, the game calculates the map height by dividing the width in bytes by 65536:<br />
<br />
int iMapHeight = 32768 / iMapWidth;<br />
<br />
Since the width of the map is always a power of 2 (min. 64), you can see that each file is "missing" 8 Bytes (or 4 Words). That means the last line of the map will always be missing the last 4 tiles. The game ignores that last, incomplete line. However, in one level (A8.MNI), there is an actor placed in that last line. Since actors are saved as individual structures instead of a grid, that actor will still be loaded by the game. But for editing a level, you should make sure the last line is visible, so that it's possible to place actors in that line or remove them from there.<br />
<br />
==== Mapping cell values to tiles ====<br />
<br />
The method of mapping elements in the <tt>iMapData</tt> structure into tiles is fairly straightforward. Each cell value is a pixel index into the tilemap. Imagine the tileset laid out left to right all on the one row. Since each tile is 8x8 pixels, at 16 pixels into the image, the third tile will begin (x = 0 for first tile, x = 8 for second tile, x = 16 for third tile.) The cell value is essentially a pixel x-coordinate into the tileset.<br />
<br />
Note that in the tileset file, the solid tiles are made up of 2000 4-plane (16-colour) images, and these are followed by 1000 5-plane images (16-colour + transparency.) Although separate images, they appear to be concatenated when the game loads them, as the cell value will be zero for the first solid tile, it will be eight for the second solid tile, it will be 15992 for the last solid tile, and it will be 16000 for the first masked tile.<br />
<br />
This means that if the solid and masked tiles have been treated as separate images, a check will need to be performed so that any cell value below 16000 is loaded from the solid tileset, and any value larger than this is loaded from the masked tileset (after subtracting 16000 from the cell value, to put it at zero for the first masked tile.) However, for some reason the values for the masked tiles are at multiples of five tiles (tile #0 (x=0) is the first tile, tile #5 (x=40) is the second tile.) This formula can be used to convert the values into tile numbers once they stray into the masked tile area:<br />
<br />
#define COSMO_TS_SOLID_NUMTILES 2000 // 40x25<br />
#define COSMO_TS_MASKED_NUMTILES 1000 // 40x4<br />
<br />
tile = cell_value / 8<br />
if (tile > COSMO_TS_SOLID_NUMTILES) {<br />
// Once we're in the masked tileset it counts up in multiples of five planes<br />
tile = COSMO_TS_SOLID_NUMTILES + (tile - COSMO_TS_SOLID_NUMTILES) / 5;<br />
}<br />
// Now 'tile' will be between 0 and 2999 inclusive<br />
<br />
As an example of a few tile values:<br />
<br />
{|class="wikitable"<br />
! Cell value !! Tile number !! Tileset !! Index !! Comments<br />
|-<br />
| 0 || 0 || N/A || N/A || See through to map backdrop<br />
|-<br />
| 8 || 1 || Solid || 1 || First solid tile, note increment of 8<br />
|-<br />
| 16 || 2 || Solid || 2 || Second solid tile, increment of 8 again<br />
|-<br />
| 15992 || 1999 || Solid || 1999 || Last solid tile<br />
|-<br />
| 16000 || 2000 || Masked || 0 || First masked tile<br />
|-<br />
| 16040 || 2001 || Masked || 1 || Second masked tile, note increment of 40<br />
|-<br />
| 16080 || 2002 || Masked || 2 || Third masked tile, increment of 40 again<br />
|-<br />
| 55960 || 2999 || Masked || 999 || Last masked tile<br />
|-<br />
| 56000 || N/A || N/A || N/A || Should never get a value this size or larger<br />
|}<br />
<br />
Note that while the cell value cannot be out of range for the solid tiles/background layer (since any values larger than 16000 will be loaded from the masked tileset) the cell values for the masked tileset have no such restriction. (Although obviously out of range tiles will not be drawn correctly by the engine!)<br />
<br />
==== Gotchas ====<br />
<br />
* The first tile in the solid tileset is used as a transparent tile. It will appear completely black if drawn (e.g. in a map editor) however the game does not draw this tile, so any cells with this as the background cell will be where the map backdrop shows through. If you wish to draw the map with the backdrop in-place, remember not to draw tile #0 over the top of the backdrop.<br />
<br />
=== Actor data ===<br />
<br />
The <tt>actorData</tt> block is in the following format:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iType||Type of actor<br />
|-<br />
|UINT16LE iX||X-coordinate of actor (in tile units)<br />
|-<br />
|UINT16LE iY||Y-coordinate of actor (in tile units)<br />
|}<br />
<br />
Because the <tt>iActorSize</tt> value in the header is in UINT16s and there are three UINT16s per actor, the number of actors can be obtained quite simply:<br />
<br />
iNumActors = iActorSize / 3<br />
<br />
This is assuming <tt>iActorSize</tt> is reliable - the original specs from Dave Bollinger indicate this is not always the case for DukeII, but no examples are known at the moment.<br />
<br />
==== Mapping Actor Types to image indices ====<br />
<br />
For the ActorTypes from 32 to 296 (inclusive), you can get an image index from ACTORS.MNI and ACTRINFO.MNI like this:<br />
<br />
ImageIndex = ActorType - 31<br />
<br />
However, this does not work for every ActorType. Some share the same images (e.g.: normal stars and falling stars), some use flipped versions of other images (like the pink eye plants) and some are invisible in the game. In either case, the index in the ACTRINFO.MNI will contain no data. You will either have to include hard-coded info to draw these, or just draw something else (like the actual ActorType as text).<br />
<br />
==== List of Actor Types ====<br />
<br />
This is a list of all the actor types that can be found in the original levels of the three episodes. There might be more ActorTypes that work in the game. For example, 69 is probably the (falling) "Cyan Fruit" item as you can guess by looking at the numbers 62-68.<br />
<br />
0 PLAYER: Cosmo (Starting position facing right)<br />
1 moving platform (fixed path)<br />
2 PLAT/HAZARD: mud fountain 1 (small)<br />
3 PLAT/HAZARD: mud fountain 2 (normal)<br />
4 PLAT/HAZARD: mud fountain 3 (big)<br />
5 PLAT/HAZARD: mud fountain 4 (huge)<br />
6 BRIGHTNESS: left border of light<br />
7 BRIGHTNESS: light source (top center)<br />
8 BRIGHTNESS: right border of light<br />
<br />
22 ??? (only in A8.MNI, doesn't seem to be doing anything)<br />
<br />
32 BONUS: Star (200)<br />
33 PLAT: Floor Spring<br />
34 HAZARD: Extending Arrow Spear (from right to left)<br />
35 HAZARD: Extending Arrow Spear (from left to right)<br />
36 HAZARD: Plasma Fireball (from right to left)<br />
37 HAZARD: Plasma Fireball (from left to right)<br />
38 Blue Switch (on ceiling)<br />
39 Red Switch (on ceiling)<br />
40 Green Switch <br />
41 Yellow Switch<br />
42 Blue Door<br />
43 Red Door<br />
44 Green Door<br />
45 Yellow Door<br />
<br />
47 OBJECT: Blue Mobile Trampoline Car<br />
48 HAZARD: Non-Retracting Spikes<br />
49 HAZARD: Retracting Spikes<br />
<br />
51 HAZARD: Big Saw Blade<br />
<br />
56 HAZARD: Green Pruny Cabbage Ball<br />
<br />
59 BONUS: Power Up (health/12800)<br />
60 BARREL: Power Up (health/12800)<br />
<br />
62 CRATE: Green Tomato<br />
63 BONUS: Green Tomato (falling)<br />
64 CRATE: Tomato (200)<br />
65 BONUS: Tomato (falling)<br />
66 CRATE: Yellow/Cyan Fruit<br />
67 BONUS: Yellow/Cyan Fruit (falling)<br />
68 CRATE: Cyan Fruit<br />
<br />
70 OBJECT: Exit Sign (ends level on touch)<br />
<br />
72 HAZARD: Spear (coming down from ceiling)<br />
73 HAZARD: Leaking Green Acid<br />
74 HAZARD: Dripping Green Acid<br />
75 ENEMY: Plasma Energy Sprites (Blue Flame-like creatures)<br />
76 HAZARD: "Two Tons" Weight going down & up<br />
77 ENEMY: Jumping Bulletheads<br />
78 ENEMY: Stone Heads (Only drops when Cosmo is close by)<br />
79 ENEMY: Big Yellow Spike on ceiling<br />
80 ENEMY: Big Yellow Spike on ceiling (falling down)<br />
81 ENEMY: Big Yellow Spike on ground<br />
82 ENEMY: Ghost<br />
83 CRATE: Green thingy<br />
<br />
85 ENEMY: Angry Moon (blue floating characters)<br />
86 ENEMY: Small Red Plant<br />
87 BARREL: Bomb (100)<br />
88 BONUS: Bomb (100)<br />
<br />
90 OBJECT: switch (1) (Activates moving platform(s))<br />
<br />
92 OBJECT: switch (2) (Activates Question Mark Block Wall Generator)<br />
93 OBJECT: Question Mark Block (Generates a wall when activated by switch)<br />
94 HAZARD: Ground Claw Spikes<br />
95 OBJECT: Rubber Wall (can blow it up, throws Cosmo backwards when touched)<br />
96 ENEMY: Mini Ghost (jumps)<br />
<br />
100 CREATURE: Green Roamer Worm<br />
101 PIPE TRANSIT DIRECTION: Arrow Up<br />
102 PIPE TRANSIT DIRECTION: Arrow Down<br />
103 PIPE TRANSIT DIRECTION: Arrow Left<br />
104 PIPE TRANSIT DIRECTION: Arrow Right<br />
105 ENEMY: Egg Head (special?) -- only 1x: in B2.MNI<br />
106 ENEMY: Egg Head<br />
<br />
109 ENEMY: Robotic Spike on ground<br />
<br />
111 ENEMY: Robotic Spike on ceiling<br />
112 CRATE/BONUS: Burger<br />
<br />
114 ENEMY: Blue/Red plant<br />
<br />
116 BONUS: Purple Grapes (800)<br />
117 ENEMY: Blue Ball<br />
118 ENEMY: Spikes (on left wall)<br />
119 ENEMY: Retracting Spikes (on left wall)<br />
120 ENEMY: Spikes (on right wall)<br />
121 ENEMY: Robot with Blue Vertical Electric Arc<br />
122 PLAT: Blue Platform (splits open when standing on top)<br />
123 ENEMY: Spark<br />
<br />
125 BONUS: Cyan Dancing Mushroom (400)<br />
126 DECO: Pink Eye Plant<br />
127 DECO: Pink Eye Plant (hanging upside down)<br />
<br />
132 ENEMY: Big Red Jumper (MAY ONLY WORK IN COSMO2 & COSMO3.EXE. APPEARS TO BE FROZEN IN COSMO1.EXE)<br />
133 ENEMY: BOSS (Purple Alien in Spike-bottomed ship)<br />
<br />
135 PNEUMATIC PIPES: Exit<br />
136 PNEUMATIC PIPES: Entrance<br />
137 ENEMY: Suction-Cup-Legged Alien<br />
138 OBJECT: Teleporter A<br />
139 OBJECT: Teleporter B<br />
<br />
142 ENEMY: Cyan Spitting Plant (on left wall)<br />
143 ENEMY: Cyan Spitting Plant (on right wall)<br />
144 ENEMY: Blue Turret Alien<br />
145 PLAT: Hoverboard<br />
146 CRATE: pile of green balls<br />
<br />
148 BARREL: Saxophone-like thing<br />
149 ENEMY: Red Chomper Alien<br />
150 CRATE: Salad<br />
151 switch (3) (Possibly deactivates Actors 153 & 154; Energy Beams)<br />
152 switch (4) (Possibly activates lights, if actors 6,7, & 8 are present in level.)<br />
153 HAZARD: Vertical Energy Beam (Deactivated by Switch)<br />
154 HAZARD: Horizontal Energy Beam (Deactivated by Switch)<br />
155 CREATURE/HAZARD: Pink slug/Worm (Turns to bubbling goo when jumped upon)<br />
156 HINT: "These hint globes will help you along your journey. Press the up key to reread them."<br />
157 ENEMY: Silver Robot (pushes player around)<br />
158 ENEMY: Security Robot (shoots flashing bullet, can act as moving floor spring)<br />
<br />
160 PLAT/HAZARD: Dragonfly<br />
161 Crate/Box (can only be destroyed with bombs)<br />
<br />
165 BONUS: Bottle with red liquid<br />
166 BONUS: Green thing<br />
167 BONUS: Blue thing<br />
168 BONUS: Salad?<br />
169 BONUS: Pile of green things<br />
170 BONUS: whatever..<br />
<br />
172 BONUS: blue thing<br />
<br />
174 DECO/BONUS: Satellite<br />
<br />
176 ENEMY: Green Plant<br />
177 BONUS: 5 Yellow Grapes (800)<br />
178 BONUS: Headdress-like object<br />
179 CRATE: with item 178<br />
180 DECO: Jaws & Tongue<br />
181 invisible exit marker (go right to exit)<br />
182 small flame<br />
183 ENEMY: Big Red Plant (spitting Blue Balls/catapult)<br />
<br />
185 BONUS: Blue Crystal (on ground)<br />
186 BONUS: Red Crystal (on ground)<br />
187 BARREL: Red/Green Gem<br />
188 BARREL: Blue Crystal<br />
189 BARREL: Red Crystal<br />
190 BONUS: Green Tomato<br />
191 BONUS: Tomato<br />
192 BONUS: Yellow/Cyan Fruit (200)<br />
193 HAZARD: Clamp Trap<br />
194 PLAT: Blue Cube (falls down when you walk off)<br />
195 MESSAGE: "What's happening? Is Cosmo falling to his doom?"<br />
196 MESSAGE: "Is there no end to this pit? An what danger awaits below?!"<br />
197 Level End Object?<br />
198 CRATE: Root (400)<br />
199 BONUS: Root<br />
200 CRATE: 4 Brown Berries (400)<br />
201 BONUS: 4 Brown Berries<br />
<br />
203 BONUS: Potato-like vegetable<br />
204 BARREL: Green Gem<br />
205 BONUS: Green Gem<br />
206 BARREL: Diamond (3200)<br />
207 BONUS: Diamond<br />
<br />
217 ENEMY: Alien-Eating Space Plant (Exits the current level)<br />
218 ENEMY: Blue Bird<br />
219 OBJECT: Rocket<br />
220 BONUS: Invincibility Cube<br />
221 PLAT: Destructible Pedestal 1 (14 tiles high)<br />
222 PLAT: Destructible Pedestal 2 (20 tiles high)<br />
223 PLAT: Destructible Pedestal 3 (26 tiles high)<br />
224 BARREL: Diamond 2<br />
225 BONUS: Diamond 2 (falling)<br />
226 BARREL: Red Berry<br />
227 BONUS: Red Berry (falling)<br />
228 BARREL: Crystal (800)<br />
229 BONUS: Crystal (falling)<br />
230 BARREL: Blue Gem<br />
231 BONUS: Blue Gem (falling)<br />
<br />
233 DECO: Rocket Exhaust<br />
234 EXIT: Teleporter<br />
235 HINT: "Bump head into switch above!"<br />
236 HINT: "The ice in this cave is very, very slippery."<br />
237 HINT: "Use this shield for temporary invincibility."<br />
238 HINT: "You found a secret area!!! Good Job!"<br />
239 HINT: "In hight places look up to find bonus objects."<br />
240 HINT: "Out of Order..."<br />
241 HINT: "This might be a good time to save your game!"<br />
242 HINT: "Press your up key to use the transporter."<br />
243 HINT: "(1) FOR..."<br />
244 BONUS: Diamond 2<br />
245 BONUS: Red Berry<br />
246 BONUS: Crystal<br />
247 BONUS: Blue Gem (800)<br />
248 PLAT: Ceiling Spring<br />
249 BARREL: Headphones<br />
250 BONUS: Headphones<br />
251 BONUS: Headphones (falling)<br />
252 OBJECT: Frozen Duke NukUm<br />
<br />
254 BONUS: 3 Bananas (800)<br />
255 CRATE: Alien Raisin<br />
256 BONUS: Alien Raisin (400)<br />
<br />
258 CRATE: Brown Pear<br />
259 BONUS: Brown Pear<br />
<br />
261 CRATE: Alien Chili Pepper<br />
262 BONUS: Alien Chili Pepper (400)<br />
<br />
264 DANGER: Flame (<-)<br />
265 DANGER: Flame (->)<br />
<br />
267 HAZARD: Leaking Red acid<br />
268 HAZARD: Dripping Red Acid<br />
269 HINT: "(2) EXTRA..."<br />
270 HINT: "(3) POINTS,..."<br />
271 HINT: "(4) DESTROY..."<br />
272 HINT: "(5) HINT..."<br />
273 HINT: "(6) GLOBES!!!"<br />
274 HINT: "The Clam Plants won't hurt you if their mouths are closed."+Clam Sprite<br />
<br />
278 DECO: Big Mouth (end of E1/start of E2)<br />
279 DECO: Normal Smoke Rising<br />
280 DECO: Big Smoke rising<br />
281 EXIT: Horizontal Exit Marker (Invisible)<br />
<br />
283 BONUS: Red Crystal on ceiling<br />
284 HINT: "Collect the STARS to advance to BONUS STAGES."<br />
285 HINT: "Some creatures require more than one pounce to defeat!"<br />
286 HINT: "Cosmo can climb wall's with his suction hands."+CosmoWallSprite<br />
<br />
294 BONUS: Power Up Module (falling) (health/12800)<br />
295 BONUS: Star (falling) (200)<br />
296 end of episode 2 trigger?<br />
<br />
The hint texts are the messages you get in episode 1, the other episodes have different (and less!) messages. The later hint globes probably don't work in those episodes.<br />
<br />
== Credits ==<br />
<br />
This file format was reverse engineered by [http://www.geocities.com/dooknookimklassik/ Dave Bollinger]. Most of this info came from the [http://www.geocities.com/dooknookimklassik/dn2specs.txt Duke II specs on his website], with [[User:Malvineous|Malvineous]] working out which bits to remove to read Cosmo maps. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure&diff=4605Cosmo's Cosmic Adventure2013-04-06T20:03:10Z<p>T-Squared: /* File formats */ I know I tried this before, but I think it might be better to figure out how the attributes for the actors are formatted, so someone can look for a pattern.</p>
<hr />
<div>{{Game Infobox<br />
| Levels = Edit<br />
| Tiles = Edit<br />
| Sprites = Edit<br />
| Fullscreen = Edit<br />
| Sound = Edit<br />
| Music = Edit<br />
| Text = No<br />
| Story = No<br />
| Interface = No<br />
}}<br />
'''Cosmo's Cosmic Adventure''', also known simply as Cosmo, is a three part series chronicling the adventures of Cosmo, a small, green sucker-handed alien boy who is seeking his parents after a meteor collision forces them to land their ship on a dangerous and uncharted planet.<br />
<br />
The Cosmo engine was later updated and used for [[Duke Nukem II]], so the two games share a number of file formats.<br />
<br />
== Tools ==<br />
<br />
{{BeginFileFormatTools|Type=game}}<br />
{{FileFormatTool<br />
| Name = [[Camoto]]<br />
| Platform = Linux console/GUI<br />
| grp = Edit<br />
| map = Edit<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosedit.zip CosEdit]<br />
| Platform = DOS GUI<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosmedit10.zip Cosmo Edit]<br />
| Platform = DOS console<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/textract.zip TExtract]<br />
| Platform = DOS console<br />
| grp = Read<br />
| map = No<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [https://dl.dropbox.com/s/v046qshk3hqs9t9/wombat_04a.zip Wombat]<br />
| Platform = Windows GUI<br />
| grp = Read<br />
| map = Edit (If overwritten)<br />
| gfx = Read & Edit (If overwritten)<br />
| mus = Edit (If overwritten)<br />
| sfx = Read & Edit (If overwritten)<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [https://dl.dropbox.com/u/3940020/COSGRAPH-working.zip Cosgraph]<br />
| Platform = Windows GUI<br />
| grp = Read<br />
| map = No<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = Edit<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{EndFileFormatTools}}<br />
<br />
<br style="clear: both;"/><br />
<br />
== File formats ==<br />
<br />
This section lists the major file formats used in the game.<br />
<br />
{|class="wikitable"<br />
!Use!!Format!!Details<br />
|-<br />
| Backgrounds || [[Raw EGA data#Planar|Full-screen planar EGA]] || 32,000 byte <tt>*.MNI</tt> files are 320x200 full-screen images (in four planes: blue, green, red, intensity). <tt>TITLE1.MNI</tt> is the image on the right, which is in this format.<br />
|-<br />
| Exit screen || [[B800 Text]] || 4000-byte <tt>*.MNI</tt> files are text screens shown at exit (e.g. <tt>NOMEMORY.MNI</tt>)<br />
|-<br />
| Graphics || [[Cosmo Tileset Format]] || <tt>ACTORS.MNI</tt>, <tt>BD*.MNI</tt>, <tt>CARTOON.MNI</tt>, <tt>MASKTILE.MNI</tt>, <tt>PLAYER.MNI</tt> and <tt>TILES.MNI</tt> are all tilesets<br />
|-<br />
| Tile attributes || [[Cosmo Tile Attributes]] || Format of the <tt>TILEATTR.MNI</tt> file<br />
|-<br />
| Group || [[VOL Format]] || group file storing the game data (both the <tt>*.VOL</tt> and <tt>*.STN</tt> files are in this format.)<br />
|-<br />
| Levels || [[Cosmo Level Format]] || <tt>A*.MNI</tt> are game levels.<br />
|-<br />
| Messages || - || Text is contained in the executable in all episodes, but in Cosmo 1 & 2, the executable is compressed by [[LZEXE]], and can be uncompressed with [[UNLZEXE]].<br />
|-<br />
| Music || [[IMF Format]] || Most of the <tt>M*.MNI</tt> files are music files, e.g. <tt>MHAPPY.MNI</tt>) - see [[#Notes]] below<br />
|-<br />
| Sounds || [[Inverse Frequency Sound format]] || <tt>SOUNDSx.MNI</tt> files are in this format, there are three per episode<br />
|-<br />
| Saves || [[Cosmo Savegame Format]] || <tt>COSMOx.SVx</tt> are saved games. <tt>COSMOx.SVT</tt> is a temporary save written at the start of each level<br />
|-<br />
| Tile info || [[Cosmo Tileinfo Format]] || How to lay out the actor tiles. <tt>ACTRINFO.MNI</tt>, <tt>PLYRINFO.MNI</tt> and <tt>CARTINFO.MNI</tt> are in this format<br />
|-<br />
| Actor attributes || [[Actor Attribute Format]] || {{TODO|Research!!}} Attributes for actors hardcoded in the executable. (i.e. hitpoints, what spawns from it, how many points it gives to the player.) <br />
|}<br />
<br />
== Notes ==<br />
<br />
* In the original Cosmo Engine, the graphics memory is allocated after the memory used for storing the IMF file loaded for the current level. This has the unfortunate side effect of corrupting the entire tileset graphics table in memory, turning the graphics into random colours when a complex IMF file is loaded. This is because the data from the IMF file overflows its allocated memory and overwrites the start of the tileset data. Of course this only happens in memory, so the corruption is not permanent upon exiting. The corruption will occur whenever that particular over-sized IMF file is loaded, but the corruption will completely disappear if the IMF file is removed from the [[:Category:Group Files|group file]] or replaced with a less-complex version (i.e. by reducing the number of notes.) This does not appear to affect how the program runs, only affecting the tileset graphics. The overflow limit appears to be around 40K, which is above the size of nearly all Apogee IMF files, but not at the limit of IMF file size (64K for type-1, or effectively unlimited for type-0 as used in Cosmo.)<br />
<br />
* The game reads from the VOL and STN files in preference to the current directory. Any game files in the current directory will not be read while the VOL/STN is present. To modify a file, it will either need to be imported back into the VOL/STN, or the VOL/STN should have its entire contents extracted into the game folder and then be removed or renamed.<br />
<br />
* A directory path (relative to the current directory) can be given on the command line. Any files that the game writes (saved games, high scores, etc.) will be written to this folder instead. This is probably to allow running the game directly from read-only media like a CD.<br />
<br />
[[Category:Apogee]]<br />
[[Category:Sidescroller]]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Level_Format&diff=4604Cosmo Level Format2013-04-06T19:41:36Z<p>T-Squared: /* Level Flags */ Wouldn't "bytes" be more appropriate in this case? (I'm trying to read one of the maps, and it didn't make quite as much sense until I realized that this page is referring to "bytes" instead of "bits"</p>
<hr />
<div>{{Map Infobox<br />
| Type = 2D tile-based<br />
| Layers = 3<br />
| Tile size = 8&times;8<br />
| Viewport = 304&times;144<br />
| Game1 = Cosmo's Cosmic Adventures<br />
}}<br />
<br />
== File format ==<br />
The file is in this basic layout:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iFlags||Flags indicating music, backdrop and other stuff<br />
|-<br />
|UINT16LE iMapWidth||Map width in tiles<br />
|-<br />
|UINT16LE iActorSize||Number of UINT16 values in the actor block<br />
|-<br />
|ACTORDATA actorData[]||Variable-length array of all the actors in the level<br />
|-<br />
|BYTE bgLayer[65528]||The map data for the background layer<br />
|}<br />
<br />
The iMapWidth values in the original Cosmo levels is either 64, 128, 256 or 512. The "view window" in the game is 304x144 Pixels, so the minimal map width would be 38. However, the width must be a power of 2 to work (from 32 to 2048).<br />
<br />
The iActorSize values are reliable for all the original Cosmo level files (Version 1.20).<br />
<br />
The map data is actually sized 65528 Bytes or 32764 Words. Each entry in this block is divisable by 8 (see [[#Mapping cell values to tiles]]).<br />
<br />
=== Level Flags ===<br />
<br />
The structure of the bytes in the iFlags value is as follows:<br />
<br />
[ mmmmm | ppp | yxr | bbbbb ]<br />
<br />
m: music index<br />
p: palette animation type<br />
y: y-scrolling backdrop<br />
x: x-scrolling backdrop<br />
r: rain<br />
b: backdrop index<br />
<br />
The indices for music and backdrop refer to an array of filename strings stored in the executable. You can find them by searching for the first filename in each array. For backdrops, the first filename (index: 0) is <tt>BDBLANK.MNI</tt>, for music it's <tt>MCAVES.MNI</tt>. Note that some backdrop files are not used by the games (and therefore are not not included).<br />
<br />
The palette animation types indicate the following:<br />
<br />
%000: (most levels) no palette changes<br />
%001: (A4) random lightning (with thunder soundeffect)<br />
%010: (C8-C10) cycling: red -> yellow -> white<br />
%011: (A7) cycling: red -> green -> blue<br />
%100: (A8, B3, B4, B7) cycling: black -> grey -> white<br />
%101: (C6, C7) flashing: red -> magenta -> white<br />
%110: (C1) replace dark magenta with black, no animation unless triggered by a bomb actor. (present in Episode 3, Level 1 of Cosmo.)<br />
<br />
=== Background Layer ===<br />
<br />
The <tt>bgLayer</tt> block contains the grid/cell data:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iMapData[32764]||Actual map data<br />
|}<br />
<br />
Each "element" in <tt>iMapData</tt> refers to the foreground and/or background tile used in a single grid cell. The grids are arranged left to right, top to bottom, so the index can be calculated by this formula:<br />
<br />
int iIndex = (y * iMapWidth) + x;<br />
iMapData[iIndex] = <new value to set at x,y><br />
<br />
The map data in the original Cosmo level files is a constant 32764 UINT16LE cells long (65528 bytes), and the engine will never read more than 65535 bytes. However, the game calculates the map height by dividing the width in bytes by 65536:<br />
<br />
int iMapHeight = 32768 / iMapWidth;<br />
<br />
Since the width of the map is always a power of 2 (min. 64), you can see that each file is "missing" 8 Bytes (or 4 Words). That means the last line of the map will always be missing the last 4 tiles. The game ignores that last, incomplete line. However, in one level (A8.MNI), there is an actor placed in that last line. Since actors are saved as individual structures instead of a grid, that actor will still be loaded by the game. But for editing a level, you should make sure the last line is visible, so that it's possible to place actors in that line or remove them from there.<br />
<br />
==== Mapping cell values to tiles ====<br />
<br />
The method of mapping elements in the <tt>iMapData</tt> structure into tiles is fairly straightforward. Each cell value is a pixel index into the tilemap. Imagine the tileset laid out left to right all on the one row. Since each tile is 8x8 pixels, at 16 pixels into the image, the third tile will begin (x = 0 for first tile, x = 8 for second tile, x = 16 for third tile.) The cell value is essentially a pixel x-coordinate into the tileset.<br />
<br />
Note that in the tileset file, the solid tiles are made up of 2000 4-plane (16-colour) images, and these are followed by 1000 5-plane images (16-colour + transparency.) Although separate images, they appear to be concatenated when the game loads them, as the cell value will be zero for the first solid tile, it will be eight for the second solid tile, it will be 15992 for the last solid tile, and it will be 16000 for the first masked tile.<br />
<br />
This means that if the solid and masked tiles have been treated as separate images, a check will need to be performed so that any cell value below 16000 is loaded from the solid tileset, and any value larger than this is loaded from the masked tileset (after subtracting 16000 from the cell value, to put it at zero for the first masked tile.) However, for some reason the values for the masked tiles are at multiples of five tiles (tile #0 (x=0) is the first tile, tile #5 (x=40) is the second tile.) This formula can be used to convert the values into tile numbers once they stray into the masked tile area:<br />
<br />
#define COSMO_TS_SOLID_NUMTILES 2000 // 40x25<br />
#define COSMO_TS_MASKED_NUMTILES 1000 // 40x4<br />
<br />
tile = cell_value / 8<br />
if (tile > COSMO_TS_SOLID_NUMTILES) {<br />
// Once we're in the masked tileset it counts up in multiples of five planes<br />
tile = COSMO_TS_SOLID_NUMTILES + (tile - COSMO_TS_SOLID_NUMTILES) / 5;<br />
}<br />
// Now 'tile' will be between 0 and 2999 inclusive<br />
<br />
As an example of a few tile values:<br />
<br />
{|class="wikitable"<br />
! Cell value !! Tile number !! Tileset !! Index !! Comments<br />
|-<br />
| 0 || 0 || N/A || N/A || See through to map backdrop<br />
|-<br />
| 8 || 1 || Solid || 1 || First solid tile, note increment of 8<br />
|-<br />
| 16 || 2 || Solid || 2 || Second solid tile, increment of 8 again<br />
|-<br />
| 15992 || 1999 || Solid || 1999 || Last solid tile<br />
|-<br />
| 16000 || 2000 || Masked || 0 || First masked tile<br />
|-<br />
| 16040 || 2001 || Masked || 1 || Second masked tile, note increment of 40<br />
|-<br />
| 16080 || 2002 || Masked || 2 || Third masked tile, increment of 40 again<br />
|-<br />
| 55960 || 2999 || Masked || 999 || Last masked tile<br />
|-<br />
| 56000 || N/A || N/A || N/A || Should never get a value this size or larger<br />
|}<br />
<br />
Note that while the cell value cannot be out of range for the solid tiles/background layer (since any values larger than 16000 will be loaded from the masked tileset) the cell values for the masked tileset have no such restriction. (Although obviously out of range tiles will not be drawn correctly by the engine!)<br />
<br />
==== Gotchas ====<br />
<br />
* The first tile in the solid tileset is used as a transparent tile. It will appear completely black if drawn (e.g. in a map editor) however the game does not draw this tile, so any cells with this as the background cell will be where the map backdrop shows through. If you wish to draw the map with the backdrop in-place, remember not to draw tile #0 over the top of the backdrop.<br />
<br />
=== Actor data ===<br />
<br />
The <tt>actorData</tt> block is in the following format:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iType||Type of actor<br />
|-<br />
|UINT16LE iX||X-coordinate of actor (in tile units)<br />
|-<br />
|UINT16LE iY||Y-coordinate of actor (in tile units)<br />
|}<br />
<br />
Because the <tt>iActorSize</tt> value in the header is in UINT16s and there are three UINT16s per actor, the number of actors can be obtained quite simply:<br />
<br />
iNumActors = iActorSize / 3<br />
<br />
This is assuming <tt>iActorSize</tt> is reliable - the original specs from Dave Bollinger indicate this is not always the case for DukeII, but no examples are known at the moment.<br />
<br />
==== Mapping Actor Types to image indices ====<br />
<br />
For the ActorTypes from 32 to 296 (inclusive), you can get an image index from ACTORS.MNI and ACTRINFO.MNI like this:<br />
<br />
ImageIndex = ActorType - 31<br />
<br />
However, this does not work for every ActorType. Some share the same images (e.g.: normal stars and falling stars), some use flipped versions of other images (like the pink eye plants) and some are invisible in the game. In either case, the index in the ACTRINFO.MNI will contain no data. You will either have to include hard-coded info to draw these, or just draw something else (like the actual ActorType as text).<br />
<br />
==== List of Actor Types ====<br />
<br />
This is a list of all the actor types that can be found in the original levels of the three episodes. There might be more ActorTypes that work in the game. For example, 69 is probably the (falling) "Cyan Fruit" item as you can guess by looking at the numbers 62-68.<br />
<br />
0 PLAYER: Cosmo (Starting position facing right)<br />
1 moving platform (fixed path)<br />
2 PLAT/HAZARD: mud fountain 1 (small)<br />
3 PLAT/HAZARD: mud fountain 2 (normal)<br />
4 PLAT/HAZARD: mud fountain 3 (big)<br />
5 PLAT/HAZARD: mud fountain 4 (huge)<br />
6 BRIGHTNESS: left border of light<br />
7 BRIGHTNESS: light source (top center)<br />
8 BRIGHTNESS: right border of light<br />
<br />
22 ??? (only in A8.MNI, doesn't seem to be doing anything)<br />
<br />
32 BONUS: Star (200)<br />
33 PLAT: Floor Spring<br />
34 HAZARD: Extending Arrow Spear (from right to left)<br />
35 HAZARD: Extending Arrow Spear (from left to right)<br />
36 HAZARD: Plasma Fireball (from right to left)<br />
37 HAZARD: Plasma Fireball (from left to right)<br />
38 Blue Switch (on ceiling)<br />
39 Red Switch (on ceiling)<br />
40 Green Switch <br />
41 Yellow Switch<br />
42 Blue Door<br />
43 Red Door<br />
44 Green Door<br />
45 Yellow Door<br />
<br />
47 OBJECT: Blue Mobile Trampoline Car<br />
48 HAZARD: Non-Retracting Spikes<br />
49 HAZARD: Retracting Spikes<br />
<br />
51 HAZARD: Big Saw Blade<br />
<br />
56 HAZARD: Green Pruny Cabbage Ball<br />
<br />
59 BONUS: Power Up (health/12800)<br />
60 BARREL: Power Up (health/12800)<br />
<br />
62 CRATE: Green Tomato<br />
63 BONUS: Green Tomato (falling)<br />
64 CRATE: Tomato (200)<br />
65 BONUS: Tomato (falling)<br />
66 CRATE: Yellow/Cyan Fruit<br />
67 BONUS: Yellow/Cyan Fruit (falling)<br />
68 CRATE: Cyan Fruit<br />
<br />
70 OBJECT: Exit Sign (ends level on touch)<br />
<br />
72 HAZARD: Spear (coming down from ceiling)<br />
73 HAZARD: Leaking Green Acid<br />
74 HAZARD: Dripping Green Acid<br />
75 ENEMY: Plasma Energy Sprites (Blue Flame-like creatures)<br />
76 HAZARD: "Two Tons" Weight going down & up<br />
77 ENEMY: Jumping Bulletheads<br />
78 ENEMY: Stone Heads (Only drops when Cosmo is close by)<br />
79 ENEMY: Big Yellow Spike on ceiling<br />
80 ENEMY: Big Yellow Spike on ceiling (falling down)<br />
81 ENEMY: Big Yellow Spike on ground<br />
82 ENEMY: Ghost<br />
83 CRATE: Green thingy<br />
<br />
85 ENEMY: Angry Moon (blue floating characters)<br />
86 ENEMY: Small Red Plant<br />
87 BARREL: Bomb (100)<br />
88 BONUS: Bomb (100)<br />
<br />
90 OBJECT: switch (1) (Activates moving platform(s))<br />
<br />
92 OBJECT: switch (2) (Activates Question Mark Block Wall Generator)<br />
93 OBJECT: Question Mark Block (Generates a wall when activated by switch)<br />
94 HAZARD: Ground Claw Spikes<br />
95 OBJECT: Rubber Wall (can blow it up, throws Cosmo backwards when touched)<br />
96 ENEMY: Mini Ghost (jumps)<br />
<br />
100 CREATURE: Green Roamer Worm<br />
101 PIPE TRANSIT DIRECTION: Arrow Up<br />
102 PIPE TRANSIT DIRECTION: Arrow Down<br />
103 PIPE TRANSIT DIRECTION: Arrow Left<br />
104 PIPE TRANSIT DIRECTION: Arrow Right<br />
105 ENEMY: Egg Head (special?) -- only 1x: in B2.MNI<br />
106 ENEMY: Egg Head<br />
<br />
109 ENEMY: Robotic Spike on ground<br />
<br />
111 ENEMY: Robotic Spike on ceiling<br />
112 CRATE/BONUS: Burger<br />
<br />
114 ENEMY: Blue/Red plant<br />
<br />
116 BONUS: Purple Grapes (800)<br />
117 ENEMY: Blue Ball<br />
118 ENEMY: Spikes (on left wall)<br />
119 ENEMY: Retracting Spikes (on left wall)<br />
120 ENEMY: Spikes (on right wall)<br />
121 ENEMY: Robot with Blue Vertical Electric Arc<br />
122 PLAT: Blue Platform (splits open when standing on top)<br />
123 ENEMY: Spark<br />
<br />
125 BONUS: Cyan Dancing Mushroom (400)<br />
126 DECO: Pink Eye Plant<br />
127 DECO: Pink Eye Plant (hanging upside down)<br />
<br />
132 ENEMY: Big Red Jumper (MAY ONLY WORK IN COSMO2 & COSMO3.EXE. APPEARS TO BE FROZEN IN COSMO1.EXE)<br />
133 ENEMY: BOSS (Purple Alien in Spike-bottomed ship)<br />
<br />
135 PNEUMATIC PIPES: Exit<br />
136 PNEUMATIC PIPES: Entrance<br />
137 ENEMY: Suction-Cup-Legged Alien<br />
138 OBJECT: Teleporter A<br />
139 OBJECT: Teleporter B<br />
<br />
142 ENEMY: Cyan Spitting Plant (on left wall)<br />
143 ENEMY: Cyan Spitting Plant (on right wall)<br />
144 ENEMY: Blue Turret Alien<br />
145 PLAT: Hoverboard<br />
146 CRATE: pile of green balls<br />
<br />
148 BARREL: Saxophone-like thing<br />
149 ENEMY: Red Chomper Alien<br />
150 CRATE: Salad<br />
151 switch (3) (Possibly deactivates Actors 153 & 154; Energy Beams)<br />
152 switch (4) (Possibly activates lights, if actors 6,7, & 8 are present in level.)<br />
153 HAZARD: Vertical Energy Beam (Deactivated by Switch)<br />
154 HAZARD: Horizontal Energy Beam (Deactivated by Switch)<br />
155 CREATURE/HAZARD: Pink slug/Worm (Turns to bubbling goo when jumped upon)<br />
156 HINT: "These hint globes will help you along your journey. Press the up key to reread them."<br />
157 ENEMY: Silver Robot (pushes player around)<br />
158 ENEMY: Security Robot (shoots flashing bullet, can act as moving floor spring)<br />
<br />
160 PLAT/HAZARD: Dragonfly<br />
161 Crate/Box (can only be destroyed with bombs)<br />
<br />
165 BONUS: Bottle with red liquid<br />
166 BONUS: Green thing<br />
167 BONUS: Blue thing<br />
168 BONUS: Salad?<br />
169 BONUS: Pile of green things<br />
170 BONUS: whatever..<br />
<br />
172 BONUS: blue thing<br />
<br />
174 DECO/BONUS: Satellite<br />
<br />
176 ENEMY: Green Plant<br />
177 BONUS: 5 Yellow Grapes (800)<br />
178 BONUS: Headdress-like object<br />
179 CRATE: with item 178<br />
180 DECO: Jaws & Tongue<br />
181 invisible exit marker (go right to exit)<br />
182 small flame<br />
183 ENEMY: Big Red Plant (spitting Blue Balls/catapult)<br />
<br />
185 BONUS: Blue Crystal (on ground)<br />
186 BONUS: Red Crystal (on ground)<br />
187 BARREL: Red/Green Gem<br />
188 BARREL: Blue Crystal<br />
189 BARREL: Red Crystal<br />
190 BONUS: Green Tomato<br />
191 BONUS: Tomato<br />
192 BONUS: Yellow/Cyan Fruit (200)<br />
193 HAZARD: Clamp Trap<br />
194 PLAT: Blue Cube (falls down when you walk off)<br />
195 MESSAGE: "What's happening? Is Cosmo falling to his doom?"<br />
196 MESSAGE: "Is there no end to this pit? An what danger awaits below?!"<br />
197 Level End Object?<br />
198 CRATE: Root (400)<br />
199 BONUS: Root<br />
200 CRATE: 4 Brown Berries (400)<br />
201 BONUS: 4 Brown Berries<br />
<br />
203 BONUS: Potato-like vegetable<br />
204 BARREL: Green Gem<br />
205 BONUS: Green Gem<br />
206 BARREL: Diamond (3200)<br />
207 BONUS: Diamond<br />
<br />
217 ENEMY: Alien-Eating Space Plant (Exits the current level)<br />
218 ENEMY: Blue Bird<br />
219 OBJECT: Rocket<br />
220 BONUS: Invincibility Cube<br />
221 PLAT: Destructible Pedestal 1 (14 tiles high)<br />
222 PLAT: Destructible Pedestal 2 (20 tiles high)<br />
223 PLAT: Destructible Pedestal 3 (26 tiles high)<br />
224 BARREL: Diamond 2<br />
225 BONUS: Diamond 2 (falling)<br />
226 BARREL: Red Berry<br />
227 BONUS: Red Berry (falling)<br />
228 BARREL: Crystal (800)<br />
229 BONUS: Crystal (falling)<br />
230 BARREL: Blue Gem<br />
231 BONUS: Blue Gem (falling)<br />
<br />
233 DECO: Rocket Exhaust<br />
234 EXIT: Teleporter<br />
235 HINT: "Bump head into switch above!"<br />
236 HINT: "The ice in this cave is very, very slippery."<br />
237 HINT: "Use this shield for temporary invincibility."<br />
238 HINT: "You found a secret area!!! Good Job!"<br />
239 HINT: "In hight places look up to find bonus objects."<br />
240 HINT: "Out of Order..."<br />
241 HINT: "This might be a good time to save your game!"<br />
242 HINT: "Press your up key to use the transporter."<br />
243 HINT: "(1) FOR..."<br />
244 BONUS: Diamond 2<br />
245 BONUS: Red Berry<br />
246 BONUS: Crystal<br />
247 BONUS: Blue Gem (800)<br />
248 PLAT: Ceiling Spring<br />
249 BARREL: Headphones<br />
250 BONUS: Headphones<br />
251 BONUS: Headphones (falling)<br />
252 OBJECT: Frozen Duke NukUm<br />
<br />
254 BONUS: 3 Bananas (800)<br />
255 CRATE: Alien Raisin<br />
256 BONUS: Alien Raisin (400)<br />
<br />
258 CRATE: Brown Pear<br />
259 BONUS: Brown Pear<br />
<br />
261 CRATE: Alien Chili Pepper<br />
262 BONUS: Alien Chili Pepper (400)<br />
<br />
264 DANGER: Flame (<-)<br />
265 DANGER: Flame (->)<br />
<br />
267 HAZARD: Leaking Red acid<br />
268 HAZARD: Dripping Red Acid<br />
269 HINT: "(2) EXTRA..."<br />
270 HINT: "(3) POINTS,..."<br />
271 HINT: "(4) DESTROY..."<br />
272 HINT: "(5) HINT..."<br />
273 HINT: "(6) GLOBES!!!"<br />
274 HINT: "The Clam Plants won't hurt you if their mouths are closed."+Clam Sprite<br />
<br />
278 DECO: Big Mouth (end of E1/start of E2)<br />
279 DECO: Normal Smoke Rising<br />
280 DECO: Big Smoke rising<br />
281 EXIT: Horizontal Exit Marker (Invisible)<br />
<br />
283 BONUS: Red Crystal on ceiling<br />
284 HINT: "Collect the STARS to advance to BONUS STAGES."<br />
285 HINT: "Some creatures require more than one pounce to defeat!"<br />
286 HINT: "Cosmo can climb wall's with his suction hands."+CosmoWallSprite<br />
<br />
294 BONUS: Power Up Module (falling) (health/12800)<br />
295 BONUS: Star (falling) (200)<br />
296 end of episode 2 trigger?<br />
<br />
The hint texts are the messages you get in episode 1, the other episodes have different (and less!) messages. The later hint globes probably don't work in those episodes.<br />
<br />
== Credits ==<br />
<br />
This file format was reverse engineered by [http://www.geocities.com/dooknookimklassik/ Dave Bollinger]. Most of this info came from the [http://www.geocities.com/dooknookimklassik/dn2specs.txt Duke II specs on his website], with [[User:Malvineous|Malvineous]] working out which bits to remove to read Cosmo maps. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure&diff=4602Cosmo's Cosmic Adventure2013-04-06T13:46:42Z<p>T-Squared: Ladies and Gentlemen, I present to you a working copy of Wombat Game Tools, for your editing pleasure!</p>
<hr />
<div>{{Game Infobox<br />
| Levels = Edit<br />
| Tiles = Edit<br />
| Sprites = Edit<br />
| Fullscreen = Edit<br />
| Sound = Edit<br />
| Music = Edit<br />
| Text = No<br />
| Story = No<br />
| Interface = No<br />
}}<br />
'''Cosmo's Cosmic Adventure''', also known simply as Cosmo, is a three part series chronicling the adventures of Cosmo, a small, green sucker-handed alien boy who is seeking his parents after a meteor collision forces them to land their ship on a dangerous and uncharted planet.<br />
<br />
The Cosmo engine was later updated and used for [[Duke Nukem II]], so the two games share a number of file formats.<br />
<br />
== Tools ==<br />
<br />
{{BeginFileFormatTools|Type=game}}<br />
{{FileFormatTool<br />
| Name = [[Camoto]]<br />
| Platform = Linux console/GUI<br />
| grp = Edit<br />
| map = Edit<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosedit.zip CosEdit]<br />
| Platform = DOS GUI<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/cosmedit10.zip Cosmo Edit]<br />
| Platform = DOS console<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [http://www.shikadi.net/wiki/files/moddingwiki/tools/cosmo/textract.zip TExtract]<br />
| Platform = DOS console<br />
| grp = Read<br />
| map = No<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [https://dl.dropbox.com/s/v046qshk3hqs9t9/wombat_04a.zip Wombat]<br />
| Platform = Windows GUI<br />
| grp = Read<br />
| map = Edit (If overwritten)<br />
| gfx = Read & Edit (If overwritten)<br />
| mus = Edit (If overwritten)<br />
| sfx = Read & Edit (If overwritten)<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = [https://dl.dropbox.com/u/3940020/COSGRAPH-working.zip Cosgraph]<br />
| Platform = Windows GUI<br />
| grp = Read<br />
| map = No<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = Edit<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{EndFileFormatTools}}<br />
<br />
<br style="clear: both;"/><br />
<br />
== File formats ==<br />
<br />
This section lists the major file formats used in the game.<br />
<br />
{|class="wikitable"<br />
!Use!!Format!!Details<br />
|-<br />
| Backgrounds || [[Raw EGA data#Planar|Full-screen planar EGA]] || 32,000 byte <tt>*.MNI</tt> files are 320x200 full-screen images (in four planes: blue, green, red, intensity). <tt>TITLE1.MNI</tt> is the image on the right, which is in this format.<br />
|-<br />
| Exit screen || [[B800 Text]] || 4000-byte <tt>*.MNI</tt> files are text screens shown at exit (e.g. <tt>NOMEMORY.MNI</tt>)<br />
|-<br />
| Graphics || [[Cosmo Tileset Format]] || <tt>ACTORS.MNI</tt>, <tt>BD*.MNI</tt>, <tt>CARTOON.MNI</tt>, <tt>MASKTILE.MNI</tt>, <tt>PLAYER.MNI</tt> and <tt>TILES.MNI</tt> are all tilesets<br />
|-<br />
| Tile attributes || [[Cosmo Tile Attributes]] || Format of the <tt>TILEATTR.MNI</tt> file<br />
|-<br />
| Group || [[VOL Format]] || group file storing the game data (both the <tt>*.VOL</tt> and <tt>*.STN</tt> files are in this format.)<br />
|-<br />
| Levels || [[Cosmo Level Format]] || <tt>A*.MNI</tt> are game levels.<br />
|-<br />
| Messages || - || Text is contained in the executable in all episodes, but in Cosmo 1 & 2, the executable is compressed by [[LZEXE]], and can be uncompressed with [[UNLZEXE]].<br />
|-<br />
| Music || [[IMF Format]] || Most of the <tt>M*.MNI</tt> files are music files, e.g. <tt>MHAPPY.MNI</tt>) - see [[#Notes]] below<br />
|-<br />
| Sounds || [[Inverse Frequency Sound format]] || <tt>SOUNDSx.MNI</tt> files are in this format, there are three per episode<br />
|-<br />
| Saves || [[Cosmo Savegame Format]] || <tt>COSMOx.SVx</tt> are saved games. <tt>COSMOx.SVT</tt> is a temporary save written at the start of each level<br />
|-<br />
| Tile info || [[Cosmo Tileinfo Format]] || How to lay out the actor tiles. <tt>ACTRINFO.MNI</tt>, <tt>PLYRINFO.MNI</tt> and <tt>CARTINFO.MNI</tt> are in this format<br />
|}<br />
<br />
== Notes ==<br />
<br />
* In the original Cosmo Engine, the graphics memory is allocated after the memory used for storing the IMF file loaded for the current level. This has the unfortunate side effect of corrupting the entire tileset graphics table in memory, turning the graphics into random colours when a complex IMF file is loaded. This is because the data from the IMF file overflows its allocated memory and overwrites the start of the tileset data. Of course this only happens in memory, so the corruption is not permanent upon exiting. The corruption will occur whenever that particular over-sized IMF file is loaded, but the corruption will completely disappear if the IMF file is removed from the [[:Category:Group Files|group file]] or replaced with a less-complex version (i.e. by reducing the number of notes.) This does not appear to affect how the program runs, only affecting the tileset graphics. The overflow limit appears to be around 40K, which is above the size of nearly all Apogee IMF files, but not at the limit of IMF file size (64K for type-1, or effectively unlimited for type-0 as used in Cosmo.)<br />
<br />
* The game reads from the VOL and STN files in preference to the current directory. Any game files in the current directory will not be read while the VOL/STN is present. To modify a file, it will either need to be imported back into the VOL/STN, or the VOL/STN should have its entire contents extracted into the game folder and then be removed or renamed.<br />
<br />
* A directory path (relative to the current directory) can be given on the command line. Any files that the game writes (saved games, high scores, etc.) will be written to this folder instead. This is probably to allow running the game directly from read-only media like a CD.<br />
<br />
[[Category:Apogee]]<br />
[[Category:Sidescroller]]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Savegame_Format&diff=4594Cosmo Savegame Format2013-03-31T05:40:01Z<p>T-Squared: Started study of the Cosmo Savegame Format. Found where the score is stored, and what format the save file is stored as.</p>
<hr />
<div>The '''Cosmo Savegame Format''' is an uncompressed file with extension .SV# (where # is a number from 1 to 9), used to store savegame information to be retrieved later by the game engine.<br />
<br />
The file is stored in Big-endian format as such:<br />
<br />
$0000: (Unknown)<br />
$0001: (Unknown)<br />
$0002-$0007: Saved Score (possibly)<br />
(More to follow)</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure&diff=4593Cosmo's Cosmic Adventure2013-03-31T05:24:47Z<p>T-Squared: Oops, missed a glitch I added.</p>
<hr />
<div>{{Game Infobox<br />
| Levels = Edit<br />
| Tiles = Edit<br />
| Sprites = No<br />
| Fullscreen = Edit<br />
| Sound = No<br />
| Music = Edit<br />
| Text = No<br />
| Story = No<br />
| Interface = No<br />
}}<br />
'''Cosmo's Cosmic Adventure''', also known simply as Cosmo, is a three part series chronicling the adventures of Cosmo, a small, green sucker-handed alien boy who is seeking his parents after a meteor collision forces them to land their ship on a dangerous and uncharted planet.<br />
<br />
The Cosmo engine was later updated and used for [[Duke Nukem II]], so the two games share a number of file formats.<br />
<br />
== Tools ==<br />
<br />
{{BeginFileFormatTools|Type=game}}<br />
{{FileFormatTool<br />
| Name = [[Camoto]]<br />
| Platform = Linux console/GUI<br />
| grp = Edit<br />
| map = Edit<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = CosEdit<br />
| Platform = DOS GUI<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = Wombat<br />
| Platform = Windows GUI<br />
| grp = Read<br />
| map = Read<br />
| gfx = Read<br />
| mus = Read<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{EndFileFormatTools}}<br />
<br />
<br style="clear: both;"/><br />
== File formats ==<br />
<br />
This section lists the major file formats used in the game.<br />
<br />
{|class="wikitable"<br />
!Use!!Format!!Details<br />
|-<br />
| Backgrounds || [[Raw EGA data#Planar|Full-screen planar EGA]] || 32,000 byte <tt>*.MNI</tt> files are 320x200 full-screen images (in four planes: blue, green, red, intensity). <tt>TITLE1.MNI</tt> is the image on the right, which is in this format.<br />
|-<br />
| Exit screen || [[B800 Text]] || 4000-byte <tt>*.MNI</tt> files are text screens shown at exit (e.g. <tt>NOMEMORY.MNI</tt>)<br />
|-<br />
| Graphics || [[Cosmo Tileset Format]] || <tt>ACTORS.MNI</tt>, <tt>BD*.MNI</tt>, <tt>CARTOON.MNI</tt>, <tt>MASKTILE.MNI</tt>, <tt>PLAYER.MNI</tt> and <tt>TILES.MNI</tt> are all tilesets<br />
|-<br />
| Tile attributes || [[Cosmo Tile Attributes]] || Format of the <tt>TILEATTR.MNI</tt> file<br />
|-<br />
| Group || [[VOL Format]] || group file storing the game data (both the <tt>*.VOL</tt> and <tt>*.STN</tt> files are in this format.)<br />
|-<br />
| Levels || [[Cosmo Level Format]] || <tt>A*.MNI</tt> are game levels.<br />
|-<br />
| Messages || - || Text is contained in the executable in all episodes, but in Cosmo 1 & 2, the executable is compressed by [[LZEXE]], and can be uncompressed with [[UNLZEXE]].<br />
|-<br />
| Music || [[IMF Format]] || Most of the <tt>M*.MNI</tt> files are music files, e.g. <tt>MHAPPY.MNI</tt>) - see [[#Notes]] below<br />
|-<br />
| Sounds || [[Inverse Frequency Sound format]] || <tt>SOUNDSx.MNI</tt> files are in this format, there are three per episode<br />
|-<br />
| Saves || [[Cosmo Savegame Format]] || <tt>COSMOx.SVx</tt> are saved games. <tt>COSMOx.SVT</tt> is a temporary save written at the start of each level<br />
|-<br />
| Tile info || [[Cosmo Tileinfo Format]] || How to lay out the actor tiles. <tt>ACTRINFO.MNI</tt>, <tt>PLYRINFO.MNI</tt> and <tt>CARTINFO.MNI</tt> are in this format<br />
|-<br />
| Executable Engine Data || [[Cosmo Executable Engine Format]] || The .EXE engine that Cosmo's Cosmic Adventure runs on, and various hard-coded game attributes, such as in-game messages and hints, or actor stats.<br />
|}<br />
<br />
== Notes ==<br />
<br />
* In the original Cosmo Engine, the graphics memory is allocated after the memory used for storing the IMF file loaded for the current level. This has the unfortunate side effect of corrupting the entire tileset graphics table in memory, turning the graphics into random colours when a complex IMF file is loaded. This is because the data from the IMF file overflows its allocated memory and overwrites the start of the tileset data. Of course this only happens in memory, so the corruption is not permanent upon exiting. The corruption will occur whenever that particular over-sized IMF file is loaded, but the corruption will completely disappear if the IMF file is removed from the [[:Category:Group Files|group file]] or replaced with a less-complex version (i.e. by reducing the number of notes.) This does not appear to affect how the program runs, only affecting the tileset graphics. The overflow limit appears to be around 40K, which is above the size of nearly all Apogee IMF files, but not at the limit of IMF file size (64K for type-1, or effectively unlimited for type-0 as used in Cosmo.)<br />
<br />
* The game reads from the VOL and STN files in preference to the current directory. Any game files in the current directory will not be read while the VOL/STN is present. To modify a file, it will either need to be imported back into the VOL/STN, or the VOL/STN should have its entire contents extracted into the game folder and then be removed or renamed.<br />
<br />
* A directory path (relative to the current directory) can be given on the command line. Any files that the game writes (saved games, high scores, etc.) will be written to this folder instead. This is probably to allow running the game directly from read-only media like a CD.<br />
<br />
[[Category:Apogee]]<br />
[[Category:Sidescroller]]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure&diff=4592Cosmo's Cosmic Adventure2013-03-31T05:23:56Z<p>T-Squared: I don't know if this is too hard to put together, or if it's not needed, but I just put this executable engine section here for anyone who needs it.</p>
<hr />
<div>{{Game Infobox<br />
| Levels = Edit<br />
| Tiles = Edit<br />
| Sprites = No<br />
| Fullscreen = Edit<br />
| Sound = No<br />
| Music = Edit<br />
| Text = No<br />
| Story = No<br />
| Interface = No<br />
}}<br />
'''Cosmo's Cosmic Adventure''', also known simply as Cosmo, is a three part series chronicling the adventures of Cosmo, a small, green sucker-handed alien boy who is seeking his parents after a meteor collision forces them to land their ship on a dangerous and uncharted planet.<br />
<br />
The Cosmo engine was later updated and used for [[Duke Nukem II]], so the two games share a number of file formats.<br />
<br />
== Tools ==<br />
<br />
{{BeginFileFormatTools|Type=game}}<br />
{{FileFormatTool<br />
| Name = [[Camoto]]<br />
| Platform = Linux console/GUI<br />
| grp = Edit<br />
| map = Edit<br />
| gfx = Edit<br />
| mus = Edit<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = CosEdit<br />
| Platform = DOS GUI<br />
| grp = No<br />
| map = Edit<br />
| gfx = No<br />
| mus = No<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{FileFormatTool<br />
| Name = Wombat<br />
| Platform = Windows GUI<br />
| grp = Read<br />
| map = Read<br />
| gfx = Read<br />
| mus = Read<br />
| sfx = No<br />
| txt = No<br />
| sav = No<br />
| exe = No<br />
}}<br />
{{EndFileFormatTools}}<br />
<br />
<br style="clear: both;"/><br />
== File formats ==<br />
<br />
This section lists the major file formats used in the game.<br />
<br />
{|class="wikitable"<br />
!Use!!Format!!Details<br />
|-<br />
| Backgrounds || [[Raw EGA data#Planar|Full-screen planar EGA]] || 32,000 byte <tt>*.MNI</tt> files are 320x200 full-screen images (in four planes: blue, green, red, intensity). <tt>TITLE1.MNI</tt> is the image on the right, which is in this format.<br />
|-<br />
| Exit screen || [[B800 Text]] || 4000-byte <tt>*.MNI</tt> files are text screens shown at exit (e.g. <tt>NOMEMORY.MNI</tt>)<br />
|-<br />
| Graphics || [[Cosmo Tileset Format]] || <tt>ACTORS.MNI</tt>, <tt>BD*.MNI</tt>, <tt>CARTOON.MNI</tt>, <tt>MASKTILE.MNI</tt>, <tt>PLAYER.MNI</tt> and <tt>TILES.MNI</tt> are all tilesets<br />
|-<br />
| Tile attributes || [[Cosmo Tile Attributes]] || Format of the <tt>TILEATTR.MNI</tt> file<br />
|-<br />
| Group || [[VOL Format]] || group file storing the game data (both the <tt>*.VOL</tt> and <tt>*.STN</tt> files are in this format.)<br />
|-<br />
| Levels || [[Cosmo Level Format]] || <tt>A*.MNI</tt> are game levels.<br />
|-<br />
| Messages || - || Text is contained in the executable in all episodes, but in Cosmo 1 & 2, the executable is compressed by [[LZEXE]], and can be uncompressed with [[UNLZEXE]].<br />
|-<br />
| Music || [[IMF Format]] || Most of the <tt>M*.MNI</tt> files are music files, e.g. <tt>MHAPPY.MNI</tt>) - see [[#Notes]] below<br />
|-<br />
| Sounds || [[Inverse Frequency Sound format]] || <tt>SOUNDSx.MNI</tt> files are in this format, there are three per episode<br />
|-<br />
| Saves || [[Cosmo Savegame Format]] || <tt>COSMOx.SVx</tt> are saved games. <tt>COSMOx.SVT</tt> is a temporary save written at the start of each level<br />
|-<br />
| Tile info || [[Cosmo Tileinfo Format]] || How to lay out the actor tiles. <tt>ACTRINFO.MNI</tt>, <tt>PLYRINFO.MNI</tt> and <tt>CARTINFO.MNI</tt> are in this format<br />
|-<br />
| Executable Engine Data || [[Cosmo Executable Engine Format]] || The .EXE engine that Cosmo's Cosmic Adventure runs on, and various hard-coded game attributes, such as in-game messages and hints, or actor stats.|}<br />
<br />
== Notes ==<br />
<br />
* In the original Cosmo Engine, the graphics memory is allocated after the memory used for storing the IMF file loaded for the current level. This has the unfortunate side effect of corrupting the entire tileset graphics table in memory, turning the graphics into random colours when a complex IMF file is loaded. This is because the data from the IMF file overflows its allocated memory and overwrites the start of the tileset data. Of course this only happens in memory, so the corruption is not permanent upon exiting. The corruption will occur whenever that particular over-sized IMF file is loaded, but the corruption will completely disappear if the IMF file is removed from the [[:Category:Group Files|group file]] or replaced with a less-complex version (i.e. by reducing the number of notes.) This does not appear to affect how the program runs, only affecting the tileset graphics. The overflow limit appears to be around 40K, which is above the size of nearly all Apogee IMF files, but not at the limit of IMF file size (64K for type-1, or effectively unlimited for type-0 as used in Cosmo.)<br />
<br />
* The game reads from the VOL and STN files in preference to the current directory. Any game files in the current directory will not be read while the VOL/STN is present. To modify a file, it will either need to be imported back into the VOL/STN, or the VOL/STN should have its entire contents extracted into the game folder and then be removed or renamed.<br />
<br />
* A directory path (relative to the current directory) can be given on the command line. Any files that the game writes (saved games, high scores, etc.) will be written to this folder instead. This is probably to allow running the game directly from read-only media like a CD.<br />
<br />
[[Category:Apogee]]<br />
[[Category:Sidescroller]]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Level_Format&diff=4559Cosmo Level Format2013-03-07T01:47:15Z<p>T-Squared: /* List of Actor Types */</p>
<hr />
<div>{{Map Infobox<br />
| Type = 2D tile-based<br />
| Layers = 3<br />
| Tile size = 8&times;8<br />
| Viewport = 304&times;144<br />
| Game1 = Cosmo's Cosmic Adventures<br />
}}<br />
<br />
== File format ==<br />
The file is in this basic layout:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iFlags||Flags indicating music, backdrop and other stuff<br />
|-<br />
|UINT16LE iMapWidth||Map width in tiles<br />
|-<br />
|UINT16LE iActorSize||Number of UINT16 values in the actor block<br />
|-<br />
|ACTORDATA actorData[]||Variable-length array of all the actors in the level<br />
|-<br />
|BYTE bgLayer[65528]||The map data for the background layer<br />
|}<br />
<br />
The iMapWidth values in the original Cosmo levels is either 64, 128, 256 or 512. The "view window" in the game is 304x144 Pixels, so the minimal map width would be 38. However, the width must be a power of 2 to work (from 32 to 2048).<br />
<br />
The iActorSize values are reliable for all the original Cosmo level files (Version 1.20).<br />
<br />
The map data is actually sized 65528 Bytes or 32764 Words. Each entry in this block is divisable by 8 (see [[#Mapping cell values to tiles]]).<br />
<br />
=== Level Flags ===<br />
<br />
The structure of the bits in the iFlags value is as follows:<br />
<br />
[ mmmmm | ppp | yxr | bbbbb ]<br />
<br />
m: music index<br />
p: palette animation type<br />
y: y-scrolling backdrop<br />
x: x-scrolling backdrop<br />
r: rain<br />
b: backdrop index<br />
<br />
The indices for music and backdrop refer to an array of filename strings stored in the executable. You can find them by searching for the first filename in each array. For backdrops, the first filename (index: 0) is <tt>BDBLANK.MNI</tt>, for music it's <tt>MCAVES.MNI</tt>. Note that some backdrop files are not used by the games (and therefore are not not included).<br />
<br />
The palette animation types indicate the following:<br />
<br />
%000: (most levels) no palette changes<br />
%001: (A4) random lightning (with thunder soundeffect)<br />
%010: (C8-C10) cycling: red -> yellow -> white<br />
%011: (A7) cycling: red -> green -> blue<br />
%100: (A8, B3, B4, B7) cycling: black -> grey -> white<br />
%101: (C6, C7) flashing: red -> magenta -> white<br />
%110: (C1) replace dark magenta with black, no animation unless triggered by a bomb actor. (present in Episode 3, Level 1 of Cosmo.)<br />
<br />
=== Background Layer ===<br />
<br />
The <tt>bgLayer</tt> block contains the grid/cell data:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iMapData[32764]||Actual map data<br />
|}<br />
<br />
Each "element" in <tt>iMapData</tt> refers to the foreground and/or background tile used in a single grid cell. The grids are arranged left to right, top to bottom, so the index can be calculated by this formula:<br />
<br />
int iIndex = (y * iMapWidth) + x;<br />
iMapData[iIndex] = <new value to set at x,y><br />
<br />
The map data in the original Cosmo level files is a constant 32764 UINT16LE cells long (65528 bytes), and the engine will never read more than 65535 bytes. However, the game calculates the map height by dividing the width in bytes by 65536:<br />
<br />
int iMapHeight = 32768 / iMapWidth;<br />
<br />
Since the width of the map is always a power of 2 (min. 64), you can see that each file is "missing" 8 Bytes (or 4 Words). That means the last line of the map will always be missing the last 4 tiles. The game ignores that last, incomplete line. However, in one level (A8.MNI), there is an actor placed in that last line. Since actors are saved as individual structures instead of a grid, that actor will still be loaded by the game. But for editing a level, you should make sure the last line is visible, so that it's possible to place actors in that line or remove them from there.<br />
<br />
==== Mapping cell values to tiles ====<br />
<br />
The method of mapping elements in the <tt>iMapData</tt> structure into tiles is fairly straightforward. Each cell value is a pixel index into the tilemap. Imagine the tileset laid out left to right all on the one row. Since each tile is 8x8 pixels, at 16 pixels into the image, the third tile will begin (x = 0 for first tile, x = 8 for second tile, x = 16 for third tile.) The cell value is essentially a pixel x-coordinate into the tileset.<br />
<br />
Note that in the tileset file, the solid tiles are made up of 2000 4-plane (16-colour) images, and these are followed by 1000 5-plane images (16-colour + transparency.) Although separate images, they appear to be concatenated when the game loads them, as the cell value will be zero for the first solid tile, it will be eight for the second solid tile, it will be 15992 for the last solid tile, and it will be 16000 for the first masked tile.<br />
<br />
This means that if the solid and masked tiles have been treated as separate images, a check will need to be performed so that any cell value below 16000 is loaded from the solid tileset, and any value larger than this is loaded from the masked tileset (after subtracting 16000 from the cell value, to put it at zero for the first masked tile.) However, for some reason the values for the masked tiles are at multiples of five tiles (tile #0 (x=0) is the first tile, tile #5 (x=40) is the second tile.) This formula can be used to convert the values into tile numbers once they stray into the masked tile area:<br />
<br />
#define COSMO_TS_SOLID_NUMTILES 2000 // 40x25<br />
#define COSMO_TS_MASKED_NUMTILES 1000 // 40x4<br />
<br />
tile = cell_value / 8<br />
if (tile > COSMO_TS_SOLID_NUMTILES) {<br />
// Once we're in the masked tileset it counts up in multiples of five planes<br />
tile = COSMO_TS_SOLID_NUMTILES + (tile - COSMO_TS_SOLID_NUMTILES) / 5;<br />
}<br />
// Now 'tile' will be between 0 and 2999 inclusive<br />
<br />
As an example of a few tile values:<br />
<br />
{|class="wikitable"<br />
! Cell value !! Tile number !! Tileset !! Index !! Comments<br />
|-<br />
| 0 || 0 || N/A || N/A || See through to map backdrop<br />
|-<br />
| 8 || 1 || Solid || 1 || First solid tile, note increment of 8<br />
|-<br />
| 16 || 2 || Solid || 2 || Second solid tile, increment of 8 again<br />
|-<br />
| 15992 || 1999 || Solid || 1999 || Last solid tile<br />
|-<br />
| 16000 || 2000 || Masked || 0 || First masked tile<br />
|-<br />
| 16040 || 2001 || Masked || 1 || Second masked tile, note increment of 40<br />
|-<br />
| 16080 || 2002 || Masked || 2 || Third masked tile, increment of 40 again<br />
|-<br />
| 55960 || 2999 || Masked || 999 || Last masked tile<br />
|-<br />
| 56000 || N/A || N/A || N/A || Should never get a value this size or larger<br />
|}<br />
<br />
Note that while the cell value cannot be out of range for the solid tiles/background layer (since any values larger than 16000 will be loaded from the masked tileset) the cell values for the masked tileset have no such restriction. (Although obviously out of range tiles will not be drawn correctly by the engine!)<br />
<br />
==== Gotchas ====<br />
<br />
* The first tile in the solid tileset is used as a transparent tile. It will appear completely black if drawn (e.g. in a map editor) however the game does not draw this tile, so any cells with this as the background cell will be where the map backdrop shows through. If you wish to draw the map with the backdrop in-place, remember not to draw tile #0 over the top of the backdrop.<br />
<br />
=== Actor data ===<br />
<br />
The <tt>actorData</tt> block is in the following format:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iType||Type of actor<br />
|-<br />
|UINT16LE iX||X-coordinate of actor (in tile units)<br />
|-<br />
|UINT16LE iY||Y-coordinate of actor (in tile units)<br />
|}<br />
<br />
Because the <tt>iActorSize</tt> value in the header is in UINT16s and there are three UINT16s per actor, the number of actors can be obtained quite simply:<br />
<br />
iNumActors = iActorSize / 3<br />
<br />
This is assuming <tt>iActorSize</tt> is reliable - the original specs from Dave Bollinger indicate this is not always the case for DukeII, but no examples are known at the moment.<br />
<br />
==== Mapping Actor Types to image indices ====<br />
<br />
For the ActorTypes from 32 to 296 (inclusive), you can get an image index from ACTORS.MNI and ACTRINFO.MNI like this:<br />
<br />
ImageIndex = ActorType - 31<br />
<br />
However, this does not work for every ActorType. Some share the same images (e.g.: normal stars and falling stars), some use flipped versions of other images (like the pink eye plants) and some are invisible in the game. In either case, the index in the ACTRINFO.MNI will contain no data. You will either have to include hard-coded info to draw these, or just draw something else (like the actual ActorType as text).<br />
<br />
==== List of Actor Types ====<br />
<br />
This is a list of all the actor types that can be found in the original levels of the three episodes. There might be more ActorTypes that work in the game. For example, 69 is probably the (falling) "Cyan Fruit" item as you can guess by looking at the numbers 62-68.<br />
<br />
0 PLAYER: Cosmo (Starting position facing right)<br />
1 moving platform (fixed path)<br />
2 PLAT/HAZARD: mud fountain 1 (small)<br />
3 PLAT/HAZARD: mud fountain 2 (normal)<br />
4 PLAT/HAZARD: mud fountain 3 (big)<br />
5 PLAT/HAZARD: mud fountain 4 (huge)<br />
6 BRIGHTNESS: left border of light<br />
7 BRIGHTNESS: light source (top center)<br />
8 BRIGHTNESS: right border of light<br />
<br />
22 ??? (only in A8.MNI, doesn't seem to be doing anything)<br />
<br />
32 BONUS: Star (200)<br />
33 PLAT: Floor Spring<br />
34 HAZARD: Extending Arrow Spear (from right to left)<br />
35 HAZARD: Extending Arrow Spear (from left to right)<br />
36 HAZARD: Plasma Fireball (from right to left)<br />
37 HAZARD: Plasma Fireball (from left to right)<br />
38 Blue Switch (on ceiling)<br />
39 Red Switch (on ceiling)<br />
40 Green Switch <br />
41 Yellow Switch<br />
42 Blue Door<br />
43 Red Door<br />
44 Green Door<br />
45 Yellow Door<br />
<br />
47 OBJECT: Blue Mobile Trampoline Car<br />
48 HAZARD: Non-Retracting Spikes<br />
49 HAZARD: Retracting Spikes<br />
<br />
51 HAZARD: Big Saw Blade<br />
<br />
56 HAZARD: Green Pruny Cabbage Ball<br />
<br />
59 BONUS: Power Up (health/12800)<br />
60 BARREL: Power Up (health/12800)<br />
<br />
62 CRATE: Green Tomato<br />
63 BONUS: Green Tomato (falling)<br />
64 CRATE: Tomato (200)<br />
65 BONUS: Tomato (falling)<br />
66 CRATE: Yellow/Cyan Fruit<br />
67 BONUS: Yellow/Cyan Fruit (falling)<br />
68 CRATE: Cyan Fruit<br />
<br />
70 OBJECT: Exit Sign (ends level on touch)<br />
<br />
72 HAZARD: Spear (coming down from ceiling)<br />
73 HAZARD: Leaking Green Acid<br />
74 HAZARD: Dripping Green Acid<br />
75 ENEMY: Plasma Energy Sprites (Blue Flame-like creatures)<br />
76 HAZARD: "Two Tons" Weight going down & up<br />
77 ENEMY: Jumping Bulletheads<br />
78 ENEMY: Stone Heads (Only drops when Cosmo is close by)<br />
79 ENEMY: Big Yellow Spike on ceiling<br />
80 ENEMY: Big Yellow Spike on ceiling (falling down)<br />
81 ENEMY: Big Yellow Spike on ground<br />
82 ENEMY: Ghost<br />
83 CRATE: Green thingy<br />
<br />
85 ENEMY: Angry Moon (blue floating characters)<br />
86 ENEMY: Small Red Plant<br />
87 BARREL: Bomb (100)<br />
88 BONUS: Bomb (100)<br />
<br />
90 OBJECT: switch (1) (Activates moving platform(s))<br />
<br />
92 OBJECT: switch (2) (Activates Question Mark Block Wall Generator)<br />
93 OBJECT: Question Mark Block (Generates a wall when activated by switch)<br />
94 HAZARD: Ground Claw Spikes<br />
95 OBJECT: Rubber Wall (can blow it up, throws Cosmo backwards when touched)<br />
96 ENEMY: Mini Ghost (jumps)<br />
<br />
100 CREATURE: Green Roamer Worm<br />
101 PIPE TRANSIT DIRECTION: Arrow Up<br />
102 PIPE TRANSIT DIRECTION: Arrow Down<br />
103 PIPE TRANSIT DIRECTION: Arrow Left<br />
104 PIPE TRANSIT DIRECTION: Arrow Right<br />
105 ENEMY: Egg Head (special?) -- only 1x: in B2.MNI<br />
106 ENEMY: Egg Head<br />
<br />
109 ENEMY: Robotic Spike on ground<br />
<br />
111 ENEMY: Robotic Spike on ceiling<br />
112 CRATE/BONUS: Burger<br />
<br />
114 ENEMY: Blue/Red plant<br />
<br />
116 BONUS: Purple Grapes (800)<br />
117 ENEMY: Blue Ball<br />
118 ENEMY: Spikes (on left wall)<br />
119 ENEMY: Retracting Spikes (on left wall)<br />
120 ENEMY: Spikes (on right wall)<br />
121 ENEMY: Robot with Blue Vertical Electric Arc<br />
122 PLAT: Blue Platform (splits open when standing on top)<br />
123 ENEMY: Spark<br />
<br />
125 BONUS: Cyan Dancing Mushroom (400)<br />
126 DECO: Pink Eye Plant<br />
127 DECO: Pink Eye Plant (hanging upside down)<br />
<br />
132 ENEMY: Big Red Jumper (MAY ONLY WORK IN COSMO2 & COSMO3.EXE. APPEARS TO BE FROZEN IN COSMO1.EXE)<br />
133 ENEMY: BOSS (Purple Alien in Spike-bottomed ship)<br />
<br />
135 PNEUMATIC PIPES: Exit<br />
136 PNEUMATIC PIPES: Entrance<br />
137 ENEMY: Suction-Cup-Legged Alien<br />
138 OBJECT: Teleporter A<br />
139 OBJECT: Teleporter B<br />
<br />
142 ENEMY: Cyan Spitting Plant (on left wall)<br />
143 ENEMY: Cyan Spitting Plant (on right wall)<br />
144 ENEMY: Blue Turret Alien<br />
145 PLAT: Hoverboard<br />
146 CRATE: pile of green balls<br />
<br />
148 BARREL: Saxophone-like thing<br />
149 ENEMY: Red Chomper Alien<br />
150 CRATE: Salad<br />
151 switch (3) (Possibly deactivates Actors 153 & 154; Energy Beams)<br />
152 switch (4) (Possibly activates lights, if actors 6,7, & 8 are present in level.)<br />
153 HAZARD: Vertical Energy Beam (Deactivated by Switch)<br />
154 HAZARD: Horizontal Energy Beam (Deactivated by Switch)<br />
155 CREATURE/HAZARD: Pink slug/Worm (Turns to bubbling goo when jumped upon)<br />
156 HINT: "These hint globes will help you along your journey. Press the up key to reread them."<br />
157 ENEMY: Silver Robot (pushes player around)<br />
158 ENEMY: Security Robot (shoots flashing bullet, can act as moving floor spring)<br />
<br />
160 PLAT/HAZARD: Dragonfly<br />
161 Crate/Box (can only be destroyed with bombs)<br />
<br />
165 BONUS: Bottle with red liquid<br />
166 BONUS: Green thing<br />
167 BONUS: Blue thing<br />
168 BONUS: Salad?<br />
169 BONUS: Pile of green things<br />
170 BONUS: whatever..<br />
<br />
172 BONUS: blue thing<br />
<br />
174 DECO/BONUS: Satellite<br />
<br />
176 ENEMY: Green Plant<br />
177 BONUS: 5 Yellow Grapes (800)<br />
178 BONUS: Headdress-like object<br />
179 CRATE: with item 178<br />
180 DECO: Jaws & Tongue<br />
181 invisible exit marker (go right to exit)<br />
182 small flame<br />
183 ENEMY: Big Red Plant (spitting Blue Balls/catapult)<br />
<br />
185 BONUS: Blue Crystal (on ground)<br />
186 BONUS: Red Crystal (on ground)<br />
187 BARREL: Red/Green Gem<br />
188 BARREL: Blue Crystal<br />
189 BARREL: Red Crystal<br />
190 BONUS: Green Tomato<br />
191 BONUS: Tomato<br />
192 BONUS: Yellow/Cyan Fruit (200)<br />
193 HAZARD: Clamp Trap<br />
194 PLAT: Blue Cube (falls down when you walk off)<br />
195 MESSAGE: "What's happening? Is Cosmo falling to his doom?"<br />
196 MESSAGE: "Is there no end to this pit? An what danger awaits below?!"<br />
197 Level End Object?<br />
198 CRATE: Root (400)<br />
199 BONUS: Root<br />
200 CRATE: 4 Brown Berries (400)<br />
201 BONUS: 4 Brown Berries<br />
<br />
203 BONUS: Potato-like vegetable<br />
204 BARREL: Green Gem<br />
205 BONUS: Green Gem<br />
206 BARREL: Diamond (3200)<br />
207 BONUS: Diamond<br />
<br />
217 ENEMY: Alien-Eating Space Plant (Exits the current level)<br />
218 ENEMY: Blue Bird<br />
219 OBJECT: Rocket<br />
220 BONUS: Invincibility Cube<br />
221 PLAT: Destructible Pedestal 1 (14 tiles high)<br />
222 PLAT: Destructible Pedestal 2 (20 tiles high)<br />
223 PLAT: Destructible Pedestal 3 (26 tiles high)<br />
224 BARREL: Diamond 2<br />
225 BONUS: Diamond 2 (falling)<br />
226 BARREL: Red Berry<br />
227 BONUS: Red Berry (falling)<br />
228 BARREL: Crystal (800)<br />
229 BONUS: Crystal (falling)<br />
230 BARREL: Blue Gem<br />
231 BONUS: Blue Gem (falling)<br />
<br />
233 DECO: Rocket Exhaust<br />
234 EXIT: Teleporter<br />
235 HINT: "Bump head into switch above!"<br />
236 HINT: "The ice in this cave is very, very slippery."<br />
237 HINT: "Use this shield for temporary invincibility."<br />
238 HINT: "You found a secret area!!! Good Job!"<br />
239 HINT: "In hight places look up to find bonus objects."<br />
240 HINT: "Out of Order..."<br />
241 HINT: "This might be a good time to save your game!"<br />
242 HINT: "Press your up key to use the transporter."<br />
243 HINT: "(1) FOR..."<br />
244 BONUS: Diamond 2<br />
245 BONUS: Red Berry<br />
246 BONUS: Crystal<br />
247 BONUS: Blue Gem (800)<br />
248 PLAT: Ceiling Spring<br />
249 BARREL: Headphones<br />
250 BONUS: Headphones<br />
251 BONUS: Headphones (falling)<br />
252 OBJECT: Frozen Duke NukUm<br />
<br />
254 BONUS: 3 Bananas (800)<br />
255 CRATE: Alien Raisin<br />
256 BONUS: Alien Raisin (400)<br />
<br />
258 CRATE: Brown Pear<br />
259 BONUS: Brown Pear<br />
<br />
261 CRATE: Alien Chili Pepper<br />
262 BONUS: Alien Chili Pepper (400)<br />
<br />
264 DANGER: Flame (<-)<br />
265 DANGER: Flame (->)<br />
<br />
267 HAZARD: Leaking Red acid<br />
268 HAZARD: Dripping Red Acid<br />
269 HINT: "(2) EXTRA..."<br />
270 HINT: "(3) POINTS,..."<br />
271 HINT: "(4) DESTROY..."<br />
272 HINT: "(5) HINT..."<br />
273 HINT: "(6) GLOBES!!!"<br />
274 HINT: "The Clam Plants won't hurt you if their mouths are closed."+Clam Sprite<br />
<br />
278 DECO: Big Mouth (end of E1/start of E2)<br />
279 DECO: Normal Smoke Rising<br />
280 DECO: Big Smoke rising<br />
281 EXIT: Horizontal Exit Marker (Invisible)<br />
<br />
283 BONUS: Red Crystal on ceiling<br />
284 HINT: "Collect the STARS to advance to BONUS STAGES."<br />
285 HINT: "Some creatures require more than one pounce to defeat!"<br />
286 HINT: "Cosmo can climb wall's with his suction hands."+CosmoWallSprite<br />
<br />
294 BONUS: Power Up Module (falling) (health/12800)<br />
295 BONUS: Star (falling) (200)<br />
296 end of episode 2 trigger?<br />
<br />
The hint texts are the messages you get in episode 1, the other episodes have different (and less!) messages. The later hint globes probably don't work in those episodes.<br />
<br />
== Credits ==<br />
<br />
This file format was reverse engineered by [http://www.geocities.com/dooknookimklassik/ Dave Bollinger]. Most of this info came from the [http://www.geocities.com/dooknookimklassik/dn2specs.txt Duke II specs on his website], with [[User:Malvineous|Malvineous]] working out which bits to remove to read Cosmo maps. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Main_Page&diff=4537Main Page2013-02-21T21:29:53Z<p>T-Squared: I didn't know you could edit this page if you were a member. Anyways, I took the time to correct a time-based oversight. (My mod is now called "HUMANIZED!!!", not "The Humanizer")</p>
<hr />
<div>__NOTOC__ <!-- Hide the 'table of contents' box --><br />
<big>'''Welcome to the DOS Game Modding Wiki!'''</big><br />
<br />
The goal of this wiki is to assist people wishing to modify DOS games (typically those released for the PC in the early 1990s) to create entirely new games. The wiki attempts to document all the file formats used by each game to assist programmers writing editing tools, as well as listing any existing tools that can already be used to modify the game.<br />
<br />
<table border="0" width="100%" cellspacing="10"><br />
<tr><td align="center"><br />
[[Image:icon-games.png|link=:Category:Game Intro Page]]<br/><br />
[[:Category:Game Intro Page|Games]]<br />
</td><td align="center"><br />
[[Image:icon-mods.png|link=:Category:Mods by game]]<br/><br />
[[:Category:Mods by game|Mods]]<br />
</td><td align="center"><br />
[[Image:icon-settings.png|link=:Category:File Formats]]<br/><br />
[[:Category:File Formats|File formats]]<br />
</td><td align="center"><br />
[[Image:icon-info.png|link=:Category:Tutorials]]<br/><br />
[[:Category:Tutorials|Tutorials]]<br />
</td></tr><br />
</table><br />
<br />
=== About ===<br />
<br />
The wiki is structured so that each game has its own summary page, which in turn branches out to other pages explaining things in more detail such as file formats and instructions for using modding tools.<br />
<br />
If you find anything missing, incomplete or inaccurate among these pages, please fix it! To help prevent spam, you'll need to [[Special:Userlogin|log in]] before you can edit pages - if you don't have an account, it's easy to [[Special:Userlogin|create one]]. Have a quick look at the [[ModdingWiki:Contributing|editing guidelines]] before your first edit so you know what we're expecting.<br />
<br />
Don't forget that this site will only become a useful reference if all the modders out there lend a hand and contribute what they know! If you've got some info about modding a DOS game that's not yet listed, please create a new page for it!<br />
<br />
=== Current projects ===<br />
<br />
* [[User:T-Squared|T-Squared]] is creating a mod for [[Cosmo's Cosmic Adventures]] called "HUMANIZED!!!". Take a look at [[User:T-Squared|T-Squared's user page]] for more info.<br />
* [[User:Eros|Eros]] is remaking the original [[Catacomb]] for Windows and Linux in OpenGL. Visit the [http://code.google.com/p/cataclone/ Google Code project page].<br />
* [[User:Malvineous|Malvineous]] is working on a cross-platform modding tool called [[Camoto]], which can edit a number of different games.</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Level_Format&diff=4536Cosmo Level Format2013-02-21T19:43:41Z<p>T-Squared: /* List of Actor Types */</p>
<hr />
<div>{{Map Infobox<br />
| Type = 2D tile-based<br />
| Layers = 3<br />
| Tile size = 8&times;8<br />
| Viewport = 304&times;144<br />
| Game1 = Cosmo's Cosmic Adventures<br />
}}<br />
<br />
== File format ==<br />
The file is in this basic layout:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iFlags||Flags indicating music, backdrop and other stuff<br />
|-<br />
|UINT16LE iMapWidth||Map width in tiles<br />
|-<br />
|UINT16LE iActorSize||Number of UINT16 values in the actor block<br />
|-<br />
|ACTORDATA actorData[]||Variable-length array of all the actors in the level<br />
|-<br />
|BYTE bgLayer[65528]||The map data for the background layer<br />
|}<br />
<br />
The iMapWidth values in the original Cosmo levels is either 64, 128, 256 or 512. The "view window" in the game is 304x144 Pixels, so the minimal map width would be 38. However, the width must be a power of 2 to work (from 32 to 2048).<br />
<br />
The iActorSize values are reliable for all the original Cosmo level files (Version 1.20).<br />
<br />
The map data is actually sized 65528 Bytes or 32764 Words. Each entry in this block is divisable by 8 (see [[#Mapping cell values to tiles]]).<br />
<br />
=== Level Flags ===<br />
<br />
The structure of the bits in the iFlags value is as follows:<br />
<br />
[ mmmmm | ppp | yxr | bbbbb ]<br />
<br />
m: music index<br />
p: palette animation type<br />
y: y-scrolling backdrop<br />
x: x-scrolling backdrop<br />
r: rain<br />
b: backdrop index<br />
<br />
The indices for music and backdrop refer to an array of filename strings stored in the executable. You can find them by searching for the first filename in each array. For backdrops, the first filename (index: 0) is <tt>BDBLANK.MNI</tt>, for music it's <tt>MCAVES.MNI</tt>. Note that some backdrop files are not used by the games (and therefore are not not included).<br />
<br />
The palette animation types indicate the following:<br />
<br />
%000: (most levels) no palette changes<br />
%001: (A4) random lightning (with thunder soundeffect)<br />
%010: (C8-C10) cycling: red -> yellow -> white<br />
%011: (A7) cycling: red -> green -> blue<br />
%100: (A8, B3, B4, B7) cycling: black -> grey -> white<br />
%101: (C6, C7) flashing: red -> magenta -> white<br />
%110: (C1) replace dark magenta with black, no animation unless triggered by a bomb actor. (present in Episode 3, Level 1 of Cosmo.)<br />
<br />
=== Background Layer ===<br />
<br />
The <tt>bgLayer</tt> block contains the grid/cell data:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iMapData[32764]||Actual map data<br />
|}<br />
<br />
Each "element" in <tt>iMapData</tt> refers to the foreground and/or background tile used in a single grid cell. The grids are arranged left to right, top to bottom, so the index can be calculated by this formula:<br />
<br />
int iIndex = (y * iMapWidth) + x;<br />
iMapData[iIndex] = <new value to set at x,y><br />
<br />
The map data in the original Cosmo level files is a constant 32764 UINT16LE cells long (65528 bytes), and the engine will never read more than 65535 bytes. However, the game calculates the map height by dividing the width in bytes by 65536:<br />
<br />
int iMapHeight = 32768 / iMapWidth;<br />
<br />
Since the width of the map is always a power of 2 (min. 64), you can see that each file is "missing" 8 Bytes (or 4 Words). That means the last line of the map will always be missing the last 4 tiles. The game ignores that last, incomplete line. However, in one level (A8.MNI), there is an actor placed in that last line. Since actors are saved as individual structures instead of a grid, that actor will still be loaded by the game. But for editing a level, you should make sure the last line is visible, so that it's possible to place actors in that line or remove them from there.<br />
<br />
==== Mapping cell values to tiles ====<br />
<br />
The method of mapping elements in the <tt>iMapData</tt> structure into tiles is fairly straightforward. Each cell value is a pixel index into the tilemap. Imagine the tileset laid out left to right all on the one row. Since each tile is 8x8 pixels, at 16 pixels into the image, the third tile will begin (x = 0 for first tile, x = 8 for second tile, x = 16 for third tile.) The cell value is essentially a pixel x-coordinate into the tileset.<br />
<br />
Note that in the tileset file, the solid tiles are made up of 2000 4-plane (16-colour) images, and these are followed by 1000 5-plane images (16-colour + transparency.) Although separate images, they appear to be concatenated when the game loads them, as the cell value will be zero for the first solid tile, it will be eight for the second solid tile, it will be 15992 for the last solid tile, and it will be 16000 for the first masked tile.<br />
<br />
This means that if the solid and masked tiles have been treated as separate images, a check will need to be performed so that any cell value below 16000 is loaded from the solid tileset, and any value larger than this is loaded from the masked tileset (after subtracting 16000 from the cell value, to put it at zero for the first masked tile.) However, for some reason the values for the masked tiles are at multiples of five tiles (tile #0 (x=0) is the first tile, tile #5 (x=40) is the second tile.) This formula can be used to convert the values into tile numbers once they stray into the masked tile area:<br />
<br />
#define COSMO_TS_SOLID_NUMTILES 2000 // 40x25<br />
#define COSMO_TS_MASKED_NUMTILES 1000 // 40x4<br />
<br />
tile = cell_value / 8<br />
if (tile > COSMO_TS_SOLID_NUMTILES) {<br />
// Once we're in the masked tileset it counts up in multiples of five planes<br />
tile = COSMO_TS_SOLID_NUMTILES + (tile - COSMO_TS_SOLID_NUMTILES) / 5;<br />
}<br />
// Now 'tile' will be between 0 and 2999 inclusive<br />
<br />
As an example of a few tile values:<br />
<br />
{|class="wikitable"<br />
! Cell value !! Tile number !! Tileset !! Index !! Comments<br />
|-<br />
| 0 || 0 || N/A || N/A || See through to map backdrop<br />
|-<br />
| 8 || 1 || Solid || 1 || First solid tile, note increment of 8<br />
|-<br />
| 16 || 2 || Solid || 2 || Second solid tile, increment of 8 again<br />
|-<br />
| 15992 || 1999 || Solid || 1999 || Last solid tile<br />
|-<br />
| 16000 || 2000 || Masked || 0 || First masked tile<br />
|-<br />
| 16040 || 2001 || Masked || 1 || Second masked tile, note increment of 40<br />
|-<br />
| 16080 || 2002 || Masked || 2 || Third masked tile, increment of 40 again<br />
|-<br />
| 55960 || 2999 || Masked || 999 || Last masked tile<br />
|-<br />
| 56000 || N/A || N/A || N/A || Should never get a value this size or larger<br />
|}<br />
<br />
Note that while the cell value cannot be out of range for the solid tiles/background layer (since any values larger than 16000 will be loaded from the masked tileset) the cell values for the masked tileset have no such restriction. (Although obviously out of range tiles will not be drawn correctly by the engine!)<br />
<br />
==== Gotchas ====<br />
<br />
* The first tile in the solid tileset is used as a transparent tile. It will appear completely black if drawn (e.g. in a map editor) however the game does not draw this tile, so any cells with this as the background cell will be where the map backdrop shows through. If you wish to draw the map with the backdrop in-place, remember not to draw tile #0 over the top of the backdrop.<br />
<br />
=== Actor data ===<br />
<br />
The <tt>actorData</tt> block is in the following format:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iType||Type of actor<br />
|-<br />
|UINT16LE iX||X-coordinate of actor (in tile units)<br />
|-<br />
|UINT16LE iY||Y-coordinate of actor (in tile units)<br />
|}<br />
<br />
Because the <tt>iActorSize</tt> value in the header is in UINT16s and there are three UINT16s per actor, the number of actors can be obtained quite simply:<br />
<br />
iNumActors = iActorSize / 3<br />
<br />
This is assuming <tt>iActorSize</tt> is reliable - the original specs from Dave Bollinger indicate this is not always the case for DukeII, but no examples are known at the moment.<br />
<br />
==== Mapping Actor Types to image indices ====<br />
<br />
For the ActorTypes from 32 to 296 (inclusive), you can get an image index from ACTORS.MNI and ACTRINFO.MNI like this:<br />
<br />
ImageIndex = ActorType - 31<br />
<br />
However, this does not work for every ActorType. Some share the same images (e.g.: normal stars and falling stars), some use flipped versions of other images (like the pink eye plants) and some are invisible in the game. In either case, the index in the ACTRINFO.MNI will contain no data. You will either have to include hard-coded info to draw these, or just draw something else (like the actual ActorType as text).<br />
<br />
==== List of Actor Types ====<br />
<br />
This is a list of all the actor types that can be found in the original levels of the three episodes. There might be more ActorTypes that work in the game. For example, 69 is probably the (falling) "Cyan Fruit" item as you can guess by looking at the numbers 62-68.<br />
<br />
0 PLAYER: Cosmo (Starting position facing right)<br />
1 moving platform (fixed path)<br />
2 PLAT/HAZARD: mud fountain 1 (small)<br />
3 PLAT/HAZARD: mud fountain 2 (normal)<br />
4 PLAT/HAZARD: mud fountain 3 (big)<br />
5 PLAT/HAZARD: mud fountain 4 (huge)<br />
6 BRIGHTNESS: left border of light<br />
7 BRIGHTNESS: light source (top center)<br />
8 BRIGHTNESS: right border of light<br />
<br />
22 ??? (only in A8.MNI, doesn't seem to be doing anything)<br />
<br />
32 BONUS: Star (200)<br />
33 PLAT: Floor Spring<br />
34 HAZARD: Extending Arrow Spear (from right to left)<br />
35 HAZARD: Extending Arrow Spear (from left to right)<br />
36 HAZARD: Plasma Fireball (from right to left)<br />
37 HAZARD: Plasma Fireball (from left to right)<br />
38 Blue Switch (on ceiling)<br />
39 Red Switch (on ceiling)<br />
40 Green Switch <br />
41 Yellow Switch<br />
42 Blue Door<br />
43 Red Door<br />
44 Green Door<br />
45 Yellow Door<br />
<br />
47 OBJECT: Blue Mobile Trampoline Car<br />
48 HAZARD: Double Spikes on ground<br />
49 HAZARD: Double Spikes (coming out of the ground)<br />
<br />
51 HAZARD: Big Saw Blade<br />
<br />
56 HAZARD: Green Pruny Cabbage Ball<br />
<br />
59 BONUS: Power Up (health/12800)<br />
60 BARREL: Power Up (health/12800)<br />
<br />
62 CRATE: Green Tomato<br />
63 BONUS: Green Tomato (falling)<br />
64 CRATE: Tomato (200)<br />
65 BONUS: Tomato (falling)<br />
66 CRATE: Yellow/Cyan Fruit<br />
67 BONUS: Yellow/Cyan Fruit (falling)<br />
68 CRATE: Cyan Fruit<br />
<br />
70 OBJECT: Exit Sign (ends level on touch)<br />
<br />
72 HAZARD: Spear (coming down from ceiling)<br />
73 HAZARD: Leaking Green Acid<br />
74 HAZARD: Dripping Green Acid<br />
75 ENEMY: Plasma Energy Sprites (Blue Flame-like creatures)<br />
76 HAZARD: "Two Tons" Weight going down & up<br />
77 ENEMY: Jumping Bulletheads<br />
78 ENEMY: Stone Heads (Only drops when Cosmo is close by)<br />
79 ENEMY: Big Yellow Spike on ceiling<br />
80 ENEMY: Big Yellow Spike on ceiling (falling down)<br />
81 ENEMY: Big Yellow Spike on ground<br />
82 ENEMY: Ghost<br />
83 CRATE: Green thingy<br />
<br />
85 ENEMY: Angry Moon (blue floating characters)<br />
86 ENEMY: Small Red Plant<br />
87 BARREL: Bomb (100)<br />
88 BONUS: Bomb (100)<br />
<br />
90 OBJECT: switch (1) (Activates moving platform(s))<br />
<br />
92 OBJECT: switch (2) (Activates Question Mark Block Wall Generator)<br />
93 OBJECT: Question Mark Block (Generates a wall when activated by switch)<br />
94 HAZARD: Ground Claw Spikes<br />
95 OBJECT: Rubber Wall (can blow it up, throws Cosmo backwards when touched)<br />
96 ENEMY: Mini Ghost (jumps)<br />
<br />
100 CREATURE: Green Roamer Worm<br />
101 PIPE TRANSIT DIRECTION: Arrow Up<br />
102 PIPE TRANSIT DIRECTION: Arrow Down<br />
103 PIPE TRANSIT DIRECTION: Arrow Left<br />
104 PIPE TRANSIT DIRECTION: Arrow Right<br />
105 ENEMY: Egg Head (special?) -- only 1x: in B2.MNI<br />
106 ENEMY: Egg Head<br />
<br />
109 ENEMY: Robotic Spike on ground<br />
<br />
111 ENEMY: Robotic Spike on ceiling<br />
112 CRATE/BONUS: Burger<br />
<br />
114 ENEMY: Blue/Red plant<br />
<br />
116 BONUS: Purple Grapes (800)<br />
117 ENEMY: Blue Ball<br />
118 ENEMY: Spikes (on left wall)<br />
119 ENEMY: Retracting Spikes (on left wall)<br />
120 ENEMY: Spikes (on right wall)<br />
121 ENEMY: Robot with Blue Vertical Electric Arc<br />
122 PLAT: Blue Platform (splits open when standing on top)<br />
123 ENEMY: Spark<br />
<br />
125 BONUS: Cyan Dancing Mushroom (400)<br />
126 DECO: Pink Eye Plant<br />
127 DECO: Pink Eye Plant (hanging upside down)<br />
<br />
132 ENEMY: Big Red Jumper<br />
133 ENEMY: BOSS (Purple Alien in Spike-bottomed ship)<br />
<br />
135 PNEUMATIC PIPES: Exit<br />
136 PNEUMATIC PIPES: Entrance<br />
137 ENEMY: Suction-Cup-Legged Alien<br />
138 OBJECT: Teleporter A<br />
139 OBJECT: Teleporter B<br />
<br />
142 ENEMY: Cyan Spitting Plant (on left wall)<br />
143 ENEMY: Cyan Spitting Plant (on right wall)<br />
144 ENEMY: Blue Turret Alien<br />
145 PLAT: Hoverboard<br />
146 CRATE: pile of green balls<br />
<br />
148 BARREL: Saxophone-like thing<br />
149 ENEMY: Red Chomper Alien<br />
150 CRATE: Salad<br />
151 switch (3) (Possibly deactivates Actors 153 & 154; Energy Beams)<br />
152 switch (4) (Possibly activates lights, if actors 6,7, & 8 are present in level.)<br />
153 HAZARD: Vertical Energy Beam (Deactivated by Switch)<br />
154 HAZARD: Horizontal Energy Beam (Deactivated by Switch)<br />
155 CREATURE/HAZARD: Pink slug/Worm (Turns to bubbling goo when jumped upon)<br />
156 HINT: "These hint globes will help you along your journey. Press the up key to reread them."<br />
157 ENEMY: Silver Robot (pushes player around)<br />
158 ENEMY: Security Robot (shoots flashing bullet, can act as moving floor spring)<br />
<br />
160 PLAT/HAZARD: Dragonfly<br />
161 Crate/Box (can only be destroyed with bombs)<br />
<br />
165 BONUS: Bottle with red liquid<br />
166 BONUS: Green thing<br />
167 BONUS: Blue thing<br />
168 BONUS: Salad?<br />
169 BONUS: Pile of green things<br />
170 BONUS: whatever..<br />
<br />
172 BONUS: blue thing<br />
<br />
174 DECO/BONUS: Satellite<br />
<br />
176 ENEMY: Green Plant<br />
177 BONUS: 5 Yellow Grapes (800)<br />
178 BONUS: Headdress-like object<br />
179 CRATE: with item 178<br />
180 DECO: Jaws & Tongue<br />
181 invisible exit marker (go right to exit)<br />
182 small flame<br />
183 ENEMY: Big Red Plant (spitting Blue Balls/catapult)<br />
<br />
185 BONUS: Blue Crystal (on ground)<br />
186 BONUS: Red Crystal (on ground)<br />
187 BARREL: Red/Green Gem<br />
188 BARREL: Blue Crystal<br />
189 BARREL: Red Crystal<br />
190 BONUS: Green Tomato<br />
191 BONUS: Tomato<br />
192 BONUS: Yellow/Cyan Fruit (200)<br />
193 HAZARD: Clamp Trap<br />
194 PLAT: Blue Cube (falls down when you walk off)<br />
195 MESSAGE: "What's happening? Is Cosmo falling to his doom?"<br />
196 MESSAGE: "Is there no end to this pit? An what danger awaits below?!"<br />
197 Level End Object?<br />
198 CRATE: Root (400)<br />
199 BONUS: Root<br />
200 CRATE: 4 Brown Berries (400)<br />
201 BONUS: 4 Brown Berries<br />
<br />
203 BONUS: Potato-like vegetable<br />
204 BARREL: Green Gem<br />
205 BONUS: Green Gem<br />
206 BARREL: Diamond (3200)<br />
207 BONUS: Diamond<br />
<br />
217 ENEMY: Alien-Eating Space Plant (Exits the current level)<br />
218 ENEMY: Blue Bird<br />
219 OBJECT: Rocket<br />
220 BONUS: Invincibility Cube<br />
221 PLAT: Destructible Pedestal 1 (14 tiles high)<br />
222 PLAT: Destructible Pedestal 2 (20 tiles high)<br />
223 PLAT: Destructible Pedestal 3 (26 tiles high)<br />
224 BARREL: Diamond 2<br />
225 BONUS: Diamond 2 (falling)<br />
226 BARREL: Red Berry<br />
227 BONUS: Red Berry (falling)<br />
228 BARREL: Crystal (800)<br />
229 BONUS: Crystal (falling)<br />
230 BARREL: Blue Gem<br />
231 BONUS: Blue Gem (falling)<br />
<br />
233 DECO: Rocket Exhaust<br />
234 EXIT: Teleporter<br />
235 HINT: "Bump head into switch above!"<br />
236 HINT: "The ice in this cave is very, very slippery."<br />
237 HINT: "Use this shield for temporary invincibility."<br />
238 HINT: "You found a secret area!!! Good Job!"<br />
239 HINT: "In hight places look up to find bonus objects."<br />
240 HINT: "Out of Order..."<br />
241 HINT: "This might be a good time to save your game!"<br />
242 HINT: "Press your up key to use the transporter."<br />
243 HINT: "(1) FOR..."<br />
244 BONUS: Diamond 2<br />
245 BONUS: Red Berry<br />
246 BONUS: Crystal<br />
247 BONUS: Blue Gem (800)<br />
248 PLAT: Ceiling Spring<br />
249 BARREL: Headphones<br />
250 BONUS: Headphones<br />
251 BONUS: Headphones (falling)<br />
252 OBJECT: Frozen Duke NukUm<br />
<br />
254 BONUS: 3 Bananas (800)<br />
255 CRATE: Alien Raisin<br />
256 BONUS: Alien Raisin (400)<br />
<br />
258 CRATE: Brown Pear<br />
259 BONUS: Brown Pear<br />
<br />
261 CRATE: Alien Chili Pepper<br />
262 BONUS: Alien Chili Pepper (400)<br />
<br />
264 DANGER: Flame (<-)<br />
265 DANGER: Flame (->)<br />
<br />
267 HAZARD: Leaking Red acid<br />
268 HAZARD: Dripping Red Acid<br />
269 HINT: "(2) EXTRA..."<br />
270 HINT: "(3) POINTS,..."<br />
271 HINT: "(4) DESTROY..."<br />
272 HINT: "(5) HINT..."<br />
273 HINT: "(6) GLOBES!!!"<br />
274 HINT: "The Clam Plants won't hurt you if their mouths are closed."+Clam Sprite<br />
<br />
278 DECO: Big Mouth (end of E1/start of E2)<br />
279 DECO: Normal Smoke Rising<br />
280 DECO: Big Smoke rising<br />
281 EXIT: Horizontal Exit Marker (Invisible)<br />
<br />
283 BONUS: Red Crystal on ceiling<br />
284 HINT: "Collect the STARS to advance to BONUS STAGES."<br />
285 HINT: "Some creatures require more than one pounce to defeat!"<br />
286 HINT: "Cosmo can climb wall's with his suction hands."+CosmoWallSprite<br />
<br />
294 BONUS: Power Up Module (falling) (health/12800)<br />
295 BONUS: Star (falling) (200)<br />
296 end of episode 2 trigger?<br />
<br />
The hint texts are the messages you get in episode 1, the other episodes have different (and less!) messages. The later hint globes probably don't work in those episodes.<br />
<br />
== Credits ==<br />
<br />
This file format was reverse engineered by [http://www.geocities.com/dooknookimklassik/ Dave Bollinger]. Most of this info came from the [http://www.geocities.com/dooknookimklassik/dn2specs.txt Duke II specs on his website], with [[User:Malvineous|Malvineous]] working out which bits to remove to read Cosmo maps. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Level_Format&diff=4532Cosmo Level Format2013-02-19T18:00:19Z<p>T-Squared: /* List of Actor Types */ I seem to have finished finalizing the character and object names and adding more details about them. (Will correct Actors 151 & 152 when possible.)</p>
<hr />
<div>{{Map Infobox<br />
| Type = 2D tile-based<br />
| Layers = 3<br />
| Tile size = 8&times;8<br />
| Viewport = 304&times;144<br />
| Game1 = Cosmo's Cosmic Adventures<br />
}}<br />
<br />
== File format ==<br />
The file is in this basic layout:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iFlags||Flags indicating music, backdrop and other stuff<br />
|-<br />
|UINT16LE iMapWidth||Map width in tiles<br />
|-<br />
|UINT16LE iActorSize||Number of UINT16 values in the actor block<br />
|-<br />
|ACTORDATA actorData[]||Variable-length array of all the actors in the level<br />
|-<br />
|BYTE bgLayer[65528]||The map data for the background layer<br />
|}<br />
<br />
The iMapWidth values in the original Cosmo levels is either 64, 128, 256 or 512. The "view window" in the game is 304x144 Pixels, so the minimal map width would be 38. However, the width must be a power of 2 to work (from 32 to 2048).<br />
<br />
The iActorSize values are reliable for all the original Cosmo level files (Version 1.20).<br />
<br />
The map data is actually sized 65528 Bytes or 32764 Words. Each entry in this block is divisable by 8 (see [[#Mapping cell values to tiles]]).<br />
<br />
=== Level Flags ===<br />
<br />
The structure of the bits in the iFlags value is as follows:<br />
<br />
[ mmmmm | ppp | yxr | bbbbb ]<br />
<br />
m: music index<br />
p: palette animation type<br />
y: y-scrolling backdrop<br />
x: x-scrolling backdrop<br />
r: rain<br />
b: backdrop index<br />
<br />
The indices for music and backdrop refer to an array of filename strings stored in the executable. You can find them by searching for the first filename in each array. For backdrops, the first filename (index: 0) is <tt>BDBLANK.MNI</tt>, for music it's <tt>MCAVES.MNI</tt>. Note that some backdrop files are not used by the games (and therefore are not not included).<br />
<br />
The palette animation types indicate the following:<br />
<br />
%000: (most levels) no palette changes<br />
%001: (A4) random lightning (with thunder soundeffect)<br />
%010: (C8-C10) cycling: red -> yellow -> white<br />
%011: (A7) cycling: red -> green -> blue<br />
%100: (A8, B3, B4, B7) cycling: black -> grey -> white<br />
%101: (C6, C7) flashing: red -> magenta -> white<br />
%110: (C1) replace dark magenta with black, no animation unless triggered by a bomb actor. (present in Episode 3, Level 1 of Cosmo.)<br />
<br />
=== Background Layer ===<br />
<br />
The <tt>bgLayer</tt> block contains the grid/cell data:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iMapData[32764]||Actual map data<br />
|}<br />
<br />
Each "element" in <tt>iMapData</tt> refers to the foreground and/or background tile used in a single grid cell. The grids are arranged left to right, top to bottom, so the index can be calculated by this formula:<br />
<br />
int iIndex = (y * iMapWidth) + x;<br />
iMapData[iIndex] = <new value to set at x,y><br />
<br />
The map data in the original Cosmo level files is a constant 32764 UINT16LE cells long (65528 bytes), and the engine will never read more than 65535 bytes. However, the game calculates the map height by dividing the width in bytes by 65536:<br />
<br />
int iMapHeight = 32768 / iMapWidth;<br />
<br />
Since the width of the map is always a power of 2 (min. 64), you can see that each file is "missing" 8 Bytes (or 4 Words). That means the last line of the map will always be missing the last 4 tiles. The game ignores that last, incomplete line. However, in one level (A8.MNI), there is an actor placed in that last line. Since actors are saved as individual structures instead of a grid, that actor will still be loaded by the game. But for editing a level, you should make sure the last line is visible, so that it's possible to place actors in that line or remove them from there.<br />
<br />
==== Mapping cell values to tiles ====<br />
<br />
The method of mapping elements in the <tt>iMapData</tt> structure into tiles is fairly straightforward. Each cell value is a pixel index into the tilemap. Imagine the tileset laid out left to right all on the one row. Since each tile is 8x8 pixels, at 16 pixels into the image, the third tile will begin (x = 0 for first tile, x = 8 for second tile, x = 16 for third tile.) The cell value is essentially a pixel x-coordinate into the tileset.<br />
<br />
Note that in the tileset file, the solid tiles are made up of 2000 4-plane (16-colour) images, and these are followed by 1000 5-plane images (16-colour + transparency.) Although separate images, they appear to be concatenated when the game loads them, as the cell value will be zero for the first solid tile, it will be eight for the second solid tile, it will be 15992 for the last solid tile, and it will be 16000 for the first masked tile.<br />
<br />
This means that if the solid and masked tiles have been treated as separate images, a check will need to be performed so that any cell value below 16000 is loaded from the solid tileset, and any value larger than this is loaded from the masked tileset (after subtracting 16000 from the cell value, to put it at zero for the first masked tile.) However, for some reason the values for the masked tiles are at multiples of five tiles (tile #0 (x=0) is the first tile, tile #5 (x=40) is the second tile.) This formula can be used to convert the values into tile numbers once they stray into the masked tile area:<br />
<br />
#define COSMO_TS_SOLID_NUMTILES 2000 // 40x25<br />
#define COSMO_TS_MASKED_NUMTILES 1000 // 40x4<br />
<br />
tile = cell_value / 8<br />
if (tile > COSMO_TS_SOLID_NUMTILES) {<br />
// Once we're in the masked tileset it counts up in multiples of five planes<br />
tile = COSMO_TS_SOLID_NUMTILES + (tile - COSMO_TS_SOLID_NUMTILES) / 5;<br />
}<br />
// Now 'tile' will be between 0 and 2999 inclusive<br />
<br />
As an example of a few tile values:<br />
<br />
{|class="wikitable"<br />
! Cell value !! Tile number !! Tileset !! Index !! Comments<br />
|-<br />
| 0 || 0 || N/A || N/A || See through to map backdrop<br />
|-<br />
| 8 || 1 || Solid || 1 || First solid tile, note increment of 8<br />
|-<br />
| 16 || 2 || Solid || 2 || Second solid tile, increment of 8 again<br />
|-<br />
| 15992 || 1999 || Solid || 1999 || Last solid tile<br />
|-<br />
| 16000 || 2000 || Masked || 0 || First masked tile<br />
|-<br />
| 16040 || 2001 || Masked || 1 || Second masked tile, note increment of 40<br />
|-<br />
| 16080 || 2002 || Masked || 2 || Third masked tile, increment of 40 again<br />
|-<br />
| 55960 || 2999 || Masked || 999 || Last masked tile<br />
|-<br />
| 56000 || N/A || N/A || N/A || Should never get a value this size or larger<br />
|}<br />
<br />
Note that while the cell value cannot be out of range for the solid tiles/background layer (since any values larger than 16000 will be loaded from the masked tileset) the cell values for the masked tileset have no such restriction. (Although obviously out of range tiles will not be drawn correctly by the engine!)<br />
<br />
==== Gotchas ====<br />
<br />
* The first tile in the solid tileset is used as a transparent tile. It will appear completely black if drawn (e.g. in a map editor) however the game does not draw this tile, so any cells with this as the background cell will be where the map backdrop shows through. If you wish to draw the map with the backdrop in-place, remember not to draw tile #0 over the top of the backdrop.<br />
<br />
=== Actor data ===<br />
<br />
The <tt>actorData</tt> block is in the following format:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iType||Type of actor<br />
|-<br />
|UINT16LE iX||X-coordinate of actor (in tile units)<br />
|-<br />
|UINT16LE iY||Y-coordinate of actor (in tile units)<br />
|}<br />
<br />
Because the <tt>iActorSize</tt> value in the header is in UINT16s and there are three UINT16s per actor, the number of actors can be obtained quite simply:<br />
<br />
iNumActors = iActorSize / 3<br />
<br />
This is assuming <tt>iActorSize</tt> is reliable - the original specs from Dave Bollinger indicate this is not always the case for DukeII, but no examples are known at the moment.<br />
<br />
==== Mapping Actor Types to image indices ====<br />
<br />
For the ActorTypes from 32 to 296 (inclusive), you can get an image index from ACTORS.MNI and ACTRINFO.MNI like this:<br />
<br />
ImageIndex = ActorType - 31<br />
<br />
However, this does not work for every ActorType. Some share the same images (e.g.: normal stars and falling stars), some use flipped versions of other images (like the pink eye plants) and some are invisible in the game. In either case, the index in the ACTRINFO.MNI will contain no data. You will either have to include hard-coded info to draw these, or just draw something else (like the actual ActorType as text).<br />
<br />
==== List of Actor Types ====<br />
<br />
This is a list of all the actor types that can be found in the original levels of the three episodes. There might be more ActorTypes that work in the game. For example, 69 is probably the (falling) "Onion" item as you can guess by looking at the numbers 62-68.<br />
<br />
0 PLAYER: Cosmo (Starting position facing right)<br />
1 moving platform (fixed path)<br />
2 PLAT/HAZARD: mud fountain 1 (small)<br />
3 PLAT/HAZARD: mud fountain 2 (normal)<br />
4 PLAT/HAZARD: mud fountain 3 (big)<br />
5 PLAT/HAZARD: mud fountain 4 (huge)<br />
6 BRIGHTNESS: left border of light<br />
7 BRIGHTNESS: light source (top center)<br />
8 BRIGHTNESS: right border of light<br />
<br />
22 ??? (only in A8.MNI, doesn't seem to be doing anything)<br />
<br />
32 BONUS: Star (200)<br />
33 PLAT: Floor Spring<br />
34 HAZARD: Extending Arrow Spear (from right to left)<br />
35 HAZARD: Extending Arrow Spear (from left to right)<br />
36 HAZARD: Plasma Fireball (from right to left)<br />
37 HAZARD: Plasma Fireball (from left to right)<br />
38 Blue Switch (on ceiling)<br />
39 Red Switch (on ceiling)<br />
40 Green Switch <br />
41 Yellow Switch<br />
42 Blue Door<br />
43 Red Door<br />
44 Green Door<br />
45 Yellow Door<br />
<br />
47 OBJECT: Blue Mobile Trampoline Car<br />
48 HAZARD: Double Spikes on ground<br />
49 HAZARD: Double Spikes (coming out of the ground)<br />
<br />
51 HAZARD: Big Saw Blade<br />
<br />
56 HAZARD: Green Pruny Cabbage Ball<br />
<br />
59 BONUS: Power Up (health/12800)<br />
60 BARREL: Power Up (health/12800)<br />
<br />
62 CRATE: Green Tomato<br />
63 BONUS: Green Tomato (falling)<br />
64 CRATE: Tomato (200)<br />
65 BONUS: Tomato (falling)<br />
66 CRATE: Yellow/Cyan Fruit<br />
67 BONUS: Yellow/Cyan Fruit (falling)<br />
68 CRATE: Cyan Fruit<br />
<br />
70 OBJECT: Exit Sign (ends level on touch)<br />
<br />
72 HAZARD: Spear (coming down from ceiling)<br />
73 HAZARD: Leaking Green Acid<br />
74 HAZARD: Dripping Green Acid<br />
75 ENEMY: Plasma Energy Sprites (Blue Flame-like creatures)<br />
76 HAZARD: "Two Tons" Weight going down & up<br />
77 ENEMY: Jumping Bulletheads<br />
78 ENEMY: Stone Heads (Only drops when Cosmo is close by)<br />
79 ENEMY: Big Yellow Spike on ceiling<br />
80 ENEMY: Big Yellow Spike on ceiling (falling down)<br />
81 ENEMY: Big Yellow Spike on ground<br />
82 ENEMY: Ghost<br />
83 CRATE: Green thingy<br />
<br />
85 ENEMY: Angry Moon (blue floating characters)<br />
86 ENEMY: Small Red Plant<br />
87 BARREL: Bomb (100)<br />
88 BONUS: Bomb (100)<br />
<br />
90 OBJECT: switch (1) (Activates moving platform(s))<br />
<br />
92 OBJECT: switch (2) (Activates Question Mark Block Wall Generator)<br />
93 OBJECT: Question Mark Block (Generates a wall when activated by switch)<br />
94 HAZARD: Ground Claw Spikes<br />
95 OBJECT: Rubber Wall (can blow it up, throws Cosmo backwards when touched)<br />
96 ENEMY: Mini Ghost (jumps)<br />
<br />
100 CREATURE: Green Roamer Worm<br />
101 PIPE TRANSIT DIRECTION: Arrow Up<br />
102 PIPE TRANSIT DIRECTION: Arrow Down<br />
103 PIPE TRANSIT DIRECTION: Arrow Left<br />
104 PIPE TRANSIT DIRECTION: Arrow Right<br />
105 ENEMY: Egg Head (special?) -- only 1x: in B2.MNI<br />
106 ENEMY: Egg Head<br />
<br />
109 ENEMY: Robotic Spike on ground<br />
<br />
111 ENEMY: Robotic Spike on ceiling<br />
112 CRATE/BONUS: Burger<br />
<br />
114 ENEMY: Blue/Red plant<br />
<br />
116 BONUS: Purple Grapes (800)<br />
117 ENEMY: Blue Ball<br />
118 ENEMY: Spikes (on left wall)<br />
119 ENEMY: Retracting Spikes (on left wall)<br />
120 ENEMY: Spikes (on right wall)<br />
121 ENEMY: Robot with Blue Vertical Electric Arc<br />
122 PLAT: Blue Platform (splits open when standing on top)<br />
123 ENEMY: Spark<br />
<br />
125 BONUS: Cyan Dancing Mushroom (400)<br />
126 DECO: Pink Eye Plant<br />
127 DECO: Pink Eye Plant (hanging upside down)<br />
<br />
132 ENEMY: Big Red Jumper<br />
133 ENEMY: BOSS (Purple Alien in Spike-bottomed ship)<br />
<br />
135 PNEUMATIC PIPES: Exit<br />
136 PNEUMATIC PIPES: Entrance<br />
137 ENEMY: Suction-Cup-Legged Alien<br />
138 OBJECT: Teleporter A<br />
139 OBJECT: Teleporter B<br />
<br />
142 ENEMY: Cyan Spitting Plant (on left wall)<br />
143 ENEMY: Cyan Spitting Plant (on right wall)<br />
144 ENEMY: Blue Turret Alien<br />
145 PLAT: Hoverboard<br />
146 CRATE: pile of green balls<br />
<br />
148 BARREL: Saxophone-like thing<br />
149 ENEMY: Red Chomper Alien<br />
150 CRATE: Salad<br />
151 switch (3) (Possibly deactivates Actors 153 & 154; Energy Beams)<br />
152 switch (4) (Possibly activates lights, if actors 6,7, & 8 are present in level.)<br />
153 HAZARD: Vertical Energy Beam (Deactivated by Switch)<br />
154 HAZARD: Horizontal Energy Beam (Deactivated by Switch)<br />
155 CREATURE/HAZARD: Pink slug/Worm (Turns to bubbling goo when jumped upon)<br />
156 HINT: "These hint globes will help you along your journey. Press the up key to reread them."<br />
157 ENEMY: Silver Robot (pushes player around)<br />
158 ENEMY: Security Robot (shoots flashing bullet, can act as moving floor spring)<br />
<br />
160 PLAT/HAZARD: Dragonfly<br />
161 Crate/Box (can only be destroyed with bombs)<br />
<br />
165 BONUS: Bottle with red liquid<br />
166 BONUS: Green thing<br />
167 BONUS: Blue thing<br />
168 BONUS: Salad?<br />
169 BONUS: Pile of green things<br />
170 BONUS: whatever..<br />
<br />
172 BONUS: blue thing<br />
<br />
174 DECO/BONUS: Satellite<br />
<br />
176 ENEMY: Green Plant<br />
177 BONUS: 5 Yellow Grapes (800)<br />
178 BONUS: Headdress-like object<br />
179 CRATE: with item 178<br />
180 DECO: Jaws & Tongue<br />
181 invisible exit marker (go right to exit)<br />
182 small flame<br />
183 ENEMY: Big Red Plant (spitting Blue Balls/catapult)<br />
<br />
185 BONUS: Blue Crystal (on ground)<br />
186 BONUS: Red Crystal (on ground)<br />
187 BARREL: Red/Green Gem<br />
188 BARREL: Blue Crystal<br />
189 BARREL: Red Crystal<br />
190 BONUS: Green Tomato<br />
191 BONUS: Tomato<br />
192 BONUS: Yellow/Cyan Fruit (200)<br />
193 HAZARD: Clamp Trap<br />
194 PLAT: Blue Cube (falls down when you walk off)<br />
195 MESSAGE: "What's happening? Is Cosmo falling to his doom?"<br />
196 MESSAGE: "Is there no end to this pit? An what danger awaits below?!"<br />
197 Level End Object?<br />
198 CRATE: Root (400)<br />
199 BONUS: Root<br />
200 CRATE: 4 Brown Berries (400)<br />
201 BONUS: 4 Brown Berries<br />
<br />
203 BONUS: Potato-like vegetable<br />
204 BARREL: Green Gem<br />
205 BONUS: Green Gem<br />
206 BARREL: Diamond (3200)<br />
207 BONUS: Diamond<br />
<br />
217 ENEMY: Alien-Eating Space Plant (Exits the current level)<br />
218 ENEMY: Blue Bird<br />
219 OBJECT: Rocket<br />
220 BONUS: Invincibility Cube<br />
221 PLAT: Destructible Pedestal 1 (14 tiles high)<br />
222 PLAT: Destructible Pedestal 2 (20 tiles high)<br />
223 PLAT: Destructible Pedestal 3 (26 tiles high)<br />
224 BARREL: Diamond 2<br />
225 BONUS: Diamond 2 (falling)<br />
226 BARREL: Red Berry<br />
227 BONUS: Red Berry (falling)<br />
228 BARREL: Crystal (800)<br />
229 BONUS: Crystal (falling)<br />
230 BARREL: Blue Gem<br />
231 BONUS: Blue Gem (falling)<br />
<br />
233 DECO: Rocket Exhaust<br />
234 EXIT: Teleporter<br />
235 HINT: "Bump head into switch above!"<br />
236 HINT: "The ice in this cave is very, very slippery."<br />
237 HINT: "Use this shield for temporary invincibility."<br />
238 HINT: "You found a secret area!!! Good Job!"<br />
239 HINT: "In hight places look up to find bonus objects."<br />
240 HINT: "Out of Order..."<br />
241 HINT: "This might be a good time to save your game!"<br />
242 HINT: "Press your up key to use the transporter."<br />
243 HINT: "(1) FOR..."<br />
244 BONUS: Diamond 2<br />
245 BONUS: Red Berry<br />
246 BONUS: Crystal<br />
247 BONUS: Blue Gem (800)<br />
248 PLAT: Ceiling Spring<br />
249 BARREL: Headphones<br />
250 BONUS: Headphones<br />
251 BONUS: Headphones (falling)<br />
252 OBJECT: Frozen Duke NukUm<br />
<br />
254 BONUS: 3 Bananas (800)<br />
255 CRATE: Alien Raisin<br />
256 BONUS: Alien Raisin (400)<br />
<br />
258 CRATE: Brown Pear<br />
259 BONUS: Brown Pear<br />
<br />
261 CRATE: Alien Chili Pepper<br />
262 BONUS: Alien Chili Pepper (400)<br />
<br />
264 DANGER: Flame (<-)<br />
265 DANGER: Flame (->)<br />
<br />
267 HAZARD: Leaking Red acid<br />
268 HAZARD: Dripping Red Acid<br />
269 HINT: "(2) EXTRA..."<br />
270 HINT: "(3) POINTS,..."<br />
271 HINT: "(4) DESTROY..."<br />
272 HINT: "(5) HINT..."<br />
273 HINT: "(6) GLOBES!!!"<br />
274 HINT: "The Clam Plants won't hurt you if their mouths are closed."+Clam Sprite<br />
<br />
278 DECO: Big Mouth (end of E1/start of E2)<br />
279 DECO: Normal Smoke Rising<br />
280 DECO: Big Smoke rising<br />
281 EXIT: Horizontal Exit Marker (Invisible)<br />
<br />
283 BONUS: Red Crystal on ceiling<br />
284 HINT: "Collect the STARS to advance to BONUS STAGES."<br />
285 HINT: "Some creatures require more than one pounce to defeat!"<br />
286 HINT: "Cosmo can climb wall's with his suction hands."+CosmoWallSprite<br />
<br />
294 BONUS: Power Up Module (falling) (health/12800)<br />
295 BONUS: Star (falling) (200)<br />
296 end of episode 2 trigger?<br />
<br />
The hint texts are the messages you get in episode 1, the other episodes have different (and less!) messages. The later hint globes probably don't work in those episodes.<br />
<br />
== Credits ==<br />
<br />
This file format was reverse engineered by [http://www.geocities.com/dooknookimklassik/ Dave Bollinger]. Most of this info came from the [http://www.geocities.com/dooknookimklassik/dn2specs.txt Duke II specs on his website], with [[User:Malvineous|Malvineous]] working out which bits to remove to read Cosmo maps. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Level_Format&diff=4530Cosmo Level Format2013-02-16T04:04:16Z<p>T-Squared: /* List of Actor Types */</p>
<hr />
<div>{{Map Infobox<br />
| Type = 2D tile-based<br />
| Layers = 3<br />
| Tile size = 8&times;8<br />
| Viewport = 304&times;144<br />
| Game1 = Cosmo's Cosmic Adventures<br />
}}<br />
<br />
== File format ==<br />
The file is in this basic layout:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iFlags||Flags indicating music, backdrop and other stuff<br />
|-<br />
|UINT16LE iMapWidth||Map width in tiles<br />
|-<br />
|UINT16LE iActorSize||Number of UINT16 values in the actor block<br />
|-<br />
|ACTORDATA actorData[]||Variable-length array of all the actors in the level<br />
|-<br />
|BYTE bgLayer[65528]||The map data for the background layer<br />
|}<br />
<br />
The iMapWidth values in the original Cosmo levels is either 64, 128, 256 or 512. The "view window" in the game is 304x144 Pixels, so the minimal map width would be 38. However, the width must be a power of 2 to work (from 32 to 2048).<br />
<br />
The iActorSize values are reliable for all the original Cosmo level files (Version 1.20).<br />
<br />
The map data is actually sized 65528 Bytes or 32764 Words. Each entry in this block is divisable by 8 (see [[#Mapping cell values to tiles]]).<br />
<br />
=== Level Flags ===<br />
<br />
The structure of the bits in the iFlags value is as follows:<br />
<br />
[ mmmmm | ppp | yxr | bbbbb ]<br />
<br />
m: music index<br />
p: palette animation type<br />
y: y-scrolling backdrop<br />
x: x-scrolling backdrop<br />
r: rain<br />
b: backdrop index<br />
<br />
The indices for music and backdrop refer to an array of filename strings stored in the executable. You can find them by searching for the first filename in each array. For backdrops, the first filename (index: 0) is <tt>BDBLANK.MNI</tt>, for music it's <tt>MCAVES.MNI</tt>. Note that some backdrop files are not used by the games (and therefore are not not included).<br />
<br />
The palette animation types indicate the following:<br />
<br />
%000: (most levels) no palette changes<br />
%001: (A4) random lightning (with thunder soundeffect)<br />
%010: (C8-C10) cycling: red -> yellow -> white<br />
%011: (A7) cycling: red -> green -> blue<br />
%100: (A8, B3, B4, B7) cycling: black -> grey -> white<br />
%101: (C6, C7) flashing: red -> magenta -> white<br />
%110: (C1) replace dark magenta with black, no animation unless triggered by a bomb actor. (present in Episode 3, Level 1 of Cosmo.)<br />
<br />
=== Background Layer ===<br />
<br />
The <tt>bgLayer</tt> block contains the grid/cell data:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iMapData[32764]||Actual map data<br />
|}<br />
<br />
Each "element" in <tt>iMapData</tt> refers to the foreground and/or background tile used in a single grid cell. The grids are arranged left to right, top to bottom, so the index can be calculated by this formula:<br />
<br />
int iIndex = (y * iMapWidth) + x;<br />
iMapData[iIndex] = <new value to set at x,y><br />
<br />
The map data in the original Cosmo level files is a constant 32764 UINT16LE cells long (65528 bytes), and the engine will never read more than 65535 bytes. However, the game calculates the map height by dividing the width in bytes by 65536:<br />
<br />
int iMapHeight = 32768 / iMapWidth;<br />
<br />
Since the width of the map is always a power of 2 (min. 64), you can see that each file is "missing" 8 Bytes (or 4 Words). That means the last line of the map will always be missing the last 4 tiles. The game ignores that last, incomplete line. However, in one level (A8.MNI), there is an actor placed in that last line. Since actors are saved as individual structures instead of a grid, that actor will still be loaded by the game. But for editing a level, you should make sure the last line is visible, so that it's possible to place actors in that line or remove them from there.<br />
<br />
==== Mapping cell values to tiles ====<br />
<br />
The method of mapping elements in the <tt>iMapData</tt> structure into tiles is fairly straightforward. Each cell value is a pixel index into the tilemap. Imagine the tileset laid out left to right all on the one row. Since each tile is 8x8 pixels, at 16 pixels into the image, the third tile will begin (x = 0 for first tile, x = 8 for second tile, x = 16 for third tile.) The cell value is essentially a pixel x-coordinate into the tileset.<br />
<br />
Note that in the tileset file, the solid tiles are made up of 2000 4-plane (16-colour) images, and these are followed by 1000 5-plane images (16-colour + transparency.) Although separate images, they appear to be concatenated when the game loads them, as the cell value will be zero for the first solid tile, it will be eight for the second solid tile, it will be 15992 for the last solid tile, and it will be 16000 for the first masked tile.<br />
<br />
This means that if the solid and masked tiles have been treated as separate images, a check will need to be performed so that any cell value below 16000 is loaded from the solid tileset, and any value larger than this is loaded from the masked tileset (after subtracting 16000 from the cell value, to put it at zero for the first masked tile.) However, for some reason the values for the masked tiles are at multiples of five tiles (tile #0 (x=0) is the first tile, tile #5 (x=40) is the second tile.) This formula can be used to convert the values into tile numbers once they stray into the masked tile area:<br />
<br />
#define COSMO_TS_SOLID_NUMTILES 2000 // 40x25<br />
#define COSMO_TS_MASKED_NUMTILES 1000 // 40x4<br />
<br />
tile = cell_value / 8<br />
if (tile > COSMO_TS_SOLID_NUMTILES) {<br />
// Once we're in the masked tileset it counts up in multiples of five planes<br />
tile = COSMO_TS_SOLID_NUMTILES + (tile - COSMO_TS_SOLID_NUMTILES) / 5;<br />
}<br />
// Now 'tile' will be between 0 and 2999 inclusive<br />
<br />
As an example of a few tile values:<br />
<br />
{|class="wikitable"<br />
! Cell value !! Tile number !! Tileset !! Index !! Comments<br />
|-<br />
| 0 || 0 || N/A || N/A || See through to map backdrop<br />
|-<br />
| 8 || 1 || Solid || 1 || First solid tile, note increment of 8<br />
|-<br />
| 16 || 2 || Solid || 2 || Second solid tile, increment of 8 again<br />
|-<br />
| 15992 || 1999 || Solid || 1999 || Last solid tile<br />
|-<br />
| 16000 || 2000 || Masked || 0 || First masked tile<br />
|-<br />
| 16040 || 2001 || Masked || 1 || Second masked tile, note increment of 40<br />
|-<br />
| 16080 || 2002 || Masked || 2 || Third masked tile, increment of 40 again<br />
|-<br />
| 55960 || 2999 || Masked || 999 || Last masked tile<br />
|-<br />
| 56000 || N/A || N/A || N/A || Should never get a value this size or larger<br />
|}<br />
<br />
Note that while the cell value cannot be out of range for the solid tiles/background layer (since any values larger than 16000 will be loaded from the masked tileset) the cell values for the masked tileset have no such restriction. (Although obviously out of range tiles will not be drawn correctly by the engine!)<br />
<br />
==== Gotchas ====<br />
<br />
* The first tile in the solid tileset is used as a transparent tile. It will appear completely black if drawn (e.g. in a map editor) however the game does not draw this tile, so any cells with this as the background cell will be where the map backdrop shows through. If you wish to draw the map with the backdrop in-place, remember not to draw tile #0 over the top of the backdrop.<br />
<br />
=== Actor data ===<br />
<br />
The <tt>actorData</tt> block is in the following format:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iType||Type of actor<br />
|-<br />
|UINT16LE iX||X-coordinate of actor (in tile units)<br />
|-<br />
|UINT16LE iY||Y-coordinate of actor (in tile units)<br />
|}<br />
<br />
Because the <tt>iActorSize</tt> value in the header is in UINT16s and there are three UINT16s per actor, the number of actors can be obtained quite simply:<br />
<br />
iNumActors = iActorSize / 3<br />
<br />
This is assuming <tt>iActorSize</tt> is reliable - the original specs from Dave Bollinger indicate this is not always the case for DukeII, but no examples are known at the moment.<br />
<br />
==== Mapping Actor Types to image indices ====<br />
<br />
For the ActorTypes from 32 to 296 (inclusive), you can get an image index from ACTORS.MNI and ACTRINFO.MNI like this:<br />
<br />
ImageIndex = ActorType - 31<br />
<br />
However, this does not work for every ActorType. Some share the same images (e.g.: normal stars and falling stars), some use flipped versions of other images (like the pink eye plants) and some are invisible in the game. In either case, the index in the ACTRINFO.MNI will contain no data. You will either have to include hard-coded info to draw these, or just draw something else (like the actual ActorType as text).<br />
<br />
==== List of Actor Types ====<br />
<br />
This is a list of all the actor types that can be found in the original levels of the three episodes. There might be more ActorTypes that work in the game. For example, 69 is probably the (falling) "Onion" item as you can guess by looking at the numbers 62-68.<br />
<br />
0 PLAYER: Cosmo (Starting position facing right)<br />
1 moving platform (fixed path)<br />
2 PLAT/HAZARD: mud fountain 1 (small)<br />
3 PLAT/HAZARD: mud fountain 2 (normal)<br />
4 PLAT/HAZARD: mud fountain 3 (big)<br />
5 PLAT/HAZARD: mud fountain 4 (huge)<br />
6 BRIGHTNESS: left border of light<br />
7 BRIGHTNESS: light source (top center)<br />
8 BRIGHTNESS: right border of light<br />
<br />
22 ??? (only in A8.MNI, doesn't seem to be doing anything)<br />
<br />
32 BONUS: Star (200)<br />
33 PLAT: Trampoline (ground)<br />
34 HAZARD: Big Arrow (from right to left)<br />
35 HAZARD: Big Arrow (from left to right)<br />
36 HAZARD: Fireball (from right to left)<br />
37 HAZARD: Fireball (from left to right)<br />
38 Blue Switch (on ceiling)<br />
39 Red Switch (on ceiling)<br />
40 Green Switch <br />
41 Yellow Switch<br />
42 Blue Door<br />
43 Red Door<br />
44 Green Door<br />
45 Yellow Door<br />
<br />
47 OBJECT: Blue Trampoline Car<br />
48 HAZARD: Double Spikes on ground<br />
49 HAZARD: Double Spikes (coming out of the ground)<br />
<br />
51 HAZARD: Big Saw Blade<br />
<br />
56 HAZARD: Green Ball<br />
<br />
59 BONUS: Power Up (health/12800)<br />
60 BARREL: Power Up (health/12800)<br />
<br />
62 CRATE: Green Tomato<br />
63 BONUS: Green Tomato (falling)<br />
64 CRATE: Tomato (200)<br />
65 BONUS: Tomato (falling)<br />
66 CRATE: Yellow/Cyan Fruit<br />
67 BONUS: Yellow/Cyan Fruit (falling)<br />
68 CRATE: Onion<br />
<br />
70 OBJECT: Exit Sign (ends level on touch)<br />
<br />
72 HAZARD: Spear (coming down from ceiling)<br />
73 HAZARD: Green stuff leaking (NOT dropping)<br />
74 HAZARD: Green stuff dropping down<br />
75 ENEMY: Blue Flame flying up & down<br />
76 HAZARD: "Two Tons" Weight going down & up<br />
77 ENEMY: Jumping Bullets<br />
78 ENEMY: Stone Heads (Only drops when Cosmo is close by)<br />
79 ENEMY: Big Yellow Spike on ceiling<br />
80 ENEMY: Big Yellow Spike on ceiling (falling down)<br />
81 ENEMY: Big Yellow Spike on ground<br />
82 ENEMY: Ghost<br />
83 CRATE: Green thingy<br />
<br />
85 ENEMY: Cyan Ball<br />
86 ENEMY: Small Red Plant<br />
87 BARREL: Bomb (100)<br />
88 BONUS: Bomb (100)<br />
<br />
90 switch (1)<br />
<br />
92 switch (2)<br />
93 question mark<br />
94 claw spikes from ground<br />
95 Rubber Wall (can blow it up)<br />
96 ENEMY: cyan jumping ball<br />
<br />
100 CREATURE: Green Roamer Worm<br />
101 PIPES: Arrow Up<br />
102 PIPES: Arrow Down<br />
103 PIPES: Arrow Left<br />
104 PIPES: Arrow Right<br />
105 ENEMY: Egg Head (special?) -- only 1x: in B2.MNI<br />
106 ENEMY: Egg Head<br />
<br />
109 HAZARD: Spike on ground (animated)<br />
<br />
111 HAZARD: Spike on ceiling (animated)<br />
112 CRATE/BONUS: Burger<br />
<br />
114 ENEMY: Blue/Red plant<br />
<br />
116 BONUS: Purple Grapes (800)<br />
117 ENEMY: Blue Ball<br />
118 ENEMY: Spikes (on left wall)<br />
119 ENEMY: Spikes (on left wall) goes in & out of wall<br />
120 ENEMY: Spikes (on right wall)<br />
121 ENEMY: Robot with Blue Vertical Electric Arc<br />
122 PLAT: Blue Platform (splits open when standing on top)<br />
123 ENEMY: Spark<br />
<br />
125 BONUS: Cyan Mushroom (400)<br />
126 DECO: Pink Eye Plant<br />
127 DECO: Pink Eye Plant (hanging upside down)<br />
<br />
132 ENEMY: Big Red Jumper<br />
133 ENEMY: BOSS (Purple Alien in Spike-bottomed ship)<br />
<br />
135 PIPES: Exit<br />
136 PIPES: Entrance<br />
137 ENEMY: Suction-Cup-Legged Alien.<br />
138 Scooter (Teleporter 1)<br />
139 Scooter (Teleporter 2)<br />
<br />
142 ENEMY: Cyan Spitting Plant (on left wall)<br />
143 ENEMY: Cyan Spitting Plant (on right wall)<br />
144 ENEMY: Blue Turret Alien<br />
145 PLAT: Hoverboard<br />
146 CRATE: pile of green balls<br />
<br />
148 BARREL: Saxophone-like thing<br />
149 ENEMY: Red Chomper Alien<br />
150 CRATE: Salad<br />
151 switch (3)<br />
152 switch (4)<br />
153 HAZARD: Vertical Energy Beam (Deactivated by Switch)<br />
154 HAZARD: Horizontal Energy Beam (Deactivated by Switch)<br />
155 CREATURE/HAZARD: Pink slug/Worm<br />
156 HINT: "These hint globes will help you along your journey. Press the up key to reread them."<br />
157 ENEMY: Silver Robot (pushes player around)<br />
158 ENEMY: Robot<br />
<br />
160 PLAT/HAZARD: Dragonfly<br />
161 Crate/Box (can only be destroyed with bombs)<br />
<br />
165 BONUS: Bottle with red liquid<br />
166 BONUS: Green thing<br />
167 BONUS: Blue thing<br />
168 BONUS: Salad?<br />
169 BONUS: Pile of green things<br />
170 BONUS: whatever..<br />
<br />
172 BONUS: blue thing<br />
<br />
174 DECO/BONUS: Satellite<br />
<br />
176 ENEMY: Green Plant<br />
177 BONUS: 5 Yellow Grapes (800)<br />
178 BONUS: Headdress-like object<br />
179 CRATE: with item 178<br />
180 DECO: Jaws & Tongue<br />
181 invisible exit marker (go right to exit)<br />
182 small flame<br />
183 ENEMY: Big Red Plant (spitting Blue Balls/catapult)<br />
<br />
185 BONUS: Blue Crystal (on ground)<br />
186 BONUS: Red Crystal (on ground)<br />
187 BARREL: Red/Green Gem<br />
188 BARREL: Blue Crystal<br />
189 BARREL: Red Crystal<br />
190 BONUS: Green Tomato<br />
191 BONUS: Tomato<br />
192 BONUS: Yellow/Cyan Fruit (200)<br />
193 HAZARD: Clamp Trap<br />
194 PLAT: Blue Cube (falls down when you walk off)<br />
195 MESSAGE: "What's happening? Is Cosmo falling to his doom?"<br />
196 MESSAGE: "Is there no end to this pit? An what danger awaits below?!"<br />
197 Level End Object?<br />
198 CRATE: Root (400)<br />
199 BONUS: Root<br />
200 CRATE: 4 Brown Berries (400)<br />
201 BONUS: 4 Brown Berries<br />
<br />
203 BONUS: Potato-like vegetable<br />
204 BARREL: Green Gem<br />
205 BONUS: Green Gem<br />
206 BARREL: Diamond (3200)<br />
207 BONUS: Diamond<br />
<br />
217 ENEMY: Alien-Eating Space Plant (Exits the current level)<br />
218 ENEMY: Blue Bird<br />
219 OBJECT: Rocket<br />
220 BONUS: Invincibility Cube<br />
221 PLAT: Destructible Pedestal 1 (14 tiles high)<br />
222 PLAT: Destructible Pedestal 2 (20 tiles high)<br />
223 PLAT: Destructible Pedestal 3 (26 tiles high)<br />
224 BARREL: Diamond 2<br />
225 BONUS: Diamond 2 (falling)<br />
226 BARREL: Red Berry<br />
227 BONUS: Red Berry (falling)<br />
228 BARREL: Crystal (800)<br />
229 BONUS: Crystal (falling)<br />
230 BARREL: Blue Gem<br />
231 BONUS: Blue Gem (falling)<br />
<br />
233 DECO: Rocket Exhaust<br />
234 EXIT: Teleporter<br />
235 HINT: "Bump head into switch above!"<br />
236 HINT: "The ice in this cave is very, very slippery."<br />
237 HINT: "Use this shield for temporary invincibility."<br />
238 HINT: "You found a secret area!!! Good Job!"<br />
239 HINT: "In hight places look up to find bonus objects."<br />
240 HINT: "Out of Order..."<br />
241 HINT: "This might be a good time to save your game!"<br />
242 HINT: "Press your up key to use the transporter."<br />
243 HINT: "(1) FOR..."<br />
244 BONUS: Diamond 2<br />
245 BONUS: Red Berry<br />
246 BONUS: Crystal<br />
247 BONUS: Blue Gem (800)<br />
248 PLAT: Catapult on ceiling<br />
249 BARREL: Headphones<br />
250 BONUS: Headphones<br />
251 BONUS: Headphones (falling)<br />
252 OBJECT: Frozen Duke NukUm<br />
<br />
254 BONUS: 3 Bananas (800)<br />
255 CRATE: Strawberry<br />
256 BONUS: Strawberry (400)<br />
<br />
258 CRATE: Brown Pear<br />
259 BONUS: Brown Pear<br />
<br />
261 CRATE: Carrot<br />
262 BONUS: Carrot (400)<br />
<br />
264 DANGER: Flame (<-)<br />
265 DANGER: Flame (->)<br />
<br />
267 HAZARD: Leaking Red acid<br />
268 HAZARD: Dripping Red Acid<br />
269 HINT: "(2) EXTRA..."<br />
270 HINT: "(3) POINTS,..."<br />
271 HINT: "(4) DESTROY..."<br />
272 HINT: "(5) HINT..."<br />
273 HINT: "(6) GLOBES!!!"<br />
274 HINT: "The Clam Plants won't hurt you if their mouths are closed."+Clam Sprite<br />
<br />
278 DECO: Big Mouth (end of E1/start of E2)<br />
279 DECO: Normal Smoke Rising<br />
280 DECO: Big Smoke rising<br />
281 EXIT: invisible, end level when you fall below (Bonus Levels only)<br />
<br />
283 BONUS: Red Crystal hanging from ceiling<br />
284 HINT: "Collect the STARS to advance to BONUS STAGES."<br />
285 HINT: "Some creatures require more than one pounce to defeat!"<br />
286 HINT: "Cosmo can climb wall's with his suction hands."+CosmoWallSprite<br />
<br />
294 BONUS: Power Up Module (falling) (health/12800)<br />
295 BONUS: Star (falling) (200)<br />
296 end of episode 2 trigger?<br />
<br />
The hint texts are the messages you get in episode 1, the other episodes have different (and less!) messages. The later hint globes probably don't work in those episodes.<br />
<br />
== Credits ==<br />
<br />
This file format was reverse engineered by [http://www.geocities.com/dooknookimklassik/ Dave Bollinger]. Most of this info came from the [http://www.geocities.com/dooknookimklassik/dn2specs.txt Duke II specs on his website], with [[User:Malvineous|Malvineous]] working out which bits to remove to read Cosmo maps. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Level_Format&diff=4527Cosmo Level Format2013-02-15T19:58:45Z<p>T-Squared: /* List of Actor Types */ (Changed a lot of item names and terms so they were easier to understand. Will modify more later.)</p>
<hr />
<div>{{Map Infobox<br />
| Type = 2D tile-based<br />
| Layers = 3<br />
| Tile size = 8&times;8<br />
| Viewport = 304&times;144<br />
| Game1 = Cosmo's Cosmic Adventures<br />
}}<br />
<br />
== File format ==<br />
The file is in this basic layout:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iFlags||Flags indicating music, backdrop and other stuff<br />
|-<br />
|UINT16LE iMapWidth||Map width in tiles<br />
|-<br />
|UINT16LE iActorSize||Number of UINT16 values in the actor block<br />
|-<br />
|ACTORDATA actorData[]||Variable-length array of all the actors in the level<br />
|-<br />
|BYTE bgLayer[65528]||The map data for the background layer<br />
|}<br />
<br />
The iMapWidth values in the original Cosmo levels is either 64, 128, 256 or 512. The "view window" in the game is 304x144 Pixels, so the minimal map width would be 38. However, the width must be a power of 2 to work (from 32 to 2048).<br />
<br />
The iActorSize values are reliable for all the original Cosmo level files (Version 1.20).<br />
<br />
The map data is actually sized 65528 Bytes or 32764 Words. Each entry in this block is divisable by 8 (see [[#Mapping cell values to tiles]]).<br />
<br />
=== Level Flags ===<br />
<br />
The structure of the bits in the iFlags value is as follows:<br />
<br />
[ mmmmm | ppp | yxr | bbbbb ]<br />
<br />
m: music index<br />
p: palette animation type<br />
y: y-scrolling backdrop<br />
x: x-scrolling backdrop<br />
r: rain<br />
b: backdrop index<br />
<br />
The indices for music and backdrop refer to an array of filename strings stored in the executable. You can find them by searching for the first filename in each array. For backdrops, the first filename (index: 0) is <tt>BDBLANK.MNI</tt>, for music it's <tt>MCAVES.MNI</tt>. Note that some backdrop files are not used by the games (and therefore are not not included).<br />
<br />
The palette animation types indicate the following:<br />
<br />
%000: (most levels) no palette changes<br />
%001: (A4) random lightning (with thunder soundeffect)<br />
%010: (C8-C10) cycling: red -> yellow -> white<br />
%011: (A7) cycling: red -> green -> blue<br />
%100: (A8, B3, B4, B7) cycling: black -> grey -> white<br />
%101: (C6, C7) flashing: red -> magenta -> white<br />
%110: (C1) replace dark magenta with black, no animation unless triggered by a bomb actor. (present in Episode 3, Level 1 of Cosmo.)<br />
<br />
=== Background Layer ===<br />
<br />
The <tt>bgLayer</tt> block contains the grid/cell data:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iMapData[32764]||Actual map data<br />
|}<br />
<br />
Each "element" in <tt>iMapData</tt> refers to the foreground and/or background tile used in a single grid cell. The grids are arranged left to right, top to bottom, so the index can be calculated by this formula:<br />
<br />
int iIndex = (y * iMapWidth) + x;<br />
iMapData[iIndex] = <new value to set at x,y><br />
<br />
The map data in the original Cosmo level files is a constant 32764 UINT16LE cells long (65528 bytes), and the engine will never read more than 65535 bytes. However, the game calculates the map height by dividing the width in bytes by 65536:<br />
<br />
int iMapHeight = 32768 / iMapWidth;<br />
<br />
Since the width of the map is always a power of 2 (min. 64), you can see that each file is "missing" 8 Bytes (or 4 Words). That means the last line of the map will always be missing the last 4 tiles. The game ignores that last, incomplete line. However, in one level (A8.MNI), there is an actor placed in that last line. Since actors are saved as individual structures instead of a grid, that actor will still be loaded by the game. But for editing a level, you should make sure the last line is visible, so that it's possible to place actors in that line or remove them from there.<br />
<br />
==== Mapping cell values to tiles ====<br />
<br />
The method of mapping elements in the <tt>iMapData</tt> structure into tiles is fairly straightforward. Each cell value is a pixel index into the tilemap. Imagine the tileset laid out left to right all on the one row. Since each tile is 8x8 pixels, at 16 pixels into the image, the third tile will begin (x = 0 for first tile, x = 8 for second tile, x = 16 for third tile.) The cell value is essentially a pixel x-coordinate into the tileset.<br />
<br />
Note that in the tileset file, the solid tiles are made up of 2000 4-plane (16-colour) images, and these are followed by 1000 5-plane images (16-colour + transparency.) Although separate images, they appear to be concatenated when the game loads them, as the cell value will be zero for the first solid tile, it will be eight for the second solid tile, it will be 15992 for the last solid tile, and it will be 16000 for the first masked tile.<br />
<br />
This means that if the solid and masked tiles have been treated as separate images, a check will need to be performed so that any cell value below 16000 is loaded from the solid tileset, and any value larger than this is loaded from the masked tileset (after subtracting 16000 from the cell value, to put it at zero for the first masked tile.) However, for some reason the values for the masked tiles are at multiples of five tiles (tile #0 (x=0) is the first tile, tile #5 (x=40) is the second tile.) This formula can be used to convert the values into tile numbers once they stray into the masked tile area:<br />
<br />
#define COSMO_TS_SOLID_NUMTILES 2000 // 40x25<br />
#define COSMO_TS_MASKED_NUMTILES 1000 // 40x4<br />
<br />
tile = cell_value / 8<br />
if (tile > COSMO_TS_SOLID_NUMTILES) {<br />
// Once we're in the masked tileset it counts up in multiples of five planes<br />
tile = COSMO_TS_SOLID_NUMTILES + (tile - COSMO_TS_SOLID_NUMTILES) / 5;<br />
}<br />
// Now 'tile' will be between 0 and 2999 inclusive<br />
<br />
As an example of a few tile values:<br />
<br />
{|class="wikitable"<br />
! Cell value !! Tile number !! Tileset !! Index !! Comments<br />
|-<br />
| 0 || 0 || N/A || N/A || See through to map backdrop<br />
|-<br />
| 8 || 1 || Solid || 1 || First solid tile, note increment of 8<br />
|-<br />
| 16 || 2 || Solid || 2 || Second solid tile, increment of 8 again<br />
|-<br />
| 15992 || 1999 || Solid || 1999 || Last solid tile<br />
|-<br />
| 16000 || 2000 || Masked || 0 || First masked tile<br />
|-<br />
| 16040 || 2001 || Masked || 1 || Second masked tile, note increment of 40<br />
|-<br />
| 16080 || 2002 || Masked || 2 || Third masked tile, increment of 40 again<br />
|-<br />
| 55960 || 2999 || Masked || 999 || Last masked tile<br />
|-<br />
| 56000 || N/A || N/A || N/A || Should never get a value this size or larger<br />
|}<br />
<br />
Note that while the cell value cannot be out of range for the solid tiles/background layer (since any values larger than 16000 will be loaded from the masked tileset) the cell values for the masked tileset have no such restriction. (Although obviously out of range tiles will not be drawn correctly by the engine!)<br />
<br />
==== Gotchas ====<br />
<br />
* The first tile in the solid tileset is used as a transparent tile. It will appear completely black if drawn (e.g. in a map editor) however the game does not draw this tile, so any cells with this as the background cell will be where the map backdrop shows through. If you wish to draw the map with the backdrop in-place, remember not to draw tile #0 over the top of the backdrop.<br />
<br />
=== Actor data ===<br />
<br />
The <tt>actorData</tt> block is in the following format:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iType||Type of actor<br />
|-<br />
|UINT16LE iX||X-coordinate of actor (in tile units)<br />
|-<br />
|UINT16LE iY||Y-coordinate of actor (in tile units)<br />
|}<br />
<br />
Because the <tt>iActorSize</tt> value in the header is in UINT16s and there are three UINT16s per actor, the number of actors can be obtained quite simply:<br />
<br />
iNumActors = iActorSize / 3<br />
<br />
This is assuming <tt>iActorSize</tt> is reliable - the original specs from Dave Bollinger indicate this is not always the case for DukeII, but no examples are known at the moment.<br />
<br />
==== Mapping Actor Types to image indices ====<br />
<br />
For the ActorTypes from 32 to 296 (inclusive), you can get an image index from ACTORS.MNI and ACTRINFO.MNI like this:<br />
<br />
ImageIndex = ActorType - 31<br />
<br />
However, this does not work for every ActorType. Some share the same images (e.g.: normal stars and falling stars), some use flipped versions of other images (like the pink eye plants) and some are invisible in the game. In either case, the index in the ACTRINFO.MNI will contain no data. You will either have to include hard-coded info to draw these, or just draw something else (like the actual ActorType as text).<br />
<br />
==== List of Actor Types ====<br />
<br />
This is a list of all the actor types that can be found in the original levels of the three episodes. There might be more ActorTypes that work in the game. For example, 69 is probably the (falling) "Onion" item as you can guess by looking at the numbers 62-68.<br />
<br />
0 PLAYER: Cosmo (Starting position facing right)<br />
1 moving platform (fixed path)<br />
2 PLAT/HAZARD: mud fountain 1 (small)<br />
3 PLAT/HAZARD: mud fountain 2 (normal)<br />
4 PLAT/HAZARD: mud fountain 3 (big)<br />
5 PLAT/HAZARD: mud fountain 4 (huge)<br />
6 BRIGHTNESS: left border of light<br />
7 BRIGHTNESS: light source (top center)<br />
8 BRIGHTNESS: right border of light<br />
<br />
22 ??? (only in A8.MNI, doesn't seem to be doing anything)<br />
<br />
32 BONUS: Star (200)<br />
33 PLAT: Trampoline (ground)<br />
34 HAZARD: Big Arrow (from right to left)<br />
35 HAZARD: Big Arrow (from left to right)<br />
36 HAZARD: Fireball (from right to left)<br />
37 HAZARD: Fireball (from left to right)<br />
38 Blue Switch (on ceiling)<br />
39 Red Switch (on ceiling)<br />
40 Green Switch <br />
41 Yellow Switch<br />
42 Blue Door<br />
43 Red Door<br />
44 Green Door<br />
45 Yellow Door<br />
<br />
47 OBJECT: Blue Trampoline Car<br />
48 HAZARD: Double Spikes on ground<br />
49 HAZARD: Double Spikes (coming out of the ground)<br />
<br />
51 HAZARD: Big Saw Blade<br />
<br />
56 HAZARD: Green Ball<br />
<br />
59 BONUS: Power Up (health/12800)<br />
60 BARREL: Power Up (health/12800)<br />
<br />
62 CRATE: Green Tomato<br />
63 BONUS: Green Tomato (falling)<br />
64 CRATE: Tomato (200)<br />
65 BONUS: Tomato (falling)<br />
66 CRATE: Yellow/Cyan Fruit<br />
67 BONUS: Yellow/Cyan Fruit (falling)<br />
68 CRATE: Onion<br />
<br />
70 OBJECT: Exit Sign (ends level on touch)<br />
<br />
72 HAZARD: Spear (coming down from ceiling)<br />
73 HAZARD: Green stuff leaking (NOT dropping)<br />
74 HAZARD: Green stuff dropping down<br />
75 ENEMY: Blue Flame flying up & down<br />
76 HAZARD: "Two Tons" Weight going down & up<br />
77 ENEMY: Jumping Bullets<br />
78 ENEMY: Stone Heads (Only drops when Cosmo is close by)<br />
79 ENEMY: Big Yellow Spike on ceiling<br />
80 ENEMY: Big Yellow Spike on ceiling (falling down)<br />
81 ENEMY: Big Yellow Spike on ground<br />
82 ENEMY: Ghost<br />
83 CRATE: Green thingy<br />
<br />
85 ENEMY: Cyan Ball<br />
86 ENEMY: Small Red Plant<br />
87 BARREL: Bomb (100)<br />
88 BONUS: Bomb (100)<br />
<br />
90 switch (1)<br />
<br />
92 switch (2)<br />
93 question mark<br />
94 claw spikes from ground<br />
95 Rubber Wall (can blow it up)<br />
96 ENEMY: cyan jumping ball<br />
<br />
100 CREATURE: Green Roamer Worm<br />
101 PIPES: Arrow Up<br />
102 PIPES: Arrow Down<br />
103 PIPES: Arrow Left<br />
104 PIPES: Arrow Right<br />
105 ENEMY: Egg Head (special?) -- only 1x: in B2.MNI<br />
106 ENEMY: Egg Head<br />
<br />
109 HAZARD: Spike on ground (animated)<br />
<br />
111 ENEMY: Spike on ceiling (animated)<br />
112 CRATE/BONUS: Burger<br />
<br />
114 ENEMY: Blue/Red plant<br />
<br />
116 BONUS: Purple Grapes (800)<br />
117 ENEMY: Blue Ball<br />
118 ENEMY: Spikes (on left wall)<br />
119 ENEMY: Spikes (on left wall) goes in & out of wall<br />
120 ENEMY: Spikes (on right wall)<br />
121 ENEMY: Robot with Blue Vertical Electric Arc<br />
122 PLAT: Blue Platform (opens afer a few seconds)<br />
123 ENEMY: Spark<br />
<br />
125 BONUS: Cyan Mushroom (400)<br />
126 DECO: Pink Eye Plant<br />
127 DECO: Pink Eye Plant (hanging upside down)<br />
<br />
132 ENEMY: Big Red Jumper<br />
133 ENEMY: BOSS (Purple Alien in Spike-bottomed ship)<br />
<br />
135 PIPES: Exit<br />
136 PIPES: Entrance<br />
137 ENEMY: Yellow Dude with blue legs<br />
138 Scooter (Teleporter 1)<br />
139 Scooter (Teleporter 2)<br />
<br />
142 ENEMY: Cyan Spitting Plant (on left wall)<br />
143 ENEMY: Cyan Spitting Plant (on right wall)<br />
144 ENEMY: Blue spitting thing<br />
145 PLAT: Hoverboard<br />
146 CRATE: pile of green balls<br />
<br />
148 BARREL: Saxophone-like thing<br />
149 ENEMY: little red dude<br />
150 CRATE: Salad<br />
151 switch (3)<br />
152 switch (4)<br />
153 HAZARD: Vertical Energy Beam (Deactivated by Switch)<br />
154 HAZARD: Horizontal Energy Beam (Deactivated by Switch)<br />
155 ENEMY: slug/Worm<br />
156 HINT: "These hint globes will help you along your journey. Press the up key to reread them."<br />
157 ENEMY: Silver Robot (pushes player around)<br />
158 ENEMY: Robot<br />
<br />
160 PLAT/ENEMY: Dragonfly<br />
161 Crate/Box (can only be destroyed with bombs)<br />
<br />
165 BONUS: Bottle with red liquid<br />
166 BONUS: Green thing<br />
167 BONUS: Blue thing<br />
168 BONUS: Salad?<br />
169 BONUS: Pile of green things<br />
170 BONUS: whatever..<br />
<br />
172 BONUS: blue thing<br />
<br />
174 DECO/BONUS: Satellite<br />
<br />
176 ENEMY: Green Plant<br />
177 BONUS: 5 Yellow Grapes (800)<br />
178 BONUS: Headdress-like object<br />
179 CRATE: with item 178<br />
180 DECO: Jaws & Tongue<br />
181 invisible exit marker (go right to exit)<br />
182 small flame<br />
183 ENEMY: Big Red Plant (spitting Blue Balls/catapult)<br />
<br />
185 BONUS: Blue Crystal (on ground)<br />
186 BONUS: Red Crystal (on ground)<br />
187 BARREL: Red/Green Gem<br />
188 BARREL: Blue Crystal<br />
189 BARREL: Red Crystal<br />
190 BONUS: Green Tomato<br />
191 BONUS: Tomato<br />
192 BONUS: Yellow/Cyan Fruit (200)<br />
193 HAZARD: Clamp Trap<br />
194 PLAT: Blue Cube (falls down when you walk off)<br />
195 MESSAGE: "What's happening? Is Cosmo falling to his doom?"<br />
196 MESSAGE: "Is there no end to this pit? An what danger awaits below?!"<br />
197 Level End Object?<br />
198 CRATE: Root (400)<br />
199 BONUS: Root<br />
200 CRATE: 4 Brown Berries (400)<br />
201 BONUS: 4 Brown Berries<br />
<br />
203 BONUS: Potato-like vegetable<br />
204 BARREL: Green Gem<br />
205 BONUS: Green Gem<br />
206 BARREL: Diamond (3200)<br />
207 BONUS: Diamond<br />
<br />
217 ENEMY: Big Green Plant (level exit?)<br />
218 ENEMY: Blue Bird<br />
219 OBJECT: Rocket<br />
220 BONUS: Invincibility<br />
221 PLAT: Destructible Pedestal 1 (14 tiles high)<br />
222 PLAT: Destructible Pedestal 2 (20 tiles high)<br />
223 PLAT: Destructible Pedestal 3 (26 tiles high)<br />
224 BARREL: Diamond 2<br />
225 BONUS: Diamond 2 (falling)<br />
226 BARREL: Red Berry<br />
227 BONUS: Red Berry (falling)<br />
228 BARREL: Crystal (800)<br />
229 BONUS: Crystal (falling)<br />
230 BARREL: Blue Gem<br />
231 BONUS: Blue Gem (falling)<br />
<br />
233 DECO: Rocket Exhaust<br />
234 Scooter (Level Exit)<br />
235 HINT: "Bump head into switch above!"<br />
236 HINT: "The ice in this cave is very, very slippery."<br />
237 HINT: "Use this shield for temporary invincibility."<br />
238 HINT: "You found a secret area!!! Good Job!"<br />
239 HINT: "In hight places look up to find bonus objects."<br />
240 HINT: "Out of Order..."<br />
241 HINT: "This might be a good time to save your game!"<br />
242 HINT: "Press your up key to use the transporter."<br />
243 HINT: "(1) FOR..."<br />
244 BONUS: Diamond 2<br />
245 BONUS: Red Berry<br />
246 BONUS: Crystal<br />
247 BONUS: Blue Gem (800)<br />
248 PLAT: Catapult on ceiling<br />
249 BARREL: Headphones<br />
250 BONUS: Headphones<br />
251 BONUS: Headphones (falling)<br />
252 OBJECT: Frozen Duke NukUm<br />
<br />
254 BONUS: 3 Bananas (800)<br />
255 CRATE: Strawberry<br />
256 BONUS: Strawberry (400)<br />
<br />
258 CRATE: Brown Pear<br />
259 BONUS: Brown Pear<br />
<br />
261 CRATE: Carrot<br />
262 BONUS: Carrot (400)<br />
<br />
264 DANGER: Flame (<-)<br />
265 DANGER: Flame (->)<br />
<br />
267 HAZARD: Leaking Red acid<br />
268 HAZARD: Dripping Red Acid<br />
269 HINT: "(2) EXTRA..."<br />
270 HINT: "(3) POINTS,..."<br />
271 HINT: "(4) DESTROY..."<br />
272 HINT: "(5) HINT..."<br />
273 HINT: "(6) GLOBES!!!"<br />
274 HINT: "The Clam Plants won't hurt you if their mouths are closed."+Clam Sprite<br />
<br />
278 DECO: Big Mouth (end of E1/start of E2)<br />
279 DECO: Normal Smoke Rising<br />
280 DECO: Big Smoke rising<br />
281 invisible, end level when you fall below (Bonus Levels only)<br />
<br />
283 BONUS: Red Crystal hanging from ceiling<br />
284 HINT: "Collect the STARS to advance to BONUS STAGES."<br />
285 HINT: "Some creatures require more than one pounce to defeat!"<br />
286 HINT: "Cosmo can climb wall's with his suction hands."+CosmoWallSprite<br />
<br />
294 BONUS: Power Up Module (falling) (health/12800)<br />
295 BONUS: Star (falling) (200)<br />
296 end of episode 2 trigger?<br />
<br />
The hint texts are the messages you get in episode 1, the other episodes have different (and less!) messages. The later hint globes probably don't work in those episodes.<br />
<br />
== Credits ==<br />
<br />
This file format was reverse engineered by [http://www.geocities.com/dooknookimklassik/ Dave Bollinger]. Most of this info came from the [http://www.geocities.com/dooknookimklassik/dn2specs.txt Duke II specs on his website], with [[User:Malvineous|Malvineous]] working out which bits to remove to read Cosmo maps. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=4519User:T-Squared2013-02-14T11:29:14Z<p>T-Squared: </p>
<hr />
<div>Welcome to my User page.<br />
<br />
I'm working on the first true Cosmo Mod: "Cosmo's Cosmic Adventure 2: HUMANIZED!!!", but I can't do this alone. I need people to help me bring this idea to life. (I know that sounds cheesy, but I really think this idea can happen as a real mod. :D)<br />
<br />
Link to game specifics required coming soon.</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo_Level_Format&diff=4514Cosmo Level Format2013-02-08T20:11:52Z<p>T-Squared: /* Level Flags */ You forgot that Flag C1 does have an animation cycle, but isn't triggered unless a bomb dropped by Cosmo explodes.</p>
<hr />
<div>{{Map Infobox<br />
| Type = 2D tile-based<br />
| Layers = 3<br />
| Tile size = 8&times;8<br />
| Viewport = 304&times;144<br />
| Game1 = Cosmo's Cosmic Adventures<br />
}}<br />
<br />
== File format ==<br />
The file is in this basic layout:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iFlags||Flags indicating music, backdrop and other stuff<br />
|-<br />
|UINT16LE iMapWidth||Map width in tiles<br />
|-<br />
|UINT16LE iActorSize||Number of UINT16 values in the actor block<br />
|-<br />
|ACTORDATA actorData[]||Variable-length array of all the actors in the level<br />
|-<br />
|BYTE bgLayer[65528]||The map data for the background layer<br />
|}<br />
<br />
The iMapWidth values in the original Cosmo levels is either 64, 128, 256 or 512. The "view window" in the game is 304x144 Pixels, so the minimal map width would be 38. However, the width must be a power of 2 to work (from 32 to 2048).<br />
<br />
The iActorSize values are reliable for all the original Cosmo level files (Version 1.20).<br />
<br />
The map data is actually sized 65528 Bytes or 32764 Words. Each entry in this block is divisable by 8 (see [[#Mapping cell values to tiles]]).<br />
<br />
=== Level Flags ===<br />
<br />
The structure of the bits in the iFlags value is as follows:<br />
<br />
[ mmmmm | ppp | yxr | bbbbb ]<br />
<br />
m: music index<br />
p: palette animation type<br />
y: y-scrolling backdrop<br />
x: x-scrolling backdrop<br />
r: rain<br />
b: backdrop index<br />
<br />
The indices for music and backdrop refer to an array of filename strings stored in the executable. You can find them by searching for the first filename in each array. For backdrops, the first filename (index: 0) is <tt>BDBLANK.MNI</tt>, for music it's <tt>MCAVES.MNI</tt>. Note that some backdrop files are not used by the games (and therefore are not not included).<br />
<br />
The palette animation types indicate the following:<br />
<br />
%000: (most levels) no palette changes<br />
%001: (A4) random lightning (with thunder soundeffect)<br />
%010: (C8-C10) cycling: red -> yellow -> white<br />
%011: (A7) cycling: red -> green -> blue<br />
%100: (A8, B3, B4, B7) cycling: black -> grey -> white<br />
%101: (C6, C7) flashing: red -> magenta -> white<br />
%110: (C1) replace dark magenta with black, no animation unless triggered by a bomb actor. (present in Episode 3, Level 1 of Cosmo.)<br />
<br />
=== Background Layer ===<br />
<br />
The <tt>bgLayer</tt> block contains the grid/cell data:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iMapData[32764]||Actual map data<br />
|}<br />
<br />
Each "element" in <tt>iMapData</tt> refers to the foreground and/or background tile used in a single grid cell. The grids are arranged left to right, top to bottom, so the index can be calculated by this formula:<br />
<br />
int iIndex = (y * iMapWidth) + x;<br />
iMapData[iIndex] = <new value to set at x,y><br />
<br />
The map data in the original Cosmo level files is a constant 32764 UINT16LE cells long (65528 bytes), and the engine will never read more than 65535 bytes. However, the game calculates the map height by dividing the width in bytes by 65536:<br />
<br />
int iMapHeight = 32768 / iMapWidth;<br />
<br />
Since the width of the map is always a power of 2 (min. 64), you can see that each file is "missing" 8 Bytes (or 4 Words). That means the last line of the map will always be missing the last 4 tiles. The game ignores that last, incomplete line. However, in one level (A8.MNI), there is an actor placed in that last line. Since actors are saved as individual structures instead of a grid, that actor will still be loaded by the game. But for editing a level, you should make sure the last line is visible, so that it's possible to place actors in that line or remove them from there.<br />
<br />
==== Mapping cell values to tiles ====<br />
<br />
The method of mapping elements in the <tt>iMapData</tt> structure into tiles is fairly straightforward. Each cell value is a pixel index into the tilemap. Imagine the tileset laid out left to right all on the one row. Since each tile is 8x8 pixels, at 16 pixels into the image, the third tile will begin (x = 0 for first tile, x = 8 for second tile, x = 16 for third tile.) The cell value is essentially a pixel x-coordinate into the tileset.<br />
<br />
Note that in the tileset file, the solid tiles are made up of 2000 4-plane (16-colour) images, and these are followed by 1000 5-plane images (16-colour + transparency.) Although separate images, they appear to be concatenated when the game loads them, as the cell value will be zero for the first solid tile, it will be eight for the second solid tile, it will be 15992 for the last solid tile, and it will be 16000 for the first masked tile.<br />
<br />
This means that if the solid and masked tiles have been treated as separate images, a check will need to be performed so that any cell value below 16000 is loaded from the solid tileset, and any value larger than this is loaded from the masked tileset (after subtracting 16000 from the cell value, to put it at zero for the first masked tile.) However, for some reason the values for the masked tiles are at multiples of five tiles (tile #0 (x=0) is the first tile, tile #5 (x=40) is the second tile.) This formula can be used to convert the values into tile numbers once they stray into the masked tile area:<br />
<br />
#define COSMO_TS_SOLID_NUMTILES 2000 // 40x25<br />
#define COSMO_TS_MASKED_NUMTILES 1000 // 40x4<br />
<br />
tile = cell_value / 8<br />
if (tile > COSMO_TS_SOLID_NUMTILES) {<br />
// Once we're in the masked tileset it counts up in multiples of five planes<br />
tile = COSMO_TS_SOLID_NUMTILES + (tile - COSMO_TS_SOLID_NUMTILES) / 5;<br />
}<br />
// Now 'tile' will be between 0 and 2999 inclusive<br />
<br />
As an example of a few tile values:<br />
<br />
{|class="wikitable"<br />
! Cell value !! Tile number !! Tileset !! Index !! Comments<br />
|-<br />
| 0 || 0 || N/A || N/A || See through to map backdrop<br />
|-<br />
| 8 || 1 || Solid || 1 || First solid tile, note increment of 8<br />
|-<br />
| 16 || 2 || Solid || 2 || Second solid tile, increment of 8 again<br />
|-<br />
| 15992 || 1999 || Solid || 1999 || Last solid tile<br />
|-<br />
| 16000 || 2000 || Masked || 0 || First masked tile<br />
|-<br />
| 16040 || 2001 || Masked || 1 || Second masked tile, note increment of 40<br />
|-<br />
| 16080 || 2002 || Masked || 2 || Third masked tile, increment of 40 again<br />
|-<br />
| 55960 || 2999 || Masked || 999 || Last masked tile<br />
|-<br />
| 56000 || N/A || N/A || N/A || Should never get a value this size or larger<br />
|}<br />
<br />
Note that while the cell value cannot be out of range for the solid tiles/background layer (since any values larger than 16000 will be loaded from the masked tileset) the cell values for the masked tileset have no such restriction. (Although obviously out of range tiles will not be drawn correctly by the engine!)<br />
<br />
==== Gotchas ====<br />
<br />
* The first tile in the solid tileset is used as a transparent tile. It will appear completely black if drawn (e.g. in a map editor) however the game does not draw this tile, so any cells with this as the background cell will be where the map backdrop shows through. If you wish to draw the map with the backdrop in-place, remember not to draw tile #0 over the top of the backdrop.<br />
<br />
=== Actor data ===<br />
<br />
The <tt>actorData</tt> block is in the following format:<br />
<br />
{|class="wikitable"<br />
!Data type!!Description<br />
|-<br />
|UINT16LE iType||Type of actor<br />
|-<br />
|UINT16LE iX||X-coordinate of actor (in tile units)<br />
|-<br />
|UINT16LE iY||Y-coordinate of actor (in tile units)<br />
|}<br />
<br />
Because the <tt>iActorSize</tt> value in the header is in UINT16s and there are three UINT16s per actor, the number of actors can be obtained quite simply:<br />
<br />
iNumActors = iActorSize / 3<br />
<br />
This is assuming <tt>iActorSize</tt> is reliable - the original specs from Dave Bollinger indicate this is not always the case for DukeII, but no examples are known at the moment.<br />
<br />
==== Mapping Actor Types to image indices ====<br />
<br />
For the ActorTypes from 32 to 296 (inclusive), you can get an image index from ACTORS.MNI and ACTRINFO.MNI like this:<br />
<br />
ImageIndex = ActorType - 31<br />
<br />
However, this does not work for every ActorType. Some share the same images (e.g.: normal stars and falling stars), some use flipped versions of other images (like the pink eye plants) and some are invisible in the game. In either case, the index in the ACTRINFO.MNI will contain no data. You will either have to include hard-coded info to draw these, or just draw something else (like the actual ActorType as text).<br />
<br />
==== List of Actor Types ====<br />
<br />
This is a list of all the actor types that can be found in the original levels of the three episodes. There might be more ActorTypes that work in the game. For example, 69 is probably the (falling) "Onion" item as you can guess by looking at the numbers 62-68.<br />
<br />
0 PLAYER: Cosmo (facing right)<br />
1 moving platform (fixed path)<br />
2 PLAT: mud fountain 1 (small)<br />
3 PLAT: mud fountain 2 (normal)<br />
4 PLAT: mud fountain 3 (big)<br />
5 PLAT: mud fountain 4 (huge)<br />
6 BRIGHTNESS: left border of light<br />
7 BRIGHTNESS: light source (top center)<br />
8 BRIGHTNESS: right border of light<br />
<br />
22 ??? (only in A8.MNI, doesn't seem to be doing anything)<br />
<br />
32 BONUS: Star (200)<br />
33 PLAT: Catapult (ground)<br />
34 ENEMY: Big Arrow (from right to left)<br />
35 ENEMY: Big Arrow (from left to right)<br />
36 ENEMY: Fireball (from right to left)<br />
37 ENEMY: Fireball (from left to right)<br />
38 Blue Switch (on ceiling)<br />
39 Red Switch (on ceiling)<br />
40 Green Switch <br />
41 Yellow Switch<br />
42 Blue Door<br />
43 Red Door<br />
44 Green Door<br />
45 Yellow Door<br />
<br />
47 ENEMY: Blue Catapult Car<br />
48 ENEMY: Double Spikes on ground<br />
49 ENEMY: Double Spikes (coming out of the ground)<br />
<br />
51 ENEMY: Big Saw Blade<br />
<br />
56 ENEMY: Green Ball<br />
<br />
59 BONUS: Power Up (health/12800)<br />
60 BARREL: Power Up (health/12800)<br />
<br />
62 CRATE: Green Tomato<br />
63 BONUS: Green Tomato (falling)<br />
64 CRATE: Tomato (200)<br />
65 BONUS: Tomato (falling)<br />
66 CRATE: Yellow/Cyan Fruit<br />
67 BONUS: Yellow/Cyan Fruit (falling)<br />
68 CRATE: Onion<br />
<br />
70 Exit Sign (ends level on touch)<br />
<br />
72 ENEMY: Spear (coming down from ceiling)<br />
73 ENEMY: Green stuff leaking (NOT dropping)<br />
74 ENEMY: Green stuff dropping down<br />
75 ENEMY: Blue Flame flying up & down<br />
76 ENEMY: "Two Tons" Weight going down & up<br />
77 ENEMY: Jumping Bullets<br />
78 ENEMY: Big Grey Heads falling down and going back up<br />
79 ENEMY: Big Yellow Spike on ceiling<br />
80 ENEMY: Big Yellow Spike on ceiling (falling down)<br />
81 ENEMY: Big Yellow Spike on ground<br />
82 ENEMY: Ghost<br />
83 CRATE: Green thingy<br />
<br />
85 ENEMY: Cyan Ball<br />
86 ENEMY: Small Red Plant<br />
87 BARREL: Bomb (100)<br />
88 BONUS: Bomb (100)<br />
<br />
90 switch (1)<br />
<br />
92 switch (2)<br />
93 question mark<br />
94 claw spikes from ground<br />
95 Rubber Wall (can blow it up)<br />
96 ENEMY: cyan jumping ball<br />
<br />
100 CREATURE: Green Worm<br />
101 PIPES: Arrow Up<br />
102 PIPES: Arrow Down<br />
103 PIPES: Arrow Left<br />
104 PIPES: Arrow Right<br />
105 ENEMY: Egg Head (special?) -- only 1x: in B2.MNI<br />
106 ENEMY: Egg Head<br />
<br />
109 ENEMY: Spike on ground (animated)<br />
<br />
111 ENEMY: Spike on ceiling (animated)<br />
112 CRATE: Burger<br />
<br />
114 ENEMY: Blue/Red plant<br />
<br />
116 BONUS: Purple Grapes (800)<br />
117 ENEMY: Blue Ball<br />
118 ENEMY: Spikes (on left wall)<br />
119 ENEMY: Spikes (on left wall) goes in & out of wall<br />
120 ENEMY: Spikes (on right wall)<br />
121 ENEMY: Robot with elctric beam<br />
122 PLAT: Blue Platform (opens afer a few seconds)<br />
123 ENEMY: Spark<br />
<br />
125 BONUS: Cyan Mushroom (400)<br />
126 DECO: Pink Eye Plant<br />
127 DECO: Pink Eye Plant (hanging upside down)<br />
<br />
132 ENEMY: Big Red Jumper<br />
133 ENEMY: BOSS<br />
<br />
135 PIPES: Exit<br />
136 PIPES: Entrance<br />
137 ENEMY: Yellow Dude with blue legs<br />
138 Scooter (Teleporter 1)<br />
139 Scooter (Teleporter 2)<br />
<br />
142 ENEMY: Cyan Spitting Plant (on left wall)<br />
143 ENEMY: Cyan Spitting Plant (on right wall)<br />
144 ENEMY: Blue spitting thing<br />
145 PLAT: Platform you can ride and control<br />
146 CRATE: pile of green balls<br />
<br />
148 BARREL: Saxophone-like thing<br />
149 ENEMY: little red dude<br />
150 CRATE: Salad<br />
151 switch (3)<br />
152 switch (4)<br />
153 Energy Beam (|)<br />
154 Energy Beam (-)<br />
155 ENEMY: slug/Worm<br />
156 HINT: "These hint globes will help you along your journey. Press the up key to reread them."<br />
157 ENEMY: Grey Dude (pushes player around)<br />
158 ENEMY: Robot<br />
<br />
160 PLAT: Dragonfly<br />
161 Crate/Box (can only be destroyed with bombs)<br />
<br />
165 BONUS: Bottle with red liquid<br />
166 BONUS: Green thing<br />
167 BONUS: Blue thing<br />
168 BONUS: Salad?<br />
169 BONUS: Pile of green things<br />
170 BONUS: whatever..<br />
<br />
172 BONUS: blue thing<br />
<br />
174 DECO: Sattelite<br />
<br />
176 ENEMY: Green Plant<br />
177 BONUS: 5 Yellow Grapes (800)<br />
178 BONUS: whatever...<br />
179 CRATE: with item 178<br />
180 DECO: Jaws & Tongue<br />
181 invisible exit marker (go right to exit)<br />
182 small flame<br />
183 ENEMY: Big Red Plant (spitting Blue Balls/catapult)<br />
<br />
185 BONUS: Blue Crystal (on ground)<br />
186 BONUS: Red Crystal (on ground)<br />
187 BARREL: Red/Green Gem<br />
188 BARREL: Blue Crystal<br />
189 BARREL: Red Crystal<br />
190 BONUS: Green Tomato<br />
191 BONUS: Tomato<br />
192 BONUS: Yellow/Cyan Fruit (200)<br />
193 ENEMY: Bear Trap<br />
194 PLAT: Blue Cube (falls down when you walk off)<br />
195 MESSAGE: "What's happening? Is Cosmo falling to his doom?"<br />
196 MESSAGE: "Is there no end to this pit? An what danger awaits below?!"<br />
197 Level End Object?<br />
198 CRATE: Root (400)<br />
199 BONUS: Root<br />
200 CRATE: 4 Brown Berries (400)<br />
201 BONUS: 4 Brown Berries<br />
<br />
203 BONUS: Potato?<br />
204 BARREL: Green Gem<br />
205 BONUS: Green Gem<br />
206 BARREL: Diamond (3200)<br />
207 BONUS: Diamond<br />
<br />
217 ENEMY: Big Green Plant (level exit?)<br />
218 ENEMY: Blue Bird<br />
219 OBJECT: Rocket<br />
220 BONUS: Invincibility<br />
221 PLAT: Podest 1 (14 tiles high)<br />
222 PLAT: Podest 2 (20 tiles high)<br />
223 PLAT: Podest 3 (26 tiles high)<br />
224 BARREL: Diamond 2<br />
225 BONUS: Diamond 2 (falling)<br />
226 BARREL: Red Berry<br />
227 BONUS: Red Berry (falling)<br />
228 BARREL: Crystal (800)<br />
229 BONUS: Crystal (falling)<br />
230 BARREL: Blue Gem<br />
231 BONUS: Blue Gem (falling)<br />
<br />
233 DECO: Rocket Exhaust<br />
234 Scooter (Level Exit)<br />
235 HINT: "Bump head into switch above!"<br />
236 HINT: "The ice in this cave is very, very slippery."<br />
237 HINT: "Use this shield for temporary invincibility."<br />
238 HINT: "You found a secret area!!! Good Job!"<br />
239 HINT: "In hight places look up to find bonus objects."<br />
240 HINT: "Out of Order..."<br />
241 HINT: "This might be a good time to save your game!"<br />
242 HINT: "Press your up key to use the transporter."<br />
243 HINT: "(1) FOR..."<br />
244 BONUS: Diamond 2<br />
245 BONUS: Red Berry<br />
246 BONUS: Crystal<br />
247 BONUS: Blue Gem (800)<br />
248 PLAT: Catapult on ceiling<br />
249 BARREL: Headphones<br />
250 BONUS: Headphones<br />
251 BONUS: Headphones (falling)<br />
252 OBJECT: Frozen Duke NukUm<br />
<br />
254 BONUS: 3 Bananas (800)<br />
255 CRATE: Strawberry<br />
256 BONUS: Strawberry (400)<br />
<br />
258 CRATE: Brown Pear<br />
259 BONUS: Brown Pear<br />
<br />
261 CRATE: Carrot<br />
262 BONUS: Carrot (400)<br />
<br />
264 DANGER: Flame (<-)<br />
265 DANGER: Flame (->)<br />
<br />
267 DANGER: Red stuff leaking<br />
268 DANGER: Red stuff dropping down<br />
269 HINT: "(2) EXTRA..."<br />
270 HINT: "(3) POINTS,..."<br />
271 HINT: "(4) DESTROY..."<br />
272 HINT: "(5) HINT..."<br />
273 HINT: "(6) GLOBES!!!"<br />
274 HINT: "The Clam Plants won't hurt you if their mouths are closed."+Clam Sprite<br />
<br />
278 DECO: Big Mouth (end of E1/start of E2)<br />
279 DECO: Normal Smoke Rising<br />
280 DECO: Big Smoke rising<br />
281 invisible, end level when you fall below (Bonus Levels only)<br />
<br />
283 BONUS: Red Crystal hanging from ceiling<br />
284 HINT: "Collect the STARS to advance to BONUS STAGES."<br />
285 HINT: "Some creatures require more than one pounce to defeat!"<br />
286 HINT: "Cosmo can climb wall's with his suction hands."+CosmoWallSprite<br />
<br />
294 BONUS: Power Up (falling) (health/12800)<br />
295 BONUS: Star (falling) (200)<br />
296 end of episode 2 trigger?<br />
<br />
The hint texts are the messages you get in episode 1, the other episodes have different (and less!) messages. The later hint globes probably don't work in those episodes.<br />
<br />
== Credits ==<br />
<br />
This file format was reverse engineered by [http://www.geocities.com/dooknookimklassik/ Dave Bollinger]. Most of this info came from the [http://www.geocities.com/dooknookimklassik/dn2specs.txt Duke II specs on his website], with [[User:Malvineous|Malvineous]] working out which bits to remove to read Cosmo maps. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=4501User:T-Squared2013-01-28T00:39:47Z<p>T-Squared: </p>
<hr />
<div>Welcome to my User page.<br />
<br />
Here you can find out about progress on Cosmo's Cosmic Adventure 2: HUMANIZED!!! I can't do this alone. I need people to help me bring this idea to life. (I know that sounds cheesy, but I really think this idea can happen as a real mod. :D)<br />
<br />
*[[CCA2:Story|Story]]: 97% complete<br />
**'''Episode 1 Intro:''' 100%<br />
**'''Episode 1 Ending:''' 100%<br />
**'''Episode 2 Intro:''' 100%<br />
**'''Episode 2 Ending:''' 100%<br />
**'''Episode 3 Intro:''' 25% (needs segue from episode 2 into episode 3 gameplay)<br />
**'''Episode 3 Ending:''' 100%<br />
**'''Story Compression & Rewrite (to fit in story screens):''' Not Started<br />
**[[CCA2:Levels|'''Level Locations:''']] 65%<br />
<br />
*[[CCA2:Music|Music]]: <br />
**'''Adlib/Soundblaster Music:''' Unknown state (6 Songs composed so far)<br />
<br />
*[[CCA2:Graphics|Graphics]]:<br />
**'''Title Screens:''' In Progress <br />
**'''Subtitle Screens:''' In Progress (About 70% done)<br />
**'''Credit Screens:''' In Progress (One in type formatting stage, One still in planning stages, one incomplete due to lack of alien characters)<br />
**'''Ending Screens:''' 25% (One nearly complete, needs smaller graphic. One in re-working stages, One in planning stages, not started)<br />
**'''Human!Cosmo Sprites:''' In Progress (about 50% done)<br />
**'''Enemy/Item Sprites:''' Needs work and ideas<br />
**'''Backdrops:''' In Progress (Need graphics artists)<br />
**'''Midground tiles:''' Not Started<br />
**'''Foreground tiles:''' Not Started<br />
<br />
*Sound:<br />
**'''PC Speaker Sound FX:''' Not Started<br />
<br />
*Programming:<br />
**'''Text Formatting:''' Not Started<br />
**'''Story Illustration Placement:''' Not Started<br />
**'''Level Formatting Flags (palette rotation, placement of background, etc.):''' Not Started</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=4495User:T-Squared2013-01-27T21:48:35Z<p>T-Squared: </p>
<hr />
<div>Welcome to my User page.<br />
<br />
Here you can find out about progress on Cosmo's Cosmic Adventure 2: HUMANIZED!!! I can't do this alone. I need people to help me bring this idea to life. (I know that sounds cheesy, but I really think this idea can happen as a real mod. :D)<br />
<br />
<br />
*[[CCA2:Story|Story]]: 97% complete<br />
**'''Episode 1 Intro:''' 100%<br />
**'''Episode 1 Ending:''' 100%<br />
**'''Episode 2 Intro:''' 100%<br />
**'''Episode 2 Ending:''' 100%<br />
**'''Episode 3 Intro:''' 25% (needs segue from episode 2 into episode 3 gameplay)<br />
**'''Episode 3 Ending:''' 100%<br />
**'''Story Compression & Rewrite (to fit in story screens):''' Not Started<br />
**[[CCA2:Levels|'''Level Locations:''']] 65%<br />
<br />
*[[CCA2:Music|Music]]: <br />
**'''Adlib/Soundblaster Music:''' Unknown state (6 Songs composed so far)<br />
<br />
*Graphics:<br />
**'''Title Screens:''' Unknown State <br />
**'''Subtitle Screens:''' In Progress (About 70% done)<br />
**'''Credit Screens:''' In Progress (One in type formatting stage, One still in planning stages, one incomplete due to lack of alien characters)<br />
**'''Ending Screens:''' 25% (One nearly complete, needs smaller graphic. One in re-working stages, One in planning stages, not started)<br />
**'''Human!Cosmo Sprites:''' In Progress (about 50% done)<br />
**'''Enemy/Item Sprites:''' Needs work and ideas<br />
**'''Backdrops:''' In Progress (Need graphics artists)<br />
**'''Midground tiles:''' Not Started<br />
**'''Foreground tiles:''' Not Started<br />
<br />
*Sound:<br />
**'''PC Speaker Sound FX:''' Not Started<br />
<br />
*Programming:<br />
**'''Text Formatting:''' Not Started<br />
**'''Story Illustration Placement:''' Not Started<br />
**'''Level Formatting Flags (palette rotation, placement of background, etc.):''' Not Started</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=4491User:T-Squared2013-01-27T16:09:06Z<p>T-Squared: </p>
<hr />
<div>Welcome to my User page.<br />
<br />
Here you can find out about progress on Cosmo's Cosmic Adventure 2: HUMANIZED!!! I can't do this alone. I need people to help me bring this idea to life. (I know that sounds cheesy, but I really think this idea can happen as a real mod. :D)<br />
<br />
<br />
*[[CCA2:Story|Story]]: 95% complete<br />
**'''Episode 1 Intro:''' 100%<br />
**'''Episode 1 Ending:''' 100%<br />
**'''Episode 2 Intro:''' 100%<br />
**'''Episode 2 Ending:''' 100%<br />
**'''Episode 3 Intro:''' 25% (needs segue from episode 2 into episode 3 gameplay)<br />
**'''Episode 3 Ending:''' 100%<br />
**'''Story Compression & Rewrite (to fit in story screens):''' Not Started<br />
**'''Level Locations:''' 45%<br />
<br />
*[[CCA2:Music|Music]]: <br />
**'''Adlib/Soundblaster Music:''' Unknown state (6 Songs composed so far)<br />
<br />
*Graphics:<br />
**'''Title Screens:''' Unknown State <br />
**'''Subtitle Screens:''' In Progress (About 70% done)<br />
**'''Credit Screens:''' In Progress (One in type formatting stage, One still in planning stages, one incomplete due to lack of alien characters)<br />
**'''Ending Screens:''' 25% (One nearly complete, needs smaller graphic. One in re-working stages, One in planning stages, not started)<br />
**'''Human!Cosmo Sprites:''' In Progress (about 50% done)<br />
**'''Enemy/Item Sprites:''' Needs work and ideas<br />
**'''Backdrops:''' In Progress (Need graphics artists)<br />
**'''Midground tiles:''' Not Started<br />
**'''Foreground tiles:''' Not Started<br />
<br />
*Sound:<br />
**'''PC Speaker Sound FX:''' Not Started<br />
<br />
*Programming:<br />
**'''Text Formatting:''' Not Started<br />
**'''Story Illustration Placement:''' Not Started<br />
**'''Level Formatting Flags (palette rotation, placement of background, etc.):''' Not Started</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=4490User:T-Squared2013-01-22T14:14:00Z<p>T-Squared: </p>
<hr />
<div>Welcome to my User page.<br />
<br />
Here you can find out about progress on Cosmo's Cosmic Adventure 2: HUMANIZED!!! I can't do this alone. I need people to help me bring this idea to life. (I know that sounds cheesy, but I really think this idea can happen as a real mod. :D)<br />
<br />
<br />
*Story: 95% complete<br />
**'''Episode 1 Intro:''' 100%<br />
**'''Episode 1 Ending:''' 100%<br />
**'''Episode 2 Intro:''' 100%<br />
**'''Episode 2 Ending:''' 100%<br />
**'''Episode 3 Intro:''' 25% (needs segue from episode 2 into episode 3 gameplay)<br />
**'''Episode 3 Ending:''' 100%<br />
**'''Story Compression & Rewrite (to fit in story screens):''' Not Started<br />
**'''Level Locations:''' 45%<br />
<br />
*Music: <br />
**'''Adlib/Soundblaster Music:''' Unknown state (6 Songs composed so far)<br />
<br />
*Graphics:<br />
**'''Title Screens:''' Unknown State <br />
**'''Subtitle Screens:''' In Progress (About 70% done)<br />
**'''Credit Screens:''' In Progress (One in type formatting stage, One still in planning stages, one incomplete due to lack of alien characters)<br />
**'''Ending Screens:''' 25% (One nearly complete, needs smaller graphic. One in re-working stages, One in planning stages, not started)<br />
**'''Human!Cosmo Sprites:''' In Progress (about 50% done)<br />
**'''Enemy/Item Sprites:''' Needs work and ideas<br />
**'''Backdrops:''' In Progress (Need graphics artists)<br />
**'''Midground tiles:''' Not Started<br />
**'''Foreground tiles:''' Not Started<br />
<br />
*Sound:<br />
**'''PC Speaker Sound FX:''' Not Started<br />
<br />
*Programming:<br />
**'''Text Formatting:''' Not Started<br />
**'''Story Illustration Placement:''' Not Started<br />
**'''Level Formatting Flags (palette rotation, placement of background, etc.):''' Not Started</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=4489User:T-Squared2013-01-22T14:11:41Z<p>T-Squared: </p>
<hr />
<div>Welcome to my User page.<br />
<br />
Here you can find out about progress on Cosmo's Cosmic Adventure 2: HUMANIZED!!! I can't do this alone. I need people to help me bring this idea to life. (I know that sounds cheesy, but I really think this idea can happen as a real mod. :D)<br />
<br />
<br />
*Story: 95% complete<br />
**'''Episode 1 Intro:''' 100%<br />
**'''Episode 1 Ending:''' 100%<br />
**'''Episode 2 Intro:''' 100%<br />
**'''Episode 2 Ending:''' 100%<br />
**'''Episode 3 Intro:''' 25% (needs segue from episode 2 into episode 3 gameplay)<br />
**'''Episode 3 Ending:''' 100%<br />
**'''Story Compression & Rewrite (to fit in story screens):''' Not Started<br />
<br />
*Music: <br />
**'''Adlib/Soundblaster Music:''' Unknown state (6 Songs composed so far)<br />
<br />
*Graphics:<br />
**'''Title Screens:''' Unknown State <br />
**'''Subtitle Screens:''' In Progress (About 70% done)<br />
**'''Credit Screens:''' In Progress (One in type formatting stage, One still in planning stages, one incomplete due to lack of alien characters)<br />
**'''Ending Screens:''' 25% (One nearly complete, needs smaller graphic. One in re-working stages, One in planning stages, not started)<br />
**'''Human!Cosmo Sprites:''' In Progress (about 50% done)<br />
**'''Enemy/Item Sprites:''' Needs work and ideas<br />
**'''Backdrops:''' In Progress (Need graphics artists)<br />
**'''Midground tiles:''' Not Started<br />
**'''Foreground tiles:''' Not Started<br />
<br />
*Sound:<br />
**'''PC Speaker Sound FX:''' Not Started<br />
<br />
*Programming:<br />
**'''Text Formatting:''' Not Started<br />
**'''Story Illustration Placement:''' Not Started<br />
**'''Level Formatting Flags (palette rotation, placement of background, etc.):''' Not Started</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=4488User:T-Squared2013-01-22T14:11:01Z<p>T-Squared: </p>
<hr />
<div>Welcome to my User page.<br />
<br />
Here you can find out about progress on Cosmo's Cosmic Adventure 2: HUMANIZED!!! I can't do this alone. I need people to help me bring this idea to life. (I know that sounds cheesy, but I really think this idea can happen as a real mod. :D)<br />
<br />
<br />
*Story: 95% complete<br />
**'''Episode 1 Intro:''' 100%<br />
**'''Episode 1 Ending:''' 100%<br />
**'''Episode 2 Intro:''' 100%<br />
**'''Episode 2 Ending:''' 100%<br />
**'''Episode 3 Intro:''' 25% (needs segue from episode 2 into episode 3 gameplay)<br />
**'''Episode 3 Ending:''' 100%<br />
**'''Story Compression & Rewrite (to fit in story screens):''' Not Started<br />
<br />
*Music: <br />
**'''Adlib/Soundblaster Music:''' Unknown state (6 Songs composed so far)<br />
<br />
*Graphics:<br />
**'''Title Screens:''' Unknown State <br />
**'''Subtitle Screens:''' In Progress (About 70% done)<br />
**'''Credit Screens:''' In Progress (One in type formatting stage, One still in planning stages, one incomplete due to lack of alien characters)<br />
**'''Ending Screens:''' 25% (One nearly complete, needs smaller graphic. One in re-working stages, One in planning stages, not started)<br />
**'''Human!Cosmo Sprites:''' In Progress (about 50% done)<br />
**'''Enemy/Item Sprites:''' Needs work and ideas<br />
**'''Backdrops:''' In Progress (Need graphics artists)<br />
**'''Midground tiles:''' Not Started<br />
**'''Foreground tiles:''' Not Started<br />
<br />
*Sound:<br />
**'''PC Speaker Sound FX:''' Not Started<br />
<br />
*Programming:<br />
**'''Text Formatting:''' Not Started<br />
**'''Story Illustration Placement:''' Not Started<br />
**'''Level Formatting Flags (palette rotation, placement of background:''' Not Started</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=4487User:T-Squared2013-01-22T14:03:18Z<p>T-Squared: </p>
<hr />
<div>Welcome to my User page.<br />
<br />
Here you can find out about progress on Cosmo's Cosmic Adventure 2: HUMANIZED!!! I can't do this alone. I need people to help me bring this idea to life. (I know that sounds cheesy, but I really think this idea can happen as a real mod. :D)<br />
<br />
<br />
*Story: 95% complete<br />
**'''Episode 1 Intro:''' 100%<br />
**'''Episode 1 Ending:''' 100%<br />
**'''Episode 2 Intro:''' 100%<br />
**'''Episode 2 Ending:''' 100%<br />
**'''Episode 3 Intro:''' 25% (needs segue from episode 2 into episode 3 gameplay)<br />
**'''Episode 3 Ending:''' 100%<br />
**'''Story Compression & Rewrite (to fit in story screens):''' Not Started<br />
<br />
*Music: <br />
**'''Adlib/Soundblaster Music:''' Unknown state (6 Songs composed so far)<br />
<br />
*Graphics:<br />
**'''Title Screens:''' Unknown State <br />
**'''Subtitle Screens:''' In Progress (About 70% done)<br />
**'''Credit Screens:''' In Progress (One in type formatting stage, One still in planning stages, one incomplete due to lack of alien characters)<br />
**'''Ending Screens:''' 25% (One nearly complete, needs smaller graphic. One in re-working stages, One in planning stages, not started)<br />
**'''Human!Cosmo Sprites:''' In Progress (about 50% done)<br />
**'''Enemy/Item Sprites:''' Needs work and ideas<br />
**'''Backdrops:''' In Progress (Need graphics artists)<br />
**'''Midground tiles:''' Not Started<br />
**'''Foreground tiles:''' Not Started<br />
<br />
*Sound:<br />
**'''PC Speaker Sound FX:''' Not Started<br />
<br />
*Programming:<br />
**'''Text Formatting:''' Not Started<br />
**'''Story Illustration Placement:''' Not Started</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=4486User:T-Squared2013-01-22T13:58:05Z<p>T-Squared: </p>
<hr />
<div>Welcome to my User page.<br />
<br />
Here you can find out about progress on Cosmo's Cosmic Adventure 2: HUMANIZED!!!<br />
<br />
<br />
*Story: 95% complete<br />
**'''Episode 1 Intro:''' 100%<br />
**'''Episode 1 Ending:''' 100%<br />
**'''Episode 2 Intro:''' 100%<br />
**'''Episode 2 Ending:''' 100%<br />
**'''Episode 3 Intro:''' 25% (needs segue from episode 2 into episode 3 gameplay)<br />
**'''Episode 3 Ending:''' 100%<br />
**'''Story Compression & Rewrite (to fit in story screens):''' Not Started<br />
<br />
*Music: <br />
**'''Adlib/Soundblaster Music:''' Unknown state (6 Songs composed so far)<br />
<br />
*Graphics:<br />
**'''Title Screens:''' Unknown State <br />
**'''Subtitle Screens:''' In Progress (About 70% done)<br />
**'''Credit Screens:''' In Progress (One in type formatting stage, One still in planning stages, one incomplete due to lack of alien characters)<br />
**'''Ending Screens:''' 25% (One nearly complete, needs smaller graphic. One in re-working stages, One in planning stages, not started)<br />
**'''Human!Cosmo Sprites:''' In Progress (about 50% done)<br />
**'''Enemy/Item Sprites:''' Needs work and ideas<br />
**'''Backdrops:''' In Progress (Need graphics artists)<br />
**'''Midground tiles:''' Not Started<br />
**'''Foreground tiles:''' Not Started<br />
<br />
*Sound:<br />
**'''PC Speaker Sound FX:''' Not Started<br />
<br />
*Programming:<br />
**'''Text Formatting:''' Not Started<br />
**'''Story Illustration Placement:''' Not Started</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=4485User:T-Squared2013-01-22T13:47:32Z<p>T-Squared: </p>
<hr />
<div>Welcome to my User page.<br />
<br />
Here you can find out about progress on Cosmo's Cosmic Adventure 2: HUMANIZED!!!<br />
<br />
<br />
Story: 95% complete<br />
-Episode 1 Intro: 100%<br />
-Episode 1 Ending: 100%<br />
-Episode 2 Intro: 100%<br />
-Episode 2 Ending: 100%<br />
-Episode 3 Intro: 25%<br />
-Episode 3 Ending: 100%<br />
Story Compression & Rewrite (to fit in story screens): Not Started<br />
<br />
Music: <br />
Unknown state (6 Songs composed so far)<br />
<br />
Graphics:<br />
Title Screens: Unknown State <br />
Subtitle Screens: In Progress (About 70% done)<br />
Credit Screens: In Progress (One in type formatting stage, One still in planning stages, one incomplete due to lack of alien characters)<br />
Ending Screens: 25% (One nearly complete, needs smaller graphic. One in re-working stages, One in planning stages, not started)<br />
Human!Cosmo Sprites: In Progress (about 50% done)<br />
Enemy/Item Sprites: Needs work and ideas<br />
Backdrops: In Progress (Need graphics artists)<br />
Midground tiles: Not Started<br />
Foreground tiles: Not Started<br />
<br />
PC Speaker Sound FX: Not Started<br />
<br />
Programming:<br />
Text Formatting: Not Started<br />
Story Illustration Placement: Not Started</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=3414User:T-Squared2011-05-01T20:09:04Z<p>T-Squared: </p>
<hr />
<div>Hey everyone, my name is Jon Gonzalez, and I am a freelance/independent multimedia producer.<br />
<br />
This may sound noobish, but I don't really have anything to put here. XD<br />
<br />
--<br />
<br />
Hello ppl!<br />
[[Image:Cca2title1.png|200px|thumb|right|Cosmo's Cosmic Adventure 2: The Humanizer]]<br />
I'm currently in the process of creating a sequel mod for [[Cosmo's Cosmic Adventures|Cosmo's Cosmic Adventure]], called "The Humanizer". more info is available here: http://forums.3drealms.com/vb/showthread.php?t=27359<br />
<br />
Production Positions:<br />
<br />
*Art director: Jon Gonzalez<br />
*Program-Modifier Aide: Michael Szewczyk <br />
*Level Designer: [AVAILABLE]<br />
*Music Composer: [AVAILABLE]<br />
*Story Writer: [AVAILABLE]<br />
*Voice Actor: [AVAILABLE]<br />
<br />
Information about positions:<br />
<br />
*Art Director:<br />
**Status: '''Currently Taken'''<br />
**This position is currently taken up by me. This is the person who takes over the production of graphics, including, but not limited to backgrounds, sprites, and scenery.<br />
<br />
*Level Designer:<br />
**Status: '''Available'''<br />
**This position is currently open and available. This person is responsible for design of the levels, using the art provided by the art director.<br />
<br />
*Music Composer:<br />
**Status: '''Available'''<br />
**This position is currently open and available. This person is responsible for music composition, based on the look and feel of the levels provided by the level designer. I've composed some music myself.<br />
<br />
*Story<br />
**Status: '''Possibly Complete'''<br />
**The story has found an ending, but I'm still not entirely convinced that it's a good one.<br />
<br />
*Voice Actors:<br />
**Status: '''Available'''<br />
**These positions are currently open and available. <br />
<br />
Digital audio is a twist I'm trying to include in the game, where Cosmo actually speaks with a reaction to certain situations; i.e.: getting pushed back by a black wall, Cosmo actually says "HEY!" when pushed back by it. The particular voice that I'm looking for is one similar to Hamtaro. This may be possible, due to a breakthrough in providing music for Commander Keen Episode 1. (which normally has no music on its own) I'm hoping to incorporate other voices, though.<br />
<br />
===Special Positions===<br />
*Program-Modification Aides:<br />
**Michael Szewczyk: Creator of the Wombat Game Tools, very helpful for putting all the art and music into the game. Also created a special program for formatting custom Cosmo sprites.<br />
**Lemm (Full name unknown): Probably the best person to ever grace the Apogee-ID Software modding community. Created a Music TSR for Keen 1</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=3411User:T-Squared2011-04-21T01:19:03Z<p>T-Squared: Updated the sub-title screen and edited some stuff.</p>
<hr />
<div>Hey everyone, my name is Jon Gonzalez, and I am a freelance/independent multimedia producer.<br />
<br />
This may sound noobish, but I don't really have anything to put here. XD<br />
<br />
--<br />
<br />
Hello ppl!<br />
[[Image:Cca2title1.png|200px|thumb|right|Cosmo's Cosmic Adventure 2: The Humanizer]]<br />
I'm currently in the process of creating a sequel mod for [[Cosmo's Cosmic Adventures|Cosmo's Cosmic Adventure]], called "The Humanizer". more info is available here: http://forums.3drealms.com/vb/showthread.php?t=27359<br />
<br />
Production Positions:<br />
<br />
*Art director: Jon Gonzalez<br />
*Program-Modifier Aide: Michael Szewczyk <br />
*Level Designer: [AVAILABLE]<br />
*Music Composer: [AVAILABLE]<br />
*Story Writer: [AVAILABLE]<br />
*Voice Actor: [AVAILABLE]<br />
<br />
Information about positions:<br />
<br />
*Art Director:<br />
**Status: '''Currently Taken'''<br />
**This position is currently taken up by me. This is the person who takes over the production of graphics, including, but not limited to backgrounds, sprites, and scenery.<br />
<br />
*Level Designer:<br />
**Status: '''Available'''<br />
**This position is currently open and available. This person is responsible for design of the levels, using the art provided by the art director.<br />
<br />
*Music Composer:<br />
**Status: '''Available'''<br />
**This position is currently open and available. This person is responsible for music composition, based on the look and feel of the levels provided by the level designer.<br />
<br />
*Story Writer:<br />
**Status: '''Available'''<br />
**This position is currently open and available. The story for the Humanizer is not entirely complete, check the topic listed above for more info.<br />
*Voice Actor:<br />
**Status: '''Available'''<br />
**This position is currently open and available. This is a twist I'm trying to include in the game, where Cosmo actually speaks with a reaction to certain situations; i.e.: getting pushed back by a black wall,Cosmo actually says "HEY!" when pushed back by it. The particular voice that I'm looking for is one similar to Hamtaro. This may be possible, due to a breakthrough in providing music for Commander Keen Episode 1. (which normally has no music on its own)<br />
<br />
===Special Positions===<br />
*Program-Modification Aides:<br />
**Michael Szewczyk: Creator of the Wombat Game Tools, very helpful for putting all the art and music into the game. Also created a special program for formatting custom Cosmo sprites.<br />
**Lemm (Full name unknown): Probably the best person to ever grace the Apogee-ID Software modding community. Created a Music TSR for Keen 1</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure&diff=2882Cosmo's Cosmic Adventure2010-07-12T02:56:33Z<p>T-Squared: /* Notes */</p>
<hr />
<div>{{Stub}}<br />
<br />
{{GamePage}}<br />
<br />
Cosmo's Cosmic Adventure, also known simply as Cosmo, is a three part series chronicling the adventures of Cosmo, a small, green sucker-handed alien boy who is seeking his parents after a meteor collision forces them to land their ship on a dangerous and uncharted planet.<br />
<br />
== File formats ==<br />
<br />
This section lists the major file formats used in the game.<br />
<br />
* [[B800 Text]] - 4000-byte <tt>*.MNI</tt> files are text screens shown at exit (e.g. <tt>NOMEMORY.MNI</tt>)<br />
* [[Cosmo Tileinfo Format]] - information about how to lay out the actor tiles. <tt>ACTRINFO.MNI</tt>, <tt>PLYRINFO.MNI</tt> and <tt>CARTINFO.MNI</tt> are in this format.<br />
* [[Cosmo Tileset Format]] - <tt>ACTORS.MNI</tt>, <tt>BD*.MNI</tt>, <tt>CARTOON.MNI</tt>, <tt>MASKTILE.MNI</tt>, <tt>PLAYER.MNI</tt> and <tt>TILES.MNI</tt> are all tilesets.<br />
* [[Cosmo Level Format]] - <tt>A*.MNI</tt> are game levels.<br />
* [[CMP Format]] the <tt>COSMOx.VOL</tt> and <tt>COSMOx.STN</tt> files contain most of the game files in this format<br />
* [[Inverse Frequency Sound format]] the <tt>SOUNDSx.MNI</tt> files are in this format, there are 3 per episode<br />
* [[IMF Format]] - game music (most of the <tt>M*.MNI</tt> files are music files, e.g. <tt>MHAPPY.MNI</tt>) - see [[#Notes]] below<br />
* [[Raw EGA data#Planar|Full-screen planar EGA]] - 32,000 byte <tt>*.MNI</tt> files are 320x200 full-screen images (in four planes: blue, green, red, intensity). <tt>TITLE1.MNI</tt> is the image on the right, which is in this format.<br />
* [[VOL Format]] - group file storing the game data (both the <tt>*.VOL</tt> and <tt>*.STN</tt> files are in this format.)<br />
* Text is contained in the exectuable in all episodes, but in Cosmo 1 & 2, the executable is compressed by [[LZEXE]], and can be uncompressed with [[UNLZEXE]].<br />
<br />
== Notes ==<br />
<br />
* The Cosmo engine was later updated and used for [[Duke Nukem II]], which is why the games share a number of file formats.<br />
<br />
* In the original Cosmo Engine, the graphics memory is allocated after the memory used for storing the IMF file loaded for the current level. This has the unfortunate side effect of corrupting the entire tileset graphics table in memory, turning the graphics into random colours when a complex IMF file is loaded. This is because the data from the IMF file overflows its allocated memory and overwrites the start of the tileset data. Of course this only happens in memory, so the corruption is not permanent upon exiting. The corruption will occur whenever that particular over-sized IMF file is loaded, but the corruption will completely disappear if the IMF file is removed from the [[:Category:Group Files|group file]] or replaced with a less-complex version (i.e. by reducing the number of notes.) This does not appear to affect how the program runs, only affecting the tileset graphics. The overflow limit appears to be around 40K, which is above the size of nearly all Apogee IMF files, but not at the limit of IMF file size (63.9K)<br />
<br />
[[Category:Apogee]]<br />
[[Category:Sidescroller]]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=User:T-Squared&diff=2881User:T-Squared2010-07-12T02:24:21Z<p>T-Squared: </p>
<hr />
<div>Hey everyone, my name is Jon Gonzalez, and I am a freelance/independent multimedia producer.<br />
<br />
This may sound noobish, but I don't really have anything to put here. XD<br />
<br />
--<br />
<br />
Hello ppl!<br />
[[Image:CCA2Title1.png|200px|thumb|right|Cosmo's Cosmic Adventure 2: The Humanizer]]<br />
I'm currently in the process of creating a sequel mod for [[Cosmo's Cosmic Adventures|Cosmo's Cosmic Adventure]], called "The Humanizer". more info is available here: http://forums.3drealms.com/vb/showthread.php?t=27359<br />
<br />
Production Positions:<br />
<br />
*Art director: Jon Gonzalez<br />
*Program-Modifier Aide: Michael Szewczyk <br />
*Level Designer: [AVAILABLE]<br />
*Music Composer: [AVAILABLE]<br />
*Story Writer: [AVAILABLE]<br />
*Voice Actor: [AVAILABLE]<br />
<br />
Information about positions:<br />
<br />
*Art Director:<br />
**Status: '''Currently Taken'''<br />
**This position is currently taken up by me. This is the person who takes over the production of graphics, including, but not limited to backgrounds, sprites, and scenery.<br />
<br />
*Level Designer:<br />
**Status: '''Available'''<br />
**This position is currently open and available. This person is responsible for design of the levels, using the art provided by the art director.<br />
<br />
*Music Composer:<br />
**Status: '''Available'''<br />
**This position is currently open and available. This person is responsible for music composition, based on the look and feel of the levels provided by the level designer.<br />
<br />
*Story Writer:<br />
**Status: '''Available'''<br />
**This position is currently open and available. The story for the Humanizer is not entirely complete, check the topic listed above for more info.<br />
*Voice Actor:<br />
**Status: '''Available'''<br />
**This position is currently open and available. This is a twist I'm trying to include in the game, where Cosmo actually speaks with a reaction to certain situations; i.e.: getting pushed back by a black wall,Cosmo actually says "HEY!" when pushed back by it. The particular voice that I'm looking for is one similar to Hamtaro. <strike>(I did a little research myself on the mechanics of the PC speaker format used in the Cosmo Engine, and the results were not pretty. Nothing could be heard except blips, so this option may have to be nixed... BUT(!), I figured out another way that might work...)</strike> Thanks to help from a guy named Lemm, a digital sound TRS add-on program might be possible.<br />
<br />
===Special Positions===<br />
*Program-Modification Aides:<br />
**Michael Szewczyk: Creator of the Wombat Game Tools, very helpful for putting all the art and music into the game. Also created a special program for formatting custom Cosmo sprites.<br />
**Lemm (Full name unknown): Probably the best person to ever grace the Apogee-ID Software modding community. Is currently in the middle of creating an Adlib Music TRS program for Commander Keen Episodes 1-3.</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=Cosmo%27s_Cosmic_Adventure&diff=2536Cosmo's Cosmic Adventure2009-09-18T17:51:21Z<p>T-Squared: </p>
<hr />
<div>{{Stub}}<br />
<br />
{{GamePage}}<br />
<br />
Cosmo's Cosmic Adventure, also known simply as Cosmo, is a three part series chronicling the adventures of Cosmo, a small, green sucker-handed alien boy who is seeking his parents after a meteor collision forces them to land their ship on a dangerous and uncharted planet.<br />
<br />
== File formats ==<br />
<br />
This section lists the major file formats used in the game.<br />
<br />
* [[B800 Text]] - 4000-byte <tt>*.MNI</tt> files are text screens shown at exit (e.g. <tt>NOMEMORY.MNI</tt>)<br />
* [[Cosmo Tileinfo Format]] - information about how to lay out the actor tiles. <tt>ACTRINFO.MNI</tt>, <tt>PLYRINFO.MNI</tt> and <tt>CARTINFO.MNI</tt> are in this format.<br />
* [[Cosmo Tileset Format]] - <tt>ACTORS.MNI</tt>, <tt>BD*.MNI</tt>, <tt>CARTOON.MNI</tt>, <tt>MASKTILE.MNI</tt>, <tt>PLAYER.MNI</tt> and <tt>TILES.MNI</tt> are all tilesets.<br />
* [[Cosmo Level Format]] - <tt>A*.MNI</tt> are game levels.<br />
* [[CMP Format]] the <tt>COSMOx.VOL</tt> and <tt>COSMOx.STN</tt> files contain most of the game files in this format<br />
* [[Inverse Frequency Sound format]] the <tt>SOUNDSx.MNI</tt> files are in this format, there are 3 per episode<br />
* [[IMF Format]] - game music (most of the <tt>M*.MNI</tt> files are music files, e.g. <tt>MHAPPY.MNI</tt>) - see [[#Notes]] below<br />
* [[Raw EGA data#Planar|Full-screen planar EGA]] - 32,000 byte <tt>*.MNI</tt> files are 320x200 full-screen images (in four planes: blue, green, red, intensity). <tt>TITLE1.MNI</tt> is the image on the right, which is in this format.<br />
* [[VOL Format]] - group file storing the game data (both the <tt>*.VOL</tt> and <tt>*.STN</tt> files are in this format.)<br />
* Text is contained in the exectuable in all episodes, but in Cosmo 1 & 2, the executable is compressed by [[LZEXE]], and can be uncompressed with [[UNLZEXE]].<br />
<br />
== Notes ==<br />
<br />
* The Cosmo engine was later updated and used for [[Duke Nukem II]], which is why the games share a number of file formats.<br />
<br />
* In the original Cosmo Engine, the graphics memory is allocated after the memory used for storing the IMF file loaded for the current level. This has the unfortunate side effect of corrupting the entire tileset graphics table in memory, turning the graphics into random colours when a complex IMF file is loaded. This is because the data from the IMF file overflows its allocated memory and overwrites the start of the tileset data. Of course this only happens in memory, so the corruption is not permanent upon exiting. The corruption will occur whenever that particular over-sized IMF file is loaded, but the corruption will completely disappear if the IMF file is removed from the [[:Category:Group Files|group file]] or replaced with a less-complex version (i.e. by reducing the number of notes.) This does not appear to affect how the program runs, only affecting the tileset graphics.{{TODO|Find out what the size limit really is on Cosmo IMF files}}<br />
<br />
The limit appears to be around 40K, which is above the size of nearly all Apogee IMF files, but not at the limit of IMF file size (63.9K)<br />
<br />
[[Category:Apogee]]<br />
[[Category:Sidescroller]]</div>T-Squaredhttps://moddingwiki.shikadi.net/w/index.php?title=B800_Text&diff=2535B800 Text2009-09-18T16:23:24Z<p>T-Squared: /* Tools */</p>
<hr />
<div>'''B800 Text''' is a text-mode screen dump, and under x86 real mode (such as used by DOS) can be copied byte for byte into memory starting at <tt>B800:0000</tt>, causing the data to appear on the screen. It is most often used to display the final text screen after quitting a game, with the DOS prompt appearing on the last line once the game has terminated.<br />
<br />
== File format ==<br />
<br />
{| style="border-style: none; float: right; clear: right; margin-left: 1.5em; text-align:center; hspace=10px" border="1" cellpadding="5"<br />
! colspan="2" | <nowiki>Full CGA 16-color palette</nowiki><br />
|-<br />
| style="color: white; background-color: #000000" | 0 — black<br /><nowiki>#000000</nowiki><br />
| style="color: white; background-color: #555555" | 8 — (dark) gray<br /><nowiki>#555555</nowiki><br />
|-<br />
| style="color: white; background-color: #0000AA" | 1 — blue<br /><nowiki>#0000AA</nowiki><br />
| style="color: white; background-color: #5555FF" | 9 — bright blue<br /><nowiki>#5555FF</nowiki><br />
|-<br />
| style="color: white; background-color: #00AA00" | 2 — green<br /><nowiki>#00AA00</nowiki><br />
| style="color: black; background-color: #55FF55" | 10 — bright green<br /><nowiki>#55FF55</nowiki><br />
|-<br />
| style="color: white; background-color: #00AAAA" | 3 — cyan<br /><nowiki>#00AAAA</nowiki><br />
| style="color: black; background-color: #55FFFF" | 11 — bright cyan<br /><nowiki>#55FFFF</nowiki><br />
|-<br />
| style="color: white; background-color: #AA0000" | 4 — red<br /><nowiki>#AA0000</nowiki><br />
| style="color: black; background-color: #FF5555" | 12 — bright red<br /><nowiki>#FF5555</nowiki><br />
|-<br />
| style="color: white; background-color: #AA00AA" | 5 — magenta<br /><nowiki>#AA00AA</nowiki><br />
| style="color: black; background-color: #FF55FF" | 13 — bright magenta<br /><nowiki>#FF55FF</nowiki><br />
|-<br />
| style="color: white; background-color: #AA5500" | 6 — brown<br /><nowiki>#AA5500</nowiki><br />
| style="color: black; background-color: #FFFF55" | 14 — yellow<br /><nowiki>#FFFF55</nowiki><br />
|-<br />
| style="color: black; background-color: #AAAAAA" | 7 — white (light gray)<br /><nowiki>#AAAAAA</nowiki><br />
| style="color: black; background-color: #FFFFFF" | 15 — bright white<br /><nowiki>#FFFFFF</nowiki><br />
|}<br />
<br />
Since the file format is just a direct dump of video memory, this would more accurately be termed the "CGA text mode format." The file is almost always 4000 bytes long, as this is the exact amount of space required to store a standard 80x25 text screen (80 columns * 25 rows * two bytes per cell == 4000 bytes.)<br />
<br />
The data is arranged in cells, with each cell being two bytes long (one byte for the ASCII character to display, followed by an attribute byte indicating the colour of the character.) The data appears starting at the top-left of the screen (1,1) and works its way across to the right (80,1) and then wraps down to the next line (1,2).<br />
<br />
The attribute byte contains two nybbles of data. The most significant four bits are the background colour, and the least significant bits are the foreground colour. This means the background and foreground colours can each be assigned a colour value between zero (black) and 15 (white) - see the table on the right for the full list of colours.<br />
<br />
The background colour is slightly different however. Since the original CGA hardware was not designed to produce high intensity background colours the intensity bit is used to cause the text to flash instead. This means setting the background colour to 14 won't produce a bright-yellow background, but instead will produce a normal yellow background (colour #6) with blinking text. The VGA standard includes a toggle bit that allows this flashing to be switched off, thus allowing the full 16 background colours to be used (without any flashing of course.)<br />
<br />
== Example ==<br />
<br />
As a demonstration, these bytes:<br />
<br />
<pre><br />
48 1E 65 2E 6C 3E 6C 4E 6F 5E H.e.l.l.o.<br />
</pre><br />
<br />
Would appear like this:<br />
<br />
<div style="background-color: black; padding: 4px; font-size: 14pt; width: 20em;"><tt><b><br />
&nbsp;<span style="background-color: #0000AA; color: #FFFF55">H<span style="background-color: #00AA00;">e</span><span style="background-color: #00AAAA;">l</span><span style="background-color: #AA0000;">l</span><span style="background-color: #AA00AA;">o</span></span><br />
</b></tt></div><br />
<br />
== Tools ==<br />
<br />
The following tools are known to work with this format:<br />
<br />
* [http://www.theabsolute.net/sware/oldfav.html TextPaint] - DOS-based text screen editor, which unfortunately doesn't support B800 text but is still very powerful, and useful enough to warrant a mention.<br />
* [http://dlc.softwareload.de/SHMANSi/5597 Shmansi] - Another DOS-based text screen editor, which can import and export B800 text.<br />
* [http://www.doomworld.com/idgames/index.php?id=3692 ENDOOMER]- Yet another DOS-based text screen editor, which can import and export B800 text, and can be used with the mouse as well.<br />
<br />
== See also ==<br />
<br />
* [[Wikipedia:Colour Graphics Array]] - lots of interesting information about the CGA hardware<br />
<br />
[[Category:File Formats]]<br />
[[Category:Graphics Files]]<br />
<br />
<!-- All the games that use this file format --><br />
[[Category:Blake Stone]]<br />
[[Category:Boppin']]<br />
[[Category:Commander Keen 1-3]]<br />
[[Category:Commander Keen Dreams]]<br />
[[Category:Commander Keen 4-6]]<br />
[[Category:Cosmo's Cosmic Adventures]]<br />
[[Category:Crystal Caves]]<br />
[[Category:Descent]]<br />
[[Category:Duke Nukem II]]<br />
[[Category:Duke Nukem 3D]]<br />
[[Category:Halloween Harry]]<br />
[[Category:Hocus Pocus]]<br />
[[Category:Jill of the Jungle]]<br />
[[Category:Kiloblaster]]<br />
[[Category:Major Stryker]]<br />
[[Category:Monster Bash]]<br />
[[Category:Raptor]]<br />
[[Category:Rise of the Triad]]<br />
[[Category:Secret Agent]]<br />
[[Category:Terminal Velocity]]<br />
[[Category:Vinyl Goddess From Mars]]<br />
[[Category:Wacky Wheels]]<br />
[[Category:Wolfenstein 3-D]]<br />
[[Category:Xargon]]<br />
[[Category:Zone 66]]</div>T-Squared