Jump to content

  • Log In with Google      Sign In   
  • Create Account


Should I make my game engine cross platform?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
15 replies to this topic

#1 gchris6810   Members   -  Reputation: 196

Like
0Likes
Like

Posted 03 December 2013 - 01:37 PM

Hi,

 

I started off trying to make my game engine completely cross platform from the start but now I have dug into it i'm starting to think it just isn't worth all the additional complexity and probable performance loss. Would it be better just to write the full game for windows and then port over to Linux and Mac?

 

Thanks.



Sponsor:

#2 OandO   Members   -  Reputation: 571

Like
2Likes
Like

Posted 03 December 2013 - 02:54 PM

If making your engine cross-platform is causing you performance problems on your main platform (And you're not doing anything terribly advanced that's locked in to a particular set of drivers etc.) then you're doing something very wrong.

 

I would always say yes, but then I've never run into anything troublesome when supporting all three of those.



#3 Ravyne   Crossbones+   -  Reputation: 5695

Like
3Likes
Like

Posted 03 December 2013 - 03:07 PM

The primary advantage of starting as a single-platform release (preferably the one with the largest or most-profitable user base) is that you get to discover whether the endeavor is successful on the platform with the highest potential reward, and derived from that, whether ports to other platforms would be worth the cost.

 

The trick then, if you might want to port to other platforms, is to not make any silly choices that make porting more difficult than it has to be -- whether to use OpenGL or DirectX, how to interface input, networking, and the file-system, or what the right level of abstraction is, even if you don't actually go an implement those non-primary paths. If you don't avoid painting yourself into a corner in this way, its very unlikely you could "port"--in reality, a near-total re-write--your game to another platform which has a smaller market and turn a profit.

 

Realistically this means that some of the implementation costs of cross-platform compatibility can be avoided, but the design costs have to be paid up-front as a practical matter. Granted, a run-away hit might be re-written for other platforms if cross-platform issues were never considered, but its rare. 



#4 wintertime   Members   -  Reputation: 1538

Like
2Likes
Like

Posted 04 December 2013 - 06:06 AM

If you pay some attention to stay crossplatform from the start its probably not more difficult. Just restrict yourself to only use libraries that are crossplatform already (may even save on time when selecting a library by cutting down on choices) and in the rare case there is none wrap the platform dependent calls yourself (possibly write those wrapper only for one platform at first) and only use the wrapper (I doubt you would loose much performance from this). Then with some luck porting may be as easy as providing another implementation of your thin wrappers and adapting the build system to use some other compiler (you should not have used compiler dependent things).

If you instead build your game on OS-dependent calls and put those everywhere in your code, you will be out of luck later and have to tell everyone porting is not feasible/too expensive/too much effort.


Edited by wintertime, 04 December 2013 - 06:08 AM.


#5 ferrous   Members   -  Reputation: 935

Like
6Likes
Like

Posted 04 December 2013 - 12:59 PM

My personal opinion is that if this is your first game engine, don't bother making it cross platform.  Just get it working first.  You'll learn so much during the process that you'll probably want to re-write the whole thing anyway.  (Not that that should stop you from writing the engine in the first place!)



#6 snowmanZOMG   Members   -  Reputation: 729

Like
5Likes
Like

Posted 05 December 2013 - 02:36 AM

  • Have you made a game before?
  • Do you have experience with the operating systems on all the platforms you are thinking about supporting?
  • Are you comfortable with getting into the guts of setting up a proper build system and understand the compilers you'll need to use for each platform?
  • Do you know which language features are supported by the compilers?
  • Are you using libraries which are available on all platforms?

If you've answered no to any of these questions, you almost certainly should not try to make a game that is cross platform.   You'll waste so much time and energy on making something work on all the systems rather than finishing a game on just one of them.


Edited by snowmanZOMG, 05 December 2013 - 02:37 AM.


#7 VReality   Members   -  Reputation: 431

Like
2Likes
Like

Posted 05 December 2013 - 04:07 AM

In general, don't make anything you're not using.  There are too many ideas and decisions which you'll only arrive at through practical use, which means that making without using will accumulate wasted work and required rework.

 

So don't make an engine without also making the game/content which will use it.  And by extension, don't make your engine cross platform unless you're making a cross platform game.

 

That being said, as has been suggested above, you should make your design as portable as you can even if you don't port it.  I suspect this will be good for design anyway, since isolating platform dependent code is a form of separating concerns.



#8 gchris6810   Members   -  Reputation: 196

Like
1Likes
Like

Posted 05 December 2013 - 10:12 AM

Thanks for all the suggestions everyone. I think that as it is my first proper game engine project I won't focus on the cross platform element, although the way I plan to code it would make it relatively conducive to porting when it is finished.



#9 Nathan2222   Members   -  Reputation: -409

Like
-4Likes
Like

Posted 11 December 2013 - 07:43 AM

Hi. Please when did you start making your game engine. I just need to know because i plan on making one (not soon) and since you're already making yours, it'll help me evaluate. Thanks:)
UNREAL ENGINE 4:
Total LOC: ~3M Lines
Total Languages: ~32
:)
--
GREAT QUOTES:
I can do ALL things through Christ - Jesus Christ
--
Logic will get you from A-Z, imagination gets you everywhere - Albert Einstein
--
The problems of the world cannot be solved by skeptics or cynics whose horizons are limited by the obvious realities. - John F. Kennedy

