Gracias Gracias:  0
Resultados 1 al 1 de 1

Tema: Learning the Blender Game Engine

  1. #1
    Administrador y fundador. Avatar de 3dpoder
    Fecha de ingreso
    Apr 2002
    Mensajes
    15,459

    Learning the Blender Game Engine

    Learning the Blender Game Engine
    by Mal Duffin






    Introduction
    This tutorial will show the reader how to create a simple 3D game from scratch in Blender. After completing the tutorial, the skills learned will allow readers to extend the game levels. It assumes a basic knowledge of Blender, but not of the built-in Game Engine (GE). Only aspects of Blender that are relevant to making simple games will be touched on. The tutorial should take around 2 hours to create a working 3D game from scratch.

    Level: Beginner to Intermediate

    Learning the basics of using the Blender Game Engine
    You can enter and exit Game Engine mode using the [P] and [Esc] keys.
    We will now focus on the GE related features of Blender. Lets start with the most important shortcut key in Blender, the one that starts the GE. Move your mouse cursor over the 3D scene, and press [P] to Play the Game. Congratulations, you have just played your first game within Blender!!! How easy was thatí

    As we haven't told the GE to do anything yet, nothing will occur within the scene. Press [Esc] to return to Blender.



    Setting up the default scene
    Before we start, reset the scene in Blender to get bak to the defaults. This can be done with any of the three methods below...
    Selecting the File >> New menú, and clicking on the Erase All option.
    Press [Ctrl+X], and clik on the Erase All option
    Press [Ctrl+Q] to quit Blender (versións 2.42 and prior just use [Q]. Then restart Blender manually.

    Now it's time to see how well you can use Blender, using the information you learned from the previous section. Set up the 3D view in Blender similar to the screenshot. To do this, you will need to carry out the following tasks...
    Rotate the scene using the middle mouse button (MMB).
    Change the view into perspective mode using View >> Perspective (or pressing [5] on the number keypad ).
    Add a cube and a lamp (assuming that you deleted them previously and they are not part of the default scene when Blender loads a new file).




    A very useful keypress sequence when working with the GE
    One useful keypress to remember when working with the Blender GE is the one that maximizes the current 3D window.
    Move your mouse over the 3D window, and press [Ctrl+Up] (Cursor Up) (or Ctrl Cursor Down). This will make the current window scale to the full size of the Blender área. If you press [Ctrl+Up] again, the window will be restored to its previous size and location.
    Go ahead and practice this now:
    Maximize the 3D window using [Ctrl+Up]
    Press [P] to play the current scene within the GE (nothing will happen)
    Press [ESC] to return to modelling mode
    Restore the 3D window to it's original size again using [Ctrl+ Up].

    The image sequence below shows the effects of using the Maximize/Restore keypresses within the default Blender screen setup.
    Maximising the Blender panels using [Ctrl+Up]



    Choosing the correct Shading Mode (or Draw Type) for the GE
    Enter GE mode again by moving over the 3D panel and press [P]. You will notice that the scene within the GE appears flat. Press [Esc] to return to Blender. Blender has a number of draw types for the viewport that are useful for different tasks. The panel to change the current shading mode is shown below...



    The image below shows how the basic scene looks in the GE, in the various Shading Modes
    Solid mode doesn't take into account the lights in the scene
    Shading mode takes into account the lights in the scene
    Textured mode takes into account the lights in the scene, and alos shows any textures live in the viewport. This will be as close to the actual in-game view as you can get, and should always be selected when you start a new GE project.
    The best draw type for the GE is Textured. Select this Textured draw type from the list, and press [P] again. You will notice that the lighting affects the environment within the GE now, making it look more realistic. Always remember to set this option to Textured if you play your scene in the GE and it appears flat.



    The Main Game Logic Panel
    Below the 3D window, you will see the panel that contains many different buttons for controlling different aspects of Blender.
    You can view the panel related to the GE by clicking on the purple Pacman-like icon, just like below or by pressing [F4].



    This panel is where you will control what will happen within your game.
    Blender uses a visual click-and-drag system to create basic game interactions. This allows the GE to be used by 3D artists who may not have access to a coder. Blender alos has a programming language, Python, which can be used to create more complex game interactions.
    For the purposes of this tutorial, we will focus on the visual system for creating games. When you have grasped the basics of using the Blender GE, you can then follow more advanced tutorials showing how to implement Python scripting to create more complex games.

    Visually controlling the GE - Sensors, Actuators, Controller Logic Blocks
    The GE system uses Logic Blocks as a visual way to set up interactions within the game. These logic blocks can be connected together visually to allow for complex game actions to take place.



    There are three different types of Logic Blocks - Sensors, Controllers and Actuators - each with a number of different subtypes.

    Sensors
    A Sensor will detect some form of input. This input could be anything from a keypress, a joystik button or a timer that triggers every single screen update (or frame) of the game.

    Controllers Controllers are used to link Sensors to Actuators. They allow for some more complex control over how sensor and actuators interact with each other.

    Actuators An Actuator will actually carry out an action within the game. This can include moving an object within a scene, playing an animation, or playing a sound effect.

    Setting up a basic Sensor, Controller, Actuator Logic Blok sequence.
    We will now set up a very basic system within the game panel by adding and connecting a sensor, controller and actuator together.
    GE Panel: Make sure the Game Logic panel is visible (clik on the purple pacman in the Buttons window or press [F4]), and re-select the cube within the 3D scene
    Below each of the 3 main sections, you will see the selected object's name, and an Add button. Clik this Add button once for each of the 3 sections: Sensor, Controller and Actuator. We will now connect this system together. Clik and drag from the socket (small circle) at the end of the first sensor to the socket at the start of the controller. Then clik and drag from the socket at the end of the controller to the socket at the start of the actuator.
    The image sequence on right shows the steps involved in setting up a simple Sensor, Controller, Actuator chain and connecting them together.
    Press [P] to now play the game. You will notice that, although we have added some control to the GE, nothing seems to happen again. This will be explained in the next section. Press [Esc] to return to Blender.

    Breaquíng down the events in the GE system
    We will now look into what is happening with our newly created GE system. The sensor is an Always timer. This will send out a signal every single frame keeping the linked controller continuously activated thoughout the duration of the game.
    The controller is an AND. When it has just one active sensor input (like in the current case), it will automatically call the connected Actuator.



    The Actuator controls the Motion aspects of the selected object. Because of the Always sensor connected to the controller, this actuator will be called every single frame. If we press [P] now, the Motion actuator is being called every single frame, but because all of its values are set to zero, it will not move the object within the GE. Press [Esc] again to return to Blender.

    Keeping Trak of Directions
    To keep trak of what direction X, Y and Z are in, keep an eye on the visual axis in the bottom left of the 3D view.




    Maquíng the default cube move, using no physics
    We will initially use direct manipulation to move the cube within the scene. Later on, we will set up a similar scene, but will use physics to move the cube around the environment. By using the built-in physics engine (called Bullet), more complex scene interactions such as collisions and gravity will be handled automatically. Have a look at the Motion actuator, especially the 3 numerical boxes beside the dLoc label. Each of the 3 boxes in this dLoc área can be used to specify a change to the location of the object along the X, Y or Z axis respectively.



    Change the middle dLoc numeric value (Y axis, or forward) to be 0.10. Now press [P]. You will notice that the cube continually moves along the Y axis. Press [Esc] to return to Blender. Press [P] again and you will notice that the exact same sequence of events in the GE occurs again. Press [Esc] to return to Blender again. To recap on what is happening in the GE - the timer (Sensor) sends out a signal every frame to the Cube's Controller. This then sends the signal to the Cube's Actuator, which will in turn call the Motion object, which moves the cube object 0.1 units in the Y axis. Since it is called every single frame, it looks like the cube is continually moving. If you let this game run, the cube will eventually glide off to infinity. This is about as fun as watching grass grow, so read on!

    Controlling the cube via the arrow keys
    In the example on right, the timer is responsible for moving the cube forward. We will change this now so that a keyboard press controls it. On the Always sensor, clik on the <> beside the Always label. This will bring up a list of the available sensor types (see fig below).



    Select Keyboard from the list. The Sensor will now change to show the Keyboard options. This new sensor panel will allow us to choose a key that needs to be pressed before a signal is sent to the controller, which in turn will pass it on to the actuator. Clik on the button área beside the Key label, and when it changes to say press a key, press the [Up arrow] key. Press [P] to play the game again. The cube will no longer move automatically. Press the [Up] key, and it will start to move forward. When you stop pressing the [Up] key, the cube will stop moving. Press [Up] again to move the cube again. Press [Esc] to return to Blender.



    Adding in additional keyboard controls
    We will now add in the ability to move the cube backwards, as well as rotating it, to allow you to move it around the 3D environment. To add the ability to move backwards, we will add in a new (but nearly identical) set of GE logic bricks. Clik the Add button again on the Sensor, Controller and Actuator áreas, to create 3 new logic bricks on the GE panel. Connect these as before. NOTE - You might want to use the [Ctrl+Up] key to maximise and restore the game logic panel when working in it, as it will become cluttered very quickly. With the newly added sensor, change it to keyboard type, and set it to use the [Down] arrow key. In the newly added Motion actuator, change the Y value (2nd column) of the dLoc área to be -0.1. Press [P] to play the game. If the logic blocks are set up correctly, you should now be able to move the cube forward and backward just by using the [Up] and [Down] arrow keys.



    [LEFT] To complete this "no physics" part of the tutorial, we will add in the ability to rotate the object as well, so that you will be able to "drive" your model around the 3D environment. Add in 3 new logic blocks as before, connect them, and change the sensor type to keyboard. Set the keyboard entry to use the
    arrow key. Now, in the Motion Actuator, we will set it to rotate the cube. To do this, we will rotate the object around its Z axis. In the dRot área, change the Z value (3rd column) to be -0.1.



    Press [P] to play the game. When you clik the
    key, the cube will rotate. When you press the [Up] arrow key, the cube will move forward in that direction. Press [Esc] to return to Blender, and we will add in the ability to rotate the other way. As before, add in 3 new logic blocks, connect them, and change the sensor type to keyboard. Set the keyboard entry to use the [Right] arrow key, and the Z value (3rd column) in the dRot section in the Motion actuator to be 0.1. Press [P] again to run the game. You can now "drive" the cube around the 3D environment using the arrow keys. Note that you can add this game logic to any model in Blender (no matter what shape or size it is), and it will move around just like the cube. Press [Esc] to return to Blender.

    Some GE house keeping
    We will now name some of the sensors and minimise them, to keep the game panel as uncluttered and legible as possible. This won't affect what the actual logic does, but it will help keep the game logic área more manageable. Press [Ctrl+Up] in the game panel to make it full-screen. In the first sensor panel, next to where it says Keyboard, you will see an área where the text Sensor appears. This can be changed to something more descriptive. Change this text to "up key". Next, press the arrow button beside this to minimise the Sensor panel. Repeat this for the other keys. Also, do the same in the Actuators, giving them a descriptive title (for example "move forward", "turn left", etc...). Press [Ctrl+Up] again to restore the game panel to its original size.



    As you can see, having the various blocks named make it a lot easier to figure out what is going on.

    Removing logic blocks and connections




    To remove logic blocks, press the X button at the top left corner of the logic blocks. To remove the connections between logic blocks, move the mouse over the line connecting the blocks and press the [Del] key.

    Maquíng the default cube move, using physics
    One of the most powerful features of the Blender GE is the built-in physics engine (Bullet). By using forces to move an object around the scene, the physics system will automatically handle complex interactions such as resolving collisions with other objects in the scene. For many game types, using Physics will solve more complex issues, but it does require slightly more work to set it up. We will now create a basic game from scratch using physics. The scene will consist of a sphere, which we will move around the scene using physical forces. Before we start, reset the scene in Blender to get bak to the defaults, and set up the 3D view in Blender to look like the image on right.





    • Set up Blender to look like this for the following tutorial
    • Select the File >> New menú, and clik on the Erase All option.
    • Rotate the scene using the middle mouse button MMB Change the view into perspective mode using View >> Perspective (or Keypad [5])
    • Change the 3D view to use the Textured shading mode (/Draw Type) or press [Alt+Z]
    • Open the Game (/Logic) panel


    Setting up the game scene To start creating the game scene, delete the cube by pressing [Del].


    • Add in a sphere using Add >> Mesh >> UVSphere (pressing the [spacebar] alos brings up this menu).
    • When asked, select the default 32 segments and 32 rings as the setup of the sphere.
    • Exit Edit mode straight away on the sphere by pressing [Tab], to return to Object mode.
    • Also, press [Alt+R] to clear the rotation on the object (The object must still be selected).



    Maquíng a model physical within the GE
    In the game panel, you will see an unselected Actor button. Clik on this button, and a number of other features will become available for the selected model. Select the Dynamic option - This will tell the GE that the model is a physical object. More options will then alos appear. Select the following options...

    • Rigid Body The physical object will automatically rotate correctly using the GE physics engine. If this isn't selected, the object will be able to move, but not rotate.
    • No sleeping - The physical object will never be de-activated (alos known as sleeping).




    Now, press [P] to enter the GE. You will notice that, even though we haven't added in any game engine logic blocks, the ball starts moving. This is because gravity is affecting the ball, so it falls down. This illustrates one of the features of interacting within a physical world. Press [Esc] to go bak to Blender. Press [P] again and you'll notice that the same thing happens. Press [Esc] to return to Blender.

    We need to add something for the ball to fall onto, for example a ground object.


    • Add a plane model to the scene using Add >> Mesh >> Plane.
    • Press [Tab] to exit Edit Object mode, and return to Object mode.
    • Press [Alt+R] to reset the rotation on the model.


    Use the 3D Transform Manipulator to move the plane underneath the sphere, and press [P]. You will notice that the physical sphere now falls due to gravity, but will land on the plane below it and come to a rest. We will now scale the plane up [S], so that we have plenty of room to move the ball around within. Change the 3D transform manipulator from move mode into scale mode. Grab the scaling handles and size the plane so that it is around 10 times larger in the X and Y directions. The image sequence on right illustrates the sequence of steps indicated above.



    Moving the physical object within the GE
    We will now apply physical forces to the sphere, to make it move around the 3D environment.
    IMPORTANT - Make sure the Sphere model is selected. If you have just created the ground plane model, it will still be selected, so you will have to right-clik on the sphere to re-select it.
    Add in a new sensor, controller and actuator object in the game panel, and connect them together by clicking and dragging between the dots. In the motion actuator, we will need to set the values in the Force section in order to move the physical object around the scene. In the force section, change the Y value (2nd column) to 1.



    Now press [P]. You will now see the ball falling onto the ground / plane object, and begin to roll. After the ball rolls a certain distance, you will notice that it starts to roll bak on itself. This is due to the fact that we are applying the force locally, along the balls Y axis. As the ball rotates, it's Y axis alos rotates, as seen below. Press [Esc] to return to Blender.



    In order to fix this, we will change the force movement from local to global. To do this, clik on the L at the right of the Force section to deselect it. Press [P] again, and you will see that the ball continually moves in the correct direction.



    You may not have noticed how the physics engine is working in the background. As we apply a sideways force to the ball, it will start to roll. This rolling is caused by friction between the surface of the ball and the ground. Also, as the ball reaches the end of the plane, it will realistically tip off the end of the object, and continues falling. These are a few of the advantages of using physics within the GE. Press [Esc] to return to Blender.

    Controlling the sphere using the arrow keys

    We will now take control of the sphere using the arrow keys. Change the Always sensor to Keyboard, and set it to use the [Up] arrow key. Now, add and connect additional sensors, controllers and actuators, where...

    We will now apply physical forces to the sphere, to make it move around the 3D environment.
    IMPORTANT - Make sure the Sphere model is selected. If you have just created the ground plane model, it will still be selected, so you will have to right-clik on the sphere to re-select it.
    Add in a new sensor, controller and actuator object in the game panel, and connect them together by clicking and dragging between the dots. In the motion actuator, we will need to set the values in the Force section in order to move the physical object around the scene. In the force section, change the Y value (2nd column) to 1. Now press [P]. You will now see the ball falling onto the ground / plane object, and begin to roll. After the ball rolls a certain distance, you will notice that it starts to roll bak on itself. This is due to the fact that we are applying the force locally, along the balls Y axis. As the ball rotates, it's Y axis alos rotates, as seen below. Press [Esc] to return to Blender. In order to fix this, we will change the force movement from local to global. To do this, clik on the L at the right of the Force section to deselect it. Press [P] again, and you will see that the ball continually moves in the correct direction. You may not have noticed how the physics engine is working in the background. As we apply a sideways force to the ball, it will start to roll. This rolling is caused by friction between the surface of the ball and the ground. Also, as the ball reaches the end of the plane, it will realistically tip off the end of the object, and continues falling. These are a few of the advantages of using physics within the GE. Press [Esc] to return to Blender.

    Controlling the sphere using the arrow keys
    We will now take control of the sphere using the arrow keys. Change the Always sensor to Keyboard, and set it to use the [Up] arrow key. Now, add and connect additional sensors, controllers and actuators, where...

    • The [Down] keyboard sensor controls the motion actuator with a -1 in the Y (2nd) location of the Force section (with L for Local de-selected.)
    • The
      keyboard sensor controls the motion actuator with a -1 in the X (1st) location of the Force section (with L for Local de-selected.)
    • The [Right] keyboard sensor controls the motion actuator with a 1 in the X (1st) location of the Force section (with L for Local de-selected.)






    When you press [P] again, you will be able to control the ball and move it around the ground plane. Press [Esc] to return to Blender. To make the game panel screen more legible, give the various sensors and actuators suitable labels, such as "up key" for the first sensor, and "push up" to the first actuator. Also, try changing the values in all of the motion actuators from 1 to 2, and from -1 to -2. Press [P] now, and you will see the difference in the speed of the ball when using the arrow keys.

    Adding some obstacles into the level
    Add a cube to the environment, using Add >> Mesh >> Cube. Press [Tab] to exit Edit mode and return to Object model. Press [Alt+R] to clear the rotation on the object, and drag the arrows of the 3D transform manipulator to place the box somewhere on the surface of the plane object. Repeat this step to add a few more objects to the surface of the plane, including cylinder and monkey objects.



    Now, press [P]. You will see that the ball will automatically collide and bounce off the objects that you just added. Again, this is one of the advantages of using physics within the GE. Press [Esc] to return to Blender. You might want to try adding in planes and scaling them to make ramps and jumps. If you have experience with editing models in Blender, you can spend some time now creating a more complex level layout. If you don't have experience modelling in Blender, hopefully this tutorial will have given you an interest in Blender and learning more, including how to edit models. You can see some links to tutorials on editing at the end of this tutorial.

    Maquíng some of the objects physical
    Select the cube that you have added into the new scene. In the Game Panel, select the following options, the same ones that were set for the main sphere (except that No Sleeping is not selected this time, to allow the objects to settle and rest / sleep - when an object is sleeping, it takes less time to compute within the physics system)

    • Actor
    • Dynamic
    • Rigid Body

    Now, press [P] to play the game, and move the main sphere into the cube. You will see that the cube now gets knocked out of the way. However, the box moves in a very odd way - it actually moves as if it was a sphere.

    Currently the physics system will assume that a newly added rigid body will have a spherical collision shape. Press [Esc] to return to Blender.



    You will notice that there is a Bounds button below the Actor área. Clik this button, and an additional dropdown will appear, with the default setting of Box. In the case of the cube, a Box collision type will work fine. However if you have a more complex shape, you will want to select the Convex Hull Polytope option. Select some of the other objects you have added to the scene, and carry out the same steps as above, selecting Convex Hull Polytope as the bounds type of the object. Press [P] again to play the current level, and roll into the various physical objects to move them out of the way. Press [Esc] to return to Blender.

    Renaming objects
    When you add a new object, Blender will assign it a default name (e.g. Cube, or Cube.001 if Cube already exists). It is good practice to rename your objects using more relevant terms, such as player, crate, pickup, etc... This will make your scene easier to understand when it gets more complex, as well as keeping it understandable for other people viewing it. To rename an object, you can select the Object panel, and change the name within the OB: área.



    You can alos rename the object within the Editing panel.



    Completion of the basic GE tutorial
    Congratulations on completing the basic Blender Game Engine tutorial! You should now have a general overview of the basics of using the GE. You will have practical experience of...

    • Connecting sensors, controllers and actuators in the game panel
    • Using the motion actuator to move objects directly
    • Using the motion actuator to move objects using physical forces
    • Taquíng keyboard control of game objects
    • Creating a simple 3D game scene
    • Maquíng new objects physical within the GE
    • Make sure the new object is selected (and not the main sphere).




    • Open the Game Logic panel, add a sensor, controller and actuator and connect them together.
    • Change the type of Actuator to Scene. The default setting of the Scene actuator is Restart.
    • Now, press [P] to play the game. It will look like nothing is happening. That's because the Always sensor is continually triggering the Restart Scene sensor.
    • Press [Esc] to exit the game.
    • Change the sensor type to Keyboard, and set it up to use the [R] key.
    • Press [P] again to play the game, and you will be able to move the sphere around.




    • Pressing [R] will restart the game, and allow you to continue.
    • Press [Esc] to exit the game.
    • Finally, change the sensor type again to Touch.




    • Press [P] again to play the game. The scene will restart now when you run into the cylinder with the sphere.
    • Press [Esc] to exit the game.


    This illustrates some basic game engine scene management. You could have the game go to a different scene (not covered in this tutorial) that might contain a game win or game lose sequence, or the scene might be an additional level of the game.

    Collecting pickups within the level

    • We will now add in an object that the player can collect when they move close to it.
    • Add a sphere to the scene, and place it at a reasonable distance from the main sphere.
    • Add and connect a Sensor, Controller and Actuator.
    • Change the Sensor type to Near
    • Change the Actuator type to Edit Object.
    • For Edit Object, change it from Add Object to End Object.
    • Also, activate both the Actor and the Ghost buttons. The Ghost object means that other objects (including the main player) will NOT be able to collide with the object.




    • Press [P] to play the game. Now when you move near the object, it will disappear (by ending itself).
    • Press [Esc] to return to Blender.

    Counting the collected objects When a pickup is collected, we will update a property value to reflect the total number of collected items so far. We will use the Message actuator to send a signal to another object in the scene, which will have a Message sensor. This sensor will trigger an actuator that will increase the value of a property.

    • Add another actuator to the pickup object, and change its type to Message.
    • Connect this Message actuator to the existing Controller.
    • Change the subject name to be something like "pickup". It's important to remember this name, as it will be required for the Message Sensor later on.






    • When the near sensor is activated, both of these actuators will be triggered and the message will be sent to all of the objects in the scene.
    • We will use another object to store the pickup count information. For this task, an Empty object is useful - this is an object that will exist in the scene, but as it doesn't have any geometry it will not be visible in the game engine.




    • Add an Empty object to the scene (Adding an Empty object.).
    • When this object is selected, clik on the Add Property button in the Game Logic panel (See Add Property image).




    • Change the name of the newly added object to items, and change the type from Float to Int (Integer, or whole number, e.g. 0, 1, 2, 3). This is where we will store the number of items collected.




    • Finally, press the D (for "Debug") button to the right of the property. This will allow you to see the value of the property in-game. In order to see the debug properties in-game, select the Show Debug Properties menú option.




    • Press [P] to play the game now, and you will notice some text in the top left corner of the 3D screen, showing the value of the items property (currently set to 0).
    • Press [Esc] to return to Blender.
    • On the Empty object, add in a Sensor, Controller and Actuator Logic Blok sequence, and connect them together.
    • Change the Sensor type to Message, and set the subject name to "pickup" (the same name that you placed in the Message sensor on the "pickup" object).
    • Change the Actuator type to Property, and change Assign to Add.
    • Change the Prop name to "items" (the name of the property to add to), and set the value to 1.



    Now, press [P] to play the game, and collect a pickup - you will notice that, when you collect it, the value of the property increases. Press [Esc] to return to Blender. You can use the result of this property to affect your game, such as restarting or going to a new scene when a certain number of pickups are collected.

    Adding color to the levels using Materials
    Up until now, the added objects have used the default gray color. In order to change the basic look of the scene, we will now change the colors of the models in the scene by creating new materials for the them.

    • Open the Materials panel by clicking on the gray sphere on the panel ( ) or by pressing [F5], as shown below.
    • Select the main sphere model in the 3D view with a right clik RMB .




    • Clik on the Add New button. This will add a new material to the sphere model. A more complex set of panels will appear. For now, we will just change the color of the material.
    • Clik on the área beside Col, which indicates the main material color.





    • A color picker will then appear. Use it to choose a red color, and then move the mouse cursor away from the picker. The sphere will appear red in the 3D viewport.



    Repeat this process for some of the other models in the scene until they are all different colors.


    Maquíng a stand-alone versión of the game
    Blender allows you to create a stand-alone versión of your game to distribute to colleagues, without them having to install Blender. Your game will automatically run when the program is run.
    In Blender, select File >> Save Runtime.



    In the Save screen, enter a name for the game executable (for example ball_game). This will create a ball_game executable in that folder, which you can distribute to your friends.



    Overview of all of the Sensor, Controller and Actuator Logic Blocks

    Sensors

    Joystik - Triggers when either a joystik button is pressed, or when a joystik is moved along a certain direction (left/right, up/down, etc).
    Message - Triggers when a message is received. You can send messages to other objects using a Message Actuator.
    Ray - This will trigger when an object is detected along a certain axis. You can additionally chek for the detected object having a certain material or property value.
    Random - Triggers randomly - change seed for different sequence numbers (or use python for real random generator).
    Property - Triggers when a property changes, is between certain min and max values, or is equal or not equal to a certain value.
    Radar - Triggers when an object is detected within a certain range (distance, and angle). You can specify a property that the detected object must have.



    Near - Triggers when an object is detected within a certain distance. You can specify a property that the detected object must have.
    Collision - Triggers when the object is in collision with another object. You can specify a material or a property that the collided object must have.
    Toch - Triggers when an object is touching another object. You can specify a property that the touched object must have.
    Mouse - Triggers when certain mouse events occur, such as mouse button clicks, mouse movement, etc.
    Keyboard - Triggers when a certain key is pressed.
    Always - Triggers every single frame.

    Controllers: Controllers are triggered by their attached sensors.
    AND - Runs the connected actuator if ALL of the connecting sensors are triggered.
    OR - Runs the connected actuator if ANY of the connecting sensors are triggered.
    Expression - Evaluates an expression.
    Python - Runs a python script.

    Actuators: If the relevant sensors are triggered, the controller will call the connected actuator(s). Visibility - Show and hide the current object.

    Game - Restart and Quit the current level. Can alos load a new scene.
    CD - Allows for control over CD music tracks.
    Message - Send a message to all objects, or to a certain object. This message will trigger the Message Sensor.
    Random - Sets a random value into a property of the object.
    Scene - Allows for control over scenes - loading, playing, suspending, etc.



    This is very useful for showing different scenes, such as a start-up scene or menú. When the user wants to play the actual game, a keyboard sensor (e.g. press [Space] to play) could be connected to a scene sensor, which would then load up the game scene.

    This actuator alos allows you to specify what camera to look from, within a 3D scene.

    Edit Object - Allows for control over adding, editing and deleting objects within the scene at run-time. This could be used to fire bullets from a weapon. It alos has an object tracking feature.
    Property - Sets the property value of the object (or of another object).
    Sound - Allows you to control sounds from within Blender. Only sounds that have been loaded into Blender will be accessible.
    Camera - Allows the camera to trak an object. The camera can be placed behind the object ( in either the X or Y axis ) and forced to stay within a certain distance (Min and Max) and at a certain Height.
    PO - Allows control over playing object animations.
    Constraint - Constrains the object's position.
    Motion - Allows control over the motion of the object. This includes direct positioning and rotating of the object (dLoc and dRot), as well as applying forces to a physical object to move it (Force and Torque).



    Continuing your Blender Game Engine

    I hope you enjoyed learning the basic concepts of the GE. Hopefully you will continue to work with the GE, using the basic skills you have learned here, improving them with plenty of practice, and by learning from and sharing with members of the large Blender GE community.

    Additional links and tutorials
    Blender Artists Community Forum - GE Section
    This is one of the best resources for GE users.
    If you want to asque any questions about how to do something with the GE, post some examples of your current game, or just keep up to date on all things GE, this is THE main place to visit. http://blenderartists.org/forum/forumdisplay.php?f=34

    By Mal Duffin
    www.blenderart.org

    Última edición por 3dpoder; 18-06-2009 a las 01:58
    Si vas a subir un trabajo al foro, hazlo adjuntando la imagen, archivo, vídeo o lo que sea, no publicando enlaces de otros sitios. http://www.foro3d.com/f45/forma-correcta-de-insertar-imagenes-y-archivos-en-nuestro-mensaje-98930.html

    |Agradecer cuando alguien te ayuda es de ser agradecido|

Temas similares

  1. Blender Blender Game engine en Red
    Por 3dpoder en el foro Blender Art Magazine nº 14
    Respuestas: 0
    Último mensaje: 08-04-2014, 09:30
  2. Game engine Blender
    Por MAYAMAN en el foro Videojuegos
    Respuestas: 2
    Último mensaje: 14-03-2010, 20:32
  3. Blender Texturas en Blender Engine Game
    Por zenon en el foro Materiales y Texturizado
    Respuestas: 3
    Último mensaje: 21-12-2009, 11:26
  4. Blender game engine
    Por GEKKONIDAE en el foro Blender
    Respuestas: 21
    Último mensaje: 09-10-2008, 14:27
  5. :::Blender 2 31a mas Raytrace mas game engine Blender Power :::
    Por SHAZAM en el foro Infografía General
    Respuestas: 18
    Último mensaje: 14-01-2004, 13:34

Actualmente estos son sus permisos de publicación en el foro.

  • -No puedes crear nuevos temas al no estar registrado o no haber iniciado sesión en el foro.
  • -No puedes responder temas al no estar registrado o no haber iniciado sesión en el foro.
  • -No puedes subir archivos adjuntos al no estar registrado o no haber iniciado sesión en el foro.
  • -No puedes editar tus mensajes al no estar registrado o no haber iniciado sesión en el foro.
  •