wkbre v0.1.0.0 Help file

Table of Contents

Introduction

wkbre is a engine reimplementation of the game Warrior Kings (Battles) (developed by Black Cactus) in which you can load, edit, play and save saved games of the game. It loads the game set, including the .cpp files, meshes, textures, …, so you can get a 3D view looking exactly as in the game.

The program is open source and is licensed under the GNU GPL 3. The source code and the latest build are available here: https://github.com/AdrienTD/wkbre

Start

First, you should tell wkbre the folder path where the game is installed. To do this, either copy the executable wkbre_vc.exe to the game's directory (where you should find "Warrior Kings (Battles).exe", "data.bcp" and the "saved" folder). Or you can also leave wkbre in its own directory: open the "settings.txt" file (which must be at the same directory as wkbre_vc.exe), and change the GAME_DIR value to the directory path of the game.

Now you can start the executable (wkbre_vc.exe). If it doesn’t start, be sure that the Visual C++ 2010 Redistributable Package (x86) and the latest DirectX runtime are installed. If not, you can download them from http://www.microsoft.com/download .

You will be asked which saved game you want to load. Select a file in the list then click Load or double-click the file to open it. If you click Play instead, the game will be started and unpaused when loaded!

Use the arrow, ‘E’ and ‘D’ keys to move the camera. Hold the NumPad 0 key and move the mouse to rotate the camera. You can also scroll the mouse wheel to move up/down, and press the middle mouse button and move the mouse to rotate the camera.

Click an object to select it. Press the Control key and the arrow keys at the same time to move the selected object. You can also press the N key to duplicate the selected object, the Delete key to delete it, and the * or / key to change the size. Look at the menu bar in the program or the Keys section of this document for a list of available commands.

Click Window > Object information to open a window where you can view and edit properties of the selected object.

To create a new object, click Window > Object creation and a window will open. First click the white box next to "Give to:" to select the player you want to give the new object, then click in the big list the type of the new object. You can shorten the list by typing a part of the type name in the "Filter" text box. Once you have chosen a type in the list box, do a right-click on the game view to create the object.

Once you have finished doing some modifications in the level, press F3 and type the name of the new savegame. The name should end with “.sav” (for a savegame) or “.lvl” (for a new skirmish level), otherwise the game won’t display it in its list.

Creating new custom maps

wkbre's most notable feature is to allow you to make new custom maps that you can play against AIs and real human players.

When you first start wkbre, you can see the option <New empty level>. If you choose it, you will get an empty level with a flat terrain, 8 players and no more objects, so that you can create a new map from scratch.

Click Window > Terrain editor to open the Terrain editor window, which provides you functions to modify the terrain. In the Tools section you can find tools like terrain height (vertex) elevation, texture changing, lake insertion, etc.

Each tool will change the behaviour of the mouse buttons. For example if you use the Vertex Elevate tool, pressing the left mouse button on the terrain will increase the height, and a right click will decrease instead. If you want to go back to the default tool (object selection), then click Default.

By default, when creating a new level, the map size is 128x128 tiles. If you want to change the size, click the "New" button at the top of the Terrain editor window. This will show a popup where you can specify a new map size, but note that this will reset the whole terrain!

If you want to save the terrain, type a name in the Name textbox, then click the either "Save SNR" or "Save BCM". The difference between the SNR and BCM formats are:

You can find your saved terrain files in <GAME_DIR>\saved\Maps\<name>\<name>.snr/.bcm.

Please note that SNR and BCM "map files" only contain the terrain and eventually lakes. They don't contain any objects like units and buildings. The objects are saved in the "savegame" (SAV) or "level" (LVL).

When you save your terrain, the current savegame/level will be automatically bound to the saved terrain. To check to which terrain file the current savegame is bound, go to Window > Level information > Properties > Map:.

Click Window > City creator to open a window where you create cities with automatically a manor inside and peasants in front of it. First click the Add/remove city radio button, then choose a player, and left-click on the area where you want to put the city. You can press R before clicking to rotate the manor. Right-click a city to remove it. At the end click Default to go back to object selection tool.

You can now put objects like trees and props with Window > Object creation. Be sure that the Send "On Stampdown" event checkbox is disabled for most cases. For objects like trees that are not owned by human players, give them to the Neutral Player.

The developers of the game have left in WKBattles' game set scripts certain special objects that, by stamping them down, will generate lots of trees around, so that you don't have to create every single tree. To do this, check the Send "On Stampdown" event then in the Filter box, type auto. In the listbox, click for example MARKER "AutoTrees Coniferous-10". By creating it, you will get 10 trees as well as some bushes and birds! Try other auto markers as well. If you don't need auto objects anymore, be sure to disable the On Stampdown checkbox back.

You also need to set the starting camera position of every player. To do this, open Window > Object information, then go to Window > Level information > Human players list, click a player, and in the Object information window, click Start camera. You should see the button Set. Move your camera and click this button to set the starting camera position of the selected player object to the current position of the camera.

