• Advertisement
Sign in to follow this  

Unity Game Engine Design - Best way to handle multiple APIs and Targets?

This topic is 3466 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

I have been pondering on this question for quite some time, and have reached no decisive conclusion on my own, so it's probably best to reach out to the community with this query. Having to deal with multiple targets and APIs is a reality that is only going to get more and more aggravated, we have to target multiple hardware levels that are capable of running multiple APIs (DX9, DX10, DX11, OpenGL 2.x, OpenGL 3.x, OpenGLES 2.x), and we also have to handle other types of platform like MIDs and other mobile devices, all in C/C++ code. What do you think is the best way to handle this diversity of configurations? In principle i can divide the problem in two areas build and preprocessing. Should developers handle different versions of the same engine in multiple development branches (say DX9, DX10, DX11, OpenGL 2.x, OpenGL 3.x, OpenGLES 2.x). Meaning that we have redundancy of code and our maintenance job is multiplied by the amount of platforms that we want to target. Or should developers use the preprocessor to handle this issue, creating complex scripts that are also very hard to maintain but giving us one entry point. Is complexity in either levels inevitable? Let's hypothetically consider this as a job interview question: As a lead game engine programmer how would you handle/target multiple APIs, what technique would you use for your development efforts?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by dannyBlue
Having to deal with multiple targets and APIs is a reality that is only going to get more and more aggravated, we have to target multiple hardware levels that are capable of running multiple APIs (DX9, DX10, DX11, OpenGL 2.x, OpenGL 3.x, OpenGLES 2.x), and we also have to handle other types of platform like MIDs and other mobile devices, all in C/C++ code.


C or C++?

Quote:
Is complexity in either levels inevitable?


It's not inevitable. All you need to do is separate your platform-dependent code from your platform-independent code, connecting the two using a clean interface designed for performance and simplicity.

Then, implement the different versions of your platform-dependent code respecting that interface, and implement your unique version of your platform-independent code on top of that interface.

This way, the different versions of the platform-dependent code are built independently without a complex build system, and there is no redundancy.

Share this post


Link to post
Share on other sites
Both C and C++.

Yes that is a good theory but in practice things never really work out in a clean solution.

Add to the lot the need to compile different version of shaders and different shader formats for binary shaders. What toolchain would you use to handle this?

Share this post


Link to post
Share on other sites
Quote:
Original post by dannyBlue
Yes that is a good theory but in practice things never really work out in a clean solution.

What, precisely, do you have in mind? Usually, if you don't manage to get a clean solution working, it means you're not thinking at a level that is high enough (because your abstraction fails to hide the differences between the platforms).

Quote:
Add to the lot the need to compile different version of shaders and different shader formats for binary shaders. What toolchain would you use to handle this?

Depends. Some engines use a cross-platform specification language that avoids the issue of shader languages. Failing that, I would provide different assets for different platforms (including the shaders) beause unlike the Model, the View is too dependent on the platform to be abstracted.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
  • Advertisement
  • Popular Now

  • Advertisement
  • Similar Content

    • By RoKabium Games
      Another one of our new UI for #screenshotsaturday. This is the inventory screen for showing what animal fossils you have collected so far. #gamedev #indiedev #sama
    • By eldwin11929
      We're looking for programmers for our project.
      Our project is being made in Unity
      Requirements:
      -Skills in Unity
      -C#
      -Javascript
      -Node.js
      We're looking for programmers who can perform a variety of functions on our project.
      Project is a top-down hack-and-slash pvp dungeon-crawler like game. Game is entirely multiplayer based, using randomized dungeons, and a unique combat system with emphasis on gameplay.
      We have a GDD to work off of, and a Lead Programmer you would work under.
      Assignments may include:
      -Creating new scripts of varying degrees specific to the project (mostly server-side, but sometimes client-side)
      -Assembling already created monsters/characters with existing or non-existing code.
      -Creating VFX
      -Assembling already created environment models
      If interested, please contact: eldwin11929@yahoo.com
      This project is unpaid, but with royalties.
       
      ---
      Additional Project Info:
      Summary:
      Bassetune Reapers is a Player-verus-Player, competitive dungeon crawler. This basically takes on aspects of dungeon crawling, but with a more aggressive setting. Players will have the option to play as the "dungeon-crawlers" (called the 'Knights', or "Knight Class", in-game) or as the "dungeon" itself (literally called the 'Bosses', or "Boss Class", in-game). What this means is that players can choose to play as the people invading the dungeon, or as the dungeon-holders themselves.
      Key Features:
      -Intense, fast-paced combat
      -Multiple skills, weapons, and ways to play the game
      -Tons of different Bosses, Minibosses, creatures and traps to utilize throughout the dungeon
      -Multiple unique environments
      -Interesting, detailed lore behind both the game and world
      -Intricate RPG system
      -Ladder and ranking system
      -Lots of customization for both classes s of customization for both classes
    • By RoKabium Games
      Custom coffee mugs have arrived... More caffeine!
      Have a great weekend everyone! 
      #gamedev #indiedev #sama #caffeine
    • By Atwo Studios
       
      Hey guys,

      Anthony here from Atwo Studios bringing you some new updates for the new year!
      In this video I go over our game ROY, the new games and some general updates to the company!

      If you have not checked out ROY feel free to give it a try! Many people have said they enjoyed the game thus far!
      ROY: https://goo.gl/o6JJ5P
       
    • By Affgoo
      https://play.google.com/store/apps/details?id=com.NE.Alien
      still a lot of work to do, but its pretty stable  please let me know what you think <3
      Atlas Sentry is a game of destroy everything. Using your turret, simply swivel and shoot your way to victory, upgrading your weapons to unleash destruction on the variety of spaceships. The bigger your combo’s the more score you get! Earn silver as you play and then purchase new weapons and abilities to better deal with your enemy. Different enemies use different tactics and weapons, work out your own priorities in their destruction order. 

      Features: 
      **2 different game modes 
      **A level select mode with 20 difficult levels including a final boss, can you defeat it? **Arcade mode of endless destruction, how long will you last? 
      **High scores to compete against others, see who can take the top spot. 
       
  • Advertisement