Jump to content

[MOD][BETA] The Horde 1.2


Recommended Posts

[introduction]
This mod will tweak the amount of ALL the enemies in the game that are not plot related.
It effects creatures spawned by a script or placed in the map.

Candle Keep rats before:

mqs1u0pmpj6q.png



Candle Keep rats after:

tmhebly5tazf.png



Nashkel Mines before:

vry6bj4egs97.png



Nashkel Mines after (you can guess what happened a few seconds later):

zyj0rie1l1n2.png




[installation]
1) Place the zip file in your root Baldur's Gate 1/2 directory (where baldur.exe is), right click and select Extract Here. Then move the zip file to another location.

2) Open your Baldur's Gate 1/2 folder, and double-click 'SETUP-THE_HORDE.exe'. If there is no 'SETUP-THE_HORDE.exe' in this directory, you have extracted it to the wrong place.

3) This mod should be installed last and before generalized biffing.

If you want to uninstall the mod, just double-click again 'THE_HORDE.exe' and press 'U' for uninstall.


[Compatibility]
The mod should work with BG1,BG2,TOB,BG1:EE,BG2:EE,EET.

Steam/GOG SOD dlc:
You can install it after merging SOD with BG1:EE installation.
Can find instructions HERE.


[Download]
http://www.shsforums.net/files/file/1159-the-horde-beta/


[README]
You can find the readme inside THE_HORDE folder.

 

[Version History]

 

Version 1.1 - 13/12/2016
* Made compatible with WeiDU uninstall

Version 1.0 - 12/12/2016:
* First public release


Edited by yowave
Link to comment

@yowave

It appears to me that you learned enough WeiDU to use it to extract the resources you wanted to modify from the game into the override folder, but then turned around and wrote a custom (Windows-only) application to actually modify the files. If I may ask, why didn't you learn just a bit more WeiDU and skip the whole custom program business (which would have made your mod both cross-platform compatible and compatible with all other mods)?

Link to comment

@Sam

I know a bit more about WeiDU than what you see here, already created another big (technically) kit mod "Way Of The Fist" that introduces more than 100 files, and a new gaming mechanism that never been done before (btw i need testers and feedback).

This mechanism can be used for other cool mods and kits ;)

 

I have started working on THE_HORDE in WeiDU but it doesn't give me that much control over what i want to do.

Making it in WeiDU is like shooting yourself in the leg and it's probably not possible, i am talking about the lowest level of file editing and patching, changing multiple bytes and introducing new chunks of data (aka more than a few petty bytes) on specific conditions (oh boy there's an 's' there, it means more than one condition :wallbash: ).

When it comes to script editing it's a whole new level of editing, one needs to interpret each instruction and it's arguments and act accordingly, this is just too much for WeiDU.

Oh and one more thing, i wanted this thing to be installed in mere minutes (on my machine it takes about 20 seconds), if it was even possible to make it in WeiDU and stay sane the installation would have taken longer A LOT longer.

Odds are that this mod would have never see the light of day if all i had in my disposal is WeiDU.

 

There is another way to do it though, instead of doing it programmatically i could edit all those files by hand (going through thousands of files and ending up editing thousand or more, the sheer amount of editing would drive me insane), but then i won't be able to react to changes made by mods or new files that have been introduced by mods.

 

On the good side, i will compile it to work on other operating systems once i know that it works perfectly.

Also i have some ideas to expand this mod, but it's still in the planing phase.

 

@abg1

Thanks for the info!

Edited by yowave
Link to comment

I have started working on THE_HORDE in WeiDU but it doesn't give me that much control over what i want to do.

Making it in WeiDU is like shooting yourself in the leg and it's probably not possible, i am talking about the lowest level of file editing and patching, changing multiple bytes and introducing new chunks of data (aka more than a few petty bytes) on specific conditions (oh boy there's an 's' there, it means more than one condition :wallbash: ).

When it comes to script editing it's a whole new level of editing, one needs to interpret each instruction and it's arguments and act accordingly, this is just too much for WeiDU.

Oh and one more thing, i wanted this thing to be installed in mere minutes (on my machine it takes about 20 seconds), if it was even possible to make it in WeiDU and stay sane the installation would have taken longer A LOT longer.

Odds are that this mod would have never see the light of day if all i had in my disposal is WeiDU.

I think you are underestimating Weidu. My sphere system mod goes through ~100,000 iterations patching effects into spells in about 60 seconds. That's the most complex Weidu I've done, not just for its insane "consider all .SPL files, and for each effect within each one, consider all .SPL files" thing.

 

It would help if you tell us how your mod works - what does it do to these files? What kinds of edits does it make? People around here know a fair bit about Weidu and can make it do just about anything.

Link to comment

@subtledoctor

100,000 iterations patching in 60 seconds, sorry that's slow!

I am talking about millions of iterations (21,266,213 of iterations in an unmodded BG1:EE installation), think about 20mb's (or more, depends on the game and if it's modded or not) of bcs files which my program goes through to patch.

 

