Version: 0.4a
By: Waruddar
Main Download: http://www.tesnexus.com/downloads/file.php?id=30154
Dev Site: https://sourceforge.net/projects/cbash/
Welcome to the fourth alpha release of CBash.
Background:
Wrye Bash is slow at reading esm/esp files. Really slow. So slow, that even though it fully supports CELL/WRLD/DIAL records, it does almost nothing with them because it can take ~15 minutes to load them all into memory and write them back out. Even with it sticking to the simpler records, it can easily take a couple minutes to build a Bashed Patch. That's with psyco. Without it, it takes even longer.
This isn't a problem with Wrye's code so much as it is a limitation of Python. Python is great to script with, but it does have a high amount of overhead.
TES4Edit is much faster at reading esm/esp files, but it has a limited ability to automate mod editing.
Introduction:
Luckily, Python supports the loading of foreign DLLs. So, I've written a C/C++ DLL to handle the loading and writing of esm/esp files. I then exported functions for accessing / setting records, and wrote a Python interface to hide most of the uglier details.
What does this mean? When CBash is finished, it can act as a replacement for most of the functionality in bosh.py, Bash's file handler. Bashed Patches will be created faster, will be able to handle more advanced tweaks, and be able to merge any mod into the patch.
Unrelated to Bash, and more generally useful to mod creators, the interface will allow easy and fast automated mod editing.
Trivial example: Reweigh any ingredient that weighs more than 3.0 by cutting its weight in half.
Current = Collection()srcMod = Current.addMod("Oblivion.esm")newMod = Current.addMod("ReweighedIngredients.esp", True)Current.load([eINGR], LoadMasters=True, FullLoad=True)for record in srcMod.INGR: if(record.weight > 3.0): newRecord = record.CopyAsOverride(newMod) newRecord.weight = newRecord.weight / 2.0newMod.safeSave()
Additionally, the final version will fully support FO3.
There is also a potential of linking this DLL to a OBSE plugin, and enabling the creation of mod files while in game. But, I'm not going to even think about this until v1.0 is released at the earliest.
What I'd like:
Feel free to play around with it. All Oblivion records are supported. Examples on usage can be gleaned from the Test.py file.
Whenever Bash makes a regular release, I will post which functions have been converted to use CBash. Please test them with and without CBash and give me feedback.
Instructions:
Unzip CBash.dll, Test.py, and CBashInterface.py into any directory. Ignore the Source folder unless you're curious.
Place a copy of Oblivion.esm into the same directory.
If you run Test.py, nothing will happen. Various tests are available if you uncomment the test of interest at the bottom of the file.
If you want to play around, you can use Test.py as a template for your own file.
Current Performance:
First run: Fully load all records: 14s
First run: Minimally load all records: 5s
Subsequent runs: Fully load all records: 4.1s
Subsequent runs: Minimally load all records: 1.3s
What's done:
All record types can be read, copied as new or override, new records created, written, and have been fully exposed to Python.
What isn't done:
- Setting/Changing a mod's filename after it has been added.
- Deleting subrecords
- Ability to filter records by criteria (Get all records with an eid that contains a string, has a specific weight or position, etc)
- Clean master list of unreferenced masters
- Sort master list by load order
- DeepCopy records (including all referenced records that aren't in an existing master)
- Additional safety / sanity checks
- Optimization
- FO3 Record support
Roadmap:
v0.2a - Expose remaining simple records to Python
v0.3a - Support and expose CELL/WRLD/DIAL records and subrecords
v0.4a - Hook CBash into Wrye Bash
v0.5b - Initial Beta Release - Maintenence (fix/implement all known issues)
v0.5.1b ... v0.5.XXb - Maintenence releases as needed
v0.6b - Support and expose FO3 records
v1.0 - Initial Full Release