Page 2 of 2 FirstFirst 1 2
Results 11 to 14 of 14

Thread: More than 50 music tracks - possible at all?

  
  1. #11

    Default Re: More than 50 music tracks - possible at all?

    Quote Originally Posted by DS2024 View Post
    ^^^ Wow, thank you so much!
    I got it now, so you can safely get rid of it.

    I guess I'll make preparations: migrate to the latest build and appropriate alpha patch, test it and then make a final report here. Fingers crossed, it will work as intended!
    Thanks again for your help!

    UPD:

    Great news is: it WORKS! But... not to the full extent. Currently any tracks beyond 126 get cut off. I've checked a .log, and there is some interesting info:

    First we have this (I've manually made 126 in bold, because I have a feeling this is our number of tracks - but I could be totally wrong here and that 126 is just a coincidence):



    And then this (if I try and set, say, track 127):



    So, what does it mean? Code itself works, but that sound buffer just can't handle excessive samples?
    The fact that track 126 works but track 127 cuts off suggests the issue lies with the data type of the buffer holding the track count, which I totally missed earlier.

    The code works, but the buffer, likely a signed 8-bit char, is limiting the track count to 127.

    While the buffer can handle up to 127 tracks, anything beyond that hits a data type limit. It’s not a logic issue, just a constraint of the data type.

    Changing this to an unsigned 8-bit char or a larger type might require significant changes and possibly introduce complications elsewhere in the code.

    I took a quick look, and it touches areas I’m not familiar with. :/ I’m still a rookie at coding and not an IT person. I just do this for fun. :P

    So for now, I’ll revise my plan and increase the limit by 75 instead of 200. Maybe someone with more experience can take it further in the future.

  2. #12

    Default Re: More than 50 music tracks - possible at all?

    Yani, walterKFX Thanks for all the useful info!

    Somehow it never occurred to me one can simply use the usual SET_MUSIC (plus those "" Quotation marks) for the custom media folder files. I thought only PLAY_MESSAGE was reserved for that!
    I did a test and indeed, it works like a charm! This is quite a game-changer.

    Couple of things (for anyone who'll stumble upon this topic in search of info):

    • as long as the file name inside of the SET_MUSIC ("") has an extension, (and a custom folder is properly specified beforehand) - its name can be anything (numbers, words or combination).
    • when using SET_MUSIC in combination with custom folder, max tracks specified in _keeperfx.cfg and keeperfx.cfg should not exceed the limit - or NONE of the tracks, even the ones within the proper range, will play. (So, if max track limit is 50, there should not be anything bigger than that in the CFGs. Because, judging by the .log, a track will always get assigned to the max number if that number is above hard limit. And when this max number of tracks is a proper one, our assigned track will play without errors).
    • UPD: we can actually have a total of 250 unique music tracks: 125 in our custom media folder AND another 125 in our game's main music folder. They are set by two different variants of SET_MUSIC command: SET_MUSIC() for MAIN folder, and SET_MUSIC("") for CUSTOM media folder. Naturally, music tracks from the MAIN music folder should be named according to the pattern [keeper02, keeper03, ... keeper125]
    • UPD: If we use SET_MUSIC(), followed by SET_MUSIC("") in the next line (or vice versa), the last command will override the first one. So no two instances of music, from two different sources, will play at once. This one is kind of obvious but, I felt, it should be mentioned anyway.



    Interestingly, this is, seemingly, not the case when using main MUSIC forlder in root dir - exceeding numbers in .cfg don't block music, when a track itself is within a proper range.
    For example, when new tracks are inside root MUSIC dir, when .cfg max tracks are set to 250, track 125 will play (with walterKFX's prototype patch applied). But when using custom media folder - it just won't, until we change those 250 to 126.

    All in all - everything worked out perfectly, don't you think, guys?
    I, for one, have definitely learned some EXTREMELY useful info and with that excellent prototype patch by walterKFX one of the most stressing things about music has been pretty much resolved. 126 tracks vs 50 is kinda enough for a huge campaign that can afford a couple of unique tracks for every level. I'd say this is quite awesome!

    UPD 11.11.2024: It is possible to not only have max 125 unique tracks in our custom media folder, which are used in SET_MUSIC(""), but also to have another set of unique 125 tracks in the MAIN music folder which are used in the SET_MUSIC(), without the [""]. They are treated separately and do not exclude each other. So, KeeperFX now really supports a total of 250 unique music tracks - from two separate sources of up to 125 tracks in each.
    Last edited by DS2024; November 11th, 2024 at 08:58. Reason: Important info addition.

  3. #13

    Default Re: More than 50 music tracks - possible at all?

    Just so you know, it's been merged now, so you don't need to stick to the prototype. Enjoy!

  4. #14

    Thumbs up Re: More than 50 music tracks - possible at all?

    That is just excellent! Thank you (and everyone else involved)!

Similar Threads

  1. Regarding the DK 2 music tracks
    By Zabii in forum Dungeon Keeper 2
    Replies: 1
    Last Post: July 17th, 2014, 20:16
  2. Changing music tracks
    By VoidWeaver in forum Dungeon Keeper 1
    Replies: 1
    Last Post: June 2nd, 2013, 11:59
  3. Music
    By Sensor in forum DK1 Troubleshooting
    Replies: 19
    Last Post: January 3rd, 2010, 21:07

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •