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 / Need Animated Sprite Help for AGK Android App Test Failure ....

Author
Message
ProfVersaggi
12
Years of Service
User Offline
Joined: 6th Apr 2012
Location: Maastricht Netherlands / Chicago, USA
Posted: 26th Jan 2013 23:07
I have an animated sprite that works perfectly in the development environment AppGameKit on Windows Vista but does not work at all when tested using the AppGameKit Android App via the network download.

I created this nice animation of a cannon blast in Blender, ported it to GIMP and eventually created the attached PNG file that you can download and interrogate as an attachment. It was slightly modified in Photoshop however but that doesn't seem to be a problem.

In the AppGameKit App it appears as simply the raw display of the PNG image file and not the animated sprite at all.

If you need I can upload the project executable if that helps in testing ...

Any hints or direction would be greatly appreciated, many thanks in advance.

----
From the Desk of Prof Versaggi ...

Attachments

Login to view attachments
nickele
12
Years of Service
User Offline
Joined: 3rd Jul 2012
Location:
Posted: 26th Jan 2013 23:24
Have you tried lowering the sprite's width? It is greater than 2048 pixels.
TrezSoft
AGK Tool Maker
12
Years of Service
User Offline
Joined: 8th Nov 2012
Location: UK
Posted: 26th Jan 2013 23:29
Android devices in general do not work with images over 1024 x 1024. If you adjust the spritesheet into two or more rows it should work fine.
ProfVersaggi
12
Years of Service
User Offline
Joined: 6th Apr 2012
Location: Maastricht Netherlands / Chicago, USA
Posted: 26th Jan 2013 23:54
Awesome! You guys Rock! That worked like a charm, I reduced the file size to 1024, adjusted the SetSpriteAnimation() parameters to correlate to new file size and bingo!

Thank you gentlemen!



----
From the Desk of Prof Versaggi ...
TrezSoft
AGK Tool Maker
12
Years of Service
User Offline
Joined: 8th Nov 2012
Location: UK
Posted: 27th Jan 2013 00:15
I recommend that you try and keep all your Atlas / Sprite sheets to a power of 2, try to get the best match possible for the sheets to help reduce memory (for example I think the sheet you have will fit into a 512 x 512 sheet with room to spare) and do not exceed 1024 x 1024. This way you will have fewer problems when distributing your game onto different platforms.
ProfVersaggi
12
Years of Service
User Offline
Joined: 6th Apr 2012
Location: Maastricht Netherlands / Chicago, USA
Posted: 27th Jan 2013 13:07
The reason I sent to linear format (rectangle) instead of a square was that I had problems (from my own inexperience) with the squares making the animation play in the proper sequence. It just worked a bit more intuitively for me in the non-square format. The book wasn't all that helpful in this vein, so I'm in need of resources which help explain this matter a bit more clearly .... if you can suggest any I'd be greatly appreciative.

----
From the Desk of Prof Versaggi ...
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 27th Jan 2013 13:15
The shape of an image doesn't have to be square to be power of two. You could use a 1024x512 image for example.


this.mess = abs(sin(times#))
TrezSoft
AGK Tool Maker
12
Years of Service
User Offline
Joined: 8th Nov 2012
Location: UK
Posted: 27th Jan 2013 16:31
As baxslash states the size of the images inside the spriteSheet or Atlas does not matter the sprites can be any size ( and they do not need to be all the same size).

But it is my understanding that the spriteSheet or Atlas should be a power of 2 to help reduce memory.

From what baxslash has stated about I assume that AppGameKit can handle rectangle power of 2 sheets ? as soom engines I have worked with in the past on Android devices require a square power of 2 image.

So if you have an image 1024 x 512 it will get expanded in memory to 1024 x 1024. if you have an image of 1025 x 512 it will get expanded to 2048 x 2048.

If AppGameKit does support rectangle power of 2 imgaes then I assume the above samples would get expanded to 1024 x 512 (no change) and 2048 x 512 (lots of wasted space and over the 1024 limit)

As I said this is my understanding from working with other engines on Android devices.

@baxslash : So does AppGameKit support rectangle power of 2 images or do they just get expanded ?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 27th Jan 2013 16:36
Yes, AppGameKit supports rectangular power of two images. That's what I was trying to say. Any image size under a power of two ratio will be increased (on some devices) to the next size up IE. an image 513x512 will be increased to 1024x512.


this.mess = abs(sin(times#))
ProfVersaggi
12
Years of Service
User Offline
Joined: 6th Apr 2012
Location: Maastricht Netherlands / Chicago, USA
Posted: 29th Jan 2013 10:40
Perhaps you can decode the issue for me which prompted me to go with the rectangle shape instead of the square .... The sequence of PNG's I posed at the top were intended to be in particular order from left to right. I had (because of my inexperience) problems getting the square to execute in the proper order. I'm definitely missing something but I'm just not sure .... pls advise.

----
From the Desk of Prof Versaggi ...
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Jan 2013 15:45
The order that the files are used in a multi-row, multi-column layout is to start with the image in the upper left, then the ones to the right of it until the end of the row. Then it goes to the first image at the left in the second row, followed by the ones on that row. Repeat for all rows and then start back at the first.

And all of the images must be the same size.

In the SetSpriteAnimation command, the frame width and height are the size of the individual images and the count is the total number of images in the file (or less).

If you show the code you use to load the image, assign to the sprite and set the animation, maybe we can tell if there isn't something quite right with it.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
ProfVersaggi
12
Years of Service
User Offline
Joined: 6th Apr 2012
Location: Maastricht Netherlands / Chicago, USA
Posted: 29th Jan 2013 16:16
Thank you Ancient Lady - I wasn't quite sure about how AppGameKit processes the square files. All of my stuff used rectangle shapes now but I'll begin experimenting with the square sprite layouts and start converting them over. If I get stuck in the conversion process I'll post an example.

Thanks again for your help.

----
From the Desk of Prof Versaggi ...
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Jan 2013 17:39
Good luck and Happy Programming!

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
ProfVersaggi
12
Years of Service
User Offline
Joined: 6th Apr 2012
Location: Maastricht Netherlands / Chicago, USA
Posted: 4th Feb 2013 12:13
Just a follow up ... I followed the Advice from Ancient Lady and all is working properly now. Many thanks everyone!

----
From the Desk of Prof Versaggi ...

Login to post a reply

Server time is: 2024-11-24 08:43:44
Your offset time is: 2024-11-24 08:43:44