Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

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

  
  1. #1

    Default More than 50 music tracks - possible at all?

    Hello!

    I've recently hit a limit of 50 music tracks for a campaign I'm deep at work on (22 full scale levels done, at least 10+ more to go, almost a year of hard work - loved every second of it).
    I've already created a small scripted music player of sorts, using PLAY_MESSAGE and timers and flags with custom sounds folder. It's working but is clunky and a pain to setup for every track and what not.
    Also, just splitting my work in two halves, each having a music folder with max 50 tracks is really the last resort kind of thing.

    I've tried checking files from the github source, but I couldn't understand the code or find anything that I could do to fix this myself - I'm not a coder, but more of game designer who often is having trouble with his own scripts, when they get really complicated (complicated - from my perspective).

    So, is it possible at all to expand the limit of 50 music tracks in KeeperFX?

    I just thought there is a chance it might be something relatively easy to do, but something that is out of priority, because who would need whole 50 tracks and more?
    Well, I'm that someone. I use music creatively and it is an essential part of my campaign. I'd really be happy if that could be done!

    But if this is really something that requires a whole ton of work or can't be done at all, well... At least I've asked.

    Thank You in advance for any reply!

  2. #2

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

    Hello!

    Are you talking about the setting on keeperfx.cfg? I don't think this setting is required for your campaign. But I could be wrong, I don't use custom music myself.

    But that said, I did look into it, and it's quite easy to expand this setting. I just did a pull request for that if you want to check it out!

  3. #3

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

    Quote Originally Posted by walterKFX View Post
    Are you talking about the setting on keeperfx.cfg?
    Thank you for reply and checking things out!

    Yes, this is the one.
    I did a quick test right now. I set max tracks to 60 in keeperfx.cfg. Assign a 51st track to a level, and in the log it returns this:

    Code:
    Script(line 159): set_music_process: Setting music track to 51: 
    ...
    Sync: [0] PlayMusicPlayer: This track was not loaded: 51
    So it really is limited to 50 tracks.
    Oh and if I understand correctly, one can only use a single folder of music - the one that is in the root dir. Or am I missing something?

    I wish it was as easy to do, as increasing one number in a piece of code that you've found:

    src/config.c
    Code:
    @@ -1195,7 +1195,7 @@ short load_configuration(void)
              {
                i = atoi(word_buf);
              }
              if ((i > 0) && (i <= 50)) {
    But it might be also something to do with memory or something like that. But I'm not a coder - just guessing.
    I don't have a github account or skills to compile from the source, but I guess a patch can be done to test things out? Or maybe it's a whole new build will be needed?
    From my perspective as a designer, expanding tracks to something like 500 (512) or UNLIMITED, would be a great additional feature of KeeperFX.
    Like I've mentioned, I did hit a hard limit by the 2 thirds of my project. And I've hit IFs 512 limit too, on the latest map - had to optimize and improvise.
    IF limit is a solid one, more than enough for 98% of maps, but that music limit, when expanded, would only benefit KeeperFX, I think.

    Thank you again for checking things out! Maybe something will come out of it? I really hope so!
    Last edited by DS2024; November 4th, 2024 at 17:15.

  4. #4

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

    So it really is limited to 50 tracks.
    I don’t think this setting is related to the script command, they appear to be two differents things. Regardless, I’ve increased the limit for both by 200.

    Oh and if I understand correctly, one can only use a single folder of music - the one that is in the root dir. Or am I missing something?
    You should be able to create a media folder specifically for your campaign. If you need assistance with that, I suggest joining the Discord community, it's easier for troubleshooting.

    The music folder within the game directory is meant for default tracks. While you can add your own music there for personal use, the track limit is defined in the keeperfx.cfg file, which defaults to 7.

    I wish it was as easy to do, as increasing one number in a piece of code that you've found:
    Actually, it was that easy! :P

    But it might be also something to do with memory or something like that. But I'm not a coder - just guessing.
    It seems to be more of an arbitrary limit. They probably thought 50 would be sufficient for most users.

    I don't have a github account or skills to compile from the source, but I guess a patch can be done to test things out? Or maybe it's a whole new build will be needed?
    If the pull request gets merged, you’ll need to download the alpha version. I don't know what version you currently have, but you’ll also need to do a clean install of 1.2 if you don’t have it yet.

  5. #5

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

    If you'd like to test the prototype, you can download it from GitHub, but you'll need an account to access it. You can find it here:

    https://github.com/dkfans/keeperfx/a...cts/2142319111

    It also requires version 1.2, so if you haven't installed it yet, please do a clean installation before copying the prototype files. If you already have 1.2, there's no need for a clean install.

  6. #6

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

    First of all, walterKFX, thank you again for all the explanations!

    But, I just can't get past the captcha verification - no matter what method I use (all browsers, including TOR, etc). I'm on Win 7 x64, so maybe that, too is a culprit...
    My ISP is really strict. I live in a place that's heavy under sanction and what not.
    Can't get an account not only for GitHub, but for Discord, X, Instagram - you name it, also.
    Sigh...

    I'm out of options.
    I guess, what's left is only to ask you walterKFX to attach that prototype manually, so I could get it from here - if it is small enough, of course.
    Would you be so kind and do it? I'll test it and then just wait for it (if it really works as intended) to be merged into one of the alpha patches or main builds - no problem with that.

    But please don't worry: if it is too troublesome - no problem, don't bother! I'm just happy it is resolved and will wait for a possible merge.

  7. #7

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

    Quote Originally Posted by DS2024 View Post
    First of all, walterKFX, thank you again for all the explanations!

    But, I just can't get past the captcha verification - no matter what method I use (all browsers, including TOR, etc). I'm on Win 7 x64, so maybe that, too is a culprit...
    My ISP is really strict. I live in a place that's heavy under sanction and what not.
    Can't get an account not only for GitHub, but for Discord, X, Instagram - you name it, also.
    Sigh...

    I'm out of options.
    I guess, what's left is only to ask you walterKFX to attach that prototype manually, so I could get it from here - if it is small enough, of course.
    Would you be so kind and do it? I'll test it and then just wait for it (if it really works as intended) to be merged into one of the alpha patches or main builds - no problem with that.

    But please don't worry: if it is too troublesome - no problem, don't bother! I'm just happy it is resolved and will wait for a possible merge.
    Oh, that’s unfortunate to hear. Have you tried using an open-source VPN like Proton?

    But yes, I can attach it here on this board, no problem.

    keeperfx-1_2_0_4191_Prototype_e2013a4-patch.zip

  8. #8

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

    It seems the attachment has a short lifespan, so I uploaded it under a random workshop item of mine on keeperfx.net. Please let me know when you've downloaded it so I can remove it.


    https://keeperfx.net/workshop/downlo...13a4-patch.zip

  9. #9

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

    Quote Originally Posted by walterKFX View Post
    let me know when you've downloaded it so I can remove it.
    ^^^ 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):

    Sync: SoundHeap Size 50331648
    Sync: [0] init_sound_heap_two_banks: Got sound buffer of 50294496 bytes, samples in banks: 1035,126
    And then this (if I try and set, say, track 127):

    Error: set_music_process(line 12): Invalid music track: -127. Track must be between 2 and 251 or 0 to disable.
    So, what does it mean? Code itself works, but that sound buffer just can't handle excessive samples?
    Last edited by DS2024; November 5th, 2024 at 12:32.

  10. #10
    Imp Yani's Avatar
    Join Date
    Mar 2019
    Location
    Belgium
    Posts
    43

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

    Have you tried using the filename instead of using numbers?

    SET_MUSIC("dk2track01.mp3")

    You should not drop your music files into /music. They should go in the _media folder of a campaign.
    If you add songs to /music it's to add more songs to the default background songs. These files are played in the original campaign for example based on the levelnumber.
    Last edited by Yani; November 5th, 2024 at 17:49.

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
  •