Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Creating a Basic iOS Game

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating a Basic iOS Game

    Hello folks, here is a guide similar to the "Basic UDK Game" tutorial, except it will set up a mobile game and a little workflow to the mobile viewer.

    Update: 22 December, 2010
    DarkVeil has informed me that the shortcut for launching the mobile previewer lacks "-SimMobile" which will use OpenGL ES 2.0 instead of DX for rendering. Modify the shortcut as such will provide rendering closer to that of iOS.

    Here is a video of this tutorial:

    Vimeo: (high quality)
    http://www.vimeo.com/17988043

    Youtube: (very low quality)
    Part 1: http://www.youtube.com/watch?v=usKO056s6KY
    Part 2: http://www.youtube.com/watch?v=XavMpeMvtYw

    My website: (high quality, please be courteous only use this to download and mirror it, and not to just stream/watch!)
    http://keres.satgnu.net/files/udk-basic-ios-game.mp4

    Notes:
    My microphone sucks, so my voice seems much more annoying than it really is I'm also slightly annoyed by how long it took me to make this, as I like fast paced tutorials and these are a bit slow. Please excuse this.

    Step 1, Environment Setup
    Download & install the tools you deem necessary for development. Here I am using nFringe w/ Visual Studio 2008.

    Step 2, Creating the Project:
    Open Visual Studio and create an UnrealEngine 3 Licensee Project, and type in the name for your project, as well as the Location to C:\Path\To\UDK-Year-Month\Development\Src then uncheck "Create directory for solution," and make sure the Solution is set to "Create New Solution." After this is done, exit out of Visual Studio then navigate to the folder you set up for the project location (ending in "\Src") then you will see there is a folder named after your newly created project, containing the .sln and .ucproj for it. Move all of these files up one directory, so you will have MyMobileProject.sln and MyMobileProject.ucproj in the \Development\Src\ folder. Now delete the folder titled after your project.

    Reopen your project's solution, and you should see in the Solution Explorer (CTRL+W, then hit S to show/hide) that all of the other UnrealScript files are added successfully (if done right) as folders which you can spin open in a tree view.
    If you have failed this, consult other guides for nFringe.

    Right click on your project, which should be the second item in the tree view, and hit "Add -> New Folder." Rename this folder to your project's name. Now right click on this folder, and add another one inside of it. Rename this one to "Classes" as all the other ones are, too. This folder will house your game code, just as the UTGame folder houses game code for UT.

    Step 3, Prototyping Classes
    Now we will create four .uc files in the Classes folder that you just created. Some of these classes mentioned here have no extensive functionality. They are only listed so you will know which classes I extended from. Assuming you know basic UnrealScript, create corresponding classes:

    MyGame.uc
    Code:
    class MyGame extends FrameworkGame;
    
    function Tick(float DeltaTime) // every frame, write a little messsage to screen so we know it is working
    {
    	WorldInfo.Game.Broadcast(self,"Game updated in " $ DeltaTime);
    	super.Tick(DeltaTime);
    }
    
    // Replace MyFolderName with your folder name, and the class names appropriately!
    DefaultProperties
    {
    	PlayerControllerClass=class'MyFolderName.MyPC' // name of your PlayerController
    	DefaultPawnClass=class'MyFolderName.MyPawn' // name of your pawn class
    	HUDType=class'MyFolderName.MyHUD' // your HUD
    	bRestartLevel=true // restart level when player dies
    	bDelayedStart=false // do not have a warmup
    }

    MyPC.uc
    Code:
    class MyPC extends GamePlayerController;
    
    DefaultProperties
    {
    }
    MyPawn.uc
    Code:
    class MyPawn extends GamePawn;
    
    DefaultProperties
    {
    }

    MyHUD.uc
    Code:
    class MyHUD extends MobileHUD;
    
    DefaultProperties
    {
    }
    Step 4, Configs
    Mobile games seem to have different configs than the normal UDKGame. They are located in

    \UDK-Year-Month\MobileGame\Config.

    Go to that folder, and delete MobileEngine.ini and MobileGame.ini. Then make the

    following ammendments:

    DefaultEngine.ini:
    At the top, change some values:
    Map=MG-Test.mobile
    LocalMap=MG-Test.mobile
    TransitionMap=MG-Test.mobile

    Under [UnrealEd.EditorEngine] add:
    +EditPackages=MyFolderName

    DefaultGame.ini:
    Under [Engine.GameInfo] change:
    DefaultGame=MyFolderName.MyGame
    DefaultServerGame=MyFolderName.MyGame
    DefaultGameType="MyFolderName.MyGame"

    Step 5, Compile Scripts
    Fire up UnrealFrontend.exe, located in \UDK-Year-Month\Binares. At the top, there's a big button labeled "Script." Press it and hit "Full Recompile." The log window should mention your game, and compile correctly. If it does not mention your game, then check your configs.

    Exit FrontEnd and Visual Studio.

    Step 6, Create the Map
    Launch UDK Mobile Editor via the shortcut (or make your own, "\Binares\UDKMobileLift.exe editor" is the shortcut.) The castle will probably be the default level, so create a new one under the file menu.

    Visit Hourences website, and paste in the basic map located at the following URL:
    http://www.hourences.com/snippets-1/#basicroom

    Save the map by going "File -> Save All" and save it as "MG-Test" (the "MG" prefix is important as of newer versions of UDK.) Compile the BSP and lighting, resave, then exit the editor.

    Step 7, Mobile Previewer
    Navigate back to \UDK-Year-Month\Binaries and make a shortcut for UDKMobileLift.exe. Right click on the newly created shortcut, and click "Properties." Change the Target to the following value:

    C:\Path\To\UDK-Month-Year\Binaries\UDKMobileLift.exe MG-Test -LOG=MyLog.txt

    Then hit Apply, and close the Properties dialog. This will now serve as a shortcut for quickly launching the game, instead of using the editor to launch the mobile previewer.

    Step 8, Enjoy Cake
    Fire up your modified shortcut to UDKMobileLift.exe and navigate around the map with WASD/Arrow keys. The HUD was replaced from the one in the Citadel demo, but no worries. You can always go back and change it

    Merry Christmas to all! Here is a zip of a similar project I set up before writing this. Remember to change the MobileViewer shortcut to the appropriate UDKMobileLift.exe path!
    http://keres.satgnu.net/files/UDK-2010-12-Tutorial.zip

    -Tom

  • #2
    Here's a zip containing a project I set up and tested out. The naming scheme on the files is different, but it is otherwise exactly the same.

    Remember to modify the MobileViewer shortcut to your UDKMobileLift.exe path.

    http://keres.satgnu.net/files/MobilTutorial.zip

    Comment


    • #3
      Thanks, really helpful

      Comment


      • #4
        yeah that's great. Can you post something like that but with using WOTgreal?

        nFringe cost is a lot for people who want to create commercial games on iOS

        Comment


        • #5
          You don't -really- need nFringe do you? It just helps with IntelliSense and stuff right? Or is there something I'm seriously missing out on?

          PCS

          EDIT: Fantastically well laid out tutorial btw, concise and to the point. Love your work XD.

          Comment


          • #6
            Nice tutorial, but what about controls on the device? How to get them to work?

            Comment


            • #7
              Originally posted by zero4 View Post
              yeah that's great. Can you post something like that but with using WOTgreal?

              nFringe cost is a lot for people who want to create commercial games on iOS
              Just skip the steps that require nFringe. Visual Studio is only there as an IDE. At the end of the tutorial, you should have these following folders:

              c:\Path\To\UDK-Year-Month\Development\Src\Core
              c:\Path\To\UDK-Year-Month\Development\Src\Engine
              c:\Path\To\UDK-Year-Month\Development\Src\GameFramework
              . . .other folders such as UDKFramework. . .
              c:\Path\To\UDK-Year-Month\Development\Src\MyGameFolder
              -> c:\Path\To\UDK-Year-Month\Development\Src\MyGameFolder\Classes
              MyGame.uc
              MyPC.uc
              MyHUD.uc
              MyPawn.uc

              The last item, the folder called MyGameFolder, should be the name of your project. When you go to modify DefaultEngine.ini, you set some settings that reference this folder. The .uc files inside of the classes folder can be created with notepad (just Save As... then select "All Files" for the type) if you specify the right extension.
              Then I use UnrealFrontend to compile the scripts, not Visual Studio. I also don't even use VS's error list, usually I write clean enough code and Frontend does an overall better job of catching larger-scale errors.

              If you want instructions without VS, just remove the .sln and .ucproj from the zip in the original post

              I might make this into a video. It would seriously take maybe 5 minutes.

              Originally posted by Curious View Post
              Nice tutorial, but what about controls on the device? How to get them to work?
              They're currently bound to the WASD and arrow keys. In the mobile demo for the Citadel, Epic uses a special HUD class for mobile controls. If you want, just set the MyGame's HUD class to the one that CasteGame or whatever uses.

              Comment


              • #8
                Unfortunately, nothing works for me... It recognizes what I want to do in the MobilePreviewer through the .inis and script, but it fails on the device... Just renders the scene with the Version in the upper right corner. Actually, nothing works on the device... Even the delta time output...

                Comment


                • #9
                  very helpful. thanks.

                  I've completed all the steps. It runs well. but I don't know how to control the game using iPhone input instead of pc keyboard. UDK remote does'nt work at all with this MG-Test game.

                  Comment


                  • #10
                    Originally posted by Joan View Post
                    very helpful. thanks.

                    I've completed all the steps. It runs well. but I don't know how to control the game using iPhone input instead of pc keyboard. UDK remote does'nt work at all with this MG-Test game.
                    UDK Remote sends touch information to the computer, but this game mode doesn't interpret such information for controlling the player. You need to implement such functionality (Epic did it for you with MobileHUD and MobilePC)

                    Comment


                    • #11
                      Originally posted by zero4 View Post
                      yeah that's great. Can you post something like that but with using WOTgreal?

                      nFringe cost is a lot for people who want to create commercial games on iOS
                      Set it up exactly like you would for anything else, but use udkmobile.exe instead of udk.exe

                      Comment


                      • #12
                        Original post updated with videos to this tutorial, as well as a .zip containing the final product.

                        Here is a video of this tutorial:

                        Vimeo: (high quality)
                        http://www.vimeo.com/17988043

                        Youtube: (very low quality)
                        Part 1: http://www.youtube.com/watch?v=usKO056s6KY
                        Part 2: http://www.youtube.com/watch?v=XavMpeMvtYw

                        My website: (high quality, please be courteous only use this to download and mirror it, and not to just stream/watch!)
                        http://keres.satgnu.net/files/udk-basic-ios-game.mp4

                        Notes:
                        My microphone sucks, so my voice seems much more annoying than it really is I'm also slightly annoyed by how long it took me to make this, as I like fast paced tutorials and these are a bit slow. Please excuse this.

                        http://keres.satgnu.net/files/UDK-2010-12-Tutorial.zip

                        Comment


                        • #13
                          really great tutorial. now I can get down and dirty, thanks!

                          this needs to be stickied, really it does.

                          Comment


                          • #14
                            Fantastic Tutorial, I don't suppose you could shed any light on how you could take what you've done in the tutorial here, and then apply a sidescrolling camera effect to it? I've had a quick look through what's available on the UDK website, and either the code is old or it's not functional in the iOS setting.

                            Much obliged!

                            PCS

                            Comment


                            • #15
                              I don't use nFringe is there some altenative solution.

                              Comment

                              Working...
                              X