Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - covox

Pages: 1 ... 5 6 [7]
91
Lemmings Main / Re: Best way of rendering Lemmings levels?
« on: July 19, 2006, 04:15:28 AM »
Old Mac files have two independant halves: the data and the resource fork. The resource fork is a sort of compartmentalized treasure map that's bolted onto most old Mac files. It provides a standard way of holding standard structures (like colour palettes, dialogs, machine code) and also for referencing information packed in the data part of the file.

This actually makes the data part of the file quite underused, as it's easier to keep most things in the resource fork. (The Lemmings executable, for instance, is just one large resource fork). Which, unfortunately, is a bit of a pain, as by default the resource fork is sheared off on a non-Apple filesystem.

Thankfully by packing the Mac files into a data-only format (in my case, BinHex .HQX files), it is possible to read both the data and resource fork on any platform. Of course, the resource fork is only read by the Apple system libraries and developer tools like ResEdit, so it doesn't look very nice as one long string.

Right now my tool just converts the above gibberish string into a more human-readable data structure. So it's only really useful if you're extracting data or poking around for information.

The executable has a little bit of useful information (such as the single colour palette used by Lemmings), however the Graphics file is much more cryptic. All the resource fork contains is a single table of 12-byte tuples, flagged with interesting names like "Psygnosis0", "Logo0", "Grounds1", "Special2" etc. I think the first 4 bytes references an offset, second 4 bytes references a length (all referring to the large data part of the file), but I have no idea what the last 4 bytes represent. Presumably it is an amount, as the highest two bytes always represent a small number, but it doesn't steadily increase/decrease down the list and it's always larger than the image size. As for the graphics data itself, all I know so far is that there is the occasional raw palette index, making it possible to identify sections of the image in a paint-by-numbersish way.

If anyone out there is mad enough to try it, you don't even need a real Mac to check out Lemmings with ResEdit (Basilisk II, a starter kit and a copy of HFV Explorer will do the trick).

92
Lemmings Main / Re: Best way of rendering Lemmings levels?
« on: July 18, 2006, 04:37:47 PM »
Covox, are you running Lunix? Those screens look very lunixy.
Linux... but I agree, it looks quite gnome-ish.

Very perceptive :laugh: Yep, that's Ubuntu Dapper, running GNOME + the brand new whizbang OpenGL eyecandy layer. With the world's greatest music player in the background :winktounge:

Be aware though that you might need a "collision stencil" anyway, depending on how you realize rendering, especially one-way bricks (arrowed bricks), traps and animated objects. At least I use one and I know the original game used one (though somehow different from my approach).

Sounds very similar to my current plan, which was to have a seperate offscreen surface the size of the playfield, and organize the RGB values in such a way to reference stuff like ground, steel areas, trap + object number etc, with allowances made so multiple values can coexist (so going under the assumption that if two interactive objects are around with overlapping hotspot rectangles, the frontmost one gets priority). The only alternative I can think of is having lots of rects for each specific area and polling each lemming, but that would require a metric arseload of comparisons compared to 1.

BTW: why is everybody starting his/her own Lemmings remake now? Is this only the PSP success?

As corny as it sounds, I've been stewing over ideas for one long before I heard of Lemmini or the PSP remake, and it gets easier to develop as the more tedious stuff is pushed out of the way.

Somewhat off topic, has anyone ever had a crack at extracting the high-resolution graphics from Mac Lemmings? I only got as far as writing a tool to parse the resource fork before giving up at the ominous-looking packing format.

93
Lemmings Main / Re: Best way of rendering Lemmings levels?
« on: July 18, 2006, 12:57:16 AM »
Aha. Cheers for the info. Method 2 seemed the simpler one in principle, I just felt that writing a specific method to blit objects behind was somehow sacriligeous (needing four blits instead of one! FOUR!).

I wish I knew how to do proper masking. Pygame doesn't seem to have anything in the documentation mentioning a right or wrong way (not sure how it was originally done, but my subtractive terrain handling takes unfair advantage of how an RGBA canvas can also have a transparent colourkey)

I'll say bon voyage to the two canvas system, which was at best slightly hackish. Hopefully the new method won't be too burdensome on the CPU :undecided:

