Battle Arena


Note: Once I get back around to working on AnachroRadiant all of the things noted herein will be supported by AnachroRadiant itself. It may not be as visually pleasing, but will work better and be easier to manage. Other than a few bugs using BED isn't too bad, but it would be nice to do all of this within one GUI.

Cylinder of death
The battle arena is where you define your battle. What nodes characters and monster(s) can move too, items they can interact with during battles, what monster(s) are in the battle, as well as where each monster is, and where each player starts during the battle.
Defining the battle arena can be cumbersome at first, but will become second sense over time. If you do not correctly define things, Anachronox could crash when you try to save your battle. This becomes very irritating when you have defined a whole battle, try to save, only to have Anachronox crash and you have to start all over again!
The size of the battle arena can be adjusted if you have need for a larger or smaller area for the battle to take place. For example: If you have a very large monster, like a boss monster( Hive queen, or the Mystech Sintenal), and need to increase the battle arena to accommodate the size of the monster. Or you may want a long range battle like the Krapton boss battle, or the Detta boss battle.

First things first, we have to have a compiled map to work with, and this map must have a 'trigger' entity, with a Key, and a Value of the battle you wish to start. See AnachroRadiant for more information on triggering battles.
For this example we will use a simple map I created for people who do not wish to learn AnachroRadiant at this time. This map only has five entities in it. The worldspawn, the info_player_start, a couple of func_fog, a func_group, and a trigger_console entity that sends a 'battlestart 0' command to the console when triggered.

  1. Download creapers_battle_arena. This includes the .map and .bsp files we will be using for this tutorial.
  2. Unpack this file into your /anoxdata/ directory. This will install the .map and .bsp files into the /anoxdata/maps/ directory, some textures into /anoxdata/textures/creaper/ directory, and some additional textures into /anoxdata/textures/e1u1/. It will also create the missing BED models that for some reason we never got with Anachronox. These are just temporary models and I will make better ones for BED usage later on. Also it will overwrite the /anoxdata/models/entity.dat file to include these new models. If you have made any changes to your entity.dat please back it up before extracting this archive.
  3. You must manually create the battle directories. I want you to get used too doing this. You must create the directories for every battle you make. Since the battle we are creating is battle number 0 for this map, you need to create the directories /anoxdata/bed/creapers_battle_arena, and /anoxdata/bed/creapers_battle_arena/creapers_battle_arena0/. Each map you create a battle for should have a battle directory of it's own name located under /anoxdata/bed/ and for each battle you create for that map it should have another directory under /anoxdata/bed/"mapname"/ with the name of the map plus the number of the battle. E.G. /anoxdata/bed/creapers_battle_arena/creapers_battle_arena9/, /anoxdata/bed/bricksc/bricksc21/.
  4. Load Anachronox
  5. Get control of the console with ALT+SHIFT+F10, then hit the '~' key.
  6. Load a map. For this example we will use the Creaper's Battle Arena map. Load it with the console command 'map creapers_battle_arena'.
  7. Start bed with the console command 'bedstart'.

After typing this command you will see two GUI boxes appear under the command console. Hit the '~" key again. One of these boxes will disappear, the alist window. This is a bug in BED, but there is a work around to get it to reappear(more on this will be explained later).

 

Where is that cylinder?
Another bug in BED is the spawn location of the battle cylinder. Sometimes the battle cylinder will appear at the camera location. This is where it 'should' appear, but at other times the cylinder will appear at some random location. As depicted in this picture, the cylinder spawned in the ground plane.

You do not need to worry about where the cylinder actually spawns. With a few commands we can easily adjust the location of the cylinder to where we want the battle to take place. (Too bad we cannot get the source code for Anachronox, or at least it's plugins. I could easily fix the bugs in BED and Noxdrop into working editors...).

 

Using the arrow keys move the camera to approximately the top center of the battle arena, again depicted in the picture to the left. This is the location we want the battle to take place.


Please note at this time that another bug in BED makes the battle editor "forget" it's key bindings. I have almost tracked down what is causing this "forgetfulness", and you should not experience it at this time, but I want to drill this into your little head instead of people asking about it all of the time.
If for some reason your button presses stop working, or respond in some way they are not expected too, you will need to rebind your key functions with the console command 'exec bed'. I had major headaches with this while trying to teach myself BED. Save yourself some time and get used to using this command often. This is just a minor inconvenience and can easily be worked around also. I guess the bugs in BED is why they never wrote any documentation. :)

 