#10 Unduli   Members   -  Reputation: 642

Like
0Likes
Like

Posted 11 December 2013 - 08:11 AM

I think you should more think on cross platform as PC-console rather than Windows-Mac . As I doubt it worths trouble for an indie if not designed that way at the beginning. But when console thing kicks in, it involves changes in gameplay, not only being platform agnostic.



#11 dejaime   Crossbones+   -  Reputation: 2977

Like
0Likes
Like

Posted 11 December 2013 - 12:25 PM

Making an engine cross-platform means forcing yourself not to use system shortcuts. This means higher quality code on most cases and shouldn't affect performance, unless you're doing something on a really low level, what probably is not your case.

But consider that making an engine cross-platform between Windows Mac and Linux will automatically make it easier to port it to game specific platforms and consoles, since the independent code will already be independent.

My father told me once that unplanned work means doubled work...

 

If this is an engine that you intent to use in order to actually make games and maybe release them, you may be losing profit here.

But if it is just a "learning experience", you have no real reason to worry, include that win32 with all your might!

 

Have you made a complete game before this game engine making adventure?


Edited by dejaime, 11 December 2013 - 02:33 PM.


#12 Kaptein   Prime Members   -  Reputation: 1514

Like
1Likes
Like

Posted 11 December 2013 - 01:13 PM

One good tip if you want to continue to make games for Windows, Linux and Mac would be to focus efforts on OpenGL rather than DirectX, if you choose to build the renderer yourself.

 

Alternatives are using libraries that exposes rendering functionality through its own library functions and classes, such as SDL. SDL can use both Direct3D and OpenGL.

Or using a game engine that is even MORE multiplatform, such as Unity, where you can create games for even handheld devices.

 

In my case, I am focusing on Windows, Linux and Mac. It was fairly easy to do with GNU compiler suite (g++ and co.), as well as some multiplatform libraries. For rendering I am using OpenGL.

It has been extremely easy to do, since the libraries does so much of the work for me already. My biggest problem was just creating the proper build chan, by learning to use Make properly. I have builds for Windows and Linux that just works, as it should be. :)


Edited by Kaptein, 11 December 2013 - 01:15 PM.


#13 gchris6810   Members   -  Reputation: 196

Like
0Likes
Like

Posted 11 December 2013 - 03:49 PM

I am mainly making the game engine to educate myself on graphics programming.

 

One more question. What are the benefits of using DirectX over OpenGL (if any)?



#14 lask1   Members   -  Reputation: 571

Like
0Likes
Like

Posted 14 December 2013 - 02:39 AM

the only benefit I really see using directx is support for the Xbox which would obviously not be an option for a platform. Both apis have all needed features for creating modern games. I just prefer OpenGL over directx just because of its wider support over multiple platforms.



#15 Ravyne   Crossbones+   -  Reputation: 5695

Like
0Likes
Like

Posted 16 December 2013 - 01:30 PM

Neither really hold a strict advantage over the other. In terms of platform support there's a good deal of market-share/revenue-potential overlap, but also exclusive support for certain platforms in either camp -- For example, if you want to run your game on XBox One, Windows RT (Surface, et all), or Windows Phone, you need to support Direct3D; likewise, basically every other platform runs OpenGL or OpenGL ES -- Although "more platforms" is a decent enough argument in favor of OpenGL, in practice the D3D ecosystem is probably about equal to the GL-based ecosystem in terms of dollars (if not users) available, but the GL-based ecosystem is more fragmented (linux, MacOS, iOS, Android for starters, and myriad hardware devices to finish) so its more work to tap all its potential. In the D3D-centric ecosystem, you can reasonably ask for more money for your game, whereas the bulk of the GL-based ecosystem is iOS/Android, where you reasonably can't and have to design around and subsist yourself on micro transactions for the most part. Anyways, none of this money stuff might be a concern for you now, but its worth bearing in mind for the future.

 

Other than that, Direct3D is a little more "modern" in its features and syntax (for better and for worse), but the two are close enough in functionality that you can create an abstraction layer between the two without much trouble. Pick one and learn it using contemporary best-practices, and all will be fine.


Edited by Ravyne, 16 December 2013 - 04:30 PM.


#16 AgentC   Members   -  Reputation: 1123

Like
0Likes
Like

Posted 16 December 2013 - 02:22 PM

Some benefits of each, excluding API preferences:

 

- on Direct3D shaders may execute a bit faster, and drivers are better tested, so you're less likely to get into customer support hell for your game

- on OpenGL you will get a bit faster drawcalls (less CPU overhead per drawcall)

 

For the "shaders execute faster" point, see http://aras-p.info/blog/2007/09/23/is-opengl-really-faster-than-d3d9/ which is fairly old, but that still seems to hold true for today's hardware, at least on quite basic shaders (blinn-phong lighting, shadowmapping)


Edited by AgentC, 16 December 2013 - 02:24 PM.

Every time you add a boolean member variable, God kills a kitten. Every time you create a Manager class, God kills a kitten. Every time you create a Singleton...

Urho3D (engine)  Hessian (C64 game project)





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS