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 / Depth issue in v10811 vs v1076

Author
Message
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Apr 2013 21:11 Edited at: 1st May 2013 19:28
EDIT: Solved (see my second post for today).

Okay, I am using exactly the same code (using shared files, so all are even the same physical files).

And, the sprites in question all have different display depths.

And, I ran the debugger and verified that the sprite id and target depth were correct and that the depth setting command was being called for the sprite that is NOT appearing when it should.

The only difference between the two projects is the version of the AppGameKit library and the Core.cpp and CoreForApp.h (or the lack thereof in v10811).

At the end of play of a field, the score display sprite is supposed to be in front of the play field with the score info and buttons to select next action.

In my v1076, it displays properly and hides all the other game stuff. In v10811, it does not display at all and the score info and buttons do appear in front of the game field.

I added code to inform me if the sprite did not exist before changing the depth, and that did not trigger.

I wish I could come up with a simple example that exhibits the same behavior.

EDIT: I also tried calling the function that raises the score page right after the menu is displayed, and the score sprite showed up fine.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 29th Apr 2013 21:22 Edited at: 29th Apr 2013 21:25
AL, do you set depths for ALL your sprites? Or only those you wish to influence? I believe one of the changes from v1076 was that you could no longer use negative depths and the default depth is now 10.

I had similar issues when moving to v108x so I ended up giving every single sprite a depth of 1000. I then use a lower value (as 0 is closer to the screen) for things like buttons etc. Once I had given everything a depth, my depth issues disappeared...

All you need to remember is 0 is closest to the screen, anything above this is farther away...

EDIT: Also wanted to mention that I do not use the SetSortCreated()...
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Apr 2013 21:40
Default is indeed 10, I recall that from the help files recently. I'm not aware of what using a negative number would do however. But my current game uses various depths on sprites and I haven't had any issues in v10811.

Can you write a small sample showing the issue and I can try running it from my PC.

"You're all wrong. You're all idiots." ~Fluffy Rabbit
haliop
User Banned
Posted: 29th Apr 2013 21:46
im also expriancing some depth problems... but i found a way to override it .. the problem is that it takes too much cpu/gpu time..

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Apr 2013 00:02
hmm, what happens if you set the hidden sprite depth at 0?
maybe u use the same depth for different groups?
is the sprte in screen,correct size/image etc.?
did you use setspritevisible?
...
exclude all
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th Apr 2013 00:53 Edited at: 30th Apr 2013 01:02
Quote: "AL, do you set depths for ALL your sprites?"

Yes, every single one.

Quote: "All you need to remember is 0 is closest to the screen"

Totally aware of this, which is why the different depths are used the way they are.

Quote: "Can you write a small sample showing the issue and I can try running it from my PC."

As I mentioned in my post, I wish I could. I tried the simplest possible one in Tier 1, and it didn't work. I will try doing the same in Tier 2 tomorrow.

Quote: "hmm, what happens if you set the hidden sprite depth at 0?"

I added code to deliberately set the spite at depth 0 and make sure it is visible. No difference.

Quote: "maybe u use the same depth for different groups?"

It shouldn't matter about group. Certainly, not if the depth is at zero and everything else is higher.

Quote: "is the sprte in screen,correct size/image etc.?"

Yes, the particular sprite is created and positioned and then the only thing ever done to it is change its depth. A test using the function that displays it was added after the main menu was created and the sprite displayed fine. But then wouldn't when it was supposed to.

Quote: "did you use setspritevisible?"

The sprites being manipulated are set visible when initially created and then left that way. The 'visibility' is set using depth. And I had a debug output showing the sprite visibility when it is detected as being at depth zero and it was always visible.

And it all works perfectly in v1076.

Note that I don't use SetSortCreated() and it doesn't apply because all of the sprites involved are at different depths.

I added a simple set of print statements to display

Quote: "but i found a way to override it"

What were your issues and how did you override it?