Node Droppings
Droppings? Ick! Well, you have to do what you have to do. Nodes are how you define the different aspects of a battle. The default classname of any node you drop is info_battle_posp. 'Posp' stands for position and is a node that a player character or monster is able to move too during battle. Drop a node at this location using the keypad->0(insert) key. You will see a blue square appear at the same location the camera is currently located. If you look at the top left of your screen you will see that this node has a classname of info_battle_posp.
Right now we are still defining the main aspects of the battle. Primarily where the battle takes place, thus we need to adjust the location of the battle cylinder. The easiest and quickest way I have discovered(and the best way to fix the above noted bug) is to rename the classname of this node to info_battle_manager.
Bring down your console using the '~' key and type on the console line 'bedclass info_battle_manager'. Doing so will change this node into the info_battle_manager. If you then move your camera off of this node and turn around you will see that the battle cylinder has relocated to center upon this node and that there is a model of boots within this node(I couldn't think of a better model to be the manager of battles other than boots himself).

Now we must center the battle arena to the correct location. Using your Keypad, you can move the info_battle_manager into the correct position for your battle. You must adjust the horizontal and vertical positions. The keypad->8 and keypad->2 keys will move the info _battle_manager and the battle cylinder in the maps X axis(left, right), the keypad->6 and keypad->4 keys will move them in the maps Y axis(forward, backward), and the keypad->9 and keypad->3 keys will move them in the maps Z axis(up, and down).
Adjust the location of the battle cylinder and it's info_battle_manager into accordance to the RIGHT locations depicted below. The locations of the nodes, monsters, and players for this battle will be within the outskirts of this battle cylinder. Discussion on increasing and decreasing the size of the battle cylinder will take place in the section on Advanced BED.

WRONG
WRONG
WRONG
RIGHT
WRONG
WRONG
WRONG
RIGHT


The first four pictures show the correct Z vertical axis position(up and down) for the battle cylinder, the last four show where the cylinder should be placed in the maps horizontal X, and Y axis(left and right), (forward and backward). Note that your view may be a little different depending on where your camera is currently positioned.

 

More Droppings
*knock* *knock* Hey, Do you need help in there? Now that we have the info_battle_manager and battle cylinder in place we need to drop the movement nodes. The movement nodes depict where the players and monsters are capable of moving too, and where they all start. Be aware that in any given battle there must be at least four info_battle_posp(not really). Three of these nodes will show where each of the three player characters will start, and the fourth one will show where the monster will start. Any extra nodes are usually used for players, or monsters to move around the battle arena to give them a better position to attack, or use an interactive element within the battle scene.

For this tutorial we will be using five info_battle_posp nodes. Three for the players, one for the monster, and an extra one that the players or the monster can move too and from. Using the arrow keys move your camera around the battle cylinder and drop nodes using the KEYPAD->0(insert) key to approximately match the configuration on the right. Do not worry about getting them in the exact locations, you will learn how to adjust the positions of the nodes in the next topic.

As you drop each node you will need to remember the UID number for each of the nodes. Yours could be different than mine. In the picture to the right I have marked which node is a player, which is a monster, as well as the UID numbers for my nodes. UID numbers are used to tell each node what other nodes they are linked too. They indicate what node(s) a player or monster can move too from any other node.
Please note that by using this node configuration, only one player or the monster can move to the middle node, after that nobody will be capable of moving, unless the player or monster occupying the middle node returns to it's original node. More on this will be explained in Advanced BED .

 

Adjusting the nodes
Do I really have to touch it? Ick, lets get our hands dirty. Now that you have all five info_battle_posp nodes dropped you need to adjust their positions so they will work together. Each one needs to be aware of where any particular monster starts, where each player starts, and they must all be on the same Z axis plane.
Let's start by adjusting the 1st node we dropped, the player 1 start node(UID 5). Using the HOME or END keys to select previous or next nodes, highlight the first node you dropped from the More Droppings section. We need to set the KEY/Value for this node so Anachronox knows this is the starting position for the current parties main character.
In the top left corner of the screen you will see a menu that says Key Edit. Pressing your F6 key will freeze the 3D screen and make it so you can move your cursor easier to select this menu without changing your current 3D perspective view. Pressing the F7 key(sometimes twice!) will unfreeze the screen so you can change your perspective view. Clicking on the Key Edit menu will open the Keys/Values window so you can add, change, or delete key values for the currently selected node.
For this node we want to add one Key/Value. Click on the empty line within the KEY/Values window so you can type in a new key. For this key we need to type 'message=start1'. This will set this node as the starting position for the first character in the current party. For the 2nd node(UID 8) we dropped we do not need to put a 'message' key. This will mark the node as an open node that any player or monster can move on too. Deselect the 1st nodes Key/Value window by clicking anywhere other than where another node is, or where any of the other windows appear. Select the 3rd node by using the HOME or END keys and add the key and value of 'message=monster1'. This will designate this node as the starting position of our 1st(and for this map only) monster. For the fourth node add 'message=start2' and the fifth node 'message=start3' Key/values', to set these nodes as the starting points for the second and third player characters.

Again please note at this time that a bug in BED makes the battle editor "forget" it's key bindings. This tends to happen a lot when editing Key/Values and I want to drill this into your little head instead of people asking about it all of the time.
If for some reason your button presses stop working, or respond in some way they are not expected too, you will need to rebind your key functions with the console command 'exec bed'.

Now we need to adjust the positions of these nodes in 3D space. Reselect the 1st node using the HOME or END keys. All Nodes other than the info_battle_manager node should rest on the ground plane. Depending on the position your camera was in when you dropped these nodes, some or all of them could be above, or below the ground plane. We need to change their positions so they rest on the ground plane. That way characters will appear to walk along the ground when moving or attacking, instead of floating in the air or being stuck in the ground!
Select node UID 5 and use your Keypad->9 or Keypad->3 keys to adjust the Z axis(up and down) location. The Blue box should just barely be below the ground plane, so that the node model residing within the blue square rests on the ground plane. You can also use the Keypad->8 and Keypad->2 keys to adjust the nodes position on the X-axis(left and right), or the Keypad->4 and keypad->6 keys to adjust the nodes position on the Y-axis(forward and backward). Do this for all of the info_battle_posp nodes as shown in the picture to the left.

 

 

Linking the Nodes
Now that we have the Key/Values set for each node and also have them in their correct position in the Z-axis, we need to link the nodes together so Anachronox will know which node you can move too from any particular one. Reselect node UID 5 and while holding down SHIFT, left click on nodes UID 8, 10, and 11. This will draw a line from the UID 5 node to the UID 8, 10, and 11 nodes. You should now see either a green, flashing red, or purple line between UID nodes 5, 8, 10, and 11, depending on the nodes location relative to it's proximity to the battle cylinder edge and each other linked node as shown here.
The SHIFT key is used to link a node to the currently selected one. You can also use the CTRL key to unlink a node from the currently selected one.

A flashing red line means there is something wrong with the nodes indicated by the line. This will either be the two red lined nodes are too close together, or too far apart. To find out which one it is, look at the alist window and it will tell you which linked node has a *bad* path. Use the HOME or END keys to select the node with the bad path. Looking at the bottom left hand of your screen will give you information about the problem. In my case it says "Maximum Adjacent Z Distance Violated on nodes 5 and 8". This shows me that either UID 5 or UID 8 wasn't actually resting on the ground plane. This is easy to fix, all I have to do is select UID 8 and move it down in the Z-axis, so it matches the other nodes.
Now select node UID 10. If you get the error message "Node to Close to Cylinder Edge" then simply move the node closer to the inside of the cylinder. An error message of "Non-Adjacent Node to Close" just means that nodes UID 5, and 8 are too close to this one because those nodes are not linked to this one. We are going to link these nodes too this one so we can ignore this error.
While holding down SHIFT again, left click on nodes UID 5 and 8 to link them to this node. Again you will see the lines appear between the nodes. Hopefully yours are all green or purple. If you have a flashing red line, then you will need to look at each of the nodes with the *bad* red line path and adjust them so they no longer have an error. Do the same for node UID 11, linking nodes UID 5 and 8 to it.
We could stop linking nodes here and the battle would work just fine. This would allow the players to move around nodes 5, 8, 10, 11, but our monster would be stuck on node 9 and couldn't move anywhere. Let's link nodes 8 and 9 so the monster could also move around the nodes if it chooses too. Select node UID 8 using the HOME and END keys, then while holding down SHIFT, left click on node UID 9. This will add node UID 9 to node 8's alist, allowing movement from node 8 to node 9. Then you will have to do the same for node UID 9, adding node UID 8 to it's alist, and correcting any minimum and maximum distance violations you may receive.

 

Adding a monster
Adding a monster is the easiest thing to do in BED. All you have to do is drop a new node somewhere near node UID 9(the starting position for monster1). It does not have to be actually on node 9, just somewhere near it. When the battle starts the monster will run from where you drop this node to it's starting position node(UID 9). This node should actually be dropped where the monster is placed in the .map file, or along it's Smart Path. But for this tutorial I did not put a monster in the .map or have a Smart Path created. More on this will be discussed in the next section Advanced BED. Make sure this node is resting on the ground plane as well, unless you are making a flying monster!
Once you have your node dropped you will need to change it's classname to reflect a monster defined in GDB. Bring down your console using the '~' key and use the command 'bedclass "GDBname"'. You must use a monsters GDB name not it's name defined in entity.dat. This is the GDB name you defined for your monster in the section Enemy Creation->GDB Object. For this tutorial we will use a monster that comes with Anachronox, the Alley Goon(a short range combatant).
If you open up the text file /anoxdata/objects/monsters/alley_goon.gdb, you will see it's GDB name is #monster Alley Goon, so we need to change the class of this node using the console command 'bedclass "Alley Goon"'. You will then see the model of the Alley Goon appear at the location of this node.
Before we finish up this battle we must tell the monster what it's starting node is. We do that by adding a Key/Value to the monster. We know we want the monster to start at UID 9, and UID 9 has a Key/Value of 'message=monster1'. All we have to do is target this monster to that node by adding the Key/Value of "targetname=monster1" to the monster. Yes, it's that easy!

 

That's it your done for!
Get ready to fight. Now that we have all of the nodes defined and linked, and our monster in place, all we have to do is save our map and start the battle. Save your battle with the console command 'bedsave "creapers_battle_arena0/creapers_battle_arena0"'. Hopefully you created the directory structure noted in Cylinder of Death. If you didn't then either BED will spit out an error that it couldn't save, or it will crash and you will have to start all over again.


Let's test the battle by stopping BED with the console command 'bedstop'. Before you begin the battle you should probably take some equipment with you. Actually you must, without at least one weapon equipped you cannot attack your opponent. Initiate the cheat menu by pressing the 'u' key and give yourself some sort of weapon, other than the broken vistin pistol.
All you need to do after this is move your character off of the target area, then back onto it. This will initiate the battle and cross your fingers that everything goes according to plan.
If for some reason the battle doesn't start, then more likely you will just need to reset it with the console command 'resetbattle *'' The * resets all battles for this map so you can rebattle them. If the battle still doesn't start, try reloading the map. If the battle starts, but you get the message "Invalid Battle" then you will need to recheck the positions of all the nodes, and the Key/Values to make sure they are all what I explained herein.

If you still need some help, just message me at the link above. I may have forgot something in this documentation.