Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [IOS] Get Big - Simple lifting game  (Read 6752 times)

0 Members and 1 Guest are viewing this topic.

R23MJ

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
[IOS] Get Big - Simple lifting game
« on: July 01, 2015, 11:58:55 pm »
Hello SFML Forums.
A while ago some friends and I decided to begin working on a small game, eventually we decided to port it over to iOS. The game is about lifting, your main goal while playing is the increase your "Max", the maximum weight you can lift. What better way to achieve this then tapping :D.

Link to store: https://appsto.re/us/yPY27.i
copy and paste this into Safari on your phone. Searching may not come up with the app because of how new it is.

Modes:
Test Your Max - Tap as fast as you can to lift the weight, increasing your Max each rep until failure.
Lift For Reps - Again tap as fast as you can to lift the weight, however in this mode the weight stays the same between reps and you are given no rest for a total of four reps. Each set you complete in reps mode will increase your "Strength modifier" allowing you to easily lift more weight.

The Shop:
The shop currently only offers protein shakes, but these small drinks will increase your strength modifier significantly! To buy a protein shake you need to earn a total of 50 coins, you can do this by simply playing the game, each time you lift the weight to the top your player earns one coin!

Screenshots:


Note: This is written in C++ with SFML, SFML loads the graphics and plays the audio and, well everything. Thank you to Laurent for making this possible.
« Last Edit: July 02, 2015, 12:24:22 am by R23MJ »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: [IOS] Get Big - Simple lifting game
« Reply #1 on: July 02, 2015, 07:34:27 am »
I have no iOS device so I can't test the app, but it looks nice. :)

Since there are only very few people who have done iOS development with SFML, it might be interesting if you could talk a bit about how you did it.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

R23MJ

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: [IOS] Get Big - Simple lifting game
« Reply #2 on: July 06, 2015, 07:00:40 pm »
I have no iOS device so I can't test the app, but it looks nice. :)

Thank you :) Even though the concept was simple it still took a bit of work.

Since there are only very few people who have done iOS development with SFML, it might be interesting if you could talk a bit about how you did it.