EDIT: I just adjusted my test to output size and location as well as visibility when the sprite in question is at depth zero. And, it says it should be there.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Apr 2013 10:41 Edited at: 30th Apr 2013 10:49
hmm, have the sprite variable have a valid number?
if you deletesprites, you set variables after to =0?

was the depth of 0 free for your test?
what happens if you clear sprite for sprite without your invisible?

did you change his depth more then once?

what happens if you create a new sprite with exact same parameters?

ancient wisdom: if you not find the reason after 3 days, its not your bug

maybe this is helpful:
if key=x then fuu=1
if fuu=1 then ShowMe(spr)

function ShowMe(spr)

experiments
do
print(spritestate)
//waitclick or something, exit
sync()
loop

endfunciton
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th Apr 2013 17:02
Quote: "hmm, have the sprite variable have a valid number?"

A constant value was used for the initial creation and stored in a class member, which was checked during the debugging to show that it had the correct value.

Quote: "if you deletesprites, you set variables after to =0?"

The sprite in question is not deleted until the app exits.

Quote: "was the depth of 0 free for your test?"

That was the only sprite ever assigned to that level (and only for testing).

Quote: "did you change his depth more then once?"

The first time its depth is changed from the background to the foreground is when it fails (only in v10811, it changes back and forth many times successfully in v1076).

Quote: "what happens if you create a new sprite with exact same parameters?"

As it happens, there are is one other background sprite of the same size and location (both overfill the display). Its depths are set 1 above for background and 1 below for foreground. That sprite gets changed between depths extremely often and has always displayed where it is supposed to.

I tried a test very similar to yours using two full screen backgrounds. It did not exhibit the same behavior. Probably because it is too simple. I am working in Tier 2 and will be trying my test sample code in that and will try to increase its complexity until I can get the problem to show up.

I am 99.9999% certain it is not my bug, since exactly the same code works in v1076 without error and the debugging session and output show that the sprite is supposedly displaying at the depth and location it is supposed to, but it is not visible.

And by 'exactly the same code', I mean the same physical files are being used in both projects via a shared directory. As originally posted, the only difference is in the AppGameKit libraries and files.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Apr 2013 17:27
yes, i believe what you said.
if i understand you correct, you made depth changes with the
sprite and it do not work now.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th Apr 2013 17:54
It worked in v1076, but not in v10811. That is the issue and the only thing (I think) holding me back from switching versions for my WIP.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Apr 2013 18:18 Edited at: 30th Apr 2013 18:23
i mean, i think the depth changes are the reason, you can
tell the agk dev. with the issue list at google.

what if you delete the sprite and make a new one with the depth you need as workaround with a function?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th Apr 2013 18:58
Quote: "tell the agk dev. with the issue list at google."

As one of the Community Testers (and, apparently, the only one paying any attention anymore), I would then have to flag it as a confirmed issue, but would not be able to produce the code needed (at this time) for them to test it.

That is why I am trying to get their attention in this forum on the issue.

Quote: "what if you delete the sprite and make a new one with the depth you need as workaround with a function?"

