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

Tuesday 29 July 2014

Monday 28 July 2014

Genymotion and Android Studio and Google Play Services

10:40 Posted by LoudParrottLab No comments
My head wanted to blow up after trying out Android Studio and nothing seemed to work...

So what has happened? Basically I have updated to Android Studio 0.8.4 and have decided to create an app with stock login activity.

Then I thought I am going to launch this in the Genymotion supplied emulator (because it is light years faster)

Then I have started to receive errors related to google play services api and the login google plus button....

???

Ah yes unfortuntely due to some licensing all of the google stuff is missing from the Genymotion supplied Android simulators.

Here is the solution on Stackoverflow:
How do you install Google frameworks (Play, Accounts, etc.) on a Genymotion virtual device?

After I have installed the apps and performed some updates of Google Play and the related apps everything went fine.

Sunday 27 July 2014

How to convert Yosemite.app to iso or dmg

02:50 Posted by LoudParrottLab 6 comments
Just a quick note!

If your Redemption Code for Yosemite download is used or invalid you can go to this website
https://appleseed.apple.com/sp/betaprogram/guide

And on the bottom request a new one. Then from your developer account you can download the OS X which will open you App Store App. If the code is invalid use the code that you have just requested from the above link.

After your download stop the install, close the window and the package will be in your /Applictations folder that you have to copy to somewhere else as after installation the package will be deleted and will use it to convert it to an ISO image so that we can install it using Parallels


So today I was trying to install into my Parallels the new Yosemite OS x 10.10

I have found a nice script and the original is here
http://forums.appleinsider.com/t/159955/howto-create-bootable-mavericks-iso
I have reedited this for Yosemite

# Mount the installer image
hdiutil attach /Applications/Install\ OS\ X\ Yosemite.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app

# Convert the boot image to a sparse bundle
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Yosemite

# Increase the sparse bundle capacity to accommodate the packages
hdiutil resize -size 8g /tmp/Yosemite.sparseimage

# Mount the sparse bundle for package addition
hdiutil attach /tmp/Yosemite.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build

# Remove Package link and replace with actual files
rm /Volumes/install_build/System/Installation/Packages
cp -rp /Volumes/install_app/Packages /Volumes/install_build/System/Installation/

# Unmount the installer image
hdiutil detach /Volumes/install_app

# Unmount the sparse bundle
hdiutil detach /Volumes/install_build

# Resize the partition in the sparse bundle to remove any free space
hdiutil resize -size `hdiutil resize -limits /tmp/Yosemite.sparseimage | tail -n 1 | awk '{ print $1 }'`b /tmp/Yosemite.sparseimage

# Convert the sparse bundle to ISO/CD master
hdiutil convert /tmp/Yosemite.sparseimage -format UDTO -o /tmp/Yosemite

# Remove the sparse bundle
rm /tmp/Yosemite.sparseimage

# Rename the ISO and move it to the desktop
mv /tmp/Yosemite.cdr ~/Desktop/Yosemite.iso

Xcode6 or Xcode5 show all output (remove “Showing first 200 notices only”)

02:11 Posted by LoudParrottLab , , No comments
I have made a discovery today. Basically I was annoyed by the fact that Xcode has output only the first 200 lines of the build log while building Unreal Engine. Unreal Engine build log is over 1000 lines so was I was building blind after 200 lines, when building in Xcode. (xcodebuild is a different story,  I had the advice to build from the command line, but I wasn't happy entirely with that as it involves more windows, more switching, and from Xcode you can perform some tasks and adjust some settings quicker). I have seen a screen similar to the one below where my log has stopped after 200 lines.



So then after googling a little bit figured that there is a setting that one can use to show all the log.

1.) So in XCode 6 click on the Show the Report Navigator the little clock on the right.



 2.) Then right click anywhere in the log window and select Expand All Transcripts as shown in the pic below.



 2.) As a result you will see a screen similar to the image below, and see that the log is updating constantly if everything goes well.




 3.) To turn it off right click again anywhere in the log window and select Collapse All Transcripts.


