Register FAQ Search Today's Posts Mark Forums Read
Go Back   JazzJackrabbit Community Forums » Open Forums » General Jazz Jackrabbit Talk

JJ2 Music Restart points (Thread for coders)

Jojo

JCF Member

Joined: Dec 2006

Posts: 38

Jojo is doing well so far

Mar 8, 2010, 10:26 AM
Jojo is offline
Reply With Quote
JJ2 Music Restart points (Thread for coders)

Hi there,
first for those who don't know me, I happened to play JJ2 years ago (and still play it occasionaly) and since then, I was captivated by its great music. I also happen to be a developer of OpenMPT (ModPlug).
I have listened to many game rips and pre-releases of JJ2 music, but they're all not satisfying. That's one reason why I started coding my own J2B loader for OpenMPT. A few months have passed since I finished it, and it's pretty good, all tracks sound correct in it. However, one thing that's still missing (also in the foo_dumb implementation, if anyone was going to point that out) are the loop (restart) points: f.e. order.j2b does not restart from the beginning, but from order 4 or something like that. But the last pattern does not have a pattern jump command.
So, I have not actively followed the latest JJ2 hacks or whatever you're doing with this nice game, but I heard that the audio system has been exchanged or something, and I wonder if anyone has got their hands on the original code (apparently not) or disassembly to find out where those loop points are stored? The J2B format does not seem to have such a header field, so I guess the loop points are hardcoded into the executable.
Does anybody have any information on this?

Oh, and feel free to move this post if it doesn't fit - I hesitated to post it in the coder forum as it's not really jj2 related.

Greets,
-Jojo

Last edited by Jojo; Mar 8, 2010 at 10:27 AM. Reason: Addition
DoubleGJ DoubleGJ's Avatar

JCF Member

Joined: Sep 2002

Posts: 3,049

DoubleGJ has disabled reputation

Mar 9, 2010, 05:25 AM
DoubleGJ is offline
Reply With Quote
I would be hesistant of saying the commands are hardcoded. As you may or may not know, there is an official (albeit quite primitive) program for making custom .j2b's out of other module formats, so this would be very impractical. Although, I'm not sure if any of the custom .j2b's I know loops to a middle pattern...
__________________
"So unless I overwrote my heart with yours, I think not. But I might have." - Violet CLM

Two Games Joined releases:
Control / Splinter (twin singles)
|| Ballistic Bunny (EP)
||
Beyond (maxi-single)
|| Beyond: Remixed (remix EP)
|| Inner Monsters OST (mini-album)
||
Shadows (album)
Jojo

JCF Member

Joined: Dec 2006

Posts: 38

Jojo is doing well so far

Mar 9, 2010, 06:25 AM
Jojo is offline
Reply With Quote
Well, the tracks for JJ2 were all composed in IT and S3M format, which don't have restart points. So I would suppose that the MOD2J2B tool would not have written loop points, either...

Last edited by Jojo; Mar 9, 2010 at 06:26 AM. Reason: typo
Puffie40 Puffie40's Avatar

JCF Member

Joined: May 2002

Posts: 894

Puffie40 is doing well so far

Mar 9, 2010, 06:59 AM
Puffie40 is offline
Reply With Quote
In plus the sound engine was "Augmented" (or redone?) to handle MP3's and today's more "complex" Modules.

order.j2b loops at position 4? That's news to me... It always looped right back to the start for me in-game. Are you sure you are not overlooking position jumps?

Unless you are talking about how the music restarts when you die. That I think is a bug in the sound engine. It seems to always restart the music at position one, and It's noticeable when you are playing a module with "Action" positions like Neve.s3m
Jojo

JCF Member

Joined: Dec 2006

Posts: 38

Jojo is doing well so far

