Posted: 3rd Sep 2011 21:11
Has anyone had any issues using the "recommended" method for animated sprites? I have used standard single images up to now which have been fine. I tried a quick test yesterday to try the single image with various animation frames method.
+ Code Snippet
setvirtualresolution(480,480)
LoadImage ( 1, "AGKlogo.png" )
CreateSprite ( 1,1)
SetSpriteAnimation ( 1, 256, 256, 16 )
setspritepositionbyoffset(1,getvirtualwidth()/2,getvirtualheight()/2)
PlaySprite ( 1,10,1)
do
 Sync()
loop


That should load in one image and then play the animation. Each frame is 256x256 in size, and the image is 1204x1024.
However it plays the frames all over the place and is far from correct. I do not see what I am doing wrong here.
Posted: 3rd Sep 2011 21:50
I have had no problem with the frames, but I am manually assigning frames to the sprites. I haven't tried the "Play" command yet.

But all the frames appear correctly as I assign them, so the "make" part works for me. I'll try playing some when I get home tonight.
Posted: 3rd Sep 2011 22:41
I have used the image joiner utility. Which produced this image.

It looks as if the frames go down and across in order. I would have expected it to go left then down, but I assume that AppGameKit uses this order internally.
Posted: 4th Sep 2011 2:37
There was a bug in the previous version with atlas textures that weren't power of 2 in size. This should be fixed with the latest version (1036), or you can work around it by making the atlas texture a power of 2.

The image joiner can place images in any order, it depends what it thinks provides the best packing method. The animation frames are read from left to right in rows. To use the image joiner to make suitable animation atlases therefore requires some hacking by first making each row as an 1024x256 atlas texture, then combining the 4 rows into the final 1024x1024 atlas texture. Might be able to make a better tool for this in future.
Posted: 4th Sep 2011 5:09
As of v1036 none of my volume commands are working.
They all play at default volume, and no matter what I alter it to (even to 0) it doesn't make any difference.

This applies for music and sound.
Posted: 5th Sep 2011 4:45
Hi Guys,

We have learned a lot from DBP and FPSC, and one of those lessons is that a forum thread to hold bugs can get very long and bugs can be missed very easily. For this reason, I have created a new AppGameKit bug issues board at:

http://code.google.com/p/agk/issues/list

I have started a bug (returning strings from functions via UDT) so you can see the kind of report we are looking for.

If anyone would like to transcribe any bug confirmed as reproducible from this thread to that board, we'll have the makings of a task list for the next build. Sorry if you have spent time posting here, though perhaps it gave others a chance to reproduce the bug and perhaps help with workarounds.

Thanks for the bug reports, and we look forward to ticking them off on the new Google Issues Board.
Posted: 5th Sep 2011 6:18
Hey Lee,

excellent idea! I have already used it to report something.

Is it ok to submit feature request there, too?

Also, I'd suggest to maybe lock this thread and add another note pointing to the new bug report system.

Cheers
Posted: 5th Sep 2011 13:02
Array Bug - I declare an array and then two multidimensional arrays then open a file and read the first array, then two multidimensional arrays all from a sequential file.

So when I read the file, I read a in a string that belongs to the first array. Then I read in a number that is an element in the first multidimensional array, then I read in a number that is an element in the second multidimensional array, all from the same file.

If I print out all of the information in a for next loop:
+ Code Snippet
for h = 1 to 6
    print (a$[h])
    for h1 = 1 to 10
        print (x[h,h1])
        print (y[h,h1])
    next h1
next h


I can see all of the elements in all arrays are present.

However I cannot access one element in either of the multidimensional arrays individually.

If I leave out or remark out the print(a$[h]):
+ Code Snippet
for h = 1 to 6
//    print (a$[h])
    for h1 = 1 to 10
        print (x[h,h1])
        print (y[h,h1])
    next h1
next h


Then all I get is zeros for the x[h,h1] and the y[h,h1].

and if I try to use any of the elements of either of the two multidimensional arrays individually I get a zero as in:

SetSpritePosition( 1, x[h,h1], y[h,h1]. The sprite ends up in the 0,0 position on the screen, always for every element of each of the arrays.

Unless I refer to the string in the standard array, in order, the multidimensional arrays have no return value.

Here is the data in my file, "pos.dat":

+ Code Snippet
Level 1
295
30
25
115
155
70
20
330
230
175
155
160
230
165
25
45
295
25
30
115
Level 2 
280
440
15
440
130
300
0
0
30
245
90
390
240
350
290
25
170
290
60
325
Level 3
290
455
230
360
50
330
170
290
140
445
230
230
35
200
10
445
270
340
85
380
Level 4
0
0
295
100
180
65
65
100
290
155
295
390
215
70
295
105
240
275
195
25
Level 5
0
0
5
435
55
260
210
70
290
100
35
265
235
345
265
455
290
15
45
300
Level 6
295
455
280
5
230
240
30
440
200
230
265
70
265
340
85
390
290
100
55
0


Here is some sample code that demonstrates the problem:

+ Code Snippet
dim homeX[20,10] as integer
dim homeY[20,10] as integer
dim level$[20]


SetDisplayAspect( 0.66 )
gosub _readData
do
for h = 1 to 6 rem should be 20
    rem print(level$[h])
     for h1 = 1 to 10
        print(homeX[h,h1])
        print (homeY[h,h1])
    next h1
next h

    sync()
loop

_readData:
OpenToRead( 1, "pos.dat" )
if FileIsOpen( 1 )
  for h = 1 to 6 rem should be 20
    level$[h] = readString(1)
     for h1 = 1 to 10
        x$ = ReadString( 1 )
        y$ = ReadString( 1 )
        homeX[h,h1] = val(x$)
        homeY[h,h1] = val(y$)
    next h1
  next h
endif
closeFile(1)
return


Notice that the "print(level$[h])" line is remmed out.
When your run the code with this line remmed out, the print statements return all zeros.

If you delete the "rem" on the front of the line, you get the values for each element of the arrays.

I have also attached the "pos.dat" file

I store the data as strings in the file. This way I can easily read and write the data with "notepad".

I then read in each value and convert it from a string to a value then assign it to an element of the array. I've done this a lot in DBPro and other development environments so this should not be causing the problem.

I've tried several things to work around the problem with no success. I tried taking the string out of the file "level1", etc. and I've tried separating the two sets of array data into separate files. None of this works. When I try to get the info from the array, it holds nothing.
Posted: 5th Sep 2011 13:05
I've found a slight error in the documentation.

In the docs for OpenToRead it states:

OpenToRead( ID, szFile )

integer OpenToRead( szFile )

are two methods for opening a file.

However, in Open to write, it only shows one of the methods:

integer OpenToWrite( szFile, append )

However both methods also work with OpenToWrite.
Posted: 5th Sep 2011 13:48
JRNTexas - see the post two above yours to find out where to report bugs from now on.

And, hey mods - maybe lock this so we have to post bugs in the new location?
Posted: 5th Sep 2011 14:13
Rich,

Thank you for the information.

- JRNTexas
Posted: 5th Sep 2011 14:14
@JRNTexas
You need to replace "readstring" with "readline" and it will work
"readstring" will read a string till it finds a null terminator (ASCII 0) which is not present in your data file, or reaches the end of the file. Therefore the entire pos.dat file is stored in level(1).
Posted: 5th Sep 2011 15:43
Thread Locked

This thread has been locked for the following reason: There is now a dedicated AppGameKit bug board: http://code.google.com/p/agk/issues/list

AUP Section 3.17 ...Moderators shall, at their discretion, determine what constitutes a violation of these terms, along with generally accepted netiquette standards, and can take action against those who violate these rules.

If you contributed to the reason for locking, you may now find yourself on moderation, or in extreme cases a ban.