• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By drcrack
      It is a combination of fundamental RPG elements and challenging, session-based MOBA elements. Having features such as creating your unique build, customizing your outfit and preparing synergic team compositions with friends, players can brave dangerous adventures or merciless arena fights against deadly creatures and skilled players alike.

      This time with no grinding and no pay to win features.

      We're still looking for:
      1) 3D Character Artist
      2) 3D Environment Artist
      3) Animator
      4) Sound Designer
      5) VFX Artist

      Discord https://discord.gg/zXpY29V or drcrack#4575
    • By Francisco Tufr
      Hi everyone! I'm currently working on a series of books about 2D Shader Development.

      The idea is to synthesize a bunch of techniques that are specifically useful for 2D, even if they work on 3D as well.

      I released the first book last week. It's 4.99 on Amazon or free on the series website, https://www.2dshaders.com

      This is an independent initiative, I don't work for any publisher whatsoever. The contents of the books are the result of a 4-year span where I started teaching this in Argentina and USA, always making the workshop better. Now I'm expanding it to make more sense in book form.

      I'd love to hear your opinions on the idea and if you get the book let me know what you think.

      By the way, the examples are in Unity, but the concepts from the book should be easily transferable to any graphics api/engine.

      Hope you like it!
    • By RoKabium Games
      While looking out for that pesky Terrator, our little alien is doing a bit of relaxed mining down on the new gas planet "Lelantos" this weekend.... 
      #gamedev #indiedev #madewithunity #screenshotsaturday
    • By vividgamer
      I have a native iOS game (objective c, XCode build) which I am considering to port to other platforms.
      Core gameplay is based on solely on geographical maps, and custom drawing over maps. It also has Core Data. This part is complete in development.
      What is not done yet is: monetization, gamification (leaderboards, challenges) and multiplayer functionality.
      As I think more about it, I am tempted to think if this is the right time to move to a cross platform tool such as Unity. But before dedicating time to port my 5 years side-project effort in Objective C, I really want to know if its worth it.
      - Does Unity support such plugins / assets that will fulfill all my above requirements?
      - Unity Personal seems to have only 20 concurrent users - is it too costly scaling if I decide for extending to web and android platforms?
      - What is the general workflow involved in publishing to iOS, Android, PC, and web platforms while using Unity? I mean to ask about various points of signing stuff, paying fees and getting certified.
      - How long will it really take to port my entire Objective C project into Unity? I am somewhat familiar with C# but I am finding it hard fidgeting with Unity IDE as lot of things are focused around FPS and 3D while my game is still 2d - not much action involved. I seem bit overwhelmed by the list of features I see there. All in all, I do not want to lose my momentum while still making sure its portable to everywhere.
      - Any assets I could use (for free to try basis in debug) that are relevant for my game?
      - Last but not the least, are there any costs that I need to be paying upfront to Unity, for using it (apart from their monthly subscription model)? I don't understand their costing for multiplayer in conjunction with their subscription fees - if someone could kindly elaborate.
      Thanks in advance for your time reading a newbie
    • By GytisDev
      me and few friends are developing simple city building game with unity for a school project, think something like Banished but much simpler. I was tasked to create the path-finding for the game so I mostly followed this tutorial series up to episode 5. Then we created simple working system for cutting trees. The problem is that the path-finding is working like 90% of the time, then it get stuck randomly then there's clearly a way to the objective (tree). I tried looking for some pattern when it happens but can't find anything. So basically I need any tips for how I should approach this problem.
      Use this image to visualize the problem.
  • Advertisement
  • Advertisement
Sign in to follow this  

Unity Game Timing issues

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

http://www.gamedev.net/community/forums/topic.asp?topic_id=339608&whichpage=1� Has a few examples of getting your game updated at a certain freq. The problem I'm encountering is calling performance counter or timegettime every loop, when there is no msg pending, results in nearly 100% cpu usage. Placing a well calculated Sleep in the loop solves the problem of the cpu usage, limiting the gameupdate + drawing. I'm just wondering if this is the right way to go. thx in advance :)

Share this post

Link to post
Share on other sites
Why are you so bothered about 100% cpu usage? It's how games work, they are always updating themselfs as fast as they can.

You could place a sleep(0) somewhere to lower the cpu usage, but that's about it.


Share this post

Link to post
Share on other sites
When your application has focus, it's a good idea to run at full cpu usage, because the user expects results from your application, and not from others.

When it does not have focus, the user doesn't really care about what you do, so you should regularly sleep to allow other processes to run.

Share this post

Link to post
Share on other sites
Funny how people are concerned when their game runs at 99% CPU, but don't care at all when the process named "System Idle Process" runs at 99% CPU.

Share this post

Link to post
Share on other sites
I would actually suggest. That you take whatever idle time your loop takes up and give that to the sleep method based on either an average or a remaining time.

For instance, you find it is time for you to do your game update which is at a fixed frequency, and your rendering is running at a capped fps you could allow your program to sleep for the remaining time till the next game update or frame rendering. However, a sleep will probably hinder your key capturing and other input event checking if they run from the same thread. So you should definitely make sure that they are running in other threads and call interrupts via function pointers or the observer pattern using a thread safe/concurrent programming model. But neglecting other processes while your game is running is not only bad programming practice it can cause undo frustration on your customers and potential fans as well as increase the amount crashes that your program will experience mostly from the users getting bored of waiting a million years for the system to actually do its tasks because your game takes up as much CPU time as it possibly can.

Share this post

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

  • Advertisement