ccexplore
22 Aug 2005 11:51:19
original-music version of CustLemm now available
Since there's been a bit of talk about how CustLemm is "old-school" and all and how some people seems to prefer that, I've decided to go ahead with this, even though I'm not sure how many people really prefer this.

Anyhow, as the title says, I've hacked CustLemm so that it plays the original game's music rather than playing tracks from a CD.

In the process, I also have an answer to DragonsLover's question of why the unhacked CustLemm plays the CD tracks in the order it does.  It would seem that the very same track numbers are used to select from the set of original music, and when used as indices into the set of the original game music, it apparently maps to the first 6 music you get in DOS Lemmings.

This suggests that perhaps the version of Lemmings CustLemm was made from might actually have a CD whose audio tracks contain all the original game music.

------------------

Anyhow, here we go:

http://www.geocities.com/guestlevels/lemmings/nocdlem.zip

There are 2 EXEs there, nocdlem and nocdlem2.  They correspond to modified versions of custlemm.exe and custlem2.exe respectively.

The way it is right now, when you use them, it will go through just the first 6 music of DOS Lemmings.  However, I do have plans later to allow a way for level designers to indicate the music they want right in the level data itself.  (You'd still be restricted of course to the set of about 20 or so of the original game music.)
Isu
22 Aug 2005 16:52:14
Re: original-music version of CustLemm now availab
Ooh, This'll be good. Original music in Custlemm!:D
DragonsLover
22 Aug 2005 16:56:01
Re: original-music version of CustLemm now availab
ccexplore, you're the best! :thumbsup:
Shvegait
22 Aug 2005 17:05:20
Re: original-music version of CustLemm now availab
This is awesome!  B) Thank you!!

This suggests that perhaps the version of Lemmings CustLemm was made from might actually have a CD whose audio tracks contain all the original game music.


There are 6 songs in ONML, correct? Maybe that has something to do with why it loops only 6 songs? The victory/defeat messages are also the ONML ones instead of the original Lemmings ones. Just a thought.
ccexplore (not logged in)
22 Aug 2005 17:38:55
Re: original-music version of CustLemm now availab
That would be logical, except as there are exactly 6 ONML music, if the track numbers refer to those, than you would expect them to be some permutation of 1-6, and not what DragonsLover was seeing with a CD.

Still, you can try copying ONML's adlib.dat into CustLemm's folder and see what happens.  (Haven't tried it myself.)
Shvegait
22 Aug 2005 19:43:40
Re: original-music version of CustLemm now availab
OK, I've just tried it, and as you suspected, the order of the songs isn't right for ONML. I also tried in regular Lemmings with the ONML Adlib.dat to see where the songs fell. I don't know the order of the ONML songs, since I never was able to play ONML with music (had to just play it in XP), but the locations of the songs fell as follows:

Level 1
Level 6
Level 11(I think?)
"A Beast of a level"
"What an AWESOME level"
"A BeastII of a level"

Perhaps the author(s) of CustLemm hacked the ONML music code to read tracks from original Lemmings? Is it possible to change what tracks are pointed to? (Based on what you said about even putting this data into a level, I'm guessing this is possible.)

Side question: Just curious, does your way of putting the music data inside a level have any connection with how the special levels point to their own songs?


I don't know about what anyone else thinks, but it doesn't seem that the ONML songs are nearly as good as the original Lemmings ones. I can't imagine listening to those 6 songs through 100 levels! A couple of them are not bad, but some of them are grating.  X_X


By the way, ccexplore didn't mention this, and it may seem obvious, but when playing "nocdlem.exe" in DOSBox, you don't need to mount your CD-ROM drive. :)
ccexplore (not logged in)
22 Aug 2005 20:27:43
Re: original-music version of CustLemm now availab
Side question: Just curious, does your way of putting the music data inside a level have any connection with how the special levels point to their own songs?

No.  I actually have no idea yet how the game decides which music to play.  However, it does keep track of the currently played music in a fixed location in the game's memory, and I did locate the piece of code that actually makes the "play this music" call passing in that memory location.

The plan is to change it to look instead at a memory location within the level data itself.  Specifically, the level data has 2 bytes that aren't currently used in CustLemm as far as I can tell, namely the one that marks the level to use Superlemming vs. normal speed.  The plan is basically to store the music track in that location.

To avoid the need to hex edit your levels for this, my plan also includes writing a Windows program that does this for you with a graphical interface for you to pick the music for each level in a pack.  I'll also need to do some further hacking on nocdlem[2] for this to work, but the main effort will be in writing the Windows program.
guest
22 Aug 2005 20:57:58
Re: original-music version of CustLemm now availab
I don't know about what anyone else thinks, but it doesn't seem that the ONML songs are nearly as good as the original Lemmings ones. I can't imagine listening to those 6 songs through 100 levels! A couple of them are not bad, but some of them are grating.  X_X


I agree, I definitely prefer the original Lemmings songs.
ccexplore (not logged in)
22 Aug 2005 21:17:05
Re: original-music version of CustLemm now availab
To avoid the need to hex edit your levels for this, my plan also includes writing a Windows program that does this for you with a graphical interface for you to pick the music for each level in a pack.

I haven't actually written the program yet, but here's a mock-up of what I have in mind:

http://www.geocities.com/guestlevels/lemmings/musicpicker.png
JM
22 Aug 2005 23:13:48
Re: original-music version of CustLemm now availab
Looks good :)
Mindless
23 Aug 2005 01:03:08
Re: original-music version of CustLemm now availab
The plan is to change it to look instead at a memory location within the level data itself.  Specifically, the level data has 2 bytes that aren't currently used in CustLemm as far as I can tell, namely the one that marks the level to use Superlemming vs. normal speed.  The plan is basically to store the music track in that location.

