Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / SetViewOffset have bug in mobile devices?

Author
Message
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 8th Jul 2015 13:38
Hi.

about last mount I made a game like flappy bird, but there is lag in my game.

now I try make another side scrolling game (not like flappy bird), but I seen this problem for current project. in my project there is only two background and player sprites. In PC all thing are normal but in mobile device there is lag in scrolling.

what is this problem?
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 8th Jul 2015 13:53
Not a bug. Post some example code which illustrates the issue and we may be able to figure it out...

Using AppGameKit V2 Tier 1
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 8th Jul 2015 14:55 Edited at: 8th Jul 2015 14:55
this is sample code:

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 8th Jul 2015 20:28
for me it works at handy and pc with 2.0.14b
if background is opaque maybe try SetSpriteTransparency off

AGK 108 (B)19 + AppGameKit (Steam) V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 8th Jul 2015 20:52
Quote: "for me it works at handy and pc with 2.0.14b"


Also i used AppGameKit 2.0.14b and work very well on Pc, this problem is only on mobile devices. I test it on several mobile but still there is this problem.
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 8th Jul 2015 22:06 Edited at: 8th Jul 2015 22:08
I just tested this on my lowest spec Android device, A lowly Samsung Galaxy Y (850Mhz CPU, 128mb ram) and your example code above ran as silky smooth as it did on my PC.

What exactly is "laggy" about it? I only sat and watched it for a few minutes but I didn't see anything wrong.

What mobile devices have you tested it on? Were you broadcasting or running a compiled apk? I used the broadcast feature to test with.

>Edit<
Forgot to say I'm also using the latest version of AGK

Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 8th Jul 2015 23:05 Edited at: 8th Jul 2015 23:06
Quote: "What mobile devices have you tested it on?"


My devices : Sony Xperia M, huawei ascend g6

My friends devices: Samsung Galaxy note 4, LG(I forget model, but it's new LG model)

Quote: "
What mobile devices have you tested it on? Were you broadcasting or running a compiled apk? I used the broadcast feature to test with.
"


I running a compiled apk.
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 8th Jul 2015 23:21
I will try with a compiled apk later on.

I just conducted further testing, although again by broadcasting to the player on my Galaxy Note 3 and a Galaxy Tab 2 with exactly the same results, which was perfect smooth scrolling.

Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 9th Jul 2015 13:59 Edited at: 9th Jul 2015 15:46
I Trust you baxslash.

But all devices can't have same problem. fps in all devices is 59, but i can see lag during scrolling. I put my flappy dragons game to Persian Android Store, and 2 person send me email that sometimes there is lag in game and make them can't continue game. so ensured that there is a problem.
I published flappy dragons with AppGameKit v1, so I decide purchase ver 2 maybe this problem fix with new version, but problem still exist.

I posted example code at The third post and I don't think there is problem in my code because it's not complex.

EDIT: even I test some scrolling game on my devices and really did not see
any lag in them.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 9th Jul 2015 16:06
Without seeing your code it is going to be very tricky for anyone to help you with this. My first thought is that you may be allocating new resources during the game cycle (possible when drawing the 'pipes' for example) rather than re-using previously allocated resources. As a player progresses further into the game, the 'lag' problem would become more apparent as more and more resources are being consumed. As I'm rubbish at your Flappy Dragons game, I haven't experienced any 'lag' - possibly because I've only seen the first few seconds of gameplay.
Check through your code for any 'create' commands and maybe add a check (if get<whatever>exists) to see if the resource already exists first.

p.s. Have you had a go with Game Guru yet? I think you'll love it!

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 9th Jul 2015 16:51
Quote: "But all devices can't have same problem."

In that case it is most likely your software at fault. AppGameKit has no lag bug I've ever seen on any of my devices.

Using AppGameKit V2 Tier 1
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 9th Jul 2015 17:13
Quote: "Check through your code for any 'create' commands and maybe add a check (if get<whatever>exists) to see if the resource already exists first."


Be sure I use GetSpriteExists() to check already is created or no before do anything in my code.after finish my game, about 10 day I check my code and fix some issue (Including check GetSpriteExists()).

Quote: "p.s. Have you had a go with Game Guru yet? I think you'll love it!"


some years ago I used FPScreator, and TGC change name it to FpscreatorX10 then change to FPSCreator Reloaded then change to GameGuru because It is a failed project. after some years also I seen AI is like games that made 15 years ago maybe oldest.

I do not think it is a good suggestion To protest SetViewOffset have bug or not.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 9th Jul 2015 17:42
Quote: "change to GameGuru because It is a failed project"

Wah!???

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 9th Jul 2015 20:09
I added SetSyncRate( 70, 1 ) to my code and when run it on Pc, Exactly can see lag in scrolling like mobile devices.

anyone know why do this happen?
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 9th Jul 2015 22:27
As with all the 'bugs' you tell everyone about, the problem is with the chair to keyboard interface.

AGK V2 user - Tier 1 (mostly)
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 9th Jul 2015 23:28 Edited at: 10th Jul 2015 02:10
Quote: "the problem is with the chair to keyboard interface."


also about this topic?

http://forum.thegamecreators.com/?m=forum_view&t=214831&b=41

if you think problem is relate to me amd my code, please Prove me. i wrote a sample code at The third post and don't need wrote any code for me. if can fix it.
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 10th Jul 2015 02:08 Edited at: 10th Jul 2015 02:18
Generally:

I do not want to waste my time and others. I purchased AppGameKit v2 and want make a new game, but currently I can\'t do it because there lag in scrolling on Mobile devices. I test my code on several mobile devices and see same result on them.

I do new test, run own code on AppGameKit v1 and AppGameKit v2 On PC and result is:

in AppGameKit v1 there is lag during scrolling but in AppGameKit v2 there is no any lag during scrolling.this result show this problem is relate to AppGameKit because it fixed in v2 for pc. but exported APK form AppGameKit v1 and v2 have same problem on mobile devices.

It is not acceptable for me that:

1- all devices (Mobile and Pc) instead of AppGameKit developer have problem.
2- all people instead of AppGameKit developer make mistakes.
3- the eyes of the people instead of AppGameKit developer make mistakes.

It\'s never not acceptable for me.

after each test and see same result the more I\'m sure that problem is relate to AGK.
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 10th Jul 2015 02:59 Edited at: 10th Jul 2015 03:02
@Behdadsoft:
Ok, I compiled the example code you supplied into an apk and installed it on my 3 test devices from earlier and I still saw absolutely no lag.

I also added the SetSyncRate(70,1) to the code before running on my laptop (A rather uninspiring Dell Inspiron, certainly not a gaming rig) and once again I saw no lag.

I find it hard to believe that no one here on the forum other than you can see anything wrong. I asked earlier what exactly was "laggy" about it but you never said.

Perhaps it would help everyone if you could describe the problem in more detail? I associate "lag" with the kind of stop-start action like when network traffic is delayed, or general slowdown when a game engine is taxed? I see neither of these things happening in your example code.

SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 10th Jul 2015 03:56
Why don't you play on the device and record it then upload the clip to youtube and show what is lag??????

The Amiga and Amos were great!
My website LEAP - Download Paint Pot here!
Impetus73
12
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 10th Jul 2015 08:29
Quote: "It\'s never not acceptable for me."


Since this is a double negative (never not), it actually means that it's always acceptable to you

----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Jul 2015 11:47
Quote: "1- all devices (Mobile and Pc) instead of AppGameKit developer have problem."


Incorrect. Only your devices have the problem. This suggests you have not shown us everything, because nobody can reproduce the problem. It suggests cherry-picking the code you want to show, and hiding the bits you don't.

Quote: "2- all people instead of AppGameKit developer make mistakes."


Incorrect. There are problems with AppGameKit, and they get corrected when they are reported, with a working demonstration and analysis of the problem. This is normal procedure for all development environments due to the complexity - There's a problem, it's reported with an example showing the problem, it gets fixed in the next release.

Quote: "3- the eyes of the people instead of AppGameKit developer make mistakes."

Incorrect. You have not given an example that can be reproduced. I have tested your "problems" and not seen it with my eyes. Many others have tested it and not seen it with their eyes. You are not giving us the full picture, there is something else that you have not presented to us.

Stating that AppGameKit is bad, the developers are crap, FPSC is a failed product(!) and the community is blind is the wrong way to get help.

There is only one common denominator with all of the problems you ask for help with. And if you choose to point out other threads (i.e Scraggle's) where he admitted his error, apologised in good humour and moved on, then you are treading on very dodgy ground. You wouldn't want the reaction of other forums to your requests bringing up.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 10th Jul 2015 12:59 Edited at: 10th Jul 2015 13:00
I agree with Mr Vink. Too many bridges have been burnt for me now. Get your own house in order before slating others! (i.e: )


V2 T1 (Mostly)
Phone Tap!
Uzmadesign

Attachments

Login to view attachments
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 10th Jul 2015 15:56 Edited at: 10th Jul 2015 16:02
Quote: "Since this is a double negative (never not), it actually means that it's always acceptable to you."


@Impetus73

but google translate tell me it's not acceptable.

Quote: "Why don't you play on the device and record it then upload the clip to youtube and show what is lag??????"


@spectrepaul

tomorrow try record video and upload it on youtube.

Quote: "I agree with Mr Vink. Too many bridges have been burnt for me now. Get your own house in order before slating others!"


@CJB

this problem is relate to Hosting, And while that I've closed the site. this not relate to this problem.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 10th Jul 2015 16:22 Edited at: 10th Jul 2015 16:26
your lag can have 1000 reasons.
agk,thirdparty in agk,os version,hardware,background tasks,battery power,...

if the app do the same thing in a loop you can expect a constant frame rate.
i have a simple test for this,it draw the fps visual with lines :


AGK 108 (B)19 + AppGameKit (Steam) V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 10th Jul 2015 17:43 Edited at: 10th Jul 2015 17:45
thanks markus for your code

AGK no have any problem in normal use, I made 2 game without scrolling and work very well even without decrease fps.
Also i made 3 scrolling game but scrolling is not smooth and seem there is lag in game. this happen on PC is only for AppGameKit v1 and not AppGameKit v2. but on android devices this problem exist.

The interesting thing is that:

on Single Pc when run any code with AppGameKit v1, FPS is 69 and on AppGameKit 2 is 85.
and this different value show me two result:

1- in AppGameKit v1 scrolling have lag.
2- in AGk v2 there is no any lag during scrolling.

but FPS is "59" on mobile devices with lag during scrolling.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Jul 2015 19:11 Edited at: 10th Jul 2015 19:18
Quote: "on Single Pc when run any code with AppGameKit v1, FPS is 69 and on AppGameKit 2 is 85."

Quote: "but FPS is "59" on mobile devices with lag during scrolling."


This isn't lag. Lag would be 30 FPS when you asked for 60.
AGK1 and AGK2 run at 60FPS by default. If you get 85 you either changed the default or took the reading incorrectly.
If your program changes speed (e.g player slows down), then you coded it incorrectly. It is not AGK's fault. It is normal to code for changes in FPS. Your demo code above is not coded correctly, it will stutter if the CPU is overburdened in any way and the FPS changes (including other programs). I repeat, this is not a bug in AppGameKit, it is your code. One thing is inevitable in life...FPS will change.

This is your code in AGK2 that you claim is running at 85 FPS.It runs at 60 (those big numbers on the screen), just as it is designed. If the FPS changes (because anti-virus runs a scan, I get an email, Windows update starts, the PC wants to check out one of a 1,000 different things, memory gets paged, DropBox does a scan etc) then it will stutter.



Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt

Attachments

Login to view attachments
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 10th Jul 2015 19:14
what happens if you run your scrolling code with a 10fps limit?
is the lag still there?
maybe you can see it better at smaller frame rate.
i guess with lag you mean a not constant scrolling.

AGK 108 (B)19 + AppGameKit (Steam) V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 10th Jul 2015 19:56 Edited at: 10th Jul 2015 19:59
Quote: "Your demo code above is not coded correctly, it will stutter if the CPU is overburdened in any way and the FPS changes (including other programs)."


I don't think, because different value is also for Markus code and defualt agk code after create new project.


@Markus

Quote: "what happens if you run your scrolling code with a 10fps limit?
is the lag still there?"


yes lag is exists when i limited fps to 10. and fps is 9.9 in AppGameKit v1 and AppGameKit v2.

but when use setsyncrate(60,0), in AppGameKit v2 fps is 85 and in AppGameKit v1 fps is 69.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Jul 2015 21:32 Edited at: 10th Jul 2015 21:32
Quote: "I don't think, because different value is also for Markus code and defualt agk code after create new project."


Markus' code is proving the point! Set it to 60 and you'll get problems on a device that can't manage 60FPS. I just tried it on a Hudl here - it is up and down by about 5%
Then I set it to 40FPS and it's a perfectly straight line...because the Hudl can manage this frame rate.

If you say that it lags at 10FPS, and runs at 69 / 85 when sync rate is 60 then you are doing something very wrong.
You still haven't shown the video you were asked to upload.



Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt

Attachments

Login to view attachments
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 11th Jul 2015 01:38 Edited at: 11th Jul 2015 01:40
I check this board sometimes very far between, and that people still humour this fella is beyond me. One must be very strong mentally to attempt helping this man more than once

On Topic:

No, setviewoffset doesn't have a bug on mobile devices

My hovercraft is full of eels
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 13th Jul 2015 00:34 Edited at: 13th Jul 2015 00:35
sorry for delay.

I test my project on another PC and seen FPS in AppGameKit v1 and v2 is same and this problem is relate to my pc, so I should reinstall windows for find problem.

But lag in scrolling also exists. i can't capture from device because More frames is reduced.

@BatVink

Quote: "Your demo code above is not coded correctly, it will stutter if the CPU is overburdened in any way and the FPS changes (including other programs)."


I don't know where is the problem because it good work on PC.If my code is incorrect, if possible please give correct code for scrolling that work on mobile without lag.

thanks.
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 13th Jul 2015 01:28
Quote: "But lag in scrolling also exists. i can't capture from device because More frames is reduced.
"


OMG! This thread now has 31 messages at the time of writing! Crikey! This is getting a bit monotonous now. Can you not just record the screen using another device like a phone or something. It is not difficult.
How long does it take to record to show others the lag.

You are posting the same as at the start, have you heard of the saying about circles and going around in????????

Quote: "If my code is incorrect, if possible please give correct code for scrolling that work on mobile without lag.
"


Hmmmmm

The Amiga and Amos were great!
My website LEAP - Download Paint Pot here!
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 13th Jul 2015 01:56
Quote: ""If my code is incorrect, if possible please give correct code for scrolling that work on mobile without lag.""




Yeah, it's doing my head in.

Others have already suggested you are doing things incorrectly. So why haven't you tried doing something else? You just keep on asking the same stuff over and over, whilst telling everyone how great your games were on those game-makers you used to use.

Personally, if it was me, Id listen to the advice given and experiment with other ways to do what you are trying to achieve. Maybe start with un-hooking your scroll speed from the fps (as currently, any glitch in fps would cause a stutter in the scrolling). Perhaps something along the lines of:



BUT for what it's worth, I think you should go back to 3DRAD or Game-Editor Behdadsoft. The screenshots you posted of the racing game you made look amazing!

Please.

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 13th Jul 2015 21:40
I have found the best way to make every game appear to work at the same speed on any device, whatever the performance/spec is like; is to use a method called "Timer Based Movement".

It's fairly straight forward, especially considering that AppGameKit has a command which returns the amount of time it's taken to perform a loop. But basically, you assign a sprite a speed. For example, you want your background sprite to move at a speed of 320px per second, then simple find out how far the sprite would have moved in the time it took to run the loop.

There is lots of information about Timer Based stuff here on the forums.

Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 14th Jul 2015 12:45
Quote: "Please."



AGK V2 user - Tier 1 (mostly)
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 27th Jul 2015 13:49
Quote: "I have found the best way to make every game appear to work at the same speed on any device, whatever the performance/spec is like; is to use a method called "Timer Based Movement"."


I used timer for movement but problem still exists.

this is my code:



I Uploaded this video, but maybe can't good see lag because I take this video with another device.

https://youtu.be/EmKQl7F_ipQ
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Jul 2015 14:16
I played the video at 25% speed.

1. There is no framelag, it stays with 1FPS
2. There is no visual lag, the background scrolls at a constant speed.

This line is proof that there is no lag:

SetSpritePosition(player,GetSpriteX(player) + (speed# * deltaTime#),GetSpriteY(player))

If there was lag, your player would move, but it doesn't.

We're still chasing a problem that cannot be seen.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 27th Jul 2015 19:11
Quote: "This line is proof that there is no lag:

SetSpritePosition(player,GetSpriteX(player) + (speed# * deltaTime#),GetSpriteY(player))"


yes, player not have any lag. for this reason I choice "SetViewOffset have bug in mobile devices?", because problem is relate to scrolling.

Quote: "We're still chasing a problem that cannot be seen."


when I recorded this video with another device say that: "maybe can't good see lag because I take this video with another device."

I find a tutorial relate to using deltatime in unity that in this video show my problem with red cube.(but my lag is less than red cube).

I cut this part and upload it:

https://youtu.be/vxNDAVNdJXc
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 27th Jul 2015 19:40
Quote: "yes, player not have any lag. for this reason I choice "SetViewOffset have bug in mobile devices?", because problem is relate to scrolling."


You say there is lag even when using timer-based movement (even though it is not apparent in your video). You have used time-based movement for the player. Therefore, if there was any lag using this method then the player would move left/right.

You are moving your player in exactly the same way as the scrolling - Exactly, precisely, unequivocably the same. It is impossible for the scroll to lag and the player to stay in the same position.

Quote: "when I recorded this video with another device say that: "maybe can't good see lag because I take this video with another device.""

I ran it at 25% speed on a 27" monitor. I placed a finger on the player and a finger on the Home symbol. The backdrop was smooth and the player didn't move.

timer-based movement doesn't fix lag, it disguises it. But the timer in the top-left clearly shows that there is no lag.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
snowdog
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: London
Posted: 27th Jul 2015 23:18
Add me to the list of people that can't see anything wrong with it. Perhaps we're misunderstanding what Behdadsoft is trying to say..?

Looks pretty smooth to me in that video.

&amp;quot;This you have to understand. There's only one way to hurt a man who's lost everything. Give him back something broken.&amp;quot;

Thomas Covenant, Unbeliever
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 28th Jul 2015 10:18
I actually can see that the scrolling colours in the background jitter a little but that's clearly the device because the player is in the correct place consistently. I don't get this jitter on any of my devices. Perhaps your device is just a little slow for some reason.

Try moving the background sprites and not using SetViewOffset at all, then you will know for sure it isn't to do with that command (it isn't)...

Using AppGameKit V2 Tier 1
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 28th Jul 2015 23:58
Hate to say it folks but I have seen the "lag". Hovever, I don't think this is a bug with the SetViewOffset() command, I think it's just poor implementation and problems with cheap devices.

I tried Behdadsoft's code from the 27 Jul post and it does indeed suffer from unacceptable jittery movement on my crappy Alcatel One Touch phone, which has something like a 800x480 resolution. However, on my gen 1 Nexus 10 there wasn't any issue. So I had a play of the code and came up with this:



This was much more acceptable*. The main difference here is that the back ground is made from 100 spites that never have their position reset and this seemed to sort the issue out. I also calculated the offset as a separate variable rather than calling the GetViewOffset() command all the time, same for the player sprite.

From looking at the example for scrolling sprites it would seem that the SetViewOffset() command is more for non-repeating backgrounds rather than infinitely scrolling backgrounds. Which kind of makes sense to me.

*One thing to note, with my One Touch phone sprite movement is never that smooth for sprites that have hard edges. There's always a little bit of flicker but it is a cheap phone so I don't expect much.

Invaders of the 29th Dimension - available now on Google Play
Find me on indieDB

Login to post a reply

Server time is: 2024-04-18 11:06:05
Your offset time is: 2024-04-18 11:06:05