Compiling SFML and Setting up the Environment
Sure, I'd love to. Note: I do not currently have access to the Mac the game was developed on. So if I do not give exact instructions in XCode, this is why.
Setting up the environment was honestly the hard part. Like you said, very few people actually develop iOS apps with SFML, so finding a tutorial on how to actually set it up was impossible. I built and compiled SFML like the old tutorial (http://en.sfml-dev.org/forums/index.php?topic=13716.0) shows how. Around this time things started getting tricky. I could not include the SFML include files, I added the path to them in XCodes "User Defined Header Paths" section and to the "Header Paths" section to no avail. I eventually investigated the predefined location in "Header Paths" but the path was no existent, I created it and dragged the SFML include file it. This fixed the problem. After successfully getting SFML to include and link, I decided to give my app a test run, sadly this lead to even more errors (http://en.sfml-dev.org/forums/index.php?topic=18323.0). These errors were because I didn't link to the iOS libraries required by SFML, sadly a list of these is no where to be found. To fix this problem I simply dug around in the SFML source, each of the main source directories (i.e. "...\SFML\Graphics\" or "...\SFML\Window\") has a CMakeList.txt file. In these files you can find the dependencies for each system. The required iOS frameworks are:

Foundation
UIKit
CoreGraphics
QuartzCore
CoreMotion

When building an iOS app it is mandatory to include these. After finally getting that all sorted out I started writing the code and again decided to give it a test run. This time libJpeg was giving me problems. I'm not entirely sure how it was built, but when I tried to run my app it was telling me it was built using different architectures. I simply downloaded the libJpeg source (http://www.ijg.org/files/) and rebuilt it with the architectures I was using. After this it was smooth sailing for awhile. Everything ran on the simulator no errors, not even a warning. Then I tried to build on a device. Apple seems to enjoy watching developers suffer, I did some searching online and eventually found that in order for my app to work on a device I needed to build the SFML source for simulator and device. After building it for both I needed to combine the outputs and create what is known as a "Fat" library, to accomplish this there was a terminal command like so
lipo -create lib-sfml-graphics-device.a lib-sfml-graphics-sim.a -output lib-sfml-graphics-s.a
. Do so with each library eventually worked and my app worked great on devices.

*Skip forward a bit*

The code was now complete and worked perfectly, by now I was used to XCode and knew that I needed to build the app in archive format, verify it in XCode a few times, navigate to the directory where a stored my archive and upload it to iTunesConnect.

My Experience with Apple
Working with Apple isn't easy, they are very thorough with anything that makes it onto their stores. A quick read through the iOS review guidelines (https://developer.apple.com/app-store/review/guidelines/) will show you what I mean. That's not including the iOS Human Interface Guidelines (https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/) or the... well you get the point. Anyways, after uploading the app to iTunesConnect I was able to allow friends and family test the app using Apples TestFlight beta. Several builds later I was finally ready to submit the app. I submitted the app for the first time, less than two days later one of my testers informs me of a bug he had found. I fixed the bug, and added a few things we planned to wait on, but decided it was better to add in the initial release. After uploading the new build to iTunesConnect I was distraught when I found that I was not simply allowed to update the app currently in review. I needed to take it out of review and submit the new one, making the previous 2 days worthless. Ten days later I received word from Apple. My app had been rejected because the screenshots did not show the app in action. Again, disappointed that my previous time had gone to waste I immediately took screenshots of everything. I mean everything. I uploaded them and again submitted my app. This time I only needed to wait 7 days to here from Apple. My app had finally been accepted and was ready to hit the store.


What's Next?
With no longer having access to a Mac, my only option for updating the game, and my plans for future games, is to find a way to develop apps on my PC. Preferably Visual Studios, considering it is the compiler I am used to. After some searching I was disappointed to find no solution that allowed me to continue development in C++. I would need to learn C# if anyone here started with C++ then took a look at C# you know it is very foreign (I mean, why is everything in a class? Seriously?) but that is a discussion for another time. I am using Xamarin, a Visual Studios plugin for iOS, Android and windows phone development, it is only available with C#, luckily SFML has a dotNet binding. I will be setting everything up later today or tomorrow, and will report back with my findings. I also plan to incorporate Thor, I started to mess with it just after this project was uploaded, and I must say it is a very nice addition to SFML.

Thank you to the SFML forums for all your support.
« Last Edit: July 06, 2015, 07:03:05 pm by R23MJ »

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: [IOS] Get Big - Simple lifting game
« Reply #3 on: July 06, 2015, 09:14:46 pm »
Wouldn't even try to compile an iOS game (or app in general) on Windows. Many hoops to jump and it's likely you'll run into something you can't solve this way or another. MacOS X is their only supported development platform. Toolsets allowing you to use Windows typically involve JIT generated code (like C#) that's actually executed by their native runtime (so you're not really writing iOS apps to be specific). This is also the reason you can't just use SFML's .net bindings. Although I might be wrong here, considering you might be able to use the existing iOS libs you've compiled (but you're screwed in case of architecture/OS changes I bet).

If you're looking for a challenge, how about targeting Android now? :)

R23MJ

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: [IOS] Get Big - Simple lifting game
« Reply #4 on: July 06, 2015, 10:40:49 pm »
I figured it would be difficult to compile on Windows, I might look into that again in the future. Android was definitely something I was looking at supporting, especially since 80% of the people I know have androids.

Thanks for the advice!

willm127

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: [IOS] Get Big - Simple lifting game
« Reply #5 on: July 07, 2016, 02:14:37 pm »
Compiling SFML and Setting up the Environment

Hello!

I realize this thread is exactly(!) a year old, so do let me know if I should just start a new one. I love SFML, and would like to help with the iOS version and documentation. I believe I'm almost there, but I just need help with a few final touches, specifically, adding the frameworks (?) or the include files.

Would you mind telling me how I would go about adding the required iOS frameworks (Foundation, UIKit, etc.), and would you happen to know what the following errors are?



These are the steps I've taken:
  • cmake the master SFML build from github
  • added the iOS bool and set to true
  • added the options for C++11 per the SFML cmake install instructions
  • chose the xcode version
  • In XCode, added the basic template code into my own main.cpp file, and included SFML/Main.cpp

Once I can get the simplest of samples, I would love to begin documentation similar to what the Android version has: https://github.com/SFML/SFML/wiki/Tutorial:-Building-SFML-for-Android

Thanks for your help!

R23MJ

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: [IOS] Get Big - Simple lifting game
« Reply #6 on: July 08, 2016, 03:54:57 am »
I wish I could be of more help; however, I no longer have access to a computer running OSX. This app was built on my school laptop, and the school year just ended again this year for me, so I can't even look at the project. (They take the computers during the summer). Those errors appear to be caused by you not initializing an sf::Texture correctly, this could also be caused by the libraries not being linked correctly, it has been roughly 6 months since I last used XCode, I cannot remember how to link libraries. A few problems I had while setting up the project are on stackoverflow (links below) I don't remember if all of the questions have answers as stackoverflow dwellers are very useful (no sarcasm). Other than that I can't help, I apologize.

http://stackoverflow.com/questions/30770179/xcode-ios-build-places-blue-tint-on-images
http://stackoverflow.com/questions/30656877/undefined-symbols-for-architecture-x86-64-cmmotionmanager-with-sfml
http://stackoverflow.com/questions/30688857/display-ads-with-iad-without-storyboard-or-xib

Edit:::
Just a side note, the app was updated with a bit more functionality (still not very fun though honestly) a couple of months ago. So if anyone wants to check it out, we can be best friends :)
« Last Edit: July 08, 2016, 03:56:49 am by R23MJ »

willm127

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: [IOS] Get Big - Simple lifting game
« Reply #7 on: July 08, 2016, 08:07:36 am »
No worries, this helps tremendously! Thanks for taking the time to reply! The links will definitely give me a lead on where to look next.

And yes, I forgot to ask about the app when I wrote my initial reply. I followed the link, but all I see is a blank page on the app store. And when I searched for it by name, it also doesn't show up. Do you have another direct link to it? I'd like to check it out!

 

anything