Author Topic: original-music version of CustLemm now available  (Read 9999 times)

0 Members and 1 Guest are viewing this topic.

Offline ccexplore

  • Posts: 5311
    • View Profile
original-music version of CustLemm now available
« on: August 22, 2005, 11:51:19 AM »
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.)

Offline Isu

  • Posts: 693
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #1 on: August 22, 2005, 04:52:14 PM »
Ooh, This'll be good. Original music in Custlemm!:D

Offline DragonsLover

  • Posts: 1234
  • Do you want fire?
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #2 on: August 22, 2005, 04:56:01 PM »
ccexplore, you're the best! :thumbsup:
I like dragons! They're the center of my life! I'll never forget them...

Offline Shvegait

  • Posts: 772
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #3 on: August 22, 2005, 05:05:20 PM »
This is awesome! &#A0;B) Thank you!!

Quote
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.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #4 on: August 22, 2005, 05:38:55 PM »
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.)

Offline Shvegait

  • Posts: 772
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #5 on: August 22, 2005, 07:43:40 PM »
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. &#A0;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. :)

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #6 on: August 22, 2005, 08:27:43 PM »
Quote from: Shvegait  link=1124711479/0#5 date=1124739820
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

  • Guest
Re: original-music version of CustLemm now availab
« Reply #7 on: August 22, 2005, 08:57:58 PM »
Quote from: Shvegait  link=1124711479/0#5 date=1124739820
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.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #8 on: August 22, 2005, 09:17:05 PM »
Quote from: ccexplore (not logged in)  link=1124711479/0#6 date=1124742463
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

  • Guest
Re: original-music version of CustLemm now availab
« Reply #9 on: August 22, 2005, 11:13:48 PM »
Looks good :)

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #10 on: August 23, 2005, 01:03:08 AM »
Quote from: ccexplore (not logged in)  link=1124711479/0#6 date=1124742463
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?

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #11 on: August 23, 2005, 01:09:40 AM »
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.

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #12 on: August 23, 2005, 02:08:01 AM »
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.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #13 on: August 23, 2005, 02:22:11 AM »
Sure okay, that's easy enough.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #14 on: August 23, 2005, 02:28:13 AM »
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.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #15 on: August 23, 2005, 02:38:45 AM »
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.

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #16 on: August 23, 2005, 04:03:48 AM »
I guess that'd work too.  It's much simpler...  B)

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #17 on: September 17, 2005, 11:30:29 PM »
Quote from: ccexplore (not logged in)  link=1124711479/0#11 date=1124759380
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...

Offline Timballisto

  • Posts: 941
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #18 on: September 26, 2005, 09:39:22 PM »
How do you make midi files?

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #19 on: September 26, 2005, 11:12:24 PM »
Modplug has MIDI capabilites, but they're rather hard to use...

Offline finlay

  • Posts: 543
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #20 on: October 02, 2005, 04:43:17 PM »
Quote from: ccexplore (not logged in)  link=1124711479/0#6 date=1124742463
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...

Offline geoo

  • Administrator
  • Posts: 1475
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #21 on: October 02, 2005, 06:20:44 PM »
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.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #22 on: October 02, 2005, 09:01:38 PM »
Quote from: finlay  link=1124711479/15#20 date=1128271397
(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.

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #23 on: October 02, 2005, 09:05:56 PM »
Quote from: finlay  link=1124711479/15#20 date=1128271397
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.

Offline Mindless

  • Posts: 719
  • Inactive - may respond to PM.
    • View Profile
Re: original-music version of CustLemm now availab
« Reply #24 on: October 02, 2005, 11:07:52 PM »
Quote from: ccexplore (not logged in)  link=1124711479/15#22 date=1128286898
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...