Instead of answering your question, which would make me delve too much into the technical, let me ask you, how you or anyone else would have done it?

To set you on track let me impose a problem (one of many in such a project) on you, see if you can come up with a good way (easy and fast) to do it in WeiDU.

I want you to duplicate all the CreateCreature actions in all the script files in the game.

This is just the tip of the iceberg, you can't duplicate all the creatures willy nilly, and merely duplicating is not enough.

Edited by yowave
Link to comment

A COPY_EXISTING_REGEXP can modify all BCS files, and a REPLACE_EVALUATE with a regex pattern matching the CreateCreature action with matching groups can be used to extract the relevant parameters of the action as %MATCH1% %MATCH2% etc. REPLACE_EVALUATE also allows you to replace each matched string with a variable-expanded replacement string, so you could put your logic deciding if that creature should spawn more copies inside the REPLACE block (you can execute as many PATCH commands as you want, for each match, and then use any variables you set therein to construct the replacement string).

 

If using regex is too slow for your liking, you could use DECOMPILE_AND_PATCH to convert each BCS to BAF format (in memory) and then write a line-by-line reader FOR loop to parse each line of the BAF looking for CreateCreature. An example of such a FOR loop (looking for VERSION lines) is implemented in the BWFixpack's _ApplyPatches.tp2.

Edited by agb1
Link to comment

I am talking about millions of iterations (21,266,213 of iterations in an unmodded BG1:EE installation), think about 20mb's (or more, depends on the game and if it's modded or not) of bcs files which my program goes through to patch.

 

Instead of answering your question, which would make me delve too much into the technical, let me ask you, how you or anyone else would have done it?

You haven't explained what it does, so I can't answer that. :p

 

As to 20 million iterations: my sense is, there is nothing any BG mod does that should require 20 million operations. Whatever your mod does, can very like be done more efficiently.

 

I don't know much about .BCS files - not my area of expertise. But Weidu has all sorts of functions for mass patching.

Link to comment

My 10 player party mod first decompresses all ingame scripts, searches them and recompiles them. Similar for dialogs. At first I also thought it would take ages, but no. It's true that for the mangling, it forks to perl, since it has to do very complex stuff though.

Link to comment

@abg1

Thanks but i already know about this method, and frankly i think that BWFixpack's _ApplyPatches.tp2 is abysmal and could have been coded differently, but hey it works and it does what it does.

Now as i said, i already started coding it in WeiDU so i am speaking from experience, and thanks to @lynx now i know why it works so slowly.

 

Now let me show you a piece of simple code from my WeiDU implementation, i stripped all the mangling (hehehe @lynx) and condition checking so it's bare bones (the real source have hundreds of lines)!

on my machine this piece of code runs forever compared to my custom application which does all the complex things in mere 20 seconds (it's 14 seconds but who counts, i guess that i do xD).

OUTER_SET newLine = 10
OUTER_SET cr = 13
OUTER_SET space = 32
OUTER_SET quot = 34

COPY_EXISTING_REGEXP GLOB ~.*\.bcs~ ~override~
PATCH_IF (SOURCE_SIZE > 0) BEGIN
	FOR (i = 0; i < SOURCE_SIZE; ++i) BEGIN
		READ_ASCII i c(1)
		READ_BYTE i b
		PATCH_IF (b = newLine OR b = cr OR b = space OR b = quot) BEGIN
			SET test = 1
		END
	END
END

I kinda have an idea what can be done, maybe we should petition WeiDU developers to introduce new functions EXECUTE and GET_OS. EXECUTE will execute an application and GET_OS will return the operation system so one can execute the right application, this way one could actually expand on WeiDU and go past it's shortcomings.

Now don't even think that i think WeiDU is bad, it is a magnificent tool and it does what it does best, it's just that it'll be really nice if it had those two functions.

So anyone knows whom i can contact? if it can't happen i might delve into SML (i really don't want to) and introduce those functions into WeiDU.

Edited by yowave
Link to comment

Err, *I* chose to fork to perl, since I needed more regex power. I was speaking of the mod.

 

Reading all scripts several times a character at a time sounds really inefficient, so I agree with what subtledoctor pointed out.

 

Weidu is writen in ocaml. Using external tools with it is already possible, but then the changes aren't automatically tracked.

Link to comment

WeiDU already has a %WEIDU_OS% built in variable, and the AT_NOW action can invoke other executables.

 

As for the fix pack script, I'd love constructive criticism. I bashed my head against a lot of unexpected limitations while testing it and it has become a Frankenstein's monster due to the many workarounds I eventually found through trial and error.

Link to comment

Ooh, I see we have another diplomat among us! :p

 

Try that code on BAF files inside a DECOMPILE_AND_PATCH and see if it takes that long. (Maybe it does, what do I know, like I said BCS stuff isn't my specialty.)

 

But if all the mod does is increase spawns, then it really shouldn't need that kind of approach. Heck, there are already mods that increase spawns, which install the the blink of an eye. I don't know how they work... but I suspect you can do it more efficiently than this.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...