Huh? I know that there is an unknown WORD in the level files at bytes 0x001E to 0x001F, but I didn't know that that's what it was for? Or am I wrong?
ccexplore (not logged in)
23 Aug 2005 01:09:40
Re: original-music version of CustLemm now availab
Well, that's what I heard anyway, that the unknown is used to indicate SuperLemming status.  I'm not sure if I ever verified it myself.  But in any case, CustLemm does not support SuperLemming, so I plan to use it instead to support indicating which music the level designer wants.
Mindless
23 Aug 2005 02:08:01
Re: original-music version of CustLemm now availab
I'm not sure if this is possible, but if it is it'd be awesome if you could add the ability to specify what level pack CustLemm should load via command-line parameters.
ccexplore (not logged in)
23 Aug 2005 02:22:11
Re: original-music version of CustLemm now availab
Sure okay, that's easy enough.
ccexplore (not logged in)
23 Aug 2005 02:28:13
Re: original-music version of CustLemm now availab
oh sorry, I misunderstood.  I thought you're talking about the program I was going to write.  I realize you mean Custlemm now.

Um, I could try, but I wouldn't count on it for now.  Moreover, if I'm doing it I'm probably going to only support it in nocdlem/2 because I can overwrite the CD-related code there with the stuff for parsing the command line, whereas in CustLemm to do it I would need to find a place to put the added code in, and I currently don't know for sure how to do that.
ccexplore (not logged in)
23 Aug 2005 02:38:45
Re: original-music version of CustLemm now availab
in fact, maybe it's easier if you instead just write a batch file to do the job, something like this

copy %1 levelpak.dat
custlemm.exe

If the batch file is called, say, custlemm.bat, you can launch it like this in DOSBox

custlemm.bat mypack.dat

[note: you need the .bat since there's already a custlemm.exe.  Or you can choose to rename custlemm.exe to something else]

And it will run the batch file, which copies mypack.dat over to levelpak.dat and then run custlemm.exe

DOSBox should support batch files.
Mindless
23 Aug 2005 04:03:48
Re: original-music version of CustLemm now availab
I guess that'd work too.  It's much simpler...  B)
Mindless
17 Sep 2005 23:30:29
Re: original-music version of CustLemm now availab
Well, that's what I heard anyway, that the unknown is used to indicate SuperLemming status.  I'm not sure if I ever verified it myself.  But in any case, CustLemm does not support SuperLemming, so I plan to use it instead to support indicating which music the level designer wants.

Just tested this and CustLemm does support SuperLemming... just set the first unknown byte to 0xFF, and SuperLemming mode is enabled...
Timballisto
26 Sep 2005 21:39:22
Re: original-music version of CustLemm now availab
How do you make midi files?
Mindless
26 Sep 2005 23:12:24
Re: original-music version of CustLemm now availab
Modplug has MIDI capabilites, but they're rather hard to use...
finlay
02 Oct 2005 16:43:17
Re: original-music version of CustLemm now availab

No.  I actually have no idea yet how the game decides which music to play.  However, it does keep track of the currently played music in a fixed location in the game's memory, and I did locate the piece of code that actually makes the "play this music" call passing in that memory location.

The plan is to change it to look instead at a memory location within the level data itself.  Specifically, the level data has 2 bytes that aren't currently used in CustLemm as far as I can tell, namely the one that marks the level to use Superlemming vs. normal speed.  The plan is basically to store the music track in that location.


Why don't you implement it in the double-byte next to it which is for the special graphics levels? Or can they be used in CustLemm? And then you could reimplement Superlemming speed! (which may be a slight problem, cos I think lemedit puts something there which, when I imported levels into Mac ONML, makes them go at superlemming speed)

or maybe i'm talking crap...
geoo89
02 Oct 2005 18:20:44
Re: original-music version of CustLemm now availab
Superlemming mode does work.

One of my levels uses it, my pack will be released soon.

EDIT: You could use the second of those bytes I think, as far as I tried it out Superlemming mode already works when only the first of these bytes is set to FF.
ccexplore (not logged in)
02 Oct 2005 21:01:38
Re: original-music version of CustLemm now availab
(which may be a slight problem, cos I think lemedit puts something there which, when I imported levels into Mac ONML, makes them go at superlemming speed)

Yep, the bonehead that is the author of LemEdit put the LemEdit version number into those 2 bytes.  It didn't seem to have an effect in CustLemm despite its support of SuperLemmings according to Mindless, but it's quite possible that Mac ONML checks the bytes differently (eg. check for 0 vs. check for FF).

I suppose I could try hacking CustLemm to leave those 2 bytes as 0s, although it's probably easier if you just use a hex editor yourself to fix it.
ccexplore (not logged in)
02 Oct 2005 21:05:56
Re: original-music version of CustLemm now availab
Why don't you implement it in the double-byte next to it which is for the special graphics levels? Or can they be used in CustLemm?

You can use special graphics in CustLemm (in fact, I even made a program allowing you to create your own special graphics for CustLemm use).  But I think only 1 of the 2 bytes reserved there are actually used.

Anyway, it's simple to change which bytes to use (and thanks all for the valuable information on this), the reason I haven't finished this yet is because I wanted to first finish a few more MIDIs Ahribar requested.
Mindless
02 Oct 2005 23:07:52
Re: original-music version of CustLemm now availab

Yep, the bonehead that is the author of LemEdit put the LemEdit version number into those 2 bytes.

:D  I always wondered if LemEdit was putting random data in there, I didn't know it was the version number... that explains a few things...