Hello Guest

Author Topic: Question of performance and Resolution.  (Read 6247 times)

Syntinel

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Question of performance and Resolution.
« on: October 17, 2013, 10:48:54 pm »
Hey,

    I am making a multi-resolution iPad game. I'm building up from Ipad 2 as my 1x Resolution ( 1024x768 ). The first thing I have done is added my background and tk2d camera. I am curious as to whether I should leave the background at the size the sprite is created at, which is the resolution of the image.
      This means in unity space my background sprite is 1024x786. Now in order to move things around on the screen the numbers I'm using with regard to the physics of objects are much greater. For instance to move around on the board I have to use a significantly larger velocity because the object is covering a lot more ground in Unity space.

I hope this doesn't sound too silly but could this be effecting performance? I notice a good amount of twitching when shooting a small sprite around from one side of the background to the other at the high speeds required to traverse the entire background. ( all i'm doing is applying a velocity to a sprite that is in front of the background. )


unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Question of performance and Resolution.
« Reply #1 on: October 17, 2013, 11:32:06 pm »
No it shouldn't affect performance. However, the default Unity physics works best at around 20-100 pixels per meter. If you are experiencing twitching, its probably worth investigating different scales to see what works best for what you're doing.

Syntinel

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Question of performance and Resolution.
« Reply #2 on: October 18, 2013, 01:19:34 am »
Ok thanks for the tip I'll start playing around with it!

Syntinel

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Question of performance and Resolution.
« Reply #3 on: October 18, 2013, 01:41:31 am »
Now I'm getting some strange behavior display wise. I changed the sprite to 20pixels per meter via the sprite editor and made the tk2dcamera have the same 20px per meter view and my background (game board) is having a good 50-100 px's taken off each side.

Syntinel

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Question of performance and Resolution.
« Reply #4 on: October 18, 2013, 01:43:01 am »
I had to change the zoom factor to 0.941, to get the desired scale.

One more thing when I change the camera to have an anchor at the bottom left, and the sprite to have an anchor at the lower left, part of the bottom of the texture is cut off.
« Last Edit: October 18, 2013, 01:55:37 am by Syntinel »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Question of performance and Resolution.
« Reply #5 on: October 18, 2013, 12:01:00 pm »
It depends on the native resolution. Set the native resolution correctly (probably the size of your background?), and preview res to the same if you'd like to see what happens on that platform. Scaling will occur on other platforms.

You shouldn't have to touch zoom factor.

Syntinel

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Question of performance and Resolution.
« Reply #6 on: October 18, 2013, 05:13:20 pm »
You are correct sir, silly error on my part. Thank you!