Sign in to follow this  

Unity SDL cross-platform: processor time and multithreading

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

Given that I'm currently using SDL for my game, and I made that choice because I wanted it to be cross-platform, I've now started having some misgivings about potential difficulties in actually making it so.

The thing is, I realise that I probably have to code for the lowest common denominator I intend to support. Ultimately, I was hoping to develop on my laptop, a Core2 Duo machine, optimise as much as possible, and later do further development on a "weaker" device to bring it to an even better efficiency. The gameplay of the game is more important, however, than sticking to some lowest common denominator in terms of system specs, so I'd be flexible on this.

Then of course there is the issue of, if I go multithreaded (and that is a very distinct possibility as I will be doing a lot of procedural generation on the fly as the world progresses -- since I desire a seamless world), what can I [i]actually rely on [/i]in terms of what the lowest common denominator provides? I read a post over at the Unity forums where people were saying 2 cores is very common these days, and elsewhere I've read in the past that one thread per core is a good idea, no more (obviously that ignores OS needs but I know little enough about that).

Has anyone faced these challenges (primarily: developing multithreaded for devices with vastly different specs), who would be willing to offer some advice?

Thanks in advance,


Share this post

Link to post
Share on other sites
[quote name='Nick of ZA' timestamp='1312966987' post='4847084']
Has anyone faced these challenges (primarily: developing multithreaded for devices with vastly different specs), who would be willing to offer some advice?
Many modern engines gone multithreaded these days. Some papers talk about what approaches are take to support multithreaded game (google for "id tech5 challanges" for an example) . In short, use only few OS threads, avoid OS-locking as much as possible and build your components to support isolated, or atleast "read-only", processing of shared data.

Locking functionality offered by the OS is often very slow and abusing these too much could kill performance. A simple solution is to use synchronisation points, where only the "main" thread gathers and distributes tasks to i.e. job lists which are mostly isolated from each other and could be processed by a single thread.

Double buffering is an other simple,"lockless", synchronisation technique. One thread writes only to one buffer (i.e. waypoint calculation) and this buffer will be swapped next frame by the main thread only (avoiding any data locking at all).

Share this post

Link to post
Share on other sites

This topic is 2315 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Forum Statistics

    • Total Topics
    • Total Posts
  • Similar Content

    • By arash khalaqhdoust
      hey guys i hope you doing all well. last night i released my first game in google app store, i really appreciate you guys  to download it. and share your reviews about it
      the idea of game comes from mini hackgame of Bioshock.
       link of download:
      many thanks
    • By ForgedInteractive
      Who We Are
      We are Forged Interactive, a small team of like-minded game developers with the sole purpose of making games we love! Currently, we're progressing very quickly with our first project and there are plenty of opportunities and work for new interested programmers. With this project, our development platform is Unity 5.5.2 and C# as our behavioral language. Since this project is our first release, the game itself is a smaller project though progress is moving quickly. We are looking to finalize the current project and get started on future projects in the near future and are expanding our team to do so.
      Who We Are Looking For:
      Programmer Level Designer  
      About the Game
      Ours is the tale of two siblings, thrown into a world of chaos. Living in the shadow of their parents' heroic deeds and their Uncle's colorful military career, Finn and Atia are about to become the next force to shape our world. How will you rise through the ranks of Hereilla and what will be your legacy? Once defeated your enemies turn coat and join you in your adventures. Players can enjoy a range of troops and abilities based on their gameplay style which become more important as maps introduce more challenging terrain, enemies and bosses. Strong orc knights, dangerous shamans, and even a dragon are out on the prowl. Knowing when to fight and when to run, and how to manage your army is essential. Your actions alone decide the fate of this world.
      Previous Work by Team
      Although we are working towards our first game as Forged Interactive, our team members themselves have worked on titles including and not limited to:
      Final Fantasy Kingsglaive FIFA 2017 Xcom 2 Civilization  
      What do we expect?
      Reference work or portfolio. Examples what have you already done and what projects you have worked on academic or otherwise. The ability to commit to the project on a regular basis. If you are going on a two-week trip, we don't mind, but it would be good if you could commit 10+ hours to the project each week. Willingness to work with a royalty based compensation model, you will be paid when the game launches. Openness to learning new tools and techniques
      What can we offer?
      Continuous support and availability from our side. You have the ability to give design input, and creative say in the development of the game. Shown in credits on websites, in-game and more. Insight and contacts from within the Industry.
      If you are interested in knowing more or joining, please email or PM us on Skype. A member of our management team will reply to you within 48 hours.
      Skype: ForgedInteractive
      David, Colin and Joseph
      Follow us on:
      Twitter: @ForgedInteract

    • By dell96
      I'm trying to make my first project but I'm stuck i don't know how to make my crate to start to spawn again when i hit the start button after i die.
      hoping someone can help!!!
    • By Killah Rasta

      I have a complete idea about a 2D top-down, old-school-GTA like gangster game, that have an open world, and where you can build your black empire. I wan't to make it in Unity, but I'm a hobby developer without papers, so I'm open for ideas. I started to build it on the sources from youtube, but actually I would like to contact with a coder and an artist, to build and draw the game together. I don't have ready funds for it, but wan't to make some money by a start-up website, or something like that. I wan't to have two man, that I can trust, share and make a working pre-stage game, that could get some money on a project page and then go on toward to publish!

      Coding jobs: pathfinding (or NavMesh in 3D), AI, cover system, animation and other game mechanisms like fighting, missions, etc.
      Art jobs: buildings, structures, objects inside-outside, characters.
    • By Strifexxx
      Hi guys, check out our new game about sticks. Feedback welcome!
      Download on Google Play:
      Stickman Destruction 3 Annihilation  is a sequel to the legendary game of survival, where to make incredible tricks, driving different transport and getting into different crash! The game is made in the best traditions of simulator games with ragdoll physics elements. Make incredible jumps and tricks and destroy the enemy! Your task is make the finish alive or dead!

  • Popular Now