I'm not really sure why everyone is trying to jump right into dynamic text screen copy/scrolling, when many decent sized maps will fit within the maximum size of a text screen. Just try putting your entire map on a text screen and using TOFS for now.For me, it's mainly to get some of the functionality I had back with PTC, as that was on the DS that had actual 2D hardware that handled that sort of feature. There are plenty of instances where having upwards of a 181x181 map array to fill the max size of a text screen (TS) is just not going to be enough, not to mention when features like wrap-around would be necessary. Anyways, I believe I've optimized my method enough. As it stands, I can fill a 35x16 character TS in as little as 60 microseconds (a 128x128 TS in as little as 727 microseconds) using either 1x or 2x COPY statements equivalent to the TS's character height. Source array can be of any character width/height (not restricted to power of 2), so long as the width is greater than or equal to the TS's width. The 128x128 test was done with a 2048x2048 character source array (roughly 32MB, each character is 2 entries, each entry is 4 bytes). Combined with proper restriction of TOFS positioning to the area of a TS's character size, I got smooth dynamic TS scrolling with plenty of room to do other things. Because it's copying, it also allows altering the source map array, and having it reflect on the TS itself.
SmileBASIC 4 Discussion「プチコン4」
I'm not really sure why everyone is trying to jump right into dynamic text screen copy/scrolling, when many decent sized maps will fit within the maximum size of a text screen. Just try putting your entire map on a text screen and using TOFS for now.With the game I’m making, the entire world is 8 screens (400 tiles) wide right now at 3DS resolution, and I kind of wanted a bit more exploration involved. At 128x128, that doesn’t exist. Though, I guess for now I can lower the size and finish the port, while also adding the features that I can add at that size such as bosses. I just hope I get a solution soon enough that I can release a full version soon.
How many tiles high is the world? The limit isn't fixed to each dimension, it's based on the width*height of the map. You could do 400x81 at maximum and remain within the limit if the world needs to be 400 tiles wide.I'm not really sure why everyone is trying to jump right into dynamic text screen copy/scrolling, when many decent sized maps will fit within the maximum size of a text screen. Just try putting your entire map on a text screen and using TOFS for now.With the game I’m making, the entire world is 8 screens (400 tiles) wide right now at 3DS resolution, and I kind of wanted a bit more exploration involved. At 128x128, that doesn’t exist. Though, I guess for now I can lower the size and finish the port, while also adding the features that I can add at that size such as bosses. I just hope I get a solution soon enough that I can release a full version soon.
Yeah but I also want to incorporate mining and exploring downward as well. I also came up with using the graphics screen to copy data, using GSAVE and GLOAD. I don’t know how that’ll work.How many tiles high is the world? The limit isn't fixed to each dimension, it's based on the width*height of the map. You could do 400x81 at maximum and remain within the limit if the world needs to be 400 tiles wide.I'm not really sure why everyone is trying to jump right into dynamic text screen copy/scrolling, when many decent sized maps will fit within the maximum size of a text screen. Just try putting your entire map on a text screen and using TOFS for now.With the game I’m making, the entire world is 8 screens (400 tiles) wide right now at 3DS resolution, and I kind of wanted a bit more exploration involved. At 128x128, that doesn’t exist. Though, I guess for now I can lower the size and finish the port, while also adding the features that I can add at that size such as bosses. I just hope I get a solution soon enough that I can release a full version soon.
Please stop using this threadSorry I’ll make a new one.
I came across something odd. It seems that the smaller resolution I set for XSCREEN, the more processing my code requires, even if it differs in microseconds. For instance, when I set XSCREEN to 800x480, my function that resides within PERFBEGIN/PERFEND takes roughly 60 microseconds to complete. But, when XSCREEN is set to 400x240, it takes nearly 90 microseconds to complete. Roughly a 50% increase in running time. Thing is, nothing within my function reads XSCREEN information. In fact, all my function does is copy data from one array to another. It doesn't touch any graphical functions at all or any other function besides COPY.
Wait, so because you can reference 2D arrays as if they were 1D, can you do the opposite? Like this:Don't think so, because there's no information on how many elements there are per channel. Finally got my tunnel demo published for folks wanting to look at it. It also contains my COPY2D functions.DIM ARR[4] ARR[1,1]=7
Wait, so because you can reference 2D arrays as if they were 1D, can you do the opposite? Like this:Nope, that wouldn't be possible. Consider this code:DIM ARR[4] ARR[1,1]=7
DIM ARR[6] ARR[1,1]=7How long is a row in ARR? If we assume it's two rows of three, then it's setting ARR[4]. If it's three rows of two, then it's setting ARR[3].
So I don’t know if anyone understands but I’m trying to make a bitmap sprite with data commands like this here is the sprite
Data00000
Data01110
Data01110
Data00000
The 0 is the background and the 1 is the sprite pixel but I’ve tried many things but I can’t figure out how to do this in sb4 and after I made the sprite I would like to run a graphic page showing the sprite and then I’d like to save it
Sprites exist on graphics layer 4.
You'll want to do something like..
GTarget 4
Then the data
For y=0 to 4
Read string (Make them into strings to make them easier to work with)
For x=0 to 4
If mid(string,x,1)=="1" then GPSet x,y,COL,#G_NORMAL
If mid(string,x,1)=="0" then GPSet x,y,0,#G_NORMAL
Next
Next
(Not exact code.. typing this on an iPad!! You'll have to improvise! Make use of F1 for help for all commands)
Then you'll want to define the sprite with SPDef
. Oh and don't forget to switch your GTarget back to whatever you had it at, prior to this.
Incidentally, the layer is 2048x2048 pixels in size (I think.. or is it 1024?.. hmmm), so. Yeah, you can go crazy, really, and have tons of sprites on there.
If you're saving the spritesheet, later, you might want to start by clearing the spritesheet first. That way your save doesn't include all the default sprites.
SaveG and LoadG can be used to load or save the entire Layer 4 sheet in one simple way.
Sprites exist on graphics layer 4. You'll want to do something like.. GTarget 4 Then the data For y=0 to 4 Read string (Make them into strings to make them easier to work with) For x=0 to 4 If mid(string,x,1)=="1" then GPSet x,y,COL,#G_NORMAL If mid(string,x,1)=="0" then GPSet x,y,0,#G_NORMAL Next Next (Not exact code.. typing this on an iPad!! You'll have to improvise! Make use of F1 for help for all commands) Then you'll want to define the sprite with SPDef . Oh and don't forget to switch your GTarget back to whatever you had it at, prior to this. Incidentally, the layer is 2048x2048 pixels in size (I think.. or is it 1024?.. hmmm), so. Yeah, you can go crazy, really, and have tons of sprites on there. If you're saving the spritesheet, later, you might want to start by clearing the spritesheet first. That way your save doesn't include all the default sprites. SaveG and LoadG can be used to load or save the entire Layer 4 sheet in one simple way.Can you give me an exact example I’m getting nowhere with string and data?