A Script is a document that contains programming instructions in a certain language, which is the one understood by the tool we are using to develop any application that requires programming.
Some examples of the use of Scripts
For example, a Script may contain a list of instructions for an Arduino to perform a function. It can also contain a set of rules that define the style of a web page. A simple game could be coded in a Script.
C# language scripts used in the Unity engine
In our case we are going to use Scripts within the Unity engine, these Scripts will be written in C# language and most of the time we will make these Scripts fulfill a certain function within Unity, using the objects and components of the hierarchy and performing logical and mathematical operations necessary for the development of the mechanics of the game.
What’s inside a Script in Unity
When creating a new Script in Unity, inside it will be defined by default a PROGRAMMING CLASS with the same name that we gave to the file, this class will extend from the MonoBehaviour class defined in the Unity Engine, it will also have two methods (or functions) defined, the Start function and the Update function.
How Scripts run in Unity
In order for the code we define inside a Script to be executed, the Script must be assigned to at least one GameObject in the hierarchy (the Script has to extend from MonoBehaviour in order to be added to a GameObject) and also that GameObject has to be active in Hierarchy.
This is enough for Unity to add it to its execution cycle, when entering the game mode, Unity will execute at certain times some of the functions that are defined within the Script, for example the Start, Update and FixedUpdate functions, and it will do it automatically.
What scripts are used for in Unity
Unity is a software that is known as a graphics engine, this software facilitates many technical issues when creating graphics applications, because if we did not have it, we should manually program functions that tell the graphics cards how to render what we want to appear on screen, using libraries such as DirectX or OpenGL. Unity also provides us with a physics engine that allows us to detect collisions and represent interactions between objects as if they were rigid bodies, with the most common physical properties they have. Audio processing is also an important feature of the engines.
Unity offers us a series of very useful tools and that otherwise would require a lot of technical knowledge, but to be able to handle these tools two things are needed, one is to know the Unity engine, that is to say to become familiar with these tools and to understand what function they fulfill. And the second thing we need is to know how to program to make use of these tools, and we will do that through programming scripts.
Introduction
The word instance in computer science is used with different meanings, for example we can talk about the instance of a computer program to refer to the program that is being executed. In this article we are going to see the concept of INSTANCE in object oriented programming, i.e. the instances that are created from a certain programming CLASS.
What is an INSTANCE in programming
For example, if we have a class called “Cat” some of its properties could be “Name” and “Fur Color”, while some of its functions could be “Eat” and “Meow”.
The Cat class will allow creating Cat type objects and each one of these objects will be an INSTANCE of the Cat class, inside it will have the properties and functions defined in the class, but the information in its fields will be specific to each INSTANCE, that is to say, each object will be an independent instance with its own state, this means that we can have for example two instances of the Cat class each one with a different name and fur color.
Programming objects are abstract entities that exist in the memory of computers, the concept is very useful because it allows to increase the abstraction to solve problems.
Constructors
To create an INSTANCE of a class we use the so-called “Constructors“, functions that allow us to enter the object data and return as a result the reference of the new object.
An example of a Constructor for the Cat class in some programming languages such as Java and C# could be the following:
Then to create new objects the “new” instruction is used, as shown in the following example:
Cat aCat = new Cat(“Charles”,Color.white);
This will create an object of the Cat class with name “Charles”, white color and the object reference will be stored in the “aCat” field.
Examples of object INSTANCES in Unity
In Unity in most cases we will not need to define constructors for classes or use the “new” instruction, since there are many things that the engine takes care of. In general the Scripts that are created in Unity are MonoBehaviours so Unity is in charge of creating these objects, we simply have to tell it when or where to create them.
We are going to see the concept of Instance in programming applied to the Unity engine with the Cat class example.
Definition of the “Cat” class
We start creating a new Script by right clicking on the Assets folder, going to “Create” and choosing “C# Script”, we name it “Cat”, this Script will define the “Cat” class we talked about before.
When creating a new Script, Unity is in charge of defining a class with the same name, it will inherit from the MonoBehaviour class and will define some useful functions such as Start and Update, in figure 1.b you can see the Script as it was defined by Unity.
We will modify it as follows:
As shown in Figure 2, two fields have been defined, a string called “catName” for the Cat’s name and a Color called “furColor” for the fur color. In addition two functions have been added, Eat() which makes the Cat eat and Meow() makes the Cat meow.
Create INSTANCES of the “Cat” class
The vast majority of Scripts we create in Unity will be similar to this in the sense that they will inherit from the MonoBehaviour class. To create an INSTANCE of this type of objects just add them to some GameObject in the Unity hierarchy or create them using the Instantiate() function.
Let’s start by creating empty objects that will contain the INSTANCES of the Cat class, figure 3 shows how to create an empty GameObject.
In figure 4 we see two GameObjects, one called Cat1 and the other Cat2, both will have an instance of the same Cat class.
To create the INSTANCES of the Cat class you have to add the Script as a component of the GameObject, this can be done by selecting the GameObject to which you want to add the component and taking the Script from the Assets folder and dragging it to the inspector. Another way to add the component is by using the “Add Component” button that appears in the inspector.
In figures 5 and 6 you can see the inspector of the GameObjects Cat1 and Cat2 of figure 4, as you can see, each one has a component type “Cat”, that is to say, each one has assigned an INSTANCE of the Cat class. Notice also how their fields “catName” and “furColor” in each case have different information, since each INSTANCE represents an individual Cat.
With this we have created two instances of the Cat class, as an extra detail the instances can be assigned to the same GameObject, as shown in figure 7.
The loop is a repetitive control structure that allows us to repeat a sequence of instructions until a condition is no longer true.
In a computer program, instructions are executed instruction by instruction in a sequential manner, this is known as the program flow. The control structures allow us to alter this execution flow, enabling us to make jumps, make the flow go backwards or move to another region.
So a LOOP in programming is a control structure that makes the flow of the program go back and repeat exactly the same instructions defined in a region, it is not just an elegant and compact way to write a series of instructions, because the fact that the instructions are exactly the same does not mean that the data used inside the loop are also the same, the information can be transformed and then the following instructions will be applied on those new data, giving rise to a huge amount of possibilities.
What is an INFINITE LOOP in programming?
An infinite loop is a situation in which the program flow is confined to a region from which it cannot escape, endlessly repeating the same instructions over and over again, without reaching a condition that allows it to exit the loop.
When an infinite loop occurs, applications can freeze, become unresponsive and have to be forced to close. This usually occurs because the code that allows processing user interactions, such as screen clicks or keyboard inputs, is not executing because the program flow is trapped in the loop. In applications such as games where all the logic is processed between each picture produced by the game, if an infinite loop occurs, the program flow does not finish processing the logic and the game cannot produce the next picture.
Safety measures can be applied to prevent these loops from occurring, e.g. counters that increment in each iteration and if they exceed a certain value, force the loop’s escape condition.
REPETITIVE control structures and syntaxis
Below we will look at the most common repetitive control structures found in all programming languages.
For Loop
A FOR loop allows us to repeat instructions a fixed number of times that we indicate with a series of conditions on an iterator variable. We set the iterator variable, the initial value, the condition that the iterator variable must meet to execute the loop, and a form of increment for the iterator variable.
Some applications can be to traverse a collection of objects applying actions to each of them and making use of the iterator variable in different ways, we can perform operations such as summation, finding values within a collection, sorting elements and more.
A FOR loop does not usually produce infinite loops, unless its conditions are incorrectly set or the iterator variable is modified within the loop in a way that produces such a situation, it is not good practice to modify the iterator variable within a for loop.
Syntax of a FOR LOOP
Let n be an integer value such as the size of a collection, the FOR loop syntax in C# is as follows:
for(int i=0; i<n ; i++){ //Instructions to be performed inside the loop //The variable i is incremented at each iteration. }
WHILE Loop
A WHILE loop allows us to repeat instructions until a certain condition is no longer true, it is very useful when we do not know how many times we will have to repeat a task until we get what we need.
A possible application can be the selection of random numbers or objects without repetition, in that case there is always the probability of choosing a value that had been chosen before, so it may be necessary to repeat the operation until a new value is found.
In a WHILE loop it is more common to have infinite loops since the loop output condition depends on what we need in each particular case.
Syntax of a WHILE LOOP
Given a variable name “condition”, which is a Boolean value, for example a Boolean variable, the result of a logical operation or the result of the execution of a programming method which returns a boolean value, the syntax of a WHILE loop in C# is as follows
while(condition){ //Instructions to be performed inside the loop //”condition must change to false to exit the loop. }
FOREACH Loop
A FOREACH loop is used to go through each one of the elements of a collection, for example an array or a list, the idea is that inside the loop we have the reference of each one of the objects but without the need of an iteration variable.
As an application example it can be any task that requires to traverse a collection of elements, for example given a collection of enemy objects, apply to each of them a certain damage by magic. Another example can be to apply a certain initial configuration to a set of elements.
A FOREACH loop does not usually produce infinite loops, unless there is some way to increase the number of elements of the collection being traversed within the same loop, that would cause us to add a new element to traverse on each iteration and we would never finish.
Syntax of a FOREACH LOOP
For this example we are going to consider any programming class that we will call “DataType”, we are going to use the word “obj” to refer to each element within the collection to be traversed and finally we are going to use a collection of objects that we will call “collection” and that will be of the same type as “DataType”. The syntax of a FOREACH loop in C# is the following:
foreach( DataType obj in collection){ // Instructions to be performed inside the loop //”obj” represents each element of the collection }
The following example goes through a collection of GameObjects that represent enemies in a hypothetical game and proceeds to destroy each of those objects.
foreach(GameObject g in enemies){ Destroy(g); }
Definition of BOOLEAN
A BOOLEAN is a type of primitive variable that is characterized by being able to be in only two states, “true” or “false”. The name of this variable is due to the mathematician George Boole who created Boolean algebra, which is the basis of all digital operations.
To define a boolean variable in C# language, in Unity, we use the word “bool” and then we indicate the name of the variable, for example as follows:
bool aBoolean = false;
Applications of a BOOLEAN variable
The most important application of a Boolean variable is in decision making to control the flow of a program, an IF STATEMENT is a control structure that allows us to make decisions based on a boolean condition. If the condition indicated in the IF statement is true, the program will execute a certain region of code, if the condition is false we can make it execute a different region of code.
A WHILE loop is a repetitive control structure that will execute a series of instructions that we indicate and when finished it will repeat those instructions, this process will continue as long as the indicated condition remains true, when the condition changes to false the program flow will exit the loop.
Using Boolean variables and logical operators we can represent any logical expression we need, these expressions can use multiple variables and can be generated from a truth table.
In general, anything that is enabled/disabled states in Unity is represented by a boolean variable that is sometimes readable and writable or sometimes read-only. Two examples are the enabled state of a GameObject from the hierarchy and the enabled state of a script assigned to a GameObject. You can make an object disappear from the scene, simply by changing its enable state, this video shows how to enable and disable GameObjects from the scene and this one shows how to enable and disable components assigned to GameObjects.
Unity simplifies the syntax of string data and makes it possible to treat it as if it were a primitive variable. To define a string data, use the keyword “string” followed by a name, for example as follows:
string aString;
String data are specified using double quotes, for example:
aString = “A generic text.”;
Using the reference of a string, its size can be accessed using the dot operator and the word “Length“, as follows:
aString.Length;
The execution of the above instruction results in an integer value corresponding to the number of characters contained in the string.
Applications of a STRING data type in Unity
String variables allow us to store texts, so we can use them to store names, descriptions, texts that appear in the user interface. When saving data using PlayerPrefs in Unity you must indicate strings that will be used as keys to access the saved information.
Definition
SYNTAXIS in programming is the set of rules that define the way to write code instructions. Each programming language has its own syntax, that is why it is not convenient to study programming based purely on writing code, but understanding the way of thinking, the basic concepts, knowing the control structures and how to use them; in this way we learn programming independently of the language and then, depending on the application, we study the syntax of the language we need, something that can take us a few hours or a day.
Important elements to learn the syntax of a programming language
When we learn the syntax of a language, in general we will always fall in the same elements, I will list the most common elements of any programming language and indicate its syntax in the particular case of the C# language.
Comments
Comments are very important when programming as they help other team members understand what we are doing, but they are also important for us as a memory aid or as a quick way to interpret the code.
Imagine working on a project that lasts several weeks or months and in which you are going to write dozens of programming scripts, at the time of writing those scripts you understand perfectly what is the function that it performs, which are the variables and methods; but after a couple of days all that understanding vanishes leaving darkness behind.
When we need to return to those scripts to apply changes or fix problems, that is, to make the maintenance of a software, it is a problem to understand again what function they fulfilled or what the variables were, so it is very helpful to have comments that make this work easier for us.
In C# you can write a simple comment using two slashes ( // ), everything after that will be ignored by the compiler. Longer comments require us to indicate the start and end of the comment, the start is indicated by the slash followed by an asterisk ( /* ), while the end is indicated by the asterisk followed by a slash ( */ ), this is also very useful for commenting large sections of code.
Assignment
Assignment is the action of giving a value to a variable. The assignment operator in C# is the equal sign ( = ).
Control Structures
Control structures make it possible to modify the execution flow of a program by producing jumps or repetitions in the code.
If Statement
The IF statement allows you to make a decision based on a logical condition, the syntax in C# for an IF statement is as follows:
if(booleanValue){ //Intructions to execute if the conditions is true }else{ // Intructions to execute if the condition is false }
The condition of the if statement (in this case booleanValue) can be any variable or instruction that results in a boolean value.
There are some variants of the if statement that allow you to ignore braces, but I think that could cause a lot of problems, for example bugs that are very difficult to track, something that can be avoided by simply making use of curly braces to delimit the beginning and end of each part of the if statement.
The for loop is a repetitive control structure that allows us to execute a set of instructions a fixed number of times, it is very useful for traversing collections (such as an array) and applying actions to each of the elements. In C# the syntax for a for loop is as follows:
for( initializeInstruction; repeatCondition ; incrementInstruction){ //Instructions that repeat }
A typical example of a for loop can be the following:
for(int i=0; i<n ; i++){ // Instructions that repeat }
In the loop above, the iteration variable is i which will initially start at 0, the condition for the loop to be maintained is that i is strictly less than another integer variable n (which can be the size of an array for example) and at the end of an iteration what will be done is an increment of the variable i, with the instruction “i++”. The instructions that are looped are placed inside braces.
Definition of FLOAT
The name FLOAT comes from the “floating point” numerical representation system and refers to a type of primitive variable that is characterized by being a numerical variable that admits a decimal part, it can be used to represent positive and negative real numbers within a certain range and with a certain precision that depends on the type of floating point variable chosen.
There are different types of floating point variables that we can use in programming, the best known of these variables is the FLOAT itself, in which 32 bits are used to represent the floating point value, but there are other types of floating point variables as well, only with more or less bits for their representation. In the following table you can see some of these variables.
Type of variable
Number of Bits
Precision
Smallest representable value
Largest representable value
float
32
~6 a 9 digits
±1.5 x 10−45
±3.4 x 1038
double
64
~15 a 17 digits
±5.0 × 10−324
±1.7 × 10308
decimal
128
~28 a 29 digits
±1.0 x 10-28
±7.9 x 1028
Comparative table of the different types of floating point variables in C# with number of bits and approximate range of representation
Syntax of FLOATING POINT variables in Unity
To define a floating point variable, we use the keyword of the first column followed by the name of the variable, for example as follows:
float aFloat; double aDouble; decimal aDecimal;
Cuando ingresamos valores con decimales se utiliza el punto como separador y en el caso particular de las variables tipo float, cuando se le asigna un valor hay que hacerlo se suele incluir la letra “f”, para explicitar que el valor que indicamos es de tipo float, por ejemplo:
When we enter values with decimals we use the dot as a separator and in the particular case of float type variables, when we assign a value we usually include the letter “f”, to make it explicit that the value we indicate is a float value, for example:
aFloat = 3.51f
In the previous case, as we are assigning a decimal value in a float variable, there would be no problem in not including the “f”, however in other operations such as method executions passing float values as parameters, it may be mandatory to specify that such value is a float.
Applications of a FLOATING POINT variable in Unity
The floating point variables allow us to represent data that belong to the numerical set of real numbers, so we can use it to represent numbers that have that nature, for example weight, temperature, volume, height. They are also used to build more complex data structures such as arrays and arrays of float data, programming classes such as Vector2 and Vector3 or we can also define our own programming classes and use floats in their internal structure.
Introduction
This entry is dedicated to a legendary real-time strategy game, Commandos Behind the Enemy Lines. In this game we take control of a small troop of elite soldiers to carry out dangerous infiltration missions.
Passwords for all missions – commandos behind enemy lines
With the following keys you can play any mission of Commandos Behind the Enemy Lines.
Mission 2 NS2B7
Mission 3 BFQBF
Mission 4 YGF1J
Mission 5 FS5TL
Mission 6 BAR4M
Mission 7 Y3YWX
Mission 8 B3WJ0
Mission 9 HIAXT
Mission 10 G4CM3
Mission 11 GD0DW
Mission 12 5MB4M
Mission 13 65UWX
Mission 14 CT34V
Mission 15 YN9PD
Mission 16 BY4MD
Mission 17 YI4PW
Mission 18 8P0J8
Mission 19 8WGJ0
Mission 20 IFU48
The mission that I found most difficult
Keep in mind that when I played Commandos I was a kid of about 10 years old, at that age I did not have great strategist skills, mission 15 called “End of the Butcher” was to infiltrate a headquarters without sounding the alarm and it was impossible to solve it at that time, several years later when I returned to play Commandos I could solve it.
Commandos 1 – Complete gameplay without commentary
INTRO CINEMATICS
The opening cinematic introduces us to the historical context in which Commandos Behind Enemy Lines takes place, mid-World War II.
Mission 1 – Baptism of Fire
Mission 1 of Commandos Behind Enemy Lines takes place in Norway in February 1941, we are introduced to the first three soldiers, the green beret, the driver and the marine, they have landed in separate locations. The objective of the mission is to destroy a radio station located on another island, for this it is necessary to capture a boat with the marine to transport the green beret to the island where the radio station is located.
MISSION 1 – BRIEFING
MISSION 1 – GAMEPLAY
Mission 2 – A Quiet Blowup
In mission 2 of Commandos Behind Enemy Lines we have the green beret, the driver and the marine, from the previous mission but two new characters are also introduced, the sapper who handles explosives and the sniper. The objective is to destroy some fuel depots, but first you have to transport to the other side of the island where the mission begins, you must be cautious as a patrol boat watches the activity in the river and on the coast.
Mission 2 Password
NS2B7
MISSION’S 2 BRIEFING 👉
MISSION’S 2 GAMEPLAY 👉
Mission 3 – Reverse Engineering
Mission 3 consists of infiltrating a switching station, stealing explosives and blowing up a dam to cut off the electricity supply. For this mission we have the green beret, the sapper, the marine and a new character is introduced, the spy, with the ability to disguise himself as a high rank enemy soldier and distract them, as well as finish them off silently.
Mission 3 Password
BFQBF
MISSION’S 3 BRIEFING 👉
MISSION’S 3 GAMEPLAY 👉
Mission 4 – Restore Pride
The mission 4 of Commandos Behind Enemy Lines consists of blowing up a mansion, in this case the scenario is quite large, it is divided into two parts connected by a bridge where a train circulates. In this mission we have the green beret, the marine, the sniper, the driver and the sapper. In a certain part of the stage there are supplies that can be picked up by the corresponding soldier. A particularity that has this mission is that in the first part of the scenario there is a war tank that can be driven by the driver, the tank is virtually indestructible and is equipped with machine guns, so when you get it the mission is significantly simplified, although the tank can only be used in the first part of the scenario.
Mission 4 Password
YGF1J
MISSION’S 4 BRIEFING 👉
MISSION’S 4 GAMEPLAY 👉
Mission 5 – Blind Justice
In mission 5 of Commandos Behind Enemy Lines we only have two soldiers, the green beret and the spy, the scenario is completely covered with snow and is also divided into two parts, a lower part and a part on the mountain that are connected through a cable car. The objective is to blow up an antenna located at the top of the mountain and escape by flying a plane. A particularity that is introduced in this mission is that in a certain part of the stage is mined so you have to take into account the routes that the enemies take.
Mission 5 Password
FS5TL
MISSION’S 5 BRIEFING 👉
MISSION’S 5 GAMEPLAY 👉
Mission 6 – Menace of the Leopold
Mission 6 consists of destroying a huge artillery cannon, for this mission we have the green beret, the sniper and the sapper. In this mission a war tank commanded by the enemy is introduced, which represents a great threat.
Mission 6 Password
BAR4M
MISSION’S 6 BRIEFING 👉
MISSION’S 6 GAMEPLAY 👉
Mission 7 – Chase of the Wolves
This mission consists of getting explosives and destroying two war submarines, we have five characters that appear divided into two parts of the stage, on one side we have the sapper, the driver and the spy and on the other the green beret along with the marine.
Mission 7 Password
Y3YWX
MISSION’S 7 BRIEFING 👉
MISSION’S 7 GAMEPLAY 👉
Mission 8 – Pyrotechnics
In this mission a new cinematic is introduced, the Commandos now move to Africa, we stop seeing snowy tundra scenarios to move to more desert areas, the clothing of the Commandos also changes.
Mission eight consists of destroying a series of fuel depots, we have the green beret and the sniper.
MISSION’S 8 CINEMATICS 👉
Mission 8 Password
B3WJ0
MISSION’S 8 BRIEFING 👉
MISSION’S 8 GAMEPLAY 👉
Mission 9 – A Courtesy Call
Mission 9 of Commandos Behind Enemy Lines consists of destroying a couple of buildings, in relation to the previous levels, this mission does not present much difficulty. We have the green beret, the sniper, the sapper, the driver and the spy, the latter already has his disguise so we can quickly position him among the enemies.
Mission 9 Password
HIAXT
MISSION’S 9 BRIEFING 👉
MISSION’S 9 GAMEPLAY 👉
Mission 10 – Operation Icarus
Mission 10 of Commandos Behind Enemy Lines is the first rescue mission, we have the green beret, the sniper, the sapper, the driver and a new character, the airman who is captured by the enemy, this character is secondary, he has no special skills and we do not see him again later. In addition to freeing the airman from his prison we must destroy some planes and steal a cargo plane for the escape.
Mission 10 Password
G4CM3
MISSION’S 10 BRIEFING 👉
MISSION’S 10 GAMEPLAY 👉
Mission 11 – In the Soup
Mission 11 of Commandos Behind Enemy Lines consists of destroying four oil drilling rigs, in this mission we have the green beret, the sniper, the sapper, the driver and the spy, who already has his uniform.
Mission 11 Password
GD0DW
MISSION’S 11 BRIEFING 👉
MISSION’S 11 GAMEPLAY 👉
Mission 12 – Up on the Roof
This mission takes place in a city, the enemy has detected the Commandos and the alarm has been raised, so the soldiers had to disperse and hide among the buildings. For this mission we have the green beret, the sniper, the spy, who is already disguised and there is a new secondary character to be rescued from prison.
Mission 12 Password
5MB4M
MISSION’S 12 BRIEFING 👉
MISSION’S 12 GAMEPLAY 👉
Mission 13 – David and Goliath
In mission 13 of Commandos Behind Enemy Lines we are presented with a new cinematic.
The mission consists of stealing a small submarine equipped with torpedoes and destroying a large battleship. For this mission we have the help of the green beret, the sniper, the marine, the sapper and the driver.
MISSION’S 13 CINEMATICS 👉
Mission 13 Password
65UWX
MISSION’S 13 BRIEFING 👉
MISSION’S 13 GAMEPLAY 👉
Mission 14 – D-Day Kick Off
Mission 14 of Commandos Behind Enemy Lines is about the mythical Normandy landing, the Commandos must infiltrate the facilities of the coast and blow up certain strategic bunkers to facilitate the arrival of the troops of the allied army. For this mission we have the green beret, the sniper, the marine, the sapper and the driver.
Mission 14 Password
CT34V
MISSION’S 14 BRIEFING 👉
MISSION’S 14 GAMEPLAY 👉
Mission 15 – End of the Butcher
Mission 15 of Commandos Behind Enemy Lines takes place in the streets of a city where there is an enemy headquarters and is one of the most complex missions because all the action must be stealthy, the objective is to eliminate an enemy high officer who is in the courtyard of the headquarters, at the slightest sign of alarm the officer is evacuated and the mission results in failure. We have the sniper, the marine, the driver and the spy.
Mission 15 Password
YN9PD
MISSION’S 15 BRIEFING 👉
MISSION’S 15 GAMEPLAY 👉
Mission 16 – Stop Wildfire
A new cinematic is introduced in mission 16 of Commandos Behind Enemy Lines.
The mission is to prevent the demolition of a strategic bridge, for this we must simultaneously eliminate four explosives engineers who are responsible for detonating the charges at the slightest sign of alarm. For this mission we have the sniper, the marine and the spy.
MISSION’S 16 CINEMATICS 👉
Mission 16 Password
BY4MD
MISSION’S 16 BRIEFING 👉
MISSION’S 16 GAMEPLAY 👉
Mission 17 – Before Dawn
Mission 17 consists of rescuing a group of prisoners who will be executed at dawn. We have the green beret, the marine and the spy, the prisoner to be rescued is the same as in mission 12.
Mission 17 Password
YI4PW
MISSION’S 17 BRIEFING 👉
MISSION’S 17 GAMEPLAY 👉
Mission 18 – The Force of Circumstance
This mission consists of destroying the same bridge that was protected in mission 16. We have the green beret, the marine, the sapper and the driver.
Mission 18 Password
8P0J8
MISSION’S 18 BRIEFING 👉
MISSION’S 18 GAMEPLAY 👉
Mission 19 – Frustrate Retaliation
Mission 19 consists of infiltrating an enemy base and destroying a series of rockets that could change the course of the war. We have the green beret, the sniper, the marine and the sapper.
Mission 19 Password
8WGJ0
MISSION’S 19 BRIEFING 👉
MISSION’S 19 GAMEPLAY 👉
Mission 20 – Operation Valhalla
In the last mission of Commandos Behind Enemy Lines all Commandos are present, the mission is to infiltrate a fortress plagued by enemies, destroy rockets that are still in possession of the enemy and destroy the fortress which is the base of operations where these missiles are being produced.
Mission 20 Password
IFU48
MISSION’S 20 BRIEFING 👉
MISSION’S 20 GAMEPLAY 👉
Final cinematic of Commandos Behind Enemy Lines
FINAL CINEMATICS 👉
Introduction
In this article we talk about matrices in mathematics, how they are defined, what types of matrices there are and we are going to see some examples.
A matrix is an ordered array of numbers, consisting of a series of rows and columns, such that each element occupies a position and can be identified by its row and column number.
Given two matrices we can perform certain operations between them as long as they meet certain conditions.
One of the most useful applications of matrices is the resolution of systems of equations. For example, if we have a system of two equations with two variables, we can represent this system with a 2×2 square matrix (let’s call it A), multiplied by a column vector of variables (vector x) and that product equals the column vector of independent terms (let’s say B). This system would be represented as follows:
A.x = B
This is very reminiscent of a simple linear equation in which we have an unknown (x) that is multiplied by a coefficient (A) and this is equal to a value (B), to solve this linear equation it is enough to divide both members by the coefficient A and in this way we would find the unknown x. It is not possible to make divisions with matrices but we can use an analogous operation which is to multiply both members by the inverse matrix of A (as long as the inverse matrix of A exists), with this the unknown vector can be found.
x = A-1.B
Definition of a Matrix in Mathematics
A matrix is represented by a letter of the alphabet in uppercase (for example A, B, C…), then we can make its elements explicit, for this we will write its numbers in a table that will contain a certain number of rows and columns.
In figure 1 we see an example of a generic matrix A of m rows and n columns, we see that on the right of the equality the matrix has been made explicit by writing its elements aij.
The matrix in figure 1 refers to any matrix, it is often used for matrix definitions and properties.
Examples of matrices with values
We are going to see examples of matrices that have particular characteristics either by their size or by the way in which their elements are distributed.
Square Matrix
A square matrix is a matrix in which the number of rows matches the number of columns. In figure 2 we see an example of a matrix B with 3 rows and 3 columns.
In a square matrix we have a main diagonal that are the elements bij for which i=j, in the case of figure 2 are the elements b11, b22 and b33 whose values are 1, 0 and 2 respectively.
The main diagonal divides the matrix into two parts, an upper triangle and a lower triangle.
Diagonal Matrix
A diagonal matrix is a matrix in which all its non-zero elements are located on the main diagonal and the rest of the elements are 0. In figures 3 and 4 we see examples of diagonal matrices, in particular the matrix in figure 4 is known as the identity matrix.
Triangular Matrix
A triangular matrix is a matrix that has all its non-zero elements on one side of the main diagonal and the rest of the elements are 0. We can have upper triangular matrices and lower triangular matrices, as shown in figures 5 and 6 respectively.
Conclusion
A matrix in mathematics is an array of ordered numbers in a fixed number of rows and columns.
Square matrices are matrices in which the number of rows matches the number of columns. In a square matrix we have a main diagonal which is the element in which the row number coincides with the column number.
A diagonal matrix is a square matrix in which all its non-zero elements are on the main diagonal. Particularly the identity matrix is a diagonal matrix in which all elements have a value of 1.
Triangular matrices are those in which all the non-zero elements are on the main diagonal and above or below, hence we can classify them in upper or lower triangular matrix.
In this article we are going to see what are the differences between a class and an object in object-oriented programming (OOP). These are two concepts that can help us to solve complex problems because they allow us to increase abstraction, that is to say, to look at problems from a broader perspective.
It is important to clarify these topics are quite abstract, after all the classes and objects are still ones and zeros in memory, then to understand them is necessary to use the imagination and reason by analogy.
Summary of main differences between CLASSES and OBJECTS
1. A class is a user-defined programming structure while an object is a data type that is created from the programming class.
2. Classes are defined in the development process while objects are created at runtime, i.e. when the program is running. The creation of an object is often called “instantiation”, since what is done is to create “instances” of a class.
3. Within a class, data common to all objects is defined, then the objects are created using that information and adopt a particular state, defined by the value of their internal variables, those values may change during their lifetime. This means that we can have different objects that come from the same class but differ in their states.
What is a Class in OOP?
In essence, a class in object-oriented programming is the definition of a data type. How this definition is made will depend on what we are programming and with what tools, but in general a class is defined in a Programming Script, it has an identification name, it comes from a parent class that is higher in the inheritance hierarchy (in general the base class is Object, parent of all classes) and whithin the class all the properties and functions are defined, those members determine the behaviour of the objects that will be created from the class.
What is an OBJECT in OOP?
An object is an entity that is created based on a programming class, the creation process occurs during program execution and is known as instantiation. The object acquires a state during its creation and can be modified throughout the execution time until the program terminates or the reference to that object is lost and it is eliminated by the garbage collector.
Relationship between Classes and Objects
Objects are created from classes, classes define the structure (variables and functions) and the objects adopt a particular state, i.e its variables adopt specific values and can evolve during the object lifetime.
Conclusion
We have seen what is a class and what is an object in object-oriented programming and the main differences between class and object. Classes are like blueprints where we describe the information and behavior that objects will have, then in our code we can make use of that information and behavior through objects, which are entities that must be instantiated manually when needed. With the class we can create many copies of the same object and then each copy will have its own state and evolve in its own way.
We can think that classes are like ideas or rules conceived to describe an object, while the object is the materialization of those ideas, this of course is metaphorical since classes and objects are still ones and zeros located in computer memory.
Introduction
In this article we see how to configure the rendering parameters of the Eevee engine to render the background with transparency. In figure 1 we see a preview of a render in Blender using Eevee, it is a cube with a transparent material and in the background an HDR ambient texture. What we will do is to remove the background texture to obtain an image of the 3D model with transparent background.
In the following video I show how to remove the background from final render in Blender.
We go to the “Render Properties” tab shown in figure 2, here we can activate different effects.
We go to the “Film” section and activate the “Transparent” checkbox, this will make that the background does not appear in the final render. In figure 4 we see the preview of the rendering, the background with the texture does not appear as in figure 1, however properties such as lighting and reflections are still applied on the object.
Result of the 3D model with transparent background
When pressing F12 we obtain the final render, an image with transparent background, when saving the image make sure that the format has transparency, I suggest using the PNG format. The image in figure 5 is the render of the model in figure 4 in PNG format which I then converted to WebP format and upload it to my server.
Introduction
In this article we see how to generate a WebGL standalone version of our project that can be run on browsers, that is to say a program that can be hosted on a server, for example in Itch.IO or in our own web page.
How to create a build for browsers from a Unity 3D project
We start by going to the File > Build Settings tab, this will open the “Build Settings” window shown in Figure 1. Here we can configure some compilation parameters, such as the scenes to be added and the target platform.
Let’s click on the “Add Open Scenes” button to add the current scene to the compilation (a blank scene that comes by default). The scene placed in position 0 will be the one loaded at startup, so if we have multiple scenes we will have to reorder them accordingly.
To generate a WebGL build for browsers, it is necessary to configure Unity to produce this kind of builds. In the “Build Settings” tab is the list of target platforms, there we must select the “WebGL” platform and then click on the “Switch Platform” button. This will start the platform switching process which may take a few minutes, this process needs to be done only once, unless we need to switch between Windows or browser builds. In general it is more comfortable to test on the operating system itself and after making several advances, produce a WebGL compilation to upload it to Itch.io or to our own web page.
Once the platform change is done, the next step is to click on the “Build and Run” button, this will display a window in which we will select the destination folder to export the files of the game or application. In my case I usually create a folder called Builds in parallel to the Assets folder of the project itself, but you can choose any folder you want, make sure you remember where it is located so you can use the files later.
When we have chosen the destination folder we click on “Select Folder” to confirm.
At this point the compilation process begins, which will take more or less time depending on factors such as the complexity of the project and the power of our computer, in figure 5 we see the loading bar of this process.
When the compilation process finishes, as we compiled with the “Build and Run” option, the application opens automatically in our browser.
If we go to the folder that was chosen for the compilation we will find the game or application files (figure 8). These files can be uploaded to a website like Itch.IO or to your own server and the game can be loaded directly in the browser.
How to test WebGL builds made in Unity
In Figure 6 we see the folder containing the files that were generated during the compilation. The file “index.html” would be something like the executable of our game or application. The problem is that when we click on it to test we get the following message:
The message says that apparently our browser does not support the Unity WebGL compilation, it tells us to upload the content to a server or try another browser.
To test a WebGL build, the fastest way is to recompile with the “Build and Run” option, since by doing this, Unity automatically mounts a local server to run the files.
For the WebGL compilation to work it definitely has to be mounted on a server either locally, which can be mounted with applications like “Xampp”, or it has to be mounted on a web server, either from a third party, for example on a page like “Itch.IO” or on your own web server. I leave you a link to Hostinger, the server with which I have been working for years, a quality service and with very good prices, in addition to the facility to scale the hosting according to the growth of your web.
To upload the build to your own server you need to do it by FTP access, Hostinger has a built-in FTP access in the control panel, although I find it more convenient to use the FileZilla application to connect to the server.
Once access is established, the process is no different than copying files into your own PC, you create the folder where you want to put your compilation, upload the files and then the path to run the WebGL compilation is the URL from the root to the “index.html” file, which by the way you can name it whatever you want, for example “Play.html”.
Let’s look at the following example to understand the path as a URL within our server:
It is a WebGL compilation made in Unity, if you click on the link you can try it. Analyzing the URL we see that the root folder is in GameDevTraum.com, from there when observing the URL we see that we get in a folder called “GDT-Prototypes”, inside that folder we enter in another folder called: “go-to-hell-5”, where finally our file “index.html”.
Another alternative to know the URL of the file “index.html” is from the FTP access, we make right click on the file and probably there is an option of “Copy URL”, which in the case of FileZilla, does not give us the exact URL, but if most of it, to that we make the necessary modifications to give us the exact URL.
Unity WebGL does not finish loading in the browser
It has happened to me that when trying to open a WebGL compilation, the browser never finishes loading it, it freezes in the Unity loading screen. I have solved this problem by removing the compression in the WebGL compilation.
To do so, go to Edit > Project Settings and the window shown in Figure 8 should open.
As we can see, in the left section we go to “Player” and then in the big window on the right we go to the “Publishing Settings” section, there we change the “Compression Format” field to “Disabled” and we run the compilation again. This in my case has solved the problem that a compilation of Unity for browsers does not finish loading.
Introduction
In this article we see how to set up the Principled BSDF Shader to make transparent objects in Blender, this solution works for the EEVEE engine. To clarify some physics related issues, with “transparent” I mean that the material allows to see what is behind of the object, the effect is useful to quickly set up a basic glass material to apply for example to a window.
To show how to make transparent objects in Blender, I am going to use the objects shown in figure 1. They are three spheres of different colors and the object in front is the one we are going to make transparent. Figure 2 shows the camera view, as you can see, it is completely obstructed by the object.
Download a Blender file with the transparent shader already applied.
Create a transparent object in Blender Eevee step by step
First we go to the rendering properties and activate the option “Screen Space Reflections” and inside this option we activate the “Refraction” checkbox, as shown in figures 3 and 4.
Select the object to make transparent and go to the material configuration, if it does not have any material assigned create a new material. In “Surface” choose “Principled BSDF”, as shown in figure 5.
3. In the material properties we scroll until we reach the “Settings” part, activate the “Screen Space Refraction” option (figure 6) and write a value for the “Refraction Depth” parameter (figure 7), this value is used to calculate the path of the light inside the material.
4. In the “Principled BSDF” Shader properties we increase the value of the transmission parameter.
Results
By following these steps we make the object transparent, as shown in Figure 9.
To make the material more translucent we can decrease the value of the “Roughness” parameter.
That way the objects behind are not so distorted, in figure 11 you can see the result. You could also use a texture to give it roughness.
Page Flip #2
Page Flip #3
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are as essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.