Sign in to follow this  

Unity Creating a cross-platform C++ engine, incl. android and IOS

This topic is 1804 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all,

 

forgive me for posting about a topic that has probably been discussed several times; I do feel that my question has a few extra points though and I have done a couple of days of reading on the matter.

 

I started writing a game engine in C++ with Ogre3D, SDL and Bullet physics. I have got 70% of a game done with it but it was just not written very well with some fundamental issues so I am starting again with those lessons learned. One of the reasons I am so keen on using C++ is that I am trying to better myself in C++ (since that is what my career is based around).

 

This time I also want to consider how I can code the engine in the best way possible to be able to 'port' it to android and IOS (as well as supporting Windows/linux/mac) since I realised the current engine I have it would be near impossible to do. I have done a lot of reading about the android NDK and Objective-C but I'm still not really sure.

 

I do understand that on any platform there will always be specifics that will need to be written for that platform regardless (I think I read that I'd have to code the UI myself for android at least) but I'd like to avoid rewriting code as much as possible.

 

Ideally I would like to avoid tools like Unity as that is C# and costs a fair bit of money for licensing extra platforms which I just don't have at the moment. I also want the experience of writing more of the engine than a tool like Unity will allow (even if it is just piecing a few pieces of middleware together).

 

Will it just be easier to write 3 separate engines? One for PC/Mac/Linux and one for each mobile platform? Should I try and brush up on plain old OpenGL and OpenGL ES 2.0 for phones.

 

Am I trying to do too much for a one man job?

 

I'd be glad of any thoughts any of you have on this matter.

 

Thanks for reading,

Nixius

Share this post


Link to post
Share on other sites
Being a systems programmer for one platform is hard. Doing it for multiple platforms would be a good learning experience but it would be improbable to become expert at all of them at once without many years of experience.

You will likely come up with a set of multi-platform common code using per-device abstractions.

If that is your passion then go for it. I don't know too many people who have that passion once they understand what it really means.

Share this post


Link to post
Share on other sites

Thanks for your reply.

 

Hmmm... you are probably right there, maybe I am biting off far more than I can chew at my current level and for a project on my own.

 

Perhaps then, I will initially concentrate on a PC/Mac/Linux engine and get proficient at that, populating the engine's functionality with a few games and then try my hand at a mobile platform completely separately.

 

Once I feel I have mastered those, perhaps then I may be in a better position to tackle something like I initially proposed.

 

Do you think that sounds like a more plausible approach?

 

It just irks me that I will be starting something I know I will probably have to rewrite, perhaps that is just something I will have to swallow; at least for now.

 

Nixius

Share this post


Link to post
Share on other sites

You dont want to write 3 separate engines.  Write a single engine and put as much functionality as you can into platform-independent code.  Current mobile platforms are similar enough to the others (PC/Mac/Linux) that this should be a doable objective if you're writing in C++.

 

With each platform the parts that will mostly have to be platform-dependent will be the setup code, UI, and graphics.  If you're using OpenGL then you can get most of the graphics code to work on all those platforms.  Just make sure you still make the wrapper layer platform-independent so you can easily add new platforms later (like DirectX for Xbox, etc).  

 

As far as the setup code, just make sure you only do as little as needed to get the app up and running, then hand off the updating, rendering, input handling to the platform-independent code.

 

For UI, if you have your own UI system, then it's not a problem.  If you use each platforms native solution (Interface Builder in iOS, etc), then you do need to rewrite that for each one.

Share this post


Link to post
Share on other sites

Hello, you will need a platform abstraction that will allow you to code your game without worrying about the environment (PC/Mac/Android/etc...) ; then you will need to implement your platform abstraction for any supported environment.

 

If I'm not wrong, iOS does not support C++, so you will not be able to get a "write once, run every where" system (at least, it will not run on iOS).

Share this post


Link to post
Share on other sites

Hello, you will need a platform abstraction that will allow you to code your game without worrying about the environment (PC/Mac/Android/etc...) ; then you will need to implement your platform abstraction for any supported environment.

 

If I'm not wrong, iOS does not support C++, so you will not be able to get a "write once, run every where" system (at least, it will not run on iOS).

You're wrong. You do need an Objective C layer, though.

Share this post


Link to post
Share on other sites

This topic is 1804 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Similar Content

    • By loyalsheep
      Hey guys!
      Check out the trailer of Airavat. It's a minimalist, space survival game (and hard, very hard) 
      Download on GooglePlay: Airavat
       
    • By anomalystudiospt
      Hey, we are new around here!
      Our team spent the last year developing a prototype game called Rise of The Fey, a game that focuses on a dramatic story with a fast paced gameplay.
      Rise of The Fey is a third-person action-adventure RPG set within a fantasy world called Perrah. In Rise you control Kall, a young spaunian looking for revenge after the death of his beloved.

      We would appreciate if you could take a look at our stuff, tell us what you think and possibly help us out on Indiegogo.
      The prototype is in portuguese, sorry about that!
      Have a good one!
    • By juglar
      Hi guys, we are developing a game called BiteOff! based on Zombies topic. BiteOff! is based on a game strategy mechanics, free to play, where the player has a bunch of zombies and he can distribute them along the map landscape to be able to bite and transform all humans into each level. Humans are controlled by artificial intelligence and they differ each other on capabilities based on different weapons that give them three different levels of aggressiveness to defend against the zombies. The zombies are also presented in three types and they are differentiated by their attack, speed, strength and resistance abilities. Through different achievements, (time to eat all humans, score, among others) the player can access four extra skills that can enhance your attack in real time on next levels as power-ups.
      We are launching a crowdfunding campaign in kickico and we need some helps please visit us on the crowdfunding page https://www.kickico.com/es/campaigns/17824/biteoff-the-videogame 
      Twitter @biteoffthegame
      Facebook
      Clickme!
      Website 
      Clickme!
    • By Lord McMutton
      The world of Ethios is held aloft by massive trees known as the Pillars.
  • Popular Now