Results 1 to 31 of 31
  1. #1
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Poços de Caldas, Brasil
    Posts
    112

    Default Tutorial - Your really first game

    Author: Renan Lopes (Ayalaskin).

    Your really first game


    Kismet – Trigger - Matinee - Fog - Sounds - Emitters - Teleport


    All the basics of course.

    Am a Brazilian, so I ask sorry about my English in advance.

    Note: Because the 9 images per post, I'll have to divide the tutorial in 3 parts.

    A few days ago i was complaining about the lack of good documentation and tutorials about some aspects of the UDK, not the artistic creating content and level design, but in the functionality and gameplay aspect of the engine.

    So i’ve decided to make a few tutorials about what i’ve learned these days.
    I’am a programmer so my efforts are to make things to Work, not to Appeal.

    We will make a simple level with a locked door between two basic rooms.
    In the first room we will pick the key for the door, and we will make a simple matinee scene so the doors moves unblocking the way when the player touches it while having the key, and in the second room, you will be able to active a bomb and do some blowing effects, and to finish covering the basics aspects of the engine, we will make a teleport that ports the player from the room 2 to the room 1, and them i will show how to switch your levels, so you can divide your game in different kinds of scenarios.

    If you don’t know how to make the 2 rooms basic rooms with a passage between the rooms, refer to the Appendix A before this tutorial.

    We don’t have to setup any folder structure or .ini files.

    Lets start placing the door, open the Content Browser, in the Building Meshes chooses the door that is in there then close the Content Browser.



    Right click in the floor in select’Add Actor > Add InterpActor: Static Mesh ...‘



    The mesh MUST be placed with the InterpActor type, or we cant animate it later, if this option don’t shows for you, its because the mesh isn’t loaded, so first select ‘Add Actor > Load Static Mesh ...’.
    Place it someway that it blocks the player path.



    Now select that door and press F4, so a property window will pop.
    Expand ‘Collision’ and mark ‘Block Ridig Body’, and in the Collision Type choose ‘COLLIDE_BlockAll’, now the character can’t pass through this mesh while in play.



    We will hide the door key in one statue, so lets place it in the scene, open the Content Browser and in the Mesh Buildings choose the statue.

    Right click in the first room floor and selec ‘Add Actor > Add Static Mesh: Static Mesh...’, and put this mesh where you like, i will place it in a corner of the room.
    Now lets give a hint to the player that the key remains within the statue, we will add a glow effect, open the ‘Content Browser’ and in the’ Useful Particle Effects’ select one that you like and close the browser.
    Right click in the statue and choose ‘Add Actor > Add Emitter: ...’



    The player have to pick the key, so lets create a trigger, right click in the statue and choose ‘Add Actor > Add Trigger’.



    The trigger must be near the floor, or the player will have to jump to active it, make sure that the trigger is selected before going ahead.
    Its time to play with the Kismet Editor, open it by clicking in the green K.



    First of all, we will create a variable that will tell us if the player have the key for the door, so right click in the gray area and choose, ‘New Variable > Bool’, select the circle that represents the variable in the kismet, and in its properties give it a name like ‘PlayerKey’.



    Right click in the gray area again and choose ‘New Event Using Trigger_0 > Used’.
    We will make this event give the key to the player, right click in the grey area and choose ‘New Action > Set Variable > Bool’.
    Drag a wire from the slot ‘Used’ in the event trigger, and lik it to the ‘In’ slot of the set variable object. Link the ‘Target’ slot from the set variable with the PlayerKey variable.
    Right click the ‘Value’ red square slot in the set variable and choose ‘Create New Bool Variable’, select this new variable and set the property ‘b Value’ to 1.
    You should get something like this:

    Last edited by Ayalaskin; 12-13-2009 at 10:09 AM.
    My new Blog with all my UDK tutorials
    http://ayalaskin.wordpress.com/

    (most of them about UnrealScript and programming)

  2. #2
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Poços de Caldas, Brasil
    Posts
    112

    Default

    And we also will disable the glow effect, indicating that the player have collected the Key.
    Right click and choose ‘New Action > Toggle > Toggle’. Link the ‘Out’ slot of the set bool to the ‘Turn Off’ of the toggle component.

    Now close the Kismet Editor and in select the Emitter in the Level Editor, then open again the Kismet Editor, right click the gray area and choose ‘New Object Var Using Emitter_0’, then drag the ‘Target’ slot of the toggle component to this new variable.

    It's a good practice to tell the player whats is happening in the environment.

    Right click in the gray area and choose ’ New Action > Misc > Log’ select it and mark the option ‘Output Object Comment to Screen’ and in the property ‘Obj Comment’ enter with the text ‘You got the door key !’, in the Taget Duration put the number 4. It is good to unselect the ‘Output to Screen’, because it will display some debug information, in this case it will just replicate your message.
    Link the ‘Used’ slot of the trigger in the ‘In’ slot of the log.

    Right click in the gray area and choose ‘New Variable > Player > Player’, then link the ‘Target’ slot of the target to the player variable.



    So whats happening at all? When the player press the key ‘E’ near the statue, the trigger triggers and set the variable PlayerKey to ‘true’ value and turns off the emitter effect in the scene, also tells a message to the player, telling him that the key is in his posses.

    Tip: The trigger placement is very trick, if the holy thing is not working, move the trigger along the level, and find a good place for it, you also can higher the trigger area of effect, select it and press ‘C’, the pink lines that appears is it collision area, press F4, and go to’ Collision > Collision Component > CyllinderComponent’ and higher the radius number;

    Time to make the door open.
    Place a trigger at the door, and make sure that the trigger area can be touched in the two sides of the door.
    With the trigger selected, open the Kismet Editor and right click ‘New Event Using Trigger_1 > Touch’, select this trigger and in its property set the ‘Max Trigger Count’ to 0, so the trigger can trigger infinite number of times.

    Right click the gray area and choose ‘New Matinee’, link the Touched slot of the trigger in the ‘Play’ slot of the matinee component, also link the ‘Untouched’ in the ‘Reverse’.
    Close the Kismet Editor, select the door in the Level Editor and reopen the Kismet Editor, then double click the matinee component you created in the last step, this will pop the Matinee Editor, if it dont show for you, just minimize the Kismet editor and you should see the Matinee Editor somewhere minimized.
    Right click in the grayest area an choose ‘Add New Empty Group’:



    Select the created group, it should go orange, right click it and choose ‘Add New Movement Track’, select the new track, it will go orange too.
    Now click in the 2.0 seconds (1) in the bottom of the editor, and then click in the Add key frame (2) (marked in purple).



    The door must be selected or this step will not work.

    Minimize the Matinee Editor, and in the Level Editor, move the door to the right side a little, so the gap between the rooms is unblocked, then close the Matinee Editor.



    With the kismet sequence in the picture above, the door will open every time the player touches the trigger, but we must add a condition, so the door opens only when that player has the key.

    Right click a gray area and choose ‘Add New Condition > Comparison > Compare Bool’
    Break the link with the ‘Touched’ event, by right clickin in its slot and choosing ‘Break All Links’, and link the ‘Touched’ to the ‘In’ slot of the compare bool component, also link the ‘True’ slot to the ‘Play’ slot of the matinee component.

    We will create an reference to the Playerkey variable we have created before, so right click in the gray area and choose ‘New Variable > Named Variable’, and in the properties of this new variable, select the field ‘Find Var Name’ and enter with ‘PlayerKey’.



    If everything is right, the door will only open if the player gots the key.
    In this part of this long tutorial, we will blow, lets place the bomb in the second room, open the Content Browser click in ‘All Assets’ then in the filter mark Particle Systems, them select a particle that appears like a bomb.



    Right click in the floor in the second room them ‘Add Actor: Add Emitter...’.
    Add too a new trigger in this location and select it, open the Kismet Editor and create a new ‘Used’ event with this trigger, and use it to toggle the our bomb off, the same way we did with our first emitter.

    We will add some sound too, right click the gray area an choose ‘New Action >Sound > Play Sound’, then close the Kismet and open the Content Browser, in click in all assets then now filter with ‘Sounds Cue’, select a cool sound for your explosion, reopen the Kismet and select the sound component you have created, in the property window click in the green arrow in the ‘Play Sound’ field.
    Create a new Player variable and link the sound target to the player.
    Lets add some smoke to the ambient, in the main menu choose ‘View > Browser Windows > Actor Classes’.
    Search for the section ‘Info > HeightFog’ and select it, close the actor browser.

    Right click in your scenario and choose ‘Add HeightFog’ Here, select the fog icon and press F4.
    Choose’ HeightFog > Component > HeightFogComponent’ and in the Density put the value: 0.007000.
    In the kismet, with the ‘Touched’ event from the last trigger, toggle the fog on, the same steps like we did with the emitters.
    The sad thing is that the fogs are on when the level begin, so lets toggle it off, right click in the Kismet and choose ‘New Event > Level StartUp’



    You can also add a bunch of emitters to make a more real effect.
    Lets put some final touches in out level, by adding the teleport feature.
    First open the Content Browser and find an emitter that is like a portal, and put it in the level and also put a trigger in the emitter, as we did before.
    In the main menu choose ‘View > Browser Windows > Actor Classes’, am fetch for the ‘NavigationPoint > Teleporter > UTTeleporterBase > Teleporter’, select it.

    Now zoom to the first room, click in the floor and select ‘Add UTTeleporter Here’
    Select the teleporter and in the kismet create a variable for it, select the trigger and create a touched event for it, and put the max trigger count to 0, also create a new player variable.
    In the kismet do ‘New Action > Actor > Teleport’, connect the stuff, and your teleport now will work.



    The last thing we will do to complete this tutorial, is add the possibility to change levels.
    This will be done by using a console command in the Kismet Editor.

    First, create a trigger at any location in the level, select it then open the Kismet Editor and create the event for it.
    Now click in the gray area and choose 'New Action > Misc > Console Command'.
    Select the Console Command component and in its properties, expand the field 'Commands' and add the following string:
    open MySecondLevel

    Replace MySecondLevel with your other level name.
    Create a new player variable 'New Variable > Player > Player'.
    Link the Target slot of the console command to the player variable, and link the desired trigger event in the 'In' slot of the console command.

    Note: The Open command will NOT WORK in the unreal editor, to test if it is working choose 'Build > Play Level > On Pc'.

    Final result:

    Last edited by Ayalaskin; 12-13-2009 at 10:20 AM.
    My new Blog with all my UDK tutorials
    http://ayalaskin.wordpress.com/

    (most of them about UnrealScript and programming)

  3. #3
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Poços de Caldas, Brasil
    Posts
    112

    Default

    Appendix - A


    Lets start making the two rooms, in the main menu bar select ‘File > New’ and mark Additive in the geometry style.
    Select the the Cube Brush tool in the left menu bar (1), then enter the following properties:
    • X = 1024
    • Y = 1024
    • Z = 512
    • Hollow? -> Marked

    Then click in the Build button (2), and in the left menu click in the CSG Add button (3).



    With the mouse, fly through the cube and enter inside it, (the mouse wheel let you zoom the camera in).
    We will add some texture to it, so left click in the floor or at any wall and them press Shift+B so you will select all the faces of the current brush.
    In the main menu bar select ‘View > Browser Window > Content Browser’.



    In the Shared Collection click Cool Materials, and then select any material in the window, close the Content Browser.



    Now right click in the floor or any wall, while all the brushes are selected and choose Apply Material.



    Zoom out the room and select the Red Brush in the scenario, and move it to the right side of the room, make sure that it is aligned with our first room, you can check it looking at the other 3 visions.



    If you having trouble align the brush, you can set how many units it moves in one option at the bottom of the screen:



    Now just click the CSG Add button and apply a different material fot this room.
    We have to add the lights, so zoom inside the first room then click at any face of the brush the select Add Actor > Add Light (Point), then move the light a little up in the room.



    Do the same in the second room.
    Now we have to make a gap beetween these two room, so click in the Cube button the enter the properties:
    • X = 32
    • Y = 64
    • Z = 128
    • Tessellated? -> Marked
    Move the Red Brush and place it in a way that its became placed between the two room, make sure he is aligned along the floor, the click in the CSG Substract (right side of the CSG Add).



    Right click in the floor in the first room then select 'Add Actor > Player Start'.
    The player start actor tell the game where the player will spawn in the level, so place it where do you want.
    If you move it to an improper location, when you build all the level one error should pop.
    Let the player start be positioned little up from the floor

    In the main menu bar choose ‘Build > Build All’.
    Your level is done, right click in the floor the select ’ Play From Here’.



    Last edited by Ayalaskin; 12-13-2009 at 10:14 AM.
    My new Blog with all my UDK tutorials
    http://ayalaskin.wordpress.com/

    (most of them about UnrealScript and programming)

  4. #4

    Default

    Very Nice Tutorial

  5. #5

    Default

    At first glance this looks quite helpful... many thanks for taking the time to post it. I'll have a more indepth look when i get back to my dev machine.

    Best Regards,
    Matt.
    FearedFutureGames website: fearedfuturegames.com
    Check out my youtube: fallingbrickwork's YouTube Channel
    Dev Route: Modo 401, Unreal UDK, Unity Pro, VS2008

  6. #6

    Default

    mean i cant use the trigger i have tried everything but when i press e close and very close the object happend nothing

  7. #7
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Poços de Caldas, Brasil
    Posts
    112

    Default

    Try to put the trigger at same level as the floor, like its sprite touching the ground, or entering a little.
    Try to move it away from the walls and meshs to test if it works right.
    Try to move along the trigger radius pressing E and jumping, until you reach its touching area, then you can feel where it is and then adjust.
    My new Blog with all my UDK tutorials
    http://ayalaskin.wordpress.com/

    (most of them about UnrealScript and programming)

  8. #8

    Default

    I just kind of skimmed it, but it looks more like a 'my first level' rather than game
    See my tutorials here: Organization is the key to success in any endeavor

    mewithoutYou: The potato called from underground, "You've got it all turned upside down!"

  9. #9
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Poços de Caldas, Brasil
    Posts
    112

    Default

    Its an entire game composed by just one level =)
    My new Blog with all my UDK tutorials
    http://ayalaskin.wordpress.com/

    (most of them about UnrealScript and programming)

  10. #10

    Default

    If it's possible, can you add to the tutorial, how to change to the second level.

  11. #11
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Poços de Caldas, Brasil
    Posts
    112

    Default

    Added the possibility to change levels in the second post, and added the playerstart position in the appendix A.
    My new Blog with all my UDK tutorials
    http://ayalaskin.wordpress.com/

    (most of them about UnrealScript and programming)

  12. #12
    Skaarj
    Join Date
    Nov 2009
    Location
    Bariloche - Patagonia
    Posts
    24

    Default

    Thanks ! (This forum lacks a Thank You button )

  13. #13

    Default

    wow cool tutorial man.

  14. #14

    Default

    Don't understand the title of that tutorial. You said it would be a one level game, but you didn't build a game. You just created a map, didn't you? Excuse me if i get something wrong, i am new to UDK too.
    powered by
    UNREAL ENGINE 3

  15. #15
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    96

    Default

    thank you so much for this tutorial. I have been through SO many tutorials on the web for unreal now and have had trouble grasping the bools concept. Your simple key tutorial was so direct and to the point I now get it instantly. It has opened up a new world of possibilities to my game.

    Please post more kismet tutorials if you get chance! Thanks so much!

  16. #16

    Default

    Very nice dude... I just 'discovered' UDK and it seems to be a very simple game development framework.
    Your tutorial helped me to understand some concepts. Thanl you.

    ps.: Sou da terra tb Eu vou montar o UDK em casa, depois a gente pode trocar umas experiências sobre o desenvolvimento.

  17. #17
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Poços de Caldas, Brasil
    Posts
    112

    Default

    Sorry about the title.
    My intention was to put all the base knowledges to make a simple game in this tutorial, so i make a single level and put all on it, because if i write the entire game the tutorial would be repetitive.

    I didint meant game, but the things you have to do to get there.

    Gobain. manda pm com seu msn que agente pode trocar informacoes =)
    Last edited by Ayalaskin; 12-18-2009 at 11:26 AM.
    My new Blog with all my UDK tutorials
    http://ayalaskin.wordpress.com/

    (most of them about UnrealScript and programming)

  18. #18
    MSgt. Shooter Person
    Join Date
    Dec 2009
    Location
    Croatia / Viganj
    Posts
    97

    Thumbs up

    I think i will start to search all your posts here in hope to find more interesting tutorials about UDK. And your English is better than my
    Enlight me please!

  19. #19
    Redeemer
    Join Date
    Nov 2009
    Location
    Help-me!
    Posts
    1,248

    Default

    Good work!

    I'm still watching all the 3d buzz video tutos, it gets very boring when you have to close/open every one of them...

    [Eu ainda não consegui entender a lógica do Kismet, tipo eu conheço várias linguagens de programação, mas não consigo ainda enteder como ele "pensa"]
    Lead Programmer
    It's the Only NEET Thing to Do

    Programming for non-fiction.
    I'm the function of my code. Conditions are my body and calls are my blood. I have input over a thousand lines. Unknown of bugs, nor known to work. Have withstand coffee to create many programs. Yet, those hands will never code anything again. So, as I pray, Unlimited Code Works.

  20. #20
    MSgt. Shooter Person
    Join Date
    Dec 2009
    Location
    Croatia / Viganj
    Posts
    97

    Default

    Quote Originally Posted by Saishy View Post
    I'm still watching all the 3d buzz video tutos, it gets very boring when you have to close/open every one of them...
    Strange... When i open first video in MPC it loads all videos in that folder. So i watch and watch till my eyes pop up
    Enlight me please!

  21. #21
    Redeemer
    Join Date
    Nov 2009
    Location
    Help-me!
    Posts
    1,248

    Default

    Quote Originally Posted by DaemonXR View Post
    Strange... When i open first video in MPC it loads all videos in that folder. So i watch and watch till my eyes pop up
    I use Windows Media Player Classic.
    Its the best video player ever.

    Also, watching them in sequence still don't gives you back those seconds at the end and begin.
    Lead Programmer
    It's the Only NEET Thing to Do

    Programming for non-fiction.
    I'm the function of my code. Conditions are my body and calls are my blood. I have input over a thousand lines. Unknown of bugs, nor known to work. Have withstand coffee to create many programs. Yet, those hands will never code anything again. So, as I pray, Unlimited Code Works.

  22. #22
    MSgt. Shooter Person
    Join Date
    Jan 2010
    Posts
    48

    Thumbs up Simple Teleporter

    Sweet Bro, Thanks for the help especially with the teleporter!
    Emperius Rex!

  23. #23

    Default

    Really nice tutorial, thanks! I do have a question though, if anybody knows the answer...

    The door is castings shadows into the second room. I don't understand how that's possible and it looks really weird. How can it cast a shadow through two separate walls? I even tried moving the door slightly away from the wall to make sure there was no overlap but it stills casts the shadow right through both walls. Here's what it looks like:


    and from inside the second room:


  24. #24

    Default

    It might be a lighting issue, or could be something to do with the properties of the walls. Are they just basic BMP brushes?

  25. #25

    Default

    Yep, they are just BSP brushes created the way he described in Appendix A of this tutorial. I am brand new to the UDK though, so I thought maybe there was some setting that might control how light interacts with a BSP surface. I poked around a bit in the properties for the walls but I didn't see anything.

    The other strange thing is that there are certain places I can stand in the room and the shadow disappears, but then if I move a little bit forward or backward, or face in a slightly different direction, the shadow shows up again. It's really bizarre.

  26. #26
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Posts
    53

    Default

    pwinant:
    Is this with lightmass? And which quality setting?

    What I would try is a test lightbuild with production quality.

  27. #27

    Default

    I was running with the default settings (Lightmass/preview). But I just tried a Production quality build and it didn't change the behavior any. :-(

    Has anybody else done this tutorial without seeing that behavior? I'm curious to know if it's just happening to me.

  28. #28

    Default

    Check out the very bottom of the original posters 2nd post: it seems this issue isn't simply yours, as you can clearly see a shadow reflecting through the wall there as well.

    Can you go in and try a different model for the InterpActor and see if that makes a difference? It could be a problem related to the model specifically, though that'd be a bit bizarre.

  29. #29

    Default

    Ah, I didn't notice that it was happening in the original posting as well. Thanks for pointing that out.

    I tried using a different InterpActor (one of the other wall sections called 'S_NEC_Walls_SM_CAWall_STRb') and it did the same thing.

    I did notice that if I added that wall as a StaticMesh instead of InterpActor, then I don't see the weird shadow behavior (obviously I can't animate the wall then, but I can start the game inside the 2nd room, and the shadow isn't being cast through the wall). So it has something to do with how InterpActors are handled by the lighting engine.

  30. #30
    MSgt. Shooter Person
    Join Date
    Nov 2009
    Location
    Poços de Caldas, Brasil
    Posts
    112

    Default

    To solve the problem with the shadows, try this
    Select the door and press F4, then expand DynamicSMActor > StaticMeshComponent and in the Lightning tab set bCastDynamicShadow to false.
    It shall prevent the door to casting shadows through the wall.
    My new Blog with all my UDK tutorials
    http://ayalaskin.wordpress.com/

    (most of them about UnrealScript and programming)

  31. #31

    Default

    Well that works, in the sense that it turns off the shadowing completely (which is probably fine in this case). It still seems like the original behavior is buggy though. You ought to be able to have a moving mesh that casts a shadow *on* the wall instead of *through* the wall.

    Anyway, I'm going through all the video tutorials now so maybe it will all become clear at some point. :-)

    Thanks to everyone for the suggestions (and thanks Ayalaskin for the cool tutorial)!


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.