Search

Week 7: Discovering Weaknesses/Deploying

Updated: Dec 8, 2020

This week I have been discovering weaknesses about myself. Not the game. The game is perfect. I am joking. The game is only as good as its developer and as seen from the previous post, I am not perfect.


Physics was one of my favorite classes in high school, and I would have even majored in physics had I not been so interested in animation. Therefore, I consider myself to have a good working knowledge of basic physics. Unfortunately, my confidence and haste made me glance over a variable in a formula that was crucial in predicting the future location of a falling object (check out last week's post to see the moving bug caused by the missing variable). However, I learned that I really need to take my time and read thoroughly and carefully over all the necessary steps.


For those curious, the formula to figure out the distance traveled for a falling object is:

d = Vi*t + 0.5*g*t^2


Vi = Initial velocity, g = gravity, t = time.


So to find the location of where a falling object is going to be after X amount of time, you could use the following function.

FVector predictLocation(float time)
{
   FVector starting_location = static_mesh_component-GetComponentLocation();
   FVector velocity = static_mesh_component->GetPhysicsLinearVelocity();

   // using formula (delta distance = Vi*t + .5*g*t^2)
   return starting_location + (velocity * time) + FVector(0.0f, 0.0f, UPhysicsSettings::Get()->DefaultGravityZ * .5 * (time * time));
}
 

This week I have also been working on getting the game as an app on my iPhone and BOY! It is not a walk in the park. Mostly because macOS is required in order to build the game, which means I have to dust off my 2012 Macbook and put it through the ringer in building. Here are some of the steps I went through to get the app on my iPhone.

  1. Get the right version of macOS. It might not be the latest! In my case, I was on Mojave, I needed Catalina, and the latest version out was Big Sur.

  2. Download Xcode, not just any Xcode, the one that the specific version of the UE4 version you are using was built with, which is usually not the latest, and not the one found in some of the documentation either, like this one. Rather, it is found in the release notes of the UE4 version you are using.

  3. Buy an Apple Developer membership ($100 a year), just to get some certificate stuff and whatnots (I need to learn more about this...) I do think there is a way to develop and test your app without it, but I feel like this might be the path of least resistance. When creating the profile, make sure you select iCloud capability.

  4. Get Git, and Git LFS if you are using them as source/version control on your macOS, clone your repo onto the macOS, modify the following shell script and run it to generate the Xcode workspace.

sh "/{PATH_TO_ENGINE}/unrealEngine-4.25.4-release/engine/build/batchfiles/Mac/GenerateProjectFiles.sh" -project="/{PATH_TO_PROJECT}/{UPROJECT_FILENAME}.uproject" -game

5. If trying to do the remote build from Windows onto macOS, good luck. You must download iTunes, and NOT from the Microsoft store, instead it must be through the apple installer. If you have already downloaded it from the Microsoft Store, uninstall it, download the apple one, and modify the registry with the following:

a. Go to HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Apple Inc.\Apple Mobile Device Support\Shared

b. Add a new string value with key "MobileDeviceDLL"

c. Add the value of C:\Program Files\Common Files\Apple\Mobile Device Support\MobileDevice.dll

d. Thank parallelcube for figuring this part out.

6. After doing a rain dance, importing the certificate and profile into the iOS tab of the project settings in editor, AND setting "Automatic Signup", with the correct "Team ID" value right below it, packaging the game finally worked.

7. Plug in your device (iPhone, iPad, etc) to the Mac, go to the device in Finder and drag the .ipa onto the device info in Finder to install the app onto the device, yay!

8. Test the game, does it suck? Is it fun? Does it look cool? Is it pretty? Do I feel amazed while playing it? I actually think the core feature is pretty fun, sooo success! Now to add more features and expand who tests the game .

 

I made a trello to keep production organized, check it out here! https://trello.com/b/jwVqxomf