Mar 9, 2010, 07:02 AM
Jojo is offline
Reply With Quote
Puffie40, I'm using JJ2:TSF and I never hear the first pattern of order.j2b again after it has been played one time. That's also the case with some ingame music, but I don't know which tracks are affected right now.
DoubleGJ DoubleGJ's Avatar

JCF Member

Joined: Sep 2002

Posts: 3,049

DoubleGJ has disabled reputation

Mar 9, 2010, 08:37 AM
DoubleGJ is offline
Reply With Quote
Quote:
Originally Posted by Puffie40 View Post
Unless you are talking about how the music restarts when you die. That I think is a bug in the sound engine. It seems to always restart the music at position one, and It's noticeable when you are playing a module with "Action" positions like Neve.s3m
I am fairly sure it's intended, just so the music stops when you die and yet it remains "fluent". It is done so-so, though.
__________________
"So unless I overwrote my heart with yours, I think not. But I might have." - Violet CLM

Two Games Joined releases:
Control / Splinter (twin singles)
|| Ballistic Bunny (EP)
||
Beyond (maxi-single)
|| Beyond: Remixed (remix EP)
|| Inner Monsters OST (mini-album)
||
Shadows (album)
Grytolle Grytolle's Avatar

JCF Member

Joined: Sep 2004

Posts: 4,126

Grytolle is a forum legendGrytolle is a forum legendGrytolle is a forum legend

Mar 10, 2010, 08:41 AM
Grytolle is offline
Reply With Quote
The code has been altered so that the internal stop/start/repeat functions aren't called. Instead bass.dll(?) is called accordingly

j2b is still handled by the normal music engine though, unless blur has changed that recently
__________________
<center></center>
Jojo

JCF Member

Joined: Dec 2006

Posts: 38

Jojo is doing well so far

Mar 10, 2010, 08:46 AM
Jojo is offline
Reply With Quote
Yeah, it would be strange if j2b would be played by something else than the internal routines, since BASS can't play j2b files anyway!
Jojo

JCF Member

Joined: Dec 2006

Posts: 38

Jojo is doing well so far

Jun 21, 2010, 07:51 AM
Jojo is offline
Reply With Quote
I just sent two XMs though mod2j2b, the only difference being the restart point. And the result was the same. So that would imply that there is indeed no restart point setting in the j2b specs. And that implies that the restart points must be hardcoded... :\
blurredd blurredd's Avatar

JCF Member

Joined: Nov 2001

Posts: 1,896

blurredd is an asset to this forumblurredd is an asset to this forum

Jun 21, 2010, 11:42 AM
blurredd is offline
Reply With Quote
I'm sure that order.j2b always starts from the beginning, so JJ2 definitely does not using hardcoded restart positions for that track, and I doubt it would for any other track. The track, however, does replay nearly all of the same patterns before starting from the beginning again.

From what I can tell, xm files created with different restart positions create different j2b files through MOD2J2B so there is a chance that the relevant data is stored in the j2b file. JJ2's Galaxy Music System doesn't appear to support restart positions whether for mod tracks or j2b files, so you wouldn't be able to find out through JJ2 if j2b files store restart positions.
__________________
D3
Extra. No CTO v0.75
Animating Tiles Properties.
ATB Contest. Scripting Language.
Gameplay Theories.
1UP. Pitfall. Desolation.
SC2.

Jojo

JCF Member

Joined: Dec 2006

Posts: 38

Jojo is doing well so far

Jun 21, 2010, 02:01 PM
Jojo is offline
Reply With Quote
Hmm, I just checked again, letting OpenMPT run in the background playing order.j2b synced to JJ2... apparently my old recording was incomplete, which lead me to the conlusion that it must be looped. After playing the whole thing, it indeed seems to be returning to order 0!
Quote:
From what I can tell, xm files created with different restart positions create different j2b files through MOD2J2B
Well, I just created identical files (but with different restart points), and they all resulted in the j2b file. But since there seems to be no restart point indeed, that would explain why.
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT -8. The time now is 09:12 AM.