94
Lemmings Main / Best way of rendering Lemmings levels?
« on: July 17, 2006, 03:21:31 PM »
Hi all. I'm working on a clone in Python. As most of the internal data structures, global caches etc. have been written, I'm up to the bit of making the graphics start to work (the gui and the playfield, essentially). However, I'm a bit puzzled as to the correct order of adding terrain pieces onto a freshly-made playing field.

In my current system, I thought I had it nutted so that I only had to blit (simply put, pasting an image onto another) images, and not in reverse - that is, paste an image right behind another. For terrain pieces, this meant going through each piece in order, and either rendering it to a canvas if it was ordinary/black, or adding it to a list if it had the No Overdraw flag set. Afterwards, it reverses this list, renders these pieces in the new order to a second canvas, then blitting the first canvas on top of the second.

And it worked, in a roundabout way. Until I saw what happened with "If only they could fly"



For reference, here's how it should look:


After some thinking, I think the proper method of doing things is "go through pieces in order, if No Overdraw is selected simply blit underneath surface instead of on top".

This might account for really weird situations caused by the subtractive terrain handling, such as how a visible terrain piece can be in front of another visible terrain piece, yet with some layer changing the frontmost piece can be wiped out by a black piece stationed behind the two without affecting or appearing behind the second one.

Is this rendering philosophy correct? Also, is there a neater way of blitting images behind one another than, say, "take sample of the area about to be changed, position terrain piece on an area of the same dimensions, blit the sample area over the terrain piece, clear the changed square on the main image and blit in the new sample".

95
Lemmings Main / Re: PC Speaker sounds dos lemmings
« on: July 04, 2006, 07:24:00 AM »
Actually, even DOS Lemmings is sophisticated enough not to use the PC speaker even for sound effects (it uses Adlib FM Synthesis).

DOS Lemmings does support outputting PC speaker sound effects when it cannot find an Adlib/Sound Blaster card (easy to replicate, starting Lemmings in DOSBox at well above 2000 cycles will make the program fail to autodetect the Sound Blaster, forcing it to revert to the PC speaker for sound effects).

96
Lemmings Main / Re: Lemmini - Lemmings for Java - public Alpha
« on: March 22, 2006, 11:46:58 PM »
FAT32 partitions mounted under Linux have ambiguous case recognition (i.e. 'cat /mnt/win-c/Games/ReadMe.txt' and 'cat /mnt/win-c/games/rEaDmE.TXT' will find the same file), presumably NTFS support does the same thing.

I'll give the new build a try later on.

97
Lemmings Main / Re: Lemmini - Lemmings for Java - public Alpha
« on: March 22, 2006, 01:53:05 PM »
Tried to run under Linux (Ubuntu Dapper). Case-sensitive file/directories are somewhat ignored, so none of the levels will convert from LVL to INI if your export directory contains a capital letter. (interestingly, the graphics still convert without a hitch)

After picking a path that's entirely lowercase, the conversion process works fine for a while, but keels over when trying to patch the first level ("CRC of source differs from that in patch header"). One guess is that during the LVL2INI conversion process, the file I/O methods in UNIX Java translate "\n" into just a linefeed character (i.e. the civilized way), whereas under Windows Java it may instead give a carriage-return + linefeed (2 characters, a nasty relic from DOS and the norm for Windows text editing).

If this were the case it would certainly throw off the binary diff. Of course this is all guesswork, I haven't got a working Windows machine to litmus-test the theory on. Just for fun, here's my extracted copy of lvl1000.ini:
Code: [Select]
# LVL extracted by Lemmini # lvl1000.lvl
releaseRate = 1
numLemmings = 80
numToRecue = 80
timeLimit = 3
numClimbers = 0
numFloaters = 0
numBombers = 0
numBlockers = 0
numBuilders = 12
numBashers = 0
numMiners = 0
numDiggers = 0
xPos = 1216
style = brick

# Objects
# id, xpos, ypos, paint mode (), upside down (0,1)
# paint modes: 8=VIS_ON_TERRAIN, 4=NO_OVERWRITE, 0=FULL (only one value possible)
object_0 = 1, 1344, 128, 4, 0
object_1 = 1, 1408, 64, 4, 0
object_2 = 1, 1472, 0, 4, 0
object_3 = 0, 1376, 232, 4, 0
object_4 = 9, 1376, 264, 4, 0

