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 / particles behind background

Author
Message
Abiz
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 10th Jan 2013 00:58
I made a small test program for particles. But is doesn't work properly. The particles disappear behind the background/
The problem I have is somewhat simular to this:
http://code.google.com/p/agk/issues/detail?id=400

I narrowed it down to these 2 instructions:
SetSpriteDepth(sID, 0)
SetSpriteColor( sID, 255, 255, 255, 40)
Which is not what I want as the background picture alpha is too low for me.

I would expect that SetSpriteDepth(sID, 10000) would solve my problem but it doesn't.
If I don't use a background picture then everything works fine.

Advice anyone?




Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 10th Jan 2013 03:33
Hey Abiz

Add the command setparticlesdepth(pID,0) after you create your particles and that should fix it

-Cor
Abiz
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 10th Jan 2013 13:47
No, tried that. Doesn't work. Same effect.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 10th Jan 2013 16:47
You should definitely use something greater than zero for a background image. Zero means it is at the top most depth.

Do the particles display if you do not load and display the background?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Abiz
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 10th Jan 2013 17:07
@1
// SetSpriteDepth partly determines if particles are visible
// 10 and higher only flashes the particles on screen
SetSpriteDepth(sID, 0)

// alpha of SetSpriteColor must be lower than 255,
// otherwise picture covers(?) particles. So 20 is ok
SetSpriteColor( sID, 255, 255, 255, 20)

So the above gives the same result as when I remove the background completely.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 10th Jan 2013 17:16
Did you try commenting out the code that deletes the particles, just in case it is activating sooner than you think.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Abiz
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 10th Jan 2013 17:29
Done it, makes no difference.
And I know the particles are there as I display the text "still alive".

have you tried running my code?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 10th Jan 2013 17:34
Not yet.

Are the images used from one of the standard examples?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Abiz
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 10th Jan 2013 17:38
yes
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 10th Jan 2013 18:15 Edited at: 10th Jan 2013 18:33
I just ran your code, as you posted it, and got a burst of the particles and then they went away.

If I comment out 'SetParticlesMax ( pID, 450)', the particles stay displayed.

So, it basically behaves the way it is supposed to, based on your posted code.

I ran in v1076, v1082, v1083, v1084, v1085 and v1088 in Windows. And it worked using a Player in iOS for v1076 and v1085 and Android for v1076.

EDIT: It works on v1085 and v1088 Android Player as well.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Abiz
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 10th Jan 2013 18:34
Yes. That code works.
Now change this:
SetSpriteColor( sID, 255, 255, 255, 255)

Now I don't see the particles anymore.
But after approx. 7 secs I get GONE in top instead of 'still alive'. So I assume the particles were there, except I don't see them.
Abiz
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 10th Jan 2013 18:45
FYI: below is the current code with depth for particles and picture. With this code I see the particles flash a couple of times (4-5).
I'm working on Windows XP. Sending it to Epad with viewer 1.07 and 1.08 gives the same result


Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 10th Jan 2013 19:00 Edited at: 10th Jan 2013 19:04
EDIT: I posted the comment before I saw your updated code.

Does it work in Windows at all (without broadcasting)?

What display card do you have?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Marl
13
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 10th Jan 2013 19:06
@Abiz;
Running the code as is (in the first post), the "Gone" message does appear eventually.

Perhaps you should indicate what you expect it to do.

From what I can gather, you are telling it to generate 500 particles a second

..That each particle will live for 5.5 seconds;

..That each particle will be visible for 2 seconds;

..and that a maximum of 450 can be onscreen at once;


So it will have created 450 particles in the first 0.9 seconds and then reached the cap for the number on screen.

The first particle generated will be invisible after 2 seconds, but will exist for a further 3.5 seconds while invisible.

Since it cannot display more until these are gone, there is a lot of time when there appears to be none there.

Why have the extra invisible time? Set the life to be 2 seconds.
Abiz
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 10th Jan 2013 19:16
With these 2 instructions altered it works on the Epad iwth viewer 1.7 and 1.8


But not on Windows XP. However when I broadcast the flashing increases. Slower processing. It looks like XP shows the particles and then puts the background on top of it.

Windows XP: Core 2 quad CPU @ 2.33GHz
VDT adapter: ASUS EAH3450 Series
Abiz
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 10th Jan 2013 19:26
@Marl.
I was only testing particles. I.o.w. I was only trying to see what's possible when I ran into this problem. So the effect isn't finished. It's an adjusted remainder of the example of your website. Hence the ball1.jpg graphic.

In fact I had already decided to buy the particle sandbox. But that failed also because when I tried to pay I got the message: "we don't ship to the Netherlands". Pretty surprising for a download product.
I reported that problem too but am still waiting for an answer.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 10th Jan 2013 19:37
How old is your display card? It sounds like you are experiencing an incompatibility issue.

Try doing all the particle commands BEFORE doing the other sprite. This appears to fix the issue on some display cards (for no definable reason at all).



Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Abiz
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 10th Jan 2013 19:49
The card came with the computer. I guess some 3-5 year ago.

Your code had one mistake on line 26 (sID not defined yet). I moved it further. So below is the code. With the 2 secs adjustment from Marl.

Works fine on Epad (through broadcast) but only the occassional flash on Windows XP.


Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 10th Jan 2013 20:05
I did a quick copy, cut, paste and didn't actually test it.

Since you get a quick flash, something is happening.

If you comment out "SetParticlesMax ( pID, 450)" so that there isn't any automagic termination, does it work better?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Abiz
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 10th Jan 2013 22:28
It just flashes more. Make sense as it keeps on generating.
Still works fine on Epad.
I had a friend test it (through Dropbox), and he also says it works fine. So it looks like my XP is causing the problem.
Abiz
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 10th Jan 2013 23:27
Just installed dropbox and agk on my laptop with windows7 and it works perfectly. So it really looks Windows XP is the problem.
Thanks for the help.
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 10th Jan 2013 23:39
@Abiz - it's not so much XP as the graphic card, drivers and OpenGL system supported. If the computer's still viable, you could put a new display board in - but my experience lately is that it may just create new problems.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
Abiz
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 11th Jan 2013 23:41
Managed to install some new ATI drivers and now it works on XP.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 12th Jan 2013 18:06
Great!

It's frustrating trying to find problems like that. But so nice once the solution is found.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Abiz
12
Years of Service
User Offline
Joined: 14th Nov 2012
Location: Amsterdam
Posted: 12th Jan 2013 19:14
True

Login to post a reply

Server time is: 2024-11-24 05:54:37
Your offset time is: 2024-11-24 05:54:37