Jump to content


Photo

songlist.2da limit


  • Please log in to reply
48 replies to this topic

#21 Taimon

Taimon
  • Member
  • 387 posts

Posted 02 June 2009 - 07:50 AM

I've updated the file to completely remove the byte restrictions on the songlist number.
(Unfortunately, that required patching another function.)

I'm sure I could use your help for a whole bunch of things.

Let's continue this via PM or mail, then.

#22 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 05 June 2009 - 05:19 AM

Yes and it would be very nice, if we don't need to uninstall BGT-Music after the transition anymore.

Greetings Leomar


Absolutely!

Could this be done for BGT, Ascension64? :cheers:

#23 Jarno Mikkola

Jarno Mikkola

    The Imp in his pink raincoat.

  • Member
  • 10911 posts

Posted 05 June 2009 - 05:36 AM

Could this be done for BGT, Ascension64?

... let's not interrupt their PostModern warfare deciding which faction gets the greater part of the credits, to write them. :P

Deactivated account. The user today is known as The Imp.


#24 -Guest-

-Guest-
  • Guest

Posted 05 June 2009 - 07:40 AM

Is this something that's likely to be useful for (Easy)Tutu or BG2 games?

#25 dabus

dabus
  • Member
  • 1982 posts

Posted 05 June 2009 - 11:39 AM