To save the level, press F3 and type a name with an ending of .lvl . Note that if you have modified the terrain/map, be sure to save the terrain/map before saving the level/savegame, so that the level is already bound to the modified terrain.

To play your custom level in the game, be sure that you have installed my unofficial patch. This patch will make custom levels appear in the skirmish and multiplayer menus.

Now if you are happy with your custom map and want to share it with other players, you can pack your terrain and level files together in a single BCP file which makes uploading and installing much easier. To do this, load your custom map into wkbre, then click File > Export map to BCP... to create a BCP file with your map. So if someone wants to try your map, what he/she has to do first is just to copy to the game's directory (where you can find the .exe and the data.bcp files) the BCP file, as well as the unofficial patch if he hasn't done before. Then he/she should be able to see the custom map in the skirmish/multiplayer map selection list.

If you want to play your custom level in multiplayer, be sure that all players have copied the exported BCP file of your map to the game's directory (as well as the unofficial patch in form of d3d8.dll).

Windows

wkbre features some floating windows which allows you to view/edit a lot of properties of the level/savegame and its objects. You can open them via the Window submenu.

These windows are done thanks to the open source Dear ImGui library, so any tricks and keyboard shortcuts of Dear ImGui also apply here.

The windows are:

Object information

This shows information/properties of the first selected object. If no object is selected, it shows nothing.

At the top, you can see the ID and type of the selected object. Click Change type to change the object type. Depending on the object, you can also see the player, parent, name and color of the object. Clicking the "->" button will select the mentioned object. Clicking the player name will show a popup where you can change the player of the object. If a player object is selected, clicking the color button will show a popup where you can change the color of the player.

The window is also divided in sections/groups that are all closed by default. To open one, click it.

Level tree

Here you can view the whole tree of the objects in the level. Click a node to show its subordinates. Right-click a node to select the object (SHIFT+right-click to add to selection).

Level information

Like the Object information window, the window is divided in sections:

Object creation

Here you can easily create new objects. See the Start section of this document for a guide on how to use it.

The Send "On Stampdown" event checkbox will execute some game script after the object is created. This is especially needed for some MARKER objects. For example for a MARKER "AutoTrees ..." object this will automatically generate trees around the position of the new marker. For a village building, this will also automatically generate a cart. Sometimes this feature is important as the script that will be executed will initialise the new object properly. It is recommended to enable this feature with SAV files and to disable it with non-started LVL files.

Terrain editor

The Terrain editor allows you create, open and edit map files (terrains).

At the beginning you see a textbox for the name of the terrain you want to open or the name you want to save your terrain as.

In the Tools section, you can find these tools:

You can also change the size and the shape (square, circle) of the brush or area you want to modify. This only concerns the tools Texture, Elevate, Flatten and Equalize.

In the Properties section:

In the Texture section:

In the Lakes section:

City creator

To create a new city with a manor inside, click the Add/remove city, choose a player, then click on the terrain where you want to create the city. You can also right-click an existing manor city to remove it. In the window you can also change the size, the number of peasants as well as if you want flags in front of the city or not.

Minimap

This will display a minimap of the level and the terrain.

Note that the minimap is refreshed every frame, thus causing lags. So if you don't need the minimap, close it.

Playing games in wkbre

wkbre is also able to let you play the game. This is done by interpreting the game set script which can be found in the game data as .cpp files.

When you press 'P', the game will be unpaused. You can see your units moving, peasants doing their work, units attacking, etc...

When you have selected an unit you can also give it an order by right-clicking a target, or press 'A' to execute button commands.

Please note that savegames with AI players might not work because some game set script features related to AI are not supported yet.

If you have opened a lvl file, you can press 'Control + S' to start the level and intialize the game (for example in a tutorial this will show the first message, and in Battles it "should" initialize the AI).

Please keep in mind that whenever you start a level, it will convert the level (LVL) into a savegame (SAV), and you can't revert back to a LVL!
So if you made a new level, be sure to save it as a LVL file before starting it.

You can also start a level directly after loading by clicking the "Play" button in the Load level/savegame select window instead of the "Load" button.

You can also take control of the camera of a player/client with 'F'.

Finally, press 'Enter' to switch into a "Game" interface.

See the Keys section and the "Game" submenu in the menu bar for a list of available commands.

Also please keep in mind that the ability to play games in wkbre is "experimental", this means some features are missing and bugs can be encountered.

Keys

The number (0-9) keys in the numeric keypad (NumPad) cannot be used, except if explicitely stated.