Since it works in one version and not the other, I don't plan on making any workaround for something that basic that should be working. I don't need any of the v108+ capability, yet. I was hoping to add Facebook bits, but will wait until any issues I and others have encountered in v108+ are fixed. Then I'll put out an update.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Apr 2013 20:15
i can't reproduce it.
(i don't like the v1076...)
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th Apr 2013 20:26
Since you don't have the same setup I am using, it is hard for someone to try and reproduce it.

For starters, it is being done in Tier 2.

Then there are a number of classes being used to do all the different things.

If anyone is going to be able to come up with a shareable project that demonstrates the issue, it will have to be me.

Simple demos likes this are not enough to demo the issue:


v1076 is pretty stable. The v108+ are not yet as stable.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Apr 2013 21:11
what happens at other devices or pc's (amd,nvidia)?
same problem?
did v1076 and v108 use the same opengl version?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th Apr 2013 22:03
Quote: "what happens at other devices or pc's (amd,nvidia)?"

Fails on other PC (laptop with totally different card) and Android devices (which is the first one I experienced it on).

Appears to work on iPad.

Quote: "did v1076 and v108 use the same opengl version?"

No.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 30th Apr 2013 22:05
In your situation, without seeing your code there's probably not much the rest of us can do other than speculate.

"You're all wrong. You're all idiots." ~Fluffy Rabbit
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th Apr 2013 22:12 Edited at: 30th Apr 2013 22:14
I am looking for one of the AppGameKit developers to help out here. I really don't expect anyone else to debug this for me.

And showing all the code is not practical (in excess of 80 .cpp and .h files).

I have started trying to get a demo that has only as much as needed to display the issue, if possible. So far, only having to include 7 extra files. But still not 'failing'.

EDIT: Phaelax, you might not have noticed, but I'm one of the forum members helping everybody else debug, fix, enhance, etc.. So, I was really aiming this post at the AppGameKit developers. But some of the questions posed have been useful in adding fuel to the fire indicating that it is an AppGameKit core issue and not a bug in my code.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 30th Apr 2013 22:14
I've alerted Paul to this issue AL. I am very busy too so haven't been around much but Paul is at least aware of this thread now.


this.mess = abs(sin(times#))
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th Apr 2013 22:21
Thank you, baxslash.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th Apr 2013 23:51
As you say a small example of the problem would be ideal, but is it possible for you to email me the project so I can step it through the debugger?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 1st May 2013 00:05
I can do that. And I will include instructions about which line to comment out so that the debugger doesn't mess you up in v10811.

GetResumed() returns 1 in v10811 when you trigger a debugger break and go to VS and then restart the app. And this causes the 'game paused' function to execute, which overlaps anything while in game play mode.

I just ran a correct test on iOS and the same issue with the same code exists there as well. My earlier report of it not appearing on iOS was incorrect, because I modified the wrong project to make it the '8' version.

I will get the two projects cleaned and figure out how to package them.

All of my Windows VS projects use shared directories for the source files, so it will get interesting packaging the two versions properly for you.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 1st May 2013 00:17
This sounds suspiciously like a problem introduced with the changes made to the Z-order stack which Paul commented on elsewhere. I assume there is an internal sort there somewhere, and it looks as though it's not correct.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 1st May 2013 00:39 Edited at: 1st May 2013 00:41
@JimHawkins, when the sprite is explicitly be set to depth 4, and everything else that should be hidden is at depth 900+, it should not be an internal sort on that depth that is the issue.

@Paul, my Outlook has just finished sending my email with the attachment (just under 10MB, sorry). Thank you for looking at this. Hopefully you won't spend too much time on it. EDIT: Hopefully you spot something really stupid that I didn't see. But, it works fine in v1076!?!

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 1st May 2013 02:57
Unfortunately I've yet to receive anything. Is there some other way you can get it to me, perhaps a temporary web host?
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st May 2013 03:47
Quote: "Phaelax, you might not have noticed, but I'm one of the forum members helping everybody else debug, fix, enhance, etc.. "

Doesn't mean you can't make a mistake or someone else might see something you missed.

And this may be nothing, but I'm just a little curious if this issue is on each platform or not. Are you able to test that? At the very least it might help narrow down the possibilities.

I'll setup a temporary ftp folder on my server if you guys need it to help transfer the files.

"You're all wrong. You're all idiots." ~Fluffy Rabbit
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st May 2013 09:13
let us know what it was
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 1st May 2013 17:30
Paul, I just found out this morning that your mail server rejected my email because "Our system detected an illegal attachment in your message". I think it is because my zip file included built exe's so that you could see the behavior before building it yourself.

I just resent my email with the exe's removed from the zip file.

Phaelax, I know I am totally capable of making mistakes. What I meant, was that I know that posting code helps (that is usually the request I make of others). But, given the 80+ files, posting code is not practical. And I did verify that the issue does, in fact, appear on all platforms (my first iOS test used the wrong project). And thank you for the offer of the ftp server. But we'll work it out.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 1st May 2013 19:31
Paul solved the problem.

Apparently the AppGameKit engines assumes anything of depth greater than 5000 (the sprite with the issue had been at 5001 initially) to be a 3D object and those are drawn first.

So, even though it had a higher depth, it was drawn before the rest of the objects on the page. And one of those was the other background image filling the entire display (and then some). Therefore, it hid the one it shouldn't have.

I changed my depth values to under 5000 and the sprite magically appeared.

Thanks greatly to Paul.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st May 2013 21:41
hmm, i use also a depth until 10000 initially and have no problems.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 1st May 2013 21:55
Can someone suggest they update the help files with this info for the next update.

How many different layers is your program using that you're going over 5000?

"You're all wrong. You're all idiots." ~Fluffy Rabbit
AgentSam
12
Years of Service
User Offline
Joined: 14th Mar 2012
Location: Virtual Space
Posted: 16th May 2013 04:26
Quote: "Apparently the AppGameKit engines assumes anything of depth greater than 5000 (the sprite with the issue had been at 5001 initially) to be a 3D object and those are drawn first."


This spells trouble for one of my existing AppGameKit 1076 projects, which has a huge number of sprites, many of which are at depths 5000 and greater. I have been considering upgrading to AppGameKit 108.11, but apparently things will just be broken. (Sigh.)

Do I feel annoyed? Yes. These internal engine changes are breaking older code and none of these new depth value limits are documented anywhere (http://www.appgamekit.com/documentation/Reference/Sprite/SetSpriteDepth.htm); except here on the forums -- but only sporadically as problems arise.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 16th May 2013 05:08
AgentSam, I sympathize. I had exactly one sprite with a depth over 5000 and it made me crazy until Paul looked at my project (I only went there after trying everything else).

This isn't a 'broken' thing in v108+. It is just an assumption that isn't mentioned in any of the new help, or anywhere else.

So it is sort of a bug. They didn't understand that some of us would use big ranges to separate sprite visibility (or hiddenness).

Yup, it annoys me that I spend days trying to track this down and it wasn't anything I did (according to available documentation).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
basjak
14
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 16th May 2013 14:54
use the command setglobal3ddepth(depth) to define the 3d world depth from sprties.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 16th May 2013 16:26
I am not using any 3D sprites or 3D anything. It is purely a 2D game. Which is why it was weird.

The SetGlobal3DDepth would have no affect in my app. The full screen sprite that was getting hidden was being hidden by another sprite that filled the screen. The idea is to have one or the other in front depending on what is going on. But, since the sprite was initially set to depth 5001, it was forever labeled a 3D sprite and then was displayed before the other sprites and hidden, even though its depth value was significantly lower (5 as opposed to the other one being 5000).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 16th May 2013 17:12
SetGlobal3DDepth would also solve the problem as it can move the 5000 barrier to wherever you want. Using it with a value of 10000 would make all sprites appear in front of it. It simply divides the sprites into those that must be drawn before 3D and those that must be drawn after.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 16th May 2013 17:21
Thank you, I missed that interpretation when reading the help for the command.

I will keep that in mind when I start mixing 2D and 3D.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th May 2013 01:27
I'm still trying to figure out why anyone would need separate depths from 1-5000, much less anything beyond that.

"You're all wrong. You're all idiots." ~Fluffy Rabbit
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 17th May 2013 05:05
The idea was to have a depth definitely below any others. I used a wide variety of depths to allow different ordering at different times.

The numbers 5000 and 5001 (or maybe it was 5005) were somewhat arbitrary as the two sprites were meant to be always in the background. One or the other would be visible. And the deep depth allowed a lot of room for other things to have groupings.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-05-06 21:14:44
Your offset time is: 2024-05-06 21:14:44