Have a happy and productive day. :)

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...

Wednesday 23 July 2014

Unreal Engine Editor Crash.

11:28 Posted by LoudParrottLab No comments
Weird error today.

Advice: Do not refresh the GitHub repo of the engine while you are working on a game attached to that version of the engine. Ever.

I am following a tutorial then today I have decided to pull the latest from GitHub. Lesson? Do not do it. If you start to work on some code with Unreal Engine, freeze the engine changes or be very specific what you accept as a change in your overall codebase. It is not by accident that the game+editor+engine are all linked together. So while pulling the latest code from GitHub you might introduce incompatible changes with your game code and this is what you might need to deal with:


For now I am going to recreate my code as it is not too much, but I will try to debug this to find a solution so that I can provide some answers if someone runs into this after writing thousands of lines of code.

Someone here has run into the same problem but there is no answer to the problem.

So follow up later.

Unreal Engine - How to Cook and Run on iPhone.

09:39 Posted by LoudParrottLab , No comments
This is just a place holder... 
The tutorial is here.

I will write in the coming days a quick tutorial/reminder what to do if someone wants to run one of the templates supplied by Unreal Engine on an iPhone 5S (or not a template :) ).

Just a quick note, maybe will quickly change, but if you have upgraded to iOS 8 you cannot run the game on it as there are some OpenGL incomaptibilities that I have figured out, so either simulator or don't upgrade your os on your iphone just yet.

Anyway TBC tomorrow.

Here is a quick video that I have done about my test on an iPhone 5S.



Unreal Engine Tutorial Links

09:01 Posted by LoudParrottLab , , No comments
Unreal Engine...

The various links...

Recently I have jumped in to game development, and I have started to explore the various engines. For various reasons I have stuck with Unreal Engine. In this post I will collect my favorite links to various tutorials that I think could benefit others too.

This is my personal collection, feel free to explore, and reflects only my personal taste.

First Person Shooter C++ Tutorial (The official unreal engine tutorial)

Unreal Engine 4 C++ Tutorial: True FPS with "zoom-able" third person  (As an extension to the previous one...)

How to Limit Camera Rotation (Haven't tested this one, just stumbled upon it when thinking about the problem of a TPS with limited or fixed camera rotation)

I will add here a third person shooter tutorial using C++.

(...and then the various problems with the camera. Probably I will write a blog about it. Here I am referring to the fixed camera above the head, or a camera with limited move, for example 180 degrees...)

07:50 Posted by LoudParrottLab No comments
Unreal Engine Adventure #1

I have decided to compile from command line the whole engine.

A quick a dirty command:

So to clean I have executed:
xcodebuild -target "UE4Editor - Mac" -configuration "Development" clean

Then to make a build:
xcodebuild -target "UE4Editor - Mac" -configuration "Development"

Apart from a couple of annoying things I have found that it is a much better experience than from xcode. In xcode I frequently checked back to the build log, just to find out that annoyingly it is freezing. For instance I had to build 606 files, and at 186 it has just stopped the log while after checking the Activity Monitor it still building.

In terminal everything was fine apart from the following:

1. Warning about 2 .ini files. (No I am building on MacBook Pro but the Unreal Engine contains a lot of windows stuff, the build environment is built using C# so you have to install Mono in order to be able to build it on Mac)

Those .ini files are empty. The solution to this is to edit those files and add an emty line or a line ending character.


2. The annoying warning about IDEBuildOperationMaxNumberOfConcurrentCompileTasks 

The solution is to execute:
defaults write com.apple.dt.XCode IDEBuildOperationMaxNumberOfConcurrentCompileTasks 4

To verify execute:
defaults read com.apple.dt.XCode | grep IDEBuildOperationMaxNumberOfConcurrentCompileTasks