# Terrain
# id, xpos, ypos, modifier
# modifier: 8=NO_OVERWRITE, 4=UPSIDE_DOWN, 2=REMOVE (combining allowed, 0=FULL)
terrain_0 = 24, 1376, 198, 0
terrain_1 = 24, 1440, 198, 0
terrain_2 = 24, 1436, 128, 0
terrain_3 = 24, 1500, 128, 0
terrain_4 = 24, 1500, 64, 0
terrain_5 = 24, 1564, 64, 0
terrain_6 = 31, 1508, 262, 0
terrain_7 = 31, 1568, 198, 0
terrain_8 = 31, 1632, 124, 0
terrain_9 = 30, 1508, 278, 0
terrain_10 = 30, 1508, 310, 0
terrain_11 = 30, 1568, 214, 0
terrain_12 = 30, 1568, 246, 0
terrain_13 = 30, 1568, 278, 0
terrain_14 = 30, 1568, 310, 0
terrain_15 = 30, 1632, 140, 0
terrain_16 = 30, 1632, 172, 0
terrain_17 = 30, 1632, 204, 0
terrain_18 = 30, 1632, 236, 0
terrain_19 = 30, 1632, 268, 0
terrain_20 = 30, 1632, 300, 0
terrain_21 = 30, 1696, 288, 0
terrain_22 = 30, 1696, 256, 0
terrain_23 = 30, 1696, 224, 0
terrain_24 = 30, 1696, 192, 0
terrain_25 = 30, 1696, 160, 0
terrain_26 = 30, 1696, 128, 0
terrain_27 = 30, 1696, 96, 0
terrain_28 = 30, 1696, 64, 0
terrain_29 = 30, 1696, 32, 0
terrain_30 = 30, 1696, 0, 0
terrain_31 = 2, 1432, 302, 0
terrain_32 = 2, 1368, 302, 0
terrain_33 = 2, 1304, 302, 0
terrain_34 = 19, 1714, 0, 4
terrain_35 = 19, 1778, 0, 4
terrain_36 = 20, 1834, -8, 4
terrain_37 = 20, 1834, 8, 4
terrain_38 = 20, 1850, -8, 4
terrain_39 = 19, 1714, 288, 8
terrain_40 = 19, 1778, 288, 8
terrain_41 = 20, 1834, 302, 8
terrain_42 = 20, 1834, 286, 8
terrain_43 = 20, 1850, 302, 8
terrain_44 = 19, 1240, 288, 8
terrain_45 = 19, 1208, 288, 8
terrain_46 = 19, 1208, 0, 12
terrain_47 = 19, 1272, 0, 12
terrain_48 = 19, 1336, 0, 12
terrain_49 = 19, 1368, 0, 4
terrain_50 = 20, 1424, 8, 4
terrain_51 = 20, 1440, -8, 4
terrain_52 = 20, 1424, -8, 4
terrain_53 = 20, 1296, 286, 0
terrain_54 = 20, 1312, 302, 0
terrain_55 = 20, 1296, 302, 0
terrain_56 = 42, 1216, 0, 0
terrain_57 = 42, 1248, 0, 0
terrain_58 = 35, 1234, 32, 0
terrain_59 = 42, 1250, 160, 0
terrain_60 = 42, 1218, 160, 0
terrain_61 = 42, 1232, 192, 0
terrain_62 = 42, 1752, 288, 0
terrain_63 = 42, 1784, 288, 0
terrain_64 = 35, 1768, 160, 0
terrain_65 = 42, 1752, 128, 0
terrain_66 = 42, 1784, 128, 0
terrain_67 = 42, 1766, 96, 0
terrain_68 = 20, 1200, 286, 0
terrain_69 = 20, 1200, 302, 0
terrain_70 = 20, 1200, 8, 12
terrain_71 = 20, 1198, -6, 12

#Steel
# id, xpos, ypos, width, height

#Name
name =  It's all a matter of timing

98
Lemmings Main / lunpack 0.1 available
« on: August 26, 2005, 06:19:51 PM »
lunpack is a simple decompressor for DAT files, which should run juuuuusttt fiiiine under Linux and other Unix/POSIX systems. It was ported from lemmingologist's code to C just for fun. And by fun I mean decompression code is a soul-destroying thing to try and debug.

(take heed, windows users should use Mindless' Windows jobbie instead, making the target audience for this one smaller than a leprechaun's testicle)

Download: here (1900 bytes)

Instructions:
$ tar xjf lunpack-0.1.tar.bz2
$ gcc -g -O2 lunpack.c -o lunpack
$ ./lunpack [compressedfile] [decompressprefix]

