1
\$\begingroup\$

I have posted this issue on stackoverflow, but unfortunately nobody couldn't find solution, maybe someone here know this.

I'm developing Side Scroll 2D Game, using AND ENGINE

https://i.stack.imgur.com/58Q1U.png

I'm using their SVG extension (I'm using vector graphic)

But I discovered strange and ugly effect, while moving my player (while camera is chasing player exactly, means while camera is changing its position)

Images of my sprites looks just different, they are like blurred or there is effect like those images would be moving (not changing their possition, just jittery effect, really hard to explain and call this effect properly) Hopefully this image may explain it a bit:

https://i.stack.imgur.com/z02UL.jpg

Its more or less, how does it look in the game, where:

a) "FIRST" image is showing square, while player is moving (CAMERA isn't) image looks as it should

b) "SECOND" the same image, but with this strange effect "which looks like image moving/blurring during camera moving [chasing player])

Friend of mine told me that it might be hardware problem:

"the blurring that you notice is actually a hardware problem. Some phones "smooth" the content on the screen to give a nicer feel to applications. I don't know if it's the screen or the graphics processor, but it doesn't occur on my wife's Samsung Captivate. It happens on my Atrix and Xoom though. It's really noticable on the Xoom due to the large screen size."

But seems there is way to prevent it, since I have tested many similar games, where camera is chasing player, and I could not notice such effect.

Is there a way to turn this off in code?


I'm grateful for previous answers, unfortunately, still problem exist.

Till now, I have tried:

  • casting (int) on setCenter method which is being executed on updateChaseEntity
  • testing game using PNG images, instead of SVG extension and vector graphic
  • different TextureOptions
  • hardwareAcceleration

If someone have different idea, what may cause this strange effect, I would be really grateful for help - thank you.

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

It could be the refresh rate not being in sync with the screen's refresh rate.

First thing to test is to take a screenshot while the camera is moving and see if the blur appears on the resulting image.

If not then it definitely is a problem with the hardware and you might have to try to sync the drawing cycles with your hardware (I have no knowledge of how to achieve this in android).

Does the blur appear on the emulator as well?

\$\endgroup\$
4
  • \$\begingroup\$ Thanks for answer, I have taken couple of screenshots ussing android ddms, and while I could see this 'blurring effect' on my device, it wasn't really visible on taken screen'shots. Actually it does happen on 99% tested devices. \$\endgroup\$
    – Matim
    Dec 17, 2011 at 12:46
  • \$\begingroup\$ Ok so definitely something with the game engine settings. Post an answer if you find the cause... it's always nice to leave a solution if not for you to remember later on for all to see. \$\endgroup\$
    – Coyote
    Dec 20, 2011 at 16:40
  • \$\begingroup\$ If I will find solution, I definitely will post it, till now I have tried so many different setting combinations (Texture settings, and so on) without success. The same happens using PNG files, so its not SVG Extension problem, another thing is that my friend said its rather HARDWARE problem, not engine, seems its true, because such 'effect' is visible in many games, but in some its not visible (sometimes because bright graphic) Thats why I'm wondering. \$\endgroup\$
    – Matim
    Dec 20, 2011 at 16:52
  • \$\begingroup\$ I misread your first comment. It seems it is a hardware problem... The screen refresh is sometimes slower than you would expect, mainly on cheap hardware. With brighter graphics the persistence is more visible, mainly when you have a lot of bright and dark graphics moving... The higher the contrast the more visible is the blur. \$\endgroup\$
    – Coyote
    Dec 20, 2011 at 20:37
0
\$\begingroup\$

I had a few issues with the performance of actually moving a camera, and switched to a SmoothCamera which increased performance, and looks so much better.

Hope this helps:

http://code.google.com/p/andengine/source/browse/src/org/anddev/andengine/engine/camera/SmoothCamera.java?r=ce34423c75330560d7bb4d4a00d20e9b9a18175a

Update: This may not be the most recent version of this code, but SmoothCamera is available in GLES 2 also. Just switch "Camera" to "SmoothCamera", I believe it takes some different parameters upon configuration, (like MAX_VELOCITY, etc).

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .