View Full Version : Advanced sackbot patrol

08-14-2016, 01:19 AM
This is a advanced yet-basic Sackbot patrol customization by using microchips, batteries and sequencers instead of using animation recorders, Tag following or the buggy default patrol. This tutorial is a merge between Alic44's method of Sackbot animation and my own testing during game.

What is the idea?
The idea is to animate the Sackbot by using batteries (a-la Frankenstein), and with that, we can tell the sackbot what to do, where to go and how to do something in the way we want. In this case, the Sackbot will follow a patrol pattern of our preference and will detect the player based on the direction is walking and/or the direction he's facing at. Notice that this is the basic of the basic, but given the nature of how we're setting this, will allow us to expand his functionality!:star:

Now here's the steps. Notice that i don't have pictures since i lack for a proper tool to do screenshots (The in-game screenshot doesn't help):

1.- Spawn a Sackbot and set his brain to Inactive, his activation ratio to 0.1 and Layer detection to 0. Optionally, you can set a costume and animation style of your preference.

2.- Set a Controlinator on the Sackbot's circuit and set it as RECEIVER (You will notice this when, on the controlinator, the buttons will have an entrance on their left side). Set his radio to 0.1 and layer detection to 0.

3.- Open the Controlinator and place a Microchip on it (i strongly recommend to place it on the Left side so we can keep an organization and the cables wouldn't look extremely large). This microchip will serve as the Sackbot's patrol. Optionally, you can place a note on top of it or change his name for easy identification.

4.- Open the microchip and place the following:
-----1) 1 Tag sensor (This will serve to have a starting point relative to the level for the patrol).
-----2) 1 Sequencer.
-----3) 2 OR Gates, each of them with at least 5 ports.

5.- Set up the Tag sensor to trigger the Sequencer. Set his activation ratio to 1.0 and make it detect a Tag of your preference (Something like "Soldier 1").

6.- Select 1 OR Gate and connect it to the Left Joystick from the controlinator on the Left/Right entrance (Name it "Movement". This will serve as Sackbot's movement) and select the other OR Gate and connect it to the Six-axis on the Left/Right entrance (Name it "Head". This will serve as Sackbot's HEAD movement).

Now we have the basic set, now comes the important stuff!

7.- Open the Sequencer and place some batteries of the % you want on it. Each battery will go either to the OR Gate Movement or to the OR Gate Head, or even both! This will serve to make all things on motion. BUT consider these things:

-----1) The % value will make reference to where the Sackbot will go/see. Positive values push the Sackbot to the RIGHT, while negative values push the Sackbot to the LEFT.

Remember: Positive=Right & Negative=Left!

-----2) The % value will tell how strong the input will be. A % of 100 will be the equivalent of running at max speed or pushing a botton strong as it can be, while 60% will be a more light-weight input, which will make the sackbot to walk more slowly. Lower values like 1% will make the Sackbot movement almost unexistent.

-----3) Alic44 recommended to set the Sequencer to .1 to have more effects on a single second, but i leave that to the player's choice.

8.- Once you finished with the Sequencer , you should see it into motion when the Sackbot detects the Tag you declared. Use this to improve the animation and do proper testing.

Now, we're going to make the other half, which is important too.

9.- Go back to the Controlinator and place another Microchip. This microchip will serve to detect the player based on Sackbot's behaviour.

10.- Open it and place the following:
-----1) 2 Player sensors
-----2) 2 Direction splitters
-----3) 2 AND Gates
-----4) 3 OR Gates
-----5) 1 Sackbot Brain

11.- Select the Player Sensors and modify the angle so one sensor detect the RIGHT side of the Sackbot and the other one detects the LEFT side of the Sackbot. The range and layer detection depends of how advanced you want to get. Select one of the sensors and connect it to one of the 2 AND Gates, so the RIGHT detector will have an AND gate connected and the other one wil be connected to another AND gate. DO NOT connect both Player Sensors to a single AND Gate!

12.- The direction splitters will tell us if the value used on the Sackbot movement is positive or negative, so we can use this in conjunction to the Player sensors to detect the player based on actual movement/sight, and so, we need to use the OR Gates used on the Patrol microchip. Select 1 OR Gate from the Patrol microchip (Head or Movement) and connect it to one of the Direction Splitters used on the actual microchip we're setting. So,for example, the OR Gate used for the Head on the Patrol microchip will be connected to a Direction Splitter on the current microchip.

NOTE: Use the notes to identify which things does what. Do not get confused!

13.- Place 2 OR Gates on the microchip and connect the Direction Splitters for each direction. Example: The direction splitters outputs a positive and negative values, so, an OR Gate will be used to handle Negative values while the other OR Gate will be used to handle Positive values. Connect the negative values of both direction splitters to ONE OR Gate. Do the same for the positive ones. (I strongly recommend to put a note for the OR gates based on the values they're handling, so we cannot get confused on futher updates).

14.- Now, since we have 2 OR Gates that handle positive and negative values respectively, select 1 OR Gate and connect it to one of the AND Gates. Since we using the Negative=Left and Positive=Right distinction, we know where to connect those OR Gates. Example: The OR Gate that handle Negative values should be connected to the AND Gate that has the Player Sensor that detects the LEFT side of the Sackbot. Same goes for positive OR Gate and Player sensor that detects the RIGHT side of the Sackbot. The idea here is to trigger an action when the Sackbot actually "see" the player, either by Left or Right side.

15.- Now we should have 2 AND Gates already set, place the last OR Gate and connect the 2 AND Gates to it. So, either Left or Right will trigger the same action.

16.- Place a Brain and modify it to follow the nearest Player, now connect the last OR Gate to the brain so any input the OR Gate receives, will trigger an agressive Sackbot behaviour. Also connect the OR Gate to the Sequencers of the Patrol Microchip to reset them.

And voilá, you have a Sackbot that will follow a patrol and will seek the player if sees it! Notice that this simple tutorial will have some glitches, like reseting the patrol sequence if encounters the initial Tag, but is up to you to fit it to your needs!:p

08-14-2016, 04:48 PM
Fine tutorial, thank you so much! I will try this afterwards!
Many greetings, Jürgen^^