#1✎ 186TarudahatQSP Contest 2 Contest ParticipantI participated in the second SmileBASIC Source QSP Contest!OSP Contest 3 Contest ParticipantI participated in the third SmileBASIC Source OSP Contest!Avatar TabooI didn't change my avatar for 180 daysWebsiteIs there a way?
http://sbapi.me/get/QRNPX3V3/SUPER_BASIC/code
so for every sprite I set I also set information
spset type,anumber
Array[anumber]=something
I can only set 510 sprites. (also 1 for cursor,1 for logo)
With matching info.
BC. The limite any advice?
Posted
#2✎ 186TarudahatQSP Contest 2 Contest ParticipantI participated in the second SmileBASIC Source QSP Contest!OSP Contest 3 Contest ParticipantI participated in the third SmileBASIC Source OSP Contest!Avatar TabooI didn't change my avatar for 180 daysWebsiteI suck at ingrish
Posted
#3✎ 524chickenDeep SleepHiddenWebsitepossible solution: set sprites as they come on screen (keep track of sprites offscreen and replace those with ones that come on screen)
Posted
#4✎ 188412Me21Syntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express Yourselflink should be http://sbapi.me/get/QRNPX3V3/TSUPER_BASIC/code
(internally, smilebasic stores filenames starting with T or B depending on if it's a TXT or DAT/GRP file)
Posted
#5✎ 1560randoIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteAvatar TabooI didn't change my avatar for 180 daysWebsiteIf you're using user-set variables for your sprites, I would recommend not even using SPSET (assuming you have x/y data arrays for your sprites) but using GCOPY to display them.
Posted
#6✎ 188412Me21Syntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express Yourself
If you're using user-set variables for your sprites, I would recommend not even using SPSET (assuming you have x/y data arrays for your sprites) but using GCOPY to display them.
#7✎ 1560randoIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteAvatar TabooI didn't change my avatar for 180 daysWebsite
If you're using user-set variables for your sprites, I would recommend not even using SPSET (assuming you have x/y data arrays for your sprites) but using GCOPY to display them.
If you're using user-set variables for your sprites, I would recommend not even using SPSET (assuming you have x/y data arrays for your sprites) but using GCOPY to display them.
Don't do this.
Why not?
GCOPY is too slow to call many/multiple times per frame, e.g. used for static objects only by calling once.
The SPSET system is incredibly fast (at least in comparison).
Posted
#9✎ 1131snail_Power UserQSP Contest 1 Contest ParticipantI participated in the first SmileBASIC Source QSP Contest!HelperReceived for being very helpful around SmileBASIC SourceAchievementsAmazing ContributorSomeone thinks I'm an awesome person who has done so much for the community!Achievements
If you're using user-set variables for your sprites, I would recommend not even using SPSET (assuming you have x/y data arrays for your sprites) but using GCOPY to display them.
Don't do this.
please never do this, your performance will go in the toilet
Posted
#10✎ 412MZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!Hobbies
If you're using user-set variables for your sprites, I would recommend not even using SPSET (assuming you have x/y data arrays for your sprites) but using GCOPY to display them.
Don't do this.
Why not?
GCOPY is too slow to call many/multiple times per frame, e.g. used for static objects only by calling once.
The SPSET system is incredibly fast (at least in comparison).
Can confirm. I once built a tile rendering system with GCOPY and entered a whole new dimension of lag.
Posted
#11✎ 407hakkeRNGHiddenEaster EggsQSP Contest 2 Contest ParticipantI participated in the second SmileBASIC Source QSP Contest!Expert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthI made the tests and calling GCOPY 512 times in a sprite-rendering fashion (16x16 blocks) gives an average 90-92ms overhead in every loop iteration where rendering is required. Of course a more elaborated system can be done to only re-render objects whose position/graphics have been modified but it just adds more code and complexity to your program.
Posted
Edited
by hakke
#12✎ 412MZ952Intermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteReadingI like to read books!Hobbies
I made the tests and calling GCOPY 512 times in a sprite-rendering fashion (16x16 blocks) gives an average 90-92ms overhead in every loop iteration where rendering is required. Of course a more elaborated system can be done to only re-render objects whose position/graphics have been modified but it just adds more code and complexity to your program.
That, piled on top of a physics engine and lighting engine and a and a ...
Using sprites is basically the only viable way to go about it, I think. Although, I'm recalling that when I had exported my engine to SB4, I was able to pull off 60 fps running like 60 x 40 on-screen tiles in graphics, no sprites, on top of the physics and lighting engine. ( SB4 is nuts, man.)
Posted
I was able to pull off 60 fps running like 60 x 40 on-screen tiles in graphics, no sprites, on top of the physics and lighting engine. ( SB4 is nuts, man.)
I think this has more to do with the more powerful Switch hardware than any optimization done in SB4.
Posted
#14✎ 186TarudahatQSP Contest 2 Contest ParticipantI participated in the second SmileBASIC Source QSP Contest!OSP Contest 3 Contest ParticipantI participated in the third SmileBASIC Source OSP Contest!Avatar TabooI didn't change my avatar for 180 daysWebsiteI think I'll do this:
1) look which blocks are offscreen ( bc. I remove sprites of the offscreen blocks. So those sprites are usable.)
2) If a block should be onscreen (I get this from the coords.) then use a available sprite.
3) Rewright code for scrolling, zooming and other sprite related stuff. (should not be to hard I just use a function to look for which sprites I need to move/scale etc.)
little thing that would still mess it up: having more then 510 blocks on screen. (hope no one does that bc. that will take about an hour to do manualy+ it would be pretty useless)
Posted
Edited
by Tarudahat
#15✎ 1560randoIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteAvatar TabooI didn't change my avatar for 180 daysWebsite
If you're using user-set variables for your sprites, I would recommend not even using SPSET (assuming you have x/y data arrays for your sprites) but using GCOPY to display them.
Don't do this.
Why not?
GCOPY is too slow to call many/multiple times per frame, e.g. used for static objects only by calling once.
The SPSET system is incredibly fast (at least in comparison).
#16✎ 567HTV04Forum LeaderHiddenAchievementsThird YearMy account is over 3 years oldWebsiteIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming Strength
Thank you for explaining instead of just telling me what not to do (sorry if I'm coming off as rude you've helped a ton 12me21)
Sorry if I'm getting the wrong idea of the tone of your comment, but if you don't want to sound rude, you could just say something like "Thanks for explaining this in detail, good to know." If you're going to take a dig at 12Me21 and then say you're not trying to sound rude and that he's helpful, you might as well say nothing rude at all.
Posted
Edited
by HTV04
#17✎ 1560randoIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteAvatar TabooI didn't change my avatar for 180 daysWebsite
Thank you for explaining instead of just telling me what not to do (sorry if I'm coming off as rude you've helped a ton 12me21)
Sorry if I'm getting the wrong idea of the tone of your comment, but if you don't want to sound rude, you could just say something like "Thanks for explaining this in detail, good to know." If you're going to take a dig at 12Me21 and then say you're not trying to sound rude and that he's helpful, you might as well say nothing rude at all.
Ok good to know srry
Posted
#18✎ 567HTV04Forum LeaderHiddenAchievementsThird YearMy account is over 3 years oldWebsiteIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming Strength
Ok good to know srry
It's fine, no worries. Again, sorry if I took the wrong tone of your comment. Don't take what I said the wrong way.
Posted
Edited
by HTV04
#19✎ 1560randoIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthThird YearMy account is over 3 years oldWebsiteAvatar TabooI didn't change my avatar for 180 daysWebsiteI actually tested it and using GCOPY on a 16x16 sprite from GRP4 to GRP0 takes a hundredth of a millisecond to copy the image. Code I used:
MS=MILLISEC
FOR I=0 TO 100
GCOPY 4,0,0,15,15,0,0,0
NEXT
MS=(MILLISEC-MS)/100
?MS
I'm pretty sure that this is reliable, but I may be wrong.
EDIT: It starts getting noticably worse in quality past 900 sprites with the same conditions above; it starts flickering at that point.
Speed also gets noticeably worse there.
EDIT2: Speed only actually gets noticeably worse past 1000. When you pass 900 it drops from 59 to 58 and 57. But at 1024 it drops to 54. As long as you have flicker protection, I think that you'll be fine until about there. (This is still only using positioning and not anything else.)
Posted
Edited
by rando
#20✎ 186TarudahatQSP Contest 2 Contest ParticipantI participated in the second SmileBASIC Source QSP Contest!OSP Contest 3 Contest ParticipantI participated in the third SmileBASIC Source OSP Contest!Avatar TabooI didn't change my avatar for 180 daysWebsite
I actually tested it and using GCOPY on a 16x16 sprite from GRP4 to GRP0 takes a hundredth of a millisecond to copy the image. Code I used:
MS=MILLISEC
FOR I=0 TO 100
GCOPY 4,0,0,15,15,0,0,0
NEXT
MS=(MILLISEC-MS)/100
?MS
I'm pretty sure that this is reliable, but I may be wrong.
EDIT: It starts getting noticably worse in quality past 900 sprites with the same conditions above; it starts flickering at that point.
Speed also gets noticeably worse there.
EDIT2: Speed only actually gets noticeably worse past 1000. When you pass 900 it drops from 59 to 58 and 57. But at 1024 it drops to 54. As long as you have flicker protection, I think that you'll be fine until about there. (This is still only using positioning and not anything else.)
Lag is no prob. Off-screen things will not be rendered. Thank you also what do you mean with flicker protection and how do I do it?
Posted