KeyFunction
Camera
Arrow keyMove camera
ShiftIncreases movement speed if held down.
E/D or mouse wheelMove up/down
NumPad 0 or
Middle mouse button
Holding it will allow you to rotate the camera by moving the mouse.
TRotate up
GRotate down
URotate left
IRotate right
1Move to down-left corner
2Move to down-right corner
3Move to up-left corner
4Move to up-right corner
5Move to a selected player's manor
7Reset orientation
8Move to client’s position
Level editing
Left mouse buttonSelect the object pointed by the mouse cursor (if the object is red).
Hold Shift for multiple selection.
Hold the left button for drag selection.
NDuplicate selected object.
HomeGive selected object to another player.
DeleteDelete selected object.
* (NumPad)Multiply selected object’s scale by 1.5.
/ (NumPad)Divide selected object’s scale by 1.5.
RRotate selected objects, stampdown object or new city by 90°.
Control + Arrow keyMove selected object (hold down Shift to move it faster)
Control + Left-clickPlace the selected objects to where the mouse points at
F2Reset object heights
F3Save game
F11Randomize subtype of all objects
TabEnable/disable aligned movement.
OSelect object per ID.
Gaming
PPause/unpause game.
+Increase game speed.
-Decrease game speed.
Control + SStart the level. (Send "On Level Start" event to all objects.)
FControl a client (including its camera).
Right-clickExecute cursor command on the selected objects (target is object under the mouse cursor.)
With Shift: Do order last.
With Control: Do order first (current order will be suspended).
With nothing: Cancel all orders in stack then do the order.
XExecute action sequence
AExecute command on selected objects (without target)
YExecute command on first selected objects targetting last selected object.
JSend an event to the selected objects.
0Game "step": Unpause the game for one single frame.
Misc.
EscapeExit
F1Show this help.htm file.
F4Show/hide Object information window.
F5Show/hide Level information window.
F6Show/hide Level tree window.
F7Show/hide Object creation window.
F8Show/hide Terrain editor window.
F9Show/hide City creator window.
6Show/hide Minimap.
MDisplay/hide terrain
KDisplay/hide terrain grid
LDisplay/hide time and object information
BackspaceDisplay/hide menu bar.
EnterSwitch between level and game view.

There are also more commands which can only be accessed from the menu bar.

Settings

In “settings.txt”:

SettingValue
GAME_DIRGame directory (in quotation marks)
GAME_SET_VERSION0 = autodetection, 1 = Warrior Kings 1/Original, 2 = Warrior Kings Battles
FAR_Z_VALUEThe greater the value, the farther you can see.
OCCLUSION_RATEThe greater the value, the more you can see.
MAP_MAX_PART_SIZEMaximum width and height (each in number of tiles) of a single part of the landscape.
HARDWARE_VERTEX_PROCESSING1 for hardware, 0 for software vertex processing
TEXTURE_COMPRESSION1 = texture compression (DXT1) enabled, 0 = disabled
(NOTE: In version 0.0.3, texture compression is always disabled. This may come back in future releases.)
VSYNC1 = vertical synchronization enabled, 2 = high resolution VSYNC enabled, 0 = disabled
FOG1 = fog enabled, 0 = fog disabled
FONTPath to a .font file used to draw text (Don’t forget the quotation marks!)
HARDWARE_CURSOR1 = Use the system cursor, 0 = Draw cursor in game screen buffer
SCREEN_SIZEInitial size of the game screen/window size. Requires two numbers for width and height in pixels.
FULLSCREEN0 = windowed, 1 = fullscreen (NOTE: Fullscreen mode buggy at the moment.)
VERTICAL_FOVThe FOV of the game camera in degrees.
MULTI_BCP1 = load all BCPs found in the game directory
0 = load only data.bcp
DATA_DIRECTORY1 = enable the "data" directory
0 = disable it
RENDERER0 = Null renderer, 1 = Direct3D 9, 2 = OpenGL 1.1
MESH_BATCHINGRegroup multiples meshes in one batch, can improve graphics performance;
0 = disabled, 1 = enabled
ANIMATED_MODELSModel animation: 0 = disabled, 1 = enabled
PRELOAD_ALL_MODELS0 = load models only when needed, 1 = preload all models when loading the game
ENABLE_GAMEPLAY_SHORTCUTSKeyboard shortcuts for gameplay and ordering by right-clicking: 0 = disabled, 1 = enabled
Can be changed in runtime via the menubar.
SHOW_TIME_OBJ_INFODisplay the current time and values for the selected object: 0 = disabled, 1 = enabled
Can be changed in runtime via the menubar.
ENABLE_GAMESET_TRACINGAllow the gameset script to print trace information into the console (stdout). 1 = yes, 0 = no
R_OGL1_USE_BUFFER_OBJECTS1 = Use OpenGL Vertex Buffer Object extension, 0 = no
MAC_FILENAME_FALLBACK1 = If a file is not found, then try again with a truncated file name for compatibility with the Mac version. 0 = fail otherwise
ENABLE_LANGUAGE_FILE1 = Use the "Languages\Language.txt" file. 0 = Don't use it and show "Not localized" text instead.
IMGUI_FONTPath of font filename to use in Dear ImGui windows. And optionally, a number can be added next to the path to indicate the size of the font. For example: IMGUI_FONT "Morpheus.ttf" 30

Known issues

Contact

If you have a questions, you have found a bug or simply have a suggestion, please contact me:

Name: AdrienTD

Email: agpetit69@gmail.com

Visit our Discord server!

Or visit the Warrior Kings Community on Steam or the Warrior Kings Forum.

And don't forget to go to wkbre's GitHub repository for the lastest version of wkbre and the source code!

Enjoy! :)