Pros:
- GUIs are for schoolgirls! Simple yet intuitive CLI designed for true connoisseurs
- It runs under Unix!
- Source code! Everyone loves that.

Cons:
- While gcc builds it fine under Linux, mingw32 under Windows doesn't. or rather it does, and it decompresses fine, just that it doesn't actually switch between output files, choosing instead to make the one file bigger and bigger and bigger. however there isn't a windows port of ddd so I couldn't give the problem a better probe (it might be the use of stat.st_size to figure out the filesize; the ming header deserves a full-page picture in the euphamism dictionary for "cobbled together".)
- There's always the chance I've ballsed something up. If you see any clumsy mistakes (and I'm sure there are a few) please let me know.

On an unrelated note, currently in the works is a simple tool for converting GROUND + VGAGR pairs into 8-bit indexed PNGs.

That's it!

99
Lemmings Main / Re: Explanation of Lemmings file compression
« on: August 14, 2005, 04:17:48 AM »
Quote
Could you elaborate on this a bit? I'm not sure what it is you're trying to do. XML?


Ooh-er, could've explained myself better there ;P At some point, I'm going to have a shot at making an open-source extendable Lemmings clone. It'll be done in C and SDL, which means (hopefully) that porting and drop-in improvements should be trivial. I'm developing this on a gcc/linux base, which should compile under Windows with mingw32. No idea if VS6/VS.NET/Microsoft Magic Mystery Compiler will touch it however ;/

The Pingus guys have done a great job, however I'm aiming toward something more lightweight and ultra-portable. Oh, and ClanLib is waaay too large to stick onto a PDA. Heaven help you if you change versions :/

To start with, I'm just trying to make the game data manageable. So all the terrain/animations will be converted to indexed PNG, and the level information converted to XML documents. XML is nice because both people and computers can read it :)

Each level will be stored in an XML file, and there should be some mechanism which refreshes the index (containing all the levels/different games) each time you run the program. For example, if you were to develop a level called "Taste the golden spray", and you want it positioned as Level 12 of Fun on a levelset called "My Generic Custom Game", you could add this XML to the appropriate file:

Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<!-- Games available are Classic, ONML, Your_game_name_here -->
<LemLevel game="My Generic Custom Game" difficulty="1" level="12">
 <title>Taste the golden spray!</title>
 <settings levelset="2" release="80" save="80" speed="20" time="180"/>
 <skills climber="0" floater="0" bomber="0" blocker="0" builder="0" basher="0" miner="0" digger="0"/>

 <!-- BEGIN level metadata -->
 <Interactives>
   <interactive piecenum="4" xoffset="0" yoffset="0" flag_ground="0" flag_nooverdraw="0" flag_upsidedown="1" />
   ...
 </Interactives>
 <Terrains>
   <terrain piecenum="12" xoffset="0" yoffset="0" flag_black="1" flag_nooverdraw="0" flag_upsidedown="0" />
   ...
 </Terrains>
 <Steels>
   <steel xoffset="0" yoffset="0" xwidth="16" ywidth="16" />
   ...
 </Steels>
</LemLevel>


It's very preliminary at the moment, any suggestions are more than welcome.  There's a good chance that the schema will be extended at some point to include a broader definition of interactive objects (think the player-controlled cannons in Lemmings 2).

Quote
You can skip this step if you want, I already have working C++ code for compression and decompression.  (But I hope you will credit me for it if you do decide to use it.)  E-mail me for more info.


Thanks greatly for the offer, however I'd feel more confident if all the code is pure C. But then again, I haven't had time to compile test my attempt yet, so I may come crying back :)

100
Lemmings Main / Re: Explanation of Lemmings file compression
« on: August 14, 2005, 12:28:39 AM »
Great stuff. Unsure quite what language the code is (at first glance it looks distinctly VBish), however thankfully it's quite pseudocodey. I can't thank you enough, this is indeed a Christmas miracle.

Currently I'm writing a C port of your proceedure (tried starting from scratch using your instructions, my method invoked far too many dynamic memory hissy fits :/). Hopefully I'm aiming toward some sort of multitool to export graphics, sound and level metadata (XML, almost done) to more modern file formats/organized hierachy. If anyone's in the mood for more source code I'm happy to post what I have. Well, maybe once I've cleaned it up a bit ;)

Pages: 1 ... 5 6 [7]