A salad of blogs, tutorials and thoughts of game engines, games, c++ and all sorts of related stuff

Thursday 24 July 2014

Unreal Engine - Tutorial - How to cook and run on iPhone 5S

11:14 Posted by LoudParrottLab No comments
Well finally here is the tutorial. I am still editing this just published for the impatient.

You need to have a subscription to be able to do this.


If you happen to install using the installer please skip this step

Prerequisites
1. Make sure that you have the latest Mono installed. If not, you can download it from here.
    Execute the following from terminal to check the version, make sure it is 3.4.0
mono --version
2. iPhone 5S with iOS 7.1. iOS 8.0 does not work at the moment. Keep you posted on that one. Also I have not tested on simulator.
3. XCode 5.1 - XCode 6 is same as above

You should see an output similar to this
Mono JIT compiler version 3.4.0 ((no/d4511ef Tue Mar 25 14:35:52 EDT 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS:           normal
SIGSEGV:       altstack
Notification:  kqueue
Architecture:  x86
Disabled:      none
Misc:          softdebug
LLVM:          yes(3.4svn-mono-(no/e656cac)
GC:            sgen


1. Checkout the latest code from GitHub
git clone https://github.com/EpicGames/UnrealEngine.git
Cloning into 'UnrealEngine'...
remote: Reusing existing pack: 127489, done.
remote: Counting objects: 123, done.
remote: Compressing objects: 100% (117/117), done.
remote: Total 127612 (delta 32), reused 9 (delta 6)
Receiving objects: 100% (127612/127612), 175.89 MiB | 3.31 MiB/s, done.
Resolving deltas: 100% (84705/84705), done.
Checking connectivity... done.
Checking out files: 100% (24808/24808), done.
Ervins-MacBook-Pro:Tutorial ervinbosenbacher$

2. Change to UnrealEngine
cd UnrealEngine

3. Download to UnrealEngine (current directory)
https://github.com/EpicGames/UnrealEngine/releases/download/4.3.0-release/Required_1of2.zip
https://github.com/EpicGames/UnrealEngine/releases/download/4.3.0-release/Required_2of2.zip
https://github.com/EpicGames/UnrealEngine/releases/download/4.3.0-release/Optional.zip

4. Unzip all of the three zip files
unzip Required_1of2.zip -d 1of2
unzip Required_2of2.zip -d 2of2
unzip Optional.zip -d Optional

Our folder structure should look like this
(pic)

5. Now we need to merge the unzipped folders. You won't be able to build the engine without it.
Please make sure that you do not have a / after Engine! Or you would copy the contents of the Engine folder and not the folder itself
cp -rfv Optional/Engine .

This time make sure that you have / at the end of 1of2 so that you copy the contents recursively
cp -rfv 1of2/ .
cp -rfv 2of2/ .

verifiy tha you see this
(pic)
cd Engine
(pic)

6. For convenience remove the directories that you have unpacked
cd .. (so that you are in UnrealEngine, verify by executing pwd)
execute
rm -rf 1of2
rm -rf 2of2
rm -rf Optional

7. We need to generate the xcode project.
execute
chmod 755 GenerateProjectFiles.command
./GenerateProjectFiles.command

You should see this after successfull execution
(pic)

8. Now we have 2 options. Compile UE4.xcodeproj from command line or from xcode. My advice is that do that from command line
using the following command.
xcodebuild -target "UE4Editor - Mac" -configuration "Development"

Note: you can list the available targets, build configurations and schemes using the following command
xcodebuild -list

Note 2:
If you receive the following warnings
014-07-24 12:07:39.165 xcodebuild[21334:1007] +dataWithFirstBytes:1024 ofFile:"/Users/ervinbosenbacher/Development/workspace/games/UNREALENGINE4/Tutorial/UnrealEngine/Engine/Config/Base.ini" failed, errno = 2
2014-07-24 12:07:39.198 xcodebuild[21334:1007] +dataWithFirstBytes:1024 ofFile:"/Users/ervinbosenbacher/Development/workspace/games/UNREALENGINE4/Tutorial/UnrealEngine/Engine/Config/BaseEditorLayout.ini" failed, errno = 3

You can ignore them or do the following, this is caused by a missing end of file character on *x machines
You can just add an empty line using your favourite editor and then it will go away.

Now you can go have a nap, get a coffee or play WoW until it is done. In my case it takes about 40 minutes to perform the compilation.
On my system it had to compile and like 23 and 656 files.

9. After successfull compilation there is a bug that is need to be fixed.

Navigate here
UnrealEngine/Engine/Binaries/ThirdParty/ImgTec
and execute the following
chmod 755 PVRTexToolCLI

This will fix a bug that wont allow to run the shader compiler while cooking and packaging.

10. Launch the editor using the following
execute
open ./UnrealEngine/Engine/Binaries/Mac/UE4Editor.app

or from the Finder.

11. When your window of Unreal Project Browser is open you should see a screen as below.

12. Click on the New Project Tab and select Code First Person - c++
Leave the starter content checked and give it a name. For exampl FPSCodeProject.
For reference check the image below.

13. Select create project. This will open an xCode project.

14. Close the Unreal Project Browser.

15. We have 2 choice again. For convenience we will use the xCode porject. From the dropdown of schemes select FPSCodeProjectEditor - Mac.

16. From the dropdown select Edit Scheme. From the build configuration select Development to match the build configuration of the first build. This build will
the extension to the editor and the game which is necessary for the packaging.

17. Launch build. For some reason my XCode gets stuck at 188 out 662. I usually stop the build at that  Time for another coffee, nap or WoW. Second option
click on the project in the Navigator and on the left make a note of the location. Copy the path and navigate in the Terminal to that location. If you have a
space in the path put the path in quotes when copying into the terminal. Stop the build in XCode and close it.

execute:
xcodebuild -target "FPSCodeProjectEditor - Mac" -configuration "Development"

18. execute
open ./UE4Editor.app again to open the Unreal Project Browser from the original location.

19. you will find in the Projects Tab FPSCodeProject. Select it and click Open. If successsful it will open the Unreal Engine Editor with our project.
Close the welcome to Unreal Editor screen in the mddle.

20. Navigate to Project Settings as below go to Game->Maps & Modes. Expand the bottom on the right side at Default Modes and select from the dropdown of the Global Default
Server Game Mode to FPSCodeProjectGameMode. This will fix an automation bug.

21. Do not close Porject Setttings yet. Navigate to Platforms->IOS and click on COnfigure Now. Close the Project Settings window.

22. Navigate to Launch Options and select your device as shown in the Pic.
It will start to build, cook and package for the device.

23. If you would like to you can click on Show Output Log. This will open the log window. Most of it is spam so you can gnore it.
This is the time for the third coffe, nap, WoW combo.

24.... and show time...

0 comments: