Skip to content
This repository has been archived by the owner on Jan 22, 2023. It is now read-only.

Commit

Permalink
[DOC] updated main Readme for version 0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRedDaemon authored Nov 29, 2020
1 parent 3346d79 commit da98790
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

The *LittleCrusaderAsi* tries to tackle this issue by using a very common technique when it comes to modding. The modification uses an AsiLoader (see [Installation](#installation)) to load a Dynamic Link Library (dll, just named asi in this approach) into the address space of a program. That allows to execute additional code and modify the software during runtime.

Currently, **only some simple features and the basic program structure are implemented**. One hope is that the later can be used to extend the mod in a structured (but not restricted) way. The individual features are granted a lot of freedom how to handle issues like missing addresses, so version compatibility is provided on a per feature basis.
The implementation tries to grant individual features a lot of freedom how to handle issues like missing addresses, so version compatibility is provided on a per feature basis.
That being said, as long as no one with other versions then 1.41 and 1.41.1-E digs through the addresses, the mods will mostly be limited to the later. Additionally, the restriction is further defined by the mod being so far created using a German crusader version. As a result:

**Full compatibility so far is only guaranteed for Crusader versions 1.41 and 1.41.1-E and only if they are codewise identical to the german version. (A guess would be that this includes all using the latin alphabet, like the english version.)** Other "versions" of 1.41 and 1.41.1-E might even create crashes at the moment, since the current system might not know how to handle them. (There are reports of problems with the Russian version and the UnofficialCrusaderPatch, so this might be a candidate.) In all other cases (for example version 1.2), the feature should simply not work and the issue will be written to a log file.
Expand All @@ -31,12 +31,12 @@ For more information on the implementation approach and structure, please take a
### Getting LittleCrusaderAsi
Go [HERE](https://github.com/TheRedDaemon/LittleCrusaderAsi/releases/latest) to get the latest release.

The project can also be build from source. It is written in C++17 and the repository contains a Visual Studio 2017 project. One must make sure to use the Win32 mode and (for DEBUG mode) redefine *Properties->General->Output Directory* and *Properties->Debugging->Command*, since both are currently configured to allow debugging the dll and point therefore in the file structure of the latest who edited the project file.
The project can also be build from source. It is written in C++17 and the repository contains a Visual Studio 2019 project. One must make sure to use the Win32 mode and (for DEBUG mode) redefine *Properties->General->Output Directory* and *Properties->Debugging->Command*, since both are currently configured to allow debugging the dll and point therefore in the file structure of the latest who edited the project file.

### Getting an AsiLoader
*LittleCrusaderAsi* relies on a third party tool that loads it into the process. Basically only one tool was tested, but more or less two variants are possible:

* Using [Ultimate-ASI-Loader](https://github.com/ThirteenAG/Ultimate-ASI-Loader/releases) directly. The release will contain a 'dinput8.dll' which needs to be placed in the game root directory. However, it needs to be renamed into a dll the game loads. One that works is 'ddraw.dll'. Other names might be possible, but were not tested. Now the game will load ASI files placed in game root directory or the folders 'scripts' or 'plugins', if they are created inside the game directory.
* Using [Ultimate-ASI-Loader](https://github.com/ThirteenAG/Ultimate-ASI-Loader/releases) directly. The release will contain a 'dinput8.dll' which needs to be placed in the game root directory. However, it needs to be renamed into a dll the game loads. One that works is 'ddraw.dll'. Other names might be possible, but were not tested. Now the game will load ASI files placed in the game root directory or the folders 'scripts' or 'plugins', if they are created inside the game directory.

* Using [DxWrapper](https://github.com/elishacloud/dxwrapper), which uses code of the Ultimate-ASI-Loader to provide the same feature alongside a ton more, like [Dd7to9](https://github.com/elishacloud/dxwrapper/wiki/DirectDraw-to-Direct3D9-Conversion). The later allows stuff like running the game in window mode (with a few issues, like the cursor not being bound to the window). For the installation, please refer to the DxWrapper documentation. In short, it is required that the provided 'ddraw.dll' is placed in the game root folder alongside 'dxwrapper.dll' and 'dxwrapper.ini'. The asi-loading needs to be activated in the 'dxwrapper.ini'. It also supports the folders 'scripts' and 'plugins'.

Expand All @@ -48,36 +48,42 @@ First, all now mentioned files need to be placed in the same directory. This mig
Currently three files are needed:

1. The 'LittleCrusaderAsi.asi' of course.
2. The 'logger.config', which is the configuration for the logger. Simply using the file [HERE](src/LittleCrusaderAsi/dependencies/logger/logger.config) is enough. For customisation please refer to the easylogging++ documentation (see [Dependencies](#dependencies)). Omitting it will result in the use of a default configuration.
3. The actual 'modConfig.json'. This file contains the mod configuration. [THIS](https://github.com/TheRedDaemon/LittleCrusaderAsi/blob/Dev/src/LittleCrusaderAsi/dependencies/jsonParser/modConfig.json.example) non valid json-file will contain examples for every possible adjustments and features.
2. The 'logger.config', which is the configuration for the logger. Simply using the file [HERE](src/LittleCrusaderAsi/dependencies/easylogging++/logger.config) is enough. For customisation please refer to the easylogging++ documentation (see [Dependencies](#dependencies)). Omitting it will result in the use of a default configuration.
3. The actual 'modConfig.json'. This file contains the mod configuration. [THIS](ConfigurationDescription) non valid json-file will contain examples for every possible adjustments and features.

If the asi-file is missing, it will not work. If the modConfig is missing or invalid the mod will crash with a log.
Log output is written to a file named 'crusaderAsi.log', which will be overridden on every start and generated in the same folder as the other files. In case of a noticed exception or if requested by a feature, the log will be copied and renamed on exit. Hard crashes (in case of corrupted memory for example) will likely not show up in the log.
Log output is written to a file named 'crusaderAsi.log', which will be overwritten on every start and generated in the same folder as the other files. In case of a noticed exception or if requested by a feature, the log will be copied and renamed on exit. Hard crashes (in case of corrupted memory for example) will likely not show up in the log.

At the moment, configuring the modification is kinda clunky. The focus for now is on functionality instead of usability. However, if anyone wants to provide a GUI for generating the configuration json, feel free. ^^
At the moment, configuring the modification is kinda clunky. The focus for now is on functionality instead of usability. However, if anyone wants to provide a GUI for generating the configuration json, feel free. ^^
In the future it might also be possible to define the configuration in the overlay menu and save it at the end, but this is currently not possible.

## Current Features
A list of the features currently provided by the *LittleCrusaderAsi*. The short summery will not contain in-depth details regarding the configuration. Please search in the [example json](https://github.com/TheRedDaemon/LittleCrusaderAsi/blob/Dev/src/LittleCrusaderAsi/dependencies/jsonParser/modConfig.json.example) after the feature name to get information about the configuration.
A list of the features currently provided by the *LittleCrusaderAsi*. The short summery will not contain in-depth details regarding the configuration. Please search in the [Example Json](ConfigurationDescription) after the feature name to get information about the configuration.

**KeyboardInterceptor**
*Supported versions:* All (in theory)
The keyboard interceptor has two features. First, it allows other mods to register key functions. Second, it allows to redefine keypresses. The later is directly handled through the configuration of this mod. It is therefore possible to tranform a press on the 'a'-key to a press on 'b'. However, this is only possible for single keys and is done by catching the actual key and telling the game another was pressed. As a result, combinations like 'shift+a' are carried over (for example would become 'shift+b') and text inputs are unreliable. To circumvent this issue the interceptor as a whole has a configurable on/off-key.
The keyboard interceptor has two features. First, implementation utility. It allows other mods to register key functions and to receive text input. Second, it allows to redefine keypresses. The later is directly handled through the configuration of this mod. It is therefore possible to tranform a press on the 'a'-key to a press on 'b'. However, this is only possible for single keys and is done by catching the actual key and telling the game another was pressed. As a result, combinations like 'shift+a' are carried over (for example would become 'shift+b') and text inputs are unreliable. To circumvent this issue the interceptor as a whole has a configurable on/off-key.

**BltOverlay**
*Supported versions:* V1.41.1-E | V1.41
Not directly a feature that changes the game, but the most noticeable utility. Mods are now able to provide menus that can be accessed by using an overlay menu. It also provides a console window that can display some log messages. For more informations on the current sub-menus, please refer to [THIS](MenuDescription.md) file.

**BuildRangeChanger**
*Supported versions:* V1.41.1-E | V1.41
A very simple modification that allows to change the castle build range. Can be configured to be active at start, or can register a key function used for activation (with activated KeyboardInterceptor). Ranges are defined by map size. Key function allows toggle between vanilla- and configuration-values. The AI will build walls regardless, but no towers if they fall out of range.
A simple modification that allows to change the castle build range. Can be configured to be active at start, can register a key function used for activation (with activated KeyboardInterceptor) or be configured in more detail by using the [*BltOverlay* menu](MenuDescription.md). Ranges are defined by map size. Key function allows toggle between vanilla and custom values. The AI will build walls regardless, but no towers if they fall out of range.

**AICLoad**
*Supported versions:* V1.41.1-E | V1.41
AIC loader of the *LittleCrusaderAsi*. Allows to define an AIC-folder and a list of AIC-files to be loaded. The mod was created to support the file format defined by the UCP (2.14) ([Example with vanilla AIC](https://github.com/Sh0wdown/UnofficialCrusaderPatch/blob/master/UnofficialCrusaderPatch/AIC/Resources/vanilla.json)). The changes can either be loaded at the start or after requested. It is therefore possible to configure three key functions. The first simply switches between the current AIC data and the vanilla AICs. The second allows to reload the 'main'-AIC, which is the first in the AIC-list in the configuration file. The third allows to reload all AIC-files. AIC values are applied starting from the the main AIC to the second, then the third and so on. Note that this order is currently applied per value, so it is possible to carelessly create AI-amalgamations if one does only define half of the Rats values, while having another AIC with another Rat in line.
AIC loader of the *LittleCrusaderAsi*. The mod was created to support the file format defined by the UCP (2.14) ([Example with vanilla AIC](https://github.com/Sh0wdown/UnofficialCrusaderPatch/blob/master/UnofficialCrusaderPatch/AIC/Resources/vanilla.json)). This mod posseses a lot of features, among them the ablilty to load new AIC files, define their load order, a live editor and the possiblity to save the current custom values. Please check out the [Example Json](ConfigurationDescription) and the [Menu Description](MenuDescription.md) for more details.
Note that all AIC values are currently applied per value, so it is possible to carelessly create AI-amalgamations if one does only define half of the Rats values, while having an AIC with another Rat in line.

One last note. There is currently no direct way to indicate in-game that a function was executed and works. If in doubt, check the log-file created in the mod directory.
One last note. Not all log messages are displayed in the text console and there is also currently no way to scroll back. So if in doubt, check the log-file created in the mod directory.

## FAQ
A place for questions some might have.

1. **Is *LittleCrusaderAsi* compatible with the UCP?**
A test with version 0.1 of *LittleCrusaderAsi* and version 2.14 of the UCP (with not all but multiple features enabled) yielded no obvious errors. Considering that the current features of *LittleCrusaderAsi* only alter values and not processes, it should be compatible. That being said, using AIC modifications in both the UCP and *LittleCrusaderAsi* might lead to unwanted overwrites.
A test with version 0.1 of *LittleCrusaderAsi* and version 2.14 of the UCP (with not all but multiple features enabled) yielded no obvious errors. Version 0.2 was not tested so far, but the only changes to processes are to some of the main DirectDraw functions, which seem to be untouched by the UCP so far? I am rather sure there should be no issues. That being said, using AIC modifications in both the UCP and *LittleCrusaderAsi* might lead to unwanted overwrites. For example, the "default values" in the editor menu will be the values installed by the UCP.

## Credits

Expand Down

0 comments on commit da98790

Please sign in to comment.