This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-07-23 23:27:15

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

stamping test results, anyone else know if these sound correct?

I am making a simple demo of a tile-based and am considering using stamping to do my game screen but I have some concerns as I have not used it a lot. For one thing I thought it worked faster than it seems to. My high hopes were to be able to stamp my tiles (32x32 pixels each, maybe 10x10 or 8x8 tiles total in the map) in one full layer (ground) followed by several partial layers (map tiles, items, and 'sprites').

So here is my question.. I think by cutting some corners and running in Turbo I can make it work BUT I've noticed some things just feel sketchy in Turbo mode, like costume changes. That worries me that some aspect(s) of script timing must not run well. Can anyone tell me a good reason NOT to use Turbo?

Now here is my observation. I tested 2 methods of stamping...
1) Using a single square sprite to Stamp, then Next Costume and Move repeated 64 times to make a checkerboard pattern

2) Using 4 sprites to do the same thing, with each sprite stamping 2 rows of the checkerboard instead of one sprite stamoping te whole thing.

To compare the methods I made each run 10 times using the timer to see which was faster. Hands down, the winner seems to be using 4 sprites. But I'm worried that Turbo mode is currently only good for simple or Penned projects.

Anybody got any comments on this please?


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#2 2010-07-23 23:32:50

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: stamping test results, anyone else know if these sound correct?

Yeah, turbo is know to skip scripts, best to go with many stamping sprites.

I would have 1 stamp sprite per row.

Last edited by archmage (2010-07-23 23:33:31)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#3 2010-07-23 23:33:20

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: stamping test results, anyone else know if these sound correct?

I have also noticed some problems with Turbo mode. I think it might be because, since it is going fast, If something is complicated, it won't evaluate it. This way, I guess it lets some things slip.


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#4 2010-07-24 11:21:51

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: stamping test results, anyone else know if these sound correct?

Hmmm. Makes me wonder what all you COULD do with the pen but I guess that is for another project lol. I will do some experimenting. Right now it looks like I will need to adjust some things so I can combine all layers into a single sweep.

I see what you mean archmage about using more sprites. The only downside is that each one would have to have a copy of the game's entire tileset to make the map scroll. Which of course works fine for my little demo but Scratchs project size limitations might be an issue for people making real games. And that would make my demo kinda silly.

I had decided to scroll instead of flipping maps but I guess we'll just see how it goes. Might have to be an offline only (aka too big) type game. Come to think of it, I have no idea what the project size limit is offline? Probably depends on your pc in the long run, or it should anyway.


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#5 2010-07-24 11:33:02

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: stamping test results, anyone else know if these sound correct?

Well, with the pen tool, there are a ton of things, just look at a few of my projects and test account projects.  But stamping is different, the best size for stamping is forty by forty, which is what I used for my project, so if you want it to work outside turbo speed the best, use 40x40, but in turbo speed, yes, errors will happen.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#6 2010-07-24 12:23:09

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: stamping test results, anyone else know if these sound correct?

Locomule wrote:

Hmmm. Makes me wonder what all you COULD do with the pen but I guess that is for another project lol. I will do some experimenting. Right now it looks like I will need to adjust some things so I can combine all layers into a single sweep.

I see what you mean archmage about using more sprites. The only downside is that each one would have to have a copy of the game's entire tileset to make the map scroll. Which of course works fine for my little demo but Scratchs project size limitations might be an issue for people making real games. And that would make my demo kinda silly.

I had decided to scroll instead of flipping maps but I guess we'll just see how it goes. Might have to be an offline only (aka too big) type game. Come to think of it, I have no idea what the project size limit is offline? Probably depends on your pc in the long run, or it should anyway.

Actually, if a sprite has the same costume as another sprite, it shares the original image, but scratch doesn't tell you this.

Look at this project http://scratch.mit.edu/projects/archtest/1210524

Each sprite has 43 kilobytes of costume data, and this sprite has been cloned 65 times. If each costume was separate then the project would be over 2.7 megabytes instead of a bit over 100 kilobytes.

Having it scroll is far more difficult because the tiles won't stamp fast enough forcing you to use sprites. Scratch doesn't tend to run 100+ sprites smoothly.


I tried to make something like this in Scratch a while ago http://scratch.mit.edu/projects/archtest/357238

Generally when I more more difficult things in Scratch I use code in actionscript to guide me so my scripts were supposed to be based on the popular tile game tutorials by tonypa http://www.tonypa.pri.ee/tbw/start.html

But for making tile maps my understanding isn't perfect so I couldn't find how to make it work in scratch. Maybe I will try again.

Last edited by archmage (2010-07-24 12:36:19)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#7 2010-07-24 16:58:22

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: stamping test results, anyone else know if these sound correct?

What I would do is have, rather than repeating, a set of blocks for each tile. For example, instead of:

When green flag clicked
stamp
change x by 10

do this:

when green flag clicked
stamp
change x by 10
stamp
change x by 10

Etcetera - that way, it should work nicely up to speed without turbo mode, which I've always found is a little bit iffy.

Offline

 

#8 2010-07-24 17:37:47

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: stamping test results, anyone else know if these sound correct?

Look at my advance wars game, it uses tiles.


You can now reach me on Twitter @johnnydean1_

Offline

 

Board footer