It is useful if you install mods that "help" your songlist.2da to exceed 100 entires. It does not matter which mod it is. (I'd wonder if Tutu has a solution if you need to patch the BGMain.exe)
THINK! - It's not illegal.

#26 Azkyroth

Azkyroth
  • Modder
  • 3496 posts

Posted 05 June 2009 - 11:46 AM

It is useful if you install mods that "help" your songlist.2da to exceed 100 entires. It does not matter which mod it is. (I'd wonder if Tutu has a solution if you need to patch the BGMain.exe)


On that note...

I've made an exe patch to increase the songlist limit to 500 entries.


Kiss at least 10-15 of those spaces goodbye. ^.^

[EDIT]

I've updated the file to completely remove the byte restrictions on the songlist number.
(Unfortunately, that required patching another function.)


So does this raise the theoretical limit to 2^15 then? O.o

[EDITMOAR]WeiDU has a feature that adds a song in the next available slot, right? Will it need to be modified to work with this patch?

Edited by Azkyroth, 05 June 2009 - 11:49 AM.

"Tyranny is a quiet thing at first, a prim and proper lady pursing her lips and shaking her head disapprovingly, asking, well what were you doing (wearing that dress, walking home at that hour, expressing those inappropriate thoughts) anyway? It's subtle and insidious, disguised as reasonable precautions which become more and more oppressive over time, until our lives are defined by the things we must avoid. She's easy enough to agree with, after all, she's only trying to help -- and yet she's one of the most dangerous influences we face, because if she prevails, it puts the raping, robbing, axe-wielding madmen of the world in complete control. Eventually they'll barely need to wield a thing, all they'll have to do is leer menacingly and we fall all over ourselves trying to placate them." -godlizard


#27 Taimon

Taimon
  • Member
  • 387 posts

Posted 05 June 2009 - 12:15 PM

I've updated the file to completely remove the byte restrictions on the songlist number.
(Unfortunately, that required patching another function.)


So does this raise the theoretical limit to 2^15 then? O.o

This was a bit unclear on my part:
There was a function that treated the songlist number as a byte, which limited the songlist references in the area files to the 0-255 interval.
I changed the function to treat the reference as a word. (This is related to the issue Ascension64 has been talking about.)
We are still on 500 entries for the songlist, but it's relatively easy to change if someone needs more.

[EDITMOAR]WeiDU has a feature that adds a song in the next available slot, right? Will it need to be modified to work with this patch?

No.

Edited by Taimon, 05 June 2009 - 12:16 PM.


#28 Azkyroth

Azkyroth
  • Modder
  • 3496 posts

Posted 05 June 2009 - 12:26 PM

Is it important to you to keep this as a separate mod, or can we go ahead and include this as an installation component?

[EDIT]I understand the TP2 as written provides for only 500 entries. How many can that be increased to, in theory, given the construction of the chunk of data that specifies the song?

Edited by Azkyroth, 05 June 2009 - 02:54 PM.

"Tyranny is a quiet thing at first, a prim and proper lady pursing her lips and shaking her head disapprovingly, asking, well what were you doing (wearing that dress, walking home at that hour, expressing those inappropriate thoughts) anyway? It's subtle and insidious, disguised as reasonable precautions which become more and more oppressive over time, until our lives are defined by the things we must avoid. She's easy enough to agree with, after all, she's only trying to help -- and yet she's one of the most dangerous influences we face, because if she prevails, it puts the raping, robbing, axe-wielding madmen of the world in complete control. Eventually they'll barely need to wield a thing, all they'll have to do is leer menacingly and we fall all over ourselves trying to placate them." -godlizard


#29 Taimon

Taimon
  • Member
  • 387 posts

Posted 05 June 2009 - 07:12 PM

Is it important to you to keep this as a separate mod, or can we go ahead and include this as an installation component?

I consider all my stuff free to be used by anyone.

[EDIT]I understand the TP2 as written provides for only 500 entries. How many can that be increased to, in theory, given the construction of the chunk of data that specifies the song?

Without too much other modifications 2^16 would be the current limit. But the hard theoretical limit is 2^32.

#30 Azkyroth

Azkyroth
  • Modder
  • 3496 posts

Posted 06 June 2009 - 02:18 PM

Could this technique be adapted to add more animation slots?

"Tyranny is a quiet thing at first, a prim and proper lady pursing her lips and shaking her head disapprovingly, asking, well what were you doing (wearing that dress, walking home at that hour, expressing those inappropriate thoughts) anyway? It's subtle and insidious, disguised as reasonable precautions which become more and more oppressive over time, until our lives are defined by the things we must avoid. She's easy enough to agree with, after all, she's only trying to help -- and yet she's one of the most dangerous influences we face, because if she prevails, it puts the raping, robbing, axe-wielding madmen of the world in complete control. Eventually they'll barely need to wield a thing, all they'll have to do is leer menacingly and we fall all over ourselves trying to placate them." -godlizard


#31 dabus

dabus
  • Member
  • 1982 posts

Posted 06 June 2009 - 02:34 PM

Adding functionality is something that's very difficult to do with patching, because of the size limitations.
(Basically, you can only change existing instructions, not add new ones. If you find unused parts in the executable you might be able to hack something in, but that's really hard.)


(If you mean the spellbook / adding in general fits here)

Edited by dabus, 06 June 2009 - 02:36 PM.

THINK! - It's not illegal.

#32 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 06 June 2009 - 05:21 PM

Could this technique be adapted to add more animation slots?

See here, though I'm skeptical anything can be done with this either quickly or in volume. It will probably require some sort of external routine (like a DLL) which I understand would be quite difficult.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#33 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 06 June 2009 - 05:27 PM

If you want to chuck this in your mod, make sure that the code is version-compatible. While it works with BG2:Tob v26498, the offsets are different for other versions.

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)


#34 -Thalina-

-Thalina-
  • Guest

Posted 09 August 2009 - 12:01 PM

excuse me but how do you actually use this file songlist_patch.tp2?
i installed a megamod with the bigworld update and i get an assertion failed message at game start.
i tried to copy a songlist in the override folder and cut it down to 99 songs and it worked so i guess this patch you wrote might help.
i tried to put it in the override folder as well but that did not work.

thank you thalina

#35 dabus

dabus
  • Member
  • 1982 posts

Posted 09 August 2009 - 01:28 PM

Like any onther mod. With a weidu-copy of the same name as the tp2-file (well, of cause you will keep the exe-extension intact). So copy weidu.exe to songlist_patch.exe, put both the tp2 and the exe in your bg2-folder and start the exe.
THINK! - It's not illegal.

#36 -Thalina-

-Thalina-
  • Guest

Posted 10 August 2009 - 12:17 AM

thank you all for your help.
that patch works!

ps. i had to rename both files to Setup-songlist_patch.exe/tp2 for the installer to work properly

#37 Taimon

Taimon
  • Member
  • 387 posts

Posted 10 August 2009 - 12:45 AM

For a more user-friendly installer check out the combined BGT-Music thread or my ToB Hacks thread at G3.

#38 cmorgan

cmorgan
  • Modder
  • 2301 posts

Posted 17 May 2010 - 01:10 PM

Ascension64, Taimon, (anyone), I have a modder question on this -

I (actually, both berelinde and I, on several projects) would like to make use of the extended possibilities this runs out. It would be great to be able to use ACM and append to songlist.2da, instead of the workaround modders have been forced to use over the years - but I think I need some pointers.

1. Would there be an easy way of checking that this is installed, so that if someone is using it already (or someone is adding it on afterwards) the patch does not get applied twice?

Scenario - b uses it in Gavin, I use it in Aran, and someone adds it at the end of the install.

2. Is there a reasonable way of checking for an available blank entry in songlist.2da, or iterating through until it is determined that there is nothing available?

Scenario - b uses it in Gavin to add 3 or 4, I use it in Aran for 3 or 4 entries, and it is a Mega with other mods adding, so suddenly (unlikely, but possible I guess) instead of slots #270, 271, 272, 273, etc. it is #499, 500, 501 FAIL.


3. If this is going to be used in more than one mod, and there are two versions of you folk's hacks out there, is there a way we can standardize the approach so modders (and folks updating older mods) can get things to work together without hashing players games?


34 Aerie MXAERIE.MUS
35 Anomen MXANOM.MUS
36 Jaheira MXAERIE.MUS
37 Kalah MXKALAH.MUS
38 Khalid MXKHALI.MUS
39 ShadowThief MXTHIEF.MUS
40 Viconia MXVICON.MUS


brainstorming:

IF ~patch_is_not_installed~ THEN BEGIN
install patch
END
(or OUTER_? does this operation take place before the rest of the .tp2 is evaluated for APPEND?)


COPY ~aranw/music~ ~override~
APPEND ~songlist.2da~ ~%available_number% c-aranrom MXCARNR.MUS~ UNLESS ~MXCARNR.MUS~ // romance
APPEND ~songlist.2da~ ~%available_number% c-aranfrn MXCARNF.MUS~ UNLESS ~MXCARNF.MUS~ // friend
APPEND ~songlist.2da~ ~%available_number% c-araninn MXCARNI.MUS~ UNLESS ~MXCARNI.MUS~ // inn flirt
APPEND ~songlist.2da~ ~%available_number% c-aranang MXCARNA.MUS~ UNLESS ~MXCARNA.MUS~ // angry


Basically, what I am looking for is the easiest way to implement this idea with a keen eye on Mega-install heartaches. Just worried about abandoning PlaySong(0) PlaySound("c-aranrom").

EDIT/
heh. Much of this can be accomplished by ADD_MUSIC. I should have checks the WeiDU docs first, I guess!! ADD_MUSIC gets me off the hook for finding the last available entry. But my central questions still remain - a check for "hey, not enough slots", and a check for "hey, the list has already been patched so it has 500 entries possible, and FAIL if not." (Actually, a reversion, in my case - all I would do is

ACTION_IF (~not_too_many_entries_in_songlist~) AND (~exe_is_the_supported_one~) THEN BEGIN
 OUTER_SET my_friend_music = ~PlaySong(c-aranfr)~
 COPY ~acm_files~ ~override~
 ADD_MUSIC
END ELSE BEGIN
 OUTER_SET my_friend_music = ~PlaySong(0) PlaySound("c-aranfr")~
 COPY ~set_of_wavc~ ~override~
END

COMPILE ~myScript_with_song_variable~ 
 	EVALUATE_BUFFER


and in myScript_with_song_variable.baf,
IF
 Global("myvar","LOCALS",1)
 CC(0)
 !CD_SNV
 InMyArea(x)
 etc.
THEN
 RESPONSE #100
 	%my_friend_music%
 	SetGlobal("myvar","LOCALS",2)
 	SDNS(P1)
END

Edited by cmorgan, 17 May 2010 - 01:52 PM.


#39 -wut-

-wut-
  • Guest

Posted 17 May 2010 - 11:48 PM

1) Taimon already includes a "patch only if the executable matches the original" comparison, so you can just paste a BUT_ONLY at the end of that and you're done.

2)
COPY_EXISTING songlist.2da override
  COUNT_2DA_ROWS 3 count_of_musics
BUT_ONLY

ACTION_IF count_of_musics < 500 BEGIN
  ACTION_FOR_EACH file IN c-aranfr.mus c-aranfr.wav BEGIN
    COPY ~aran/music/%file%~ override
  END
  ADD_MUSIC c-aranfr c-aranfr.mus
END

3) It'll never happen.

#40 cmorgan

cmorgan
  • Modder
  • 2301 posts

Posted 18 May 2010 - 05:38 AM

1) Awesome - I love simple implementations - and I should have caught that check!

2)
So the
COPY_EXISTING songlist.2da override
 COUNT_2DA_ROWS 3 count_of_musics
BUT_ONLY

ACTION_IF count_of_musics < 500 BEGIN
 OUTER_SET my_friend_music = ~PlaySong(c-aranfr)~
 ACTION_FOR_EACH file IN c-aranfr.mus c-aranfr.wav BEGIN
 COPY ~aran/music/%file%~ override
 END
 ADD_MUSIC c-aranfr c-aranfr.mus
 ADD_MUSIC c-aranrm c-aranrm.mus
END ELSE BEGIN
 OUTER_SET my_friend_music = ~PlaySong(0) PlaySound("c-aranfr")~
 ACTION_FOR_EACH file IN c-aranfr.wav c-aranrom.wav c-aranin BEGIN
 COPY ~aran/music/%file%~ override
 END
END

3) heh. True enough! But since the .exe check screens, it should be fine!