The Black Wyrm's Lair - Forums

Mods under development - Baldur's Gate II => Lost Crossroads => Lost Crossroads Workroom => Topic started by: Galactygon on August 27, 2010, 07:35:30 PM

Title: Sneak Peak of B6
Post by: Galactygon on August 27, 2010, 07:35:30 PM
SpellPack B6 is almost ready for release, I've uploaded beta 6 to the BW server.

View the readme (http://galactygon.blackwyrmlair.net/spellpack/README_B6.html)
Download the mod (http://galactygon.blackwyrmlair.net/spellpack/SpellPackB6.exe) [28.3 MB]

Compared to earlier versions, SpellPack B6 has less new features. What it makes up for is stability and customizability.

Features include:
* Smaller Download size (30 MB compared to 45 MB for the previous version)
* 130 components - almost all spells have their seperate component
* No core component that forces you to make changes to install the spells.
* The new cloud spells in SpellPack are now dispellable by Zone of Sweet Air.
* The patching done by SpellPack is more robust and systematic: all components use the same handful of macros when patching items and spells in the game, and the installer will no longer bail out when finding corrupt items.
* Most spells in SpellPack interact with ingame spells - this is achieved through mass patching of thousands of files. For example, SpellPack will patch all true sight and detect invisibility spells to prevent the characters from entering the Shadow Door.
* There are no "hidden" changes when installing each component; if the changes and features are not documented in the readme, drop me line at any of the modding communities.
* There is no instance of a brand new spell overriding a different spell except the case of Undead Ward overriding a similar spell (Repulse Undead). This has no consequences to any AI mods.
* SpellPack B6 introduces race sensitive effects to the game �" these give the spells a common sense - a flying beholder or a giant will not be obstructed by a web spell for example, nor will a fog cloud hinder the movement rate for slimes. The race sensitive effects are determined through tables which can be edited with ease. The races are given fixed parameters which are used systematically by all components of SpellPack, eliminating human error and allowing spells to be edited more flexibly.
* SpellPack introduces spells that are restricted to specialist wizards: Guardian Mantle and Persistence.
Read the Version History for more details (http://galactygon.blackwyrmlair.net/spellpack/README_B6.html#Version)
Read the Summary of Features for a brief component-by-component explanation of what the new spells do (http://galactygon.blackwyrmlair.net/spellpack/README_B6.html#Summary)

I'm still refraining from making a public release, because SpellPack B6 has some flaws.
* Not all of the spells have spell icons that match those of BGII.

* I haven't added the new spell scrolls to stores yet because cross compatibility between SpellPack and Item Randomizer is in process.

* Cross compatibility between Divine Remix and SpellPack isn't resolved as of yet. DR's sphere system does not support new spells introduced in SpellPack, DR overrides some of the spell descriptions changed by SpellPack, and there are duplicates of spells between SpellPack and DR that would appear if you install SpellPack after DR.

*Because of a hardcoded limit of SPELLS.2da, where spells higher than SPPRx50 are not added to priests at levelup, SpellPack appends all of the cleric/druid/paladin/ranger CLAB files to manually give these spells at levelup. This is done in SpellPackB6/Macros/clabs.tph by ACTION_MACRO ~ADD_PRIEST_SPELLS_THROUGH_CLABS~. While the macro compiles a list of CLAB files from KITS.2da, the macro is not flexible enough to take into account any changes to the cleric/druid/paladin/ranger spell progression.

I'd enlist the help of a WeiDU ninja to come up with a more powerful way of appending the CLAB files, so they can take into account any mods that change spell progression.

* SpellPack dynamically adds effects to spells and items through a handful of macros. I've expanded on Gort's ADD_EFFECT macros so that I could control where in the extension header I want to add the effect. This is crucial for SpellPack to work, since it's possible to exclude certain effects in the extended header by placing nested protection from opcode x .effs before those x effects happen. These macros are all located in SpellPackB6/Macros/spl_itm_effect.tph

These macros are called in SpellPackB6/Macros/collateral_spell_effects.tph, and SpellPackB6/Macros/add_sectype.tph. I've added a lot of commented descriptions, so it's easy to figure out how they work. It gives me almost complete control over what effects, opcodes I'd like to find/duplicate/change/delete for any .spl or .itm. They are treated the same way in the macros, except the header size variable gets changed.

Now my problem with these macros is that I wrote most of them (ADD_EFFECT_EXTENDED_HEADER, ADD_EFFECT_FEATURE_BLOCK, and DELETE_EFFECTs are based on Gort's code). They work for SpellPack, fine. But they have flaws. One is speed and efficiency. The other is they do not take regexps.

The macros that need to be scrutinized are: FIND_EFFECT_EXTENDED_HEADER and FIND_EFFECT_FEATURE_BLOCK, and parts of the ADD_EFFECT_... and DELETE_EFFECT_... macros where they update the variables/indexes set by the FIND_EFFECT... macros.

The find effect macros use variables find_header, find_opcode, find_index (the index of the effect in the extended header), etc. After setting these variables, I launch PATCH_MACRO ~COUNT_EFFECT_EXTENDED_HEADER~, which counts the number of instances these effects appear that match the parameters. This allows me to define a FOR loop (i = 0; i < number_of_instances; i += 1) to loop through each effect and do some stuff, like adding another effect right before each instance. ADD_EFFECT and DELETE_EFFECT automatically update the indexes used by FIND_EFFECT macros, which prevents the latter macro of "refinding" the same effect over and over or skipping effects (in case when we are deleting our instances).

Here is a problem: I cannot do a simple COUNT_EFFECT_EXTENDED_HEADER for a single spell for all effect in all extended header. You will notice in SpellPackB6/Macros/collateral_spell_effects.tph, I manually loop through each header of the .spl or .itm:
READ_SHORT 0x68 a // read number of headers
// do some stuff
FOR ( find_header = 1; find_header < a + 1; find_header += 1 ) BEGIN


The other problem is that I cannot define regexps in for the FIND_EFFECT macros. Instead, I redo the search for each variation in the spell.
FOR ( opc_num = 0; opc_num < 11; opc_num += 1 ) BEGIN
                    PATCH_IF ( opc_num = 0 ) BEGIN
                                SET find_opcode = 24
                        END ELSE
                    PATCH_IF ( opc_num = 1 ) BEGIN
                                SET find_opcode = 39
                        END
                     // do some stuff

                 END


My coding skills are far removed from those of the_Bigg/Mike/Wisp/Nythrun/Miloch, and I would enlist someone who could improve these macros. I'm open to completely rewriting them as long as they work for every detail. If these macros are rewritten, they could serve as a standard for mass manipulation of effects in the community. I'd be more than happy to donate them.

Make no mistake, SpellPack can live without these changes, I'm confident about it's stability.

-Galactygon
Title: Sneak Peak of B6
Post by: Kalindor on September 01, 2010, 05:46:11 PM
I regret that I don't have the WeiDU skills to assist you, but I am really looking forward to this new version. Besides conceptual differences, do you foresee any overt reason not to attempt using B6 alongside Spell Revisions?
Title: Sneak Peak of B6
Post by: Galactygon on September 02, 2010, 06:09:21 AM
We are working on standardising spell mods in the community in the G3 workroom. The aims are: Divine Remix support for custom spells, and making sure spell mods overwrite each other

ie installing a spell from one mod will cancel the same spell from another mod - preventing duplicates from appearing.

-Galactygon
Title: Sneak Peak of B6
Post by: Kwiat_W on February 10, 2011, 11:19:28 AM
Download link doesn't work.
Title: Sneak Peak of B6
Post by: Galactygon on February 10, 2011, 03:12:09 PM
Unfortunately I cannot connect to my account either.

Yesterday's release (http://forums.blackwyrmlair.net/index.php?s=&showtopic=98&view=findpost&p=47058) has been uploaded to 4shared instead.

-Galactygon
Title: Sneak Peak of B6
Post by: Baronius on February 10, 2011, 11:27:56 PM
We will try to restore the account access within a few months at most. I know it's a long time but all the site administrators are very very busy. Thank you for your understanding.