Overview
This little guide will help you build unique levels in besiege, from multiplayer deathmatch arenas to complex puzzles.Program winning conditions, deadly traps or anything else your imagination can concieve.
Introduction
This guide is not oriented to build pretty levels, that you can learn by yourself with some experimentation. Here we will learn the basics of besiege logic programation, from making winning conditions to building deathmatch arenas with deadly traps and ammo reloading stations.
I wont saturate this guide with images (I will add only a few), I will do something better and add one level showing everything that has been explained here at the end of this guide.
Level settings
In this little section you will be able to add rules to the whole arena, like limiting the amount of blocks avaible to build your machine. You also can block the options like deactivating the building zone (this is essential in my opinion for server performance) or many of the God´s tools options, like infinite ammo or low gravity.
Also there are a few options concerning multiplayer, for example “Vote” is essential in every match, as all the players wont be able to start or end the match until everyone votes that way (also you will stop certain @$$holes players from rebooting the match everytime they want to change their machine or are losing).
You can also ban machine copy and use a curtain mode, so other people wont be able to see what you have built until the match starts. And if you want to make a really specific challenge, you can even determine the machine/s the players are allowed to use by preloading them on the map. The players are able to change the preloaded machine they selected by clicking the open dir to load a (preloaded) machine like if they were in the Sandbox.
For all of this configuration options to take effect, you need to load the level outside of the editor. You need to go to the multiverse main screen and host a game disabling the editor (the pencil icon), after that an “Add map” option will appear, there you can load as many maps as you want, wich will be played in sequense.
Trigger events and events
First of all, a simple explanatory list of each trigger and event
Once the condition is met they will start the event list under them
- On level start: triggers when you start the match.
- On enter: being the starting cube, a projectile or another object on the level (fingerprint for that specific object, Tag for all objects of that kind).
- On exit: same as above.
- On activate: when an previously deactivated object is activated.
- On deactivate: the viceversa from above.
- On death: when the human/animal is killed triggers the event list under.
- On destruction: same for objects.
- On ignite: same but with fire.
- On variable: triggers when a certain variable reaches a certain value.
NOTE: On enter and On exit on exit can work as AND and OR logic gates by clicking in the icon next to the triggering element.
- On simulation start: never figured the difference between this one and On level start.
- On stop simulation: same.
- On machine damage: triggers an event when the machine gets an X% of it destroyed, leave in small values as each block (destructible or not) counts to the global percentage.
- On key pressed: configures a key as an event trigger.
- On key released: same as above.
Events are added under the trigger event, they must be placed in order or they wont work as intended.
- Increase progress: increases (or decreases) a team progress bar.
- Victory: imposes winning conditions, it can be either for the team with higher progress, a certain variable number or health.
- Activate: makes a certain object (previously deactivated) reapear.
- Deactivate: dissapears a certain object, it also stops any chain of events going on the object.
- Wait: waits X amount of seconds to pass to the next event on the list (a visual indicator in the HUD can be added by clicking in the eye icon).
- Reset: to original position and status.
- Respawn player: respawns targeted player.
- Set respawn: set a respawning zone to be the new respawning point of the trigger player or a specific player.
- Reload ammo: reloads ammo for the entire machine or for each weapon, using only the specified ammo (arrows) or any ammo in general. It can add (+) or set the amount of ammo (=) at a certain value.
- Transform: moves and/or rotates a certain object, it can be instantaneous, in a certain amount of time or add momentum to objects
- Modify variable: adds, substracts or set a variable to a certain value.
- Randomize variable: throws a random value between a certain range.
- Repeat: Repeats the whole cicle of events until reaching himself again (can be set to a certain number of times).
Objects movement
From crushers, moving bridges or simply preety rotating cubes, the Transform event will let you add movement (intentionally activated or not) to all objects on the map.
You can program an item to move from a certain (X, Y, Z) coordinate to an other and/or adding rotation to it.
Lets say you want to make a crusher that is activated when a starting block from the red team enters an insignia. You go to the logic panel from said insignia and put the On enter –> starting block (red team)”, under it you put a Transform with the movement you want the crusher to make, lets say it is at (0, 20, 0) and you want it to go ground level, then the coordinates will be (0, -20, 0). You can make it to me instantaneous or for the crusher to take some time to go down, all that can be configured in the duration options of the event. If you want it to go up again after one second, add a Wait event and another Transform with the inverted coordinates after it.
Now lets say you want an object to move to a certain coordinates of the map (like the three mini cubes), but you also want that they only trigger when more than one condition is met, in this case, one iron ore and the starting cube in the insignia. For this to happen you have to change from global coordinates to “axis coordinates” in the transform event.
Finally, the force parameter gives momentum to certain objects, the amount of it depends on the amount of time and distance in the coordinates, three fireballs have been programed to show this.
NOTE: Only one Transform event can be active for the same object at the same time.
Check EXAMPLE 1 on the level added at the end of this guide.
Victory conditions
Lets say we want to make a level where you win by moving log stacks to an insignia, first we have to configure the insignia with an On enter event trigger, but choosing the log stacks as the targeted objects (using the Tag, not the Fingerprint). Next you have to add an Increase progress (50% progress) so when the two stacks are in, you win.
But now you have gotten more ambitious, and you wish that if one of the stacks gets out of the insignia, you lose that progress. Easy, you add a new trigger event but On exit, choosing the stacks as targets, then you add an Increase progress (-50% progress).
In multiplayer matches, independently of the main objective, you can set a timer for the match to end, I usually add this kind of conditions in a hovering cube at the center of the map just for aestesics. Enter said cube and add an On level start event trigger, under it add a Wait event with the intended duration in seconds (you should make the timer visible in the UI by clicking in the eye icon). Under this event add an Victory (progress) event. This is really good if you are going to play more than one map in a sesion and dont want to get stuck forever.
Check EXAMPLE 2 on the level added at the end of this guide. This map has a timer included, check the upper left corner.
Building arenas
Now lets say you dont want to build a puzzle, you want a deathmach arena.
You have to enter the building box Settings and choose its team color. After that you have to enter the Logic panel and add a On machine damage event trigger and set the damage level for triggering (keep it low, a lot of block are indestructible so 5% or 10% is good), under it add an Increase progress by X amount but with the other team color (blue) and a Respawn player –> Self.
Also you can add a respawn key with the On key pressed event trigger with the same events as above, this will be specially usefull to gain progress when you are fighting a machine that is made mostly of indestructible blocks, criple the machine and force that player to respawn. When you are done with this building box, duplicate it but invert the colors scheme. You can add many building boxes of each team to make 2vs2, 3vs3 or 4vs4 deathmatch arenas.
Check EXAMPLE 5 and the Building Zones on the level added at the end of this guide.
Variable manipulation
The On variable (VarName = #) trigger event will let you trigger certain events when said variable reaches a certain value. There will be two events that allow you to modify a variable amount, those are Modify variable and Randomize variable, both explained a few sections above.
Lets say you want to make something happen when you meet a certain number of conditions. In EXAMPLE 3 you have three buildings, each with a On destroy trigger event, followed by a Modify variable (Village + 1) event, so when you destroy them all, the Village variable will be equal to 3. When that happens the hovering cube has an On variable (Village = 3) trigger event that will activate eight Ipsilon knights that will attack you, each with an On death event trigger and a Modify variable (Knights + 1) event.
In EXAMPLE 4 the Randomize variable is used to make randomly spawn npc, each with a preasigned number. the only flaw about Randomize variable is that it may spawn more than once the same number, and depending on how you built your level you might get a lot of trigger activations that end in nothing.
All variable values and their effects are stored in the flying cube, this way its easier to build logic circuits or chains of events without accidentally deleting something important.
Miscellaneous
Lets say you want to build a team deathmatch arena, but you dont want people abusing of infinite ammo or respawning all the time to reload their weapons, what you need is an ammo reloading pickup.
To build such a thing, grab a pickup cube, edit its appearence and go to the logic section, put an On enter trigger event followed by a Reload ammo and a Deactivate, Wait and Activate events. I personally preffer to configure the Reload ammo to reload by each weapon, specifying ammo types and only adding the max amount of ammo each weapon can carry (if you want you can make that only one pickup logo gives each of your cannons as many rounds as you want in one pickup, is up to you. right after reloading the Deactivate, Wait and Activate events will make the pickup disappear, wait X amount of seconds and then reappear once again.
Lets say you built a racing track with obstacles, you want all of them to be destructible but not only once. What you must do in each obstacle is using an On destruction trigger event, followed by a Wait and a Reset (self) events. Each time you destroy said obstacle it will start a countdown to respawn again, try to give yourself enough time to get out of the debris, as this event chain will clean them too.
Same aplies to bombs and explosive barrels with On explode.
Now you want to add boosters to your racing track, edit a booster insignia to activate some wind, also edit the wind strenght and make it remain active for a few seconds and then deactivate once again (you already know how to edit this).
After more careful investigation, i found out that the new adition to the editor is a bit tricky, so you cant make a checkpoint and a randomized respawn point the same way. Checkpoints are fairly easy, just add a trigger and a respawn point activating it, just like the image shows. In racing tracks, just add a few set of this, always with trigger result for the target machine.
For randomized respawn points for deathmatch arenas things go tricky. there are several ways to do this, you could add a On level start followed by randomize variable, wait, repeat, and to each value of said variable pick a random respawn point for one player, or just as i did, add the randomize variable to the event list of each Buildbox.
Combinig transform with force, randomize variable, a few triggers and a little love you can build a mortar, two different methods have been added in the level below, here i leave the screenshot of one of them.
Epilogue
As you have seen, this guide covers the basics for level building.
With this information you are now able to create complex puzzles or exciting challenge arenas, you can experiment with teams distributions, variable edition, winning conditions to create Deathmatch Capture the Flag, King of the Hill or Domination maps.
As promised, in this level you will be able to test and explore everything that has been explained until now. For a better experience, you can also load it the way explained at the begining of this guide, so you will be able to see how a finished level looks.
[link]
To learn about your machine´s logic basics, chech here
[link]