The Daily Click ::. Forums ::. Klik Coding Help ::. Strange fast loop problem
 

Post Reply  Post Oekaki 
 

Posted By Message

SculptureOfSoul



Registered
  14/03/2005
Points
  52
24th March, 2005 at 04:49:02 -

Hey guys, maybe someone can help me out with this...

I'm using 2 fastloops to handle a large 2 dimensional array of data...right now it's just drawing some generic tiles to the screen. My X loop triggers my Y loop, and the determining factor for the # of iterations on both loops is Screen Width/Tile Width, and Screen Height/Tile Height, for # of iterations on X loop and Y loop, respectively.

On paper the calculations work out. The counters are even showing the right numbers. But for some reason when the tiles get small, which raises the number of iterations on the loop, the X loop will not be called the necessary number of times.
For instance if the screen is 50x50 tiles wide (a total of 2500 loop iterations), the X loop appears to only be called about 25 times. The Y loop is called the necessary number of times, as is evidenced by the fact that the tiles are drawn from the top of the screen to the bottom of the screen. But they are only drawing half way across the screen horizontally.

I tried manually adjusting the # of loop iterations to ridiculously high numbers, but it still won't draw all the tiles to the screen. The strange thing is I know that the loop IS going through all of the extra iterations, because it took about 30 seconds to finish the draw routine once I jacked the # of loop iterations.

Any ideas whatsoever? This is going to really hamper my tile engine if I can't find a work-around.

~SoS

 
Current Project: Undertaking the design of my mammoth RPG. Utilizing all of the knowledge gained while coding the now defunct "Shadow Reign".

SculptureOfSoul



Registered
  14/03/2005
Points
  52
24th March, 2005 at 06:07:44 -

After dinking around for a bit longer, I'm beginning to wonder if it's not the INI's fault. Each tile is stored in an INI (there is a reason I'm not using an array...but I may be switching to a hybrid system with ini's and arrays, soon). Anyhow, is there a certain "read limit" on INI's? If so, I'm assuming that is what I'm hitting because as I said, I know that the fastloop object is running the loops. It's just that no more data is coming in.

Can anyone tell me how many orders of degree faster it is to load data from an array during a fastloop. The built in array does store everything in RAM unless saved, correct?



 
Current Project: Undertaking the design of my mammoth RPG. Utilizing all of the knowledge gained while coding the now defunct "Shadow Reign".

SculptureOfSoul



Registered
  14/03/2005
Points
  52
24th March, 2005 at 06:58:10 -

Well, I switched my design over to incorporate an array, no INI lookup whatsoever, and the problem is still present. I'm starting to wonder if there is a limit to the amount of information that any "object" can receive during a fastloop? The object in question is getting repositioned and then pasted into the background up to 5000 times or more on the extreme settings. Er, I should have said "should be getting repositioned and pasted...", because it's not working.

Hmmm...

 
Current Project: Undertaking the design of my mammoth RPG. Utilizing all of the knowledge gained while coding the now defunct "Shadow Reign".

Destroyer (CrobaSoft)



Registered
  10/10/2004
Points
  1106
24th March, 2005 at 07:13:37 -

you can only paste around 600 objects in the background during one loop.

Image Edited by the Author.

 
Visit www.crobasoft.com or you're a Noob.

SculptureOfSoul



Registered
  14/03/2005
Points
  52
24th March, 2005 at 08:13:04 -

Awesome, and thanks!!!! I'll try just starting a second loop if the first is going to call for more than 600 iterations. Hopefully this will work!

 
Current Project: Undertaking the design of my mammoth RPG. Utilizing all of the knowledge gained while coding the now defunct "Shadow Reign".

SculptureOfSoul



Registered
  14/03/2005
Points
  52
24th March, 2005 at 10:03:08 -

Hopefully someone else can chime in with a similar story to help me feel better. Turns out I just forgot to change the object limit.

I hate wasting hours trying to code around something that is so simple. Should have been obvious...
Bah

~SoS

 
Current Project: Undertaking the design of my mammoth RPG. Utilizing all of the knowledge gained while coding the now defunct "Shadow Reign".

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
24th March, 2005 at 16:48:13 -

There is a limit to the amount of data an INI can hold. I can't remember if it's around 32kb or around 64kb.

Image Edited by the Author.

 
http://www.klik-me.com
   

Post Reply



 



Advertisement

Worth A Click