DSLua Community
Welcome,
Guest
. Please
login
or
register
.
February 05, 2012, 08:38:20 AM
1371
Posts in
262
Topics by
33109
Members
Latest Member:
Limewire Download
Home
Help
Search
Login
Register
DSLua Community
|
General DS Programming Chats
|
Code Hashing
|
maximum number of sprites to load?
« previous
next »
Pages:
[
1
]
Print
Author
Topic: maximum number of sprites to load? (Read 3639 times)
angor
Waxing Crescent
Posts: 45
maximum number of sprites to load?
«
on:
June 23, 2006, 01:30:06 PM »
I have created a FrameStrip containing font chars (26) in order to use it in the game. The idea was to create writen text on a graphical screen by using sprites (1 sprite = 1 character) (since i do not use text screens, I need a way to output text messages)
Problem
: when i try to load the FrameStrip with DSLua, it crashes (in Dualis, i have lost my DS
so no test in real hardware). I did some tests and i can load up to 18 frames in one strip. If i try to load more, Dualis just crashes (=no keyboard response and program crash after some seconds). Then I wonder the cause of this is:
1) Frame problem: Is there a maximum number of frames DSLua can load at a time with ":LoadBin"?
2) Sprite problem: What is the maximum number of sprites DSLua can manage in total?
3) Memory problem: Assuming DSlua crashes due to lack of available memory -> how can i know how much free memory is left?
Also i have a question regarding FrameStrips. Following Waruwaru's tutorial examples i have succeed loading vertical framestrips (width = 1 sprite, heigh = n sprites). When i tried another formats (width = n sprites, heigh = m sprites) it either did not load or it did but the information was corrupted. Do the framestrips have to always be vertical?
Can you help me with these questions?
Thanks
Angor
Logged
daltonlaffs
First Quarter
Posts: 189
Freaking Insane
Re: maximum number of sprites to load?
«
Reply #1 on:
June 23, 2006, 06:52:14 PM »
Well, angor, I'm not exactly sure about this matter, but I do know I have successfully placed 12 64*64 sprites in one framestrip with no problems. However, when I put them on the TOP screen, Dualis does the same thing you're talking about... hrm. Works on bottom but not on top. Cruddy
Try the same strip on the bottom screen and see if there is a different result
Logged
Code:
-- Bored? Read code line below.
-- Bored? Read code line above.
^^ That works, I SWEAR! ^^
angor
Waxing Crescent
Posts: 45
Re: maximum number of sprites to load?
«
Reply #2 on:
June 24, 2006, 06:30:52 PM »
Quote from: daltonlaffs on June 23, 2006, 06:52:14 PM
Well, angor, I'm not exactly sure about this matter, but I do know I have successfully placed 12 64*64 sprites in one framestrip with no problems. However, when I put them on the TOP screen, Dualis does the same thing you're talking about... hrm. Works on bottom but not on top. Cruddy
Try the same strip on the bottom screen and see if there is a different result
In fact I tried in the bottom screen of the main menu of the snowball game where there were already several sprites (to be accurate, 34 of different sizes). On top of that I tried to create a framestrip from the font bitmap and it crashed. Notice the crash happens during the framestrip loading even if you do not try to create the sprites. Is because of this i think about a DSLua limitation or a memory fault.
Logged
daltonlaffs
First Quarter
Posts: 189
Freaking Insane
Re: maximum number of sprites to load?
«
Reply #3 on:
June 28, 2006, 04:15:53 PM »
IMPORTANT UPDATE FROM DALTONLAFFS'S PC:
Hey angor! I found a strange discovery about the top screen. Run the .nds file in the attached zip and run 001V2.lua. You will notice that I have two 64*64 pics, one on the top screen (my logo) and the bottom screen (my main menu handler). This runs without crashing. However, when I add JUST ONE MORE sprite to the top screen, CRASH it goes! Weird. I think it's just a flaw in DSLua. Also, just to prove it isn't crashified, click on Exit Game on the bottom screen to exit. Poof, it exits, which is proof it didnt FREEZEIFY.
L00kie.zip
(252.96 KB - downloaded 207 times.)
Logged
Code:
-- Bored? Read code line below.
-- Bored? Read code line above.
^^ That works, I SWEAR! ^^
angor
Waxing Crescent
Posts: 45
Re: maximum number of sprites to load?
«
Reply #4 on:
July 12, 2006, 07:22:04 AM »
I have done more tests for the new game I am preparing and the problem continues / I do not find a clean workaround.
Example:
- player character is 32x64 (= 2 sprites of 32x32)
- player can move in 8 directions --> built as a framestrip of 16 frames = 2 sprites x 8 positions --> ok
- if I try to expand it to have a simple walk animation (=3 steps) --> 3 x 16 frames --> Dualis chrash!!!
So, the only (dirty) workaround i can think of is to use diferent sprites for each character animation step.
The problem I see coming in the horizont is to reach the maximum number of sprites in screen quite soon...
Angor
Logged
daltonlaffs
First Quarter
Posts: 189
Freaking Insane
Re: maximum number of sprites to load?
«
Reply #5 on:
July 12, 2006, 08:19:07 AM »
Well angor, first of all, just try putting all them sprites into 32*64 itself. I put 17 hero sprites into a framestrip for 3 heros so far on RPG Maker DS, and no crashes when THEY ARE ALL ANIMATED AT THE SAME TIME THE WHOLE WAY THROUGH THE STRIP AND BACK!
Then, I dug deeper. I made my first map demo system. This WAS before my hero could move, buuuut... I PUT OVER 60 FREAKIN SPRITES IN THAT SCREEN WITH NO CRASHES!!! Just for you yeh lucky dude, I attached the demo file to this post. Not only so many sprites in the bottom screen, but I put MORE sprites in the top! WOOHOO!
Also, I know that I had many crashes due to images during the creation of this demo, but GUESS WHAT? IT WAS ALL TYPOS! Remember that Dualis is CaSe SeNsItIvE! After fixing all typos, it worked! Consult the included Instructions.txt for instructions. I am also not using .lua no more. Now it's .rpg that's all the rage!
Choose a hero and l00k! Look! LOOOOOOOOOOK!
Demo001.zip
(464.42 KB - downloaded 201 times.)
Logged
Code:
-- Bored? Read code line below.
-- Bored? Read code line above.
^^ That works, I SWEAR! ^^
angor
Waxing Crescent
Posts: 45
Re: maximum number of sprites to load?
«
Reply #6 on:
July 12, 2006, 09:00:18 AM »
Quote from: daltonlaffs on July 12, 2006, 08:19:07 AM
Well angor, first of all, just try putting all them sprites into 32*64 itself.
Thanks for the suggestion. This helps to fix the number of sprites required.
However the problem is still present. Why? You use 4 positions (N,S,W,E) x 3 animation steps (left leg advanced, legs together, right leg advanced) = 12 < 16 --> So you can put the walking animation in a strip.If you try to add another animation to the strip (say, jumping, fighting or anything) it will require more frames so your strips will have more than 16 frames and according to my experience, Dualis will crash.
In my case I plan to do a more-realistic/less-manga animation. Therefore I have 8 positions (N,NE,E,SE,S,SW,W,NW). If I use, as you, 3 animation steps --> 3 x 8 = 24 > 16 --> Dualis crash. Even worse, I plan to have diferent animations (say, jumping, fighting or anything) that will require even more frames. Of course I could use different framestripes, but each consumes 1 palette and there are only 16 available!!!
Anyway, since you mention you have put "17 hero sprites into a framestrip for 3 heros so far",
can you post the framestrip you use here in the forum in a readable format (bmp/gif)?
I might be missing something...
Angor
PS: Waruwaru: could you please confirm what is the limit in DSLUA for the number of sprites / palette / frames in a framestrip?
Logged
daltonlaffs
First Quarter
Posts: 189
Freaking Insane
Re: maximum number of sprites to load?
«
Reply #7 on:
July 12, 2006, 01:57:20 PM »
Sure, Angor. Here's da framestrips. I included all 3!
Make sure ALL the images you are using have an X and Y of 16, 32, or 64, or any combination of the three. Anything higher or lower will crash Dualis. That means no 8, 24, 96, 128, etc.
They all include 17 frames. 4 for walking in each direction and one for death.
Hero1.bmp
(35.05 KB, 32x1088 - viewed 428 times.)
Hero2.bmp
(35.05 KB, 32x1088 - viewed 384 times.)
Hero3.bmp
(35.05 KB, 32x1088 - viewed 380 times.)
Logged
Code:
-- Bored? Read code line below.
-- Bored? Read code line above.
^^ That works, I SWEAR! ^^
angor
Waxing Crescent
Posts: 45
Re: maximum number of sprites to load?
«
Reply #8 on:
July 12, 2006, 03:59:51 PM »
Quote from: daltonlaffs on July 12, 2006, 01:57:20 PM
Sure, Angor. Here's da framestrips. I included all 3!
Make sure ALL the images you are using have an X and Y of 16, 32, or 64, or any combination of the three. Anything higher or lower will crash Dualis. That means no 8, 24, 96, 128, etc.
They all include 17 frames. 4 for walking in each direction and one for death.
Thanks for the files and the suggestions about image sizes. That clarifies me what you do in your program but unfortunately it does not solve my problem (the same you will face shortly as soon as you enlarge your programa).
According to my experience (in Dualis) with DSLua:
- maximum 17 frames per framestrip
- maximum 16 palettes
- you can create as many sprites as you want (=clones) based on one loaded framestrip+palete (=model)
Problems given that:
1) What do you do if you want to add extra animations to the game character (say fight for your hero) to the walking one? You can neither go above 17 frames per strip nor load more than 16 files (=palettes)
2) Talking about palettes: you use three heros (hero file = graphs+palette) in your demo. Since only 16 are allowed, do you
only
have 16 different heroes/monsters/sprites in your program?
Logged
daltonlaffs
First Quarter
Posts: 189
Freaking Insane
Re: maximum number of sprites to load?
«
Reply #9 on:
July 13, 2006, 09:46:05 AM »
AHAHAHAHAHAH! Well, Angor, normally, I would only have 16 things due to the palette limit. However, THERE IS A WAY TO GET EVEN MORE PALETTES!!! First of all, you can simply combine as many images as you can with the same size (ex. seventeen 64*64 images in one framestrip) AND after you are done using something (Like let's say you aren't using the main menu again) you can OVERWRITE ITS PALETTE SPACE WITH ANOTHER ONE! For example, if the main menu's palette was palette 0, and you weren't ever using it again, you could simply make another palette as palette 0, in its place! Like:
MAINMENUPAL = 0
.....(random text whatever that makes Main Menu appear)
MainMenu:Free()
MainMenuFrames:FreeAll()
MainMenuFrames = nil
-- now it's nil soo!
SOMETHINGELSEPAL = 0 <-- see?
It works! Just make sure everything is free before you try it. It works!
BTW, I upgraded to Mozilla Firefox! Its much better!
Logged
Code:
-- Bored? Read code line below.
-- Bored? Read code line above.
^^ That works, I SWEAR! ^^
Pages:
[
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
DSLua - Best scripting language for Nintendo DS
-----------------------------
=> News and Announcements
=> Examples/Tutorials
=> Home-brew/Hacks/Games/Projects
=> Hardware and Equipments
=> Need Help?
=> Bugs & Suggestions
-----------------------------
General DS Programming Chats
-----------------------------
=> Code Hashing
=> Chat Room
=> Test Area
Powered by SMF 1.1 RC2
|
SMF © 2001-2005, Lewis Media