Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Rendering a large pen map?
- TheUltimatum
- Scratcher
1000+ posts
Rendering a large pen map?
Is there a way for me to efficiently render a huge pen racetrack in this game? So far I have the camera and everything else worked out but rendering a map efficiently is out of my realm. Any ideas?
- gtoal
- Scratcher
1000+ posts
Rendering a large pen map?
my suggestion would be to break it down into tiles (same as if it were using costumes) and store the drawing info for each tile in a 2D array.
depends on how big and complex the racetrack is I guess…
depends on how big and complex the racetrack is I guess…
- Bryan007
- Scratcher
100+ posts
Rendering a large pen map?
I agree my suggestion would be to break it down into tiles (same as if it were using costumes) and store the drawing info for each tile in a 2D array.
depends on how big and complex the racetrack is I guess…
quit w
i'll probably only check my scratch account every year or two. if you want to leave me a message, feel free to drop it in my comments, under my profile.
- footsocktoe
- Scratcher
1000+ posts
Rendering a large pen map?
this game? So far I have the camera and everything else worked out but rendering a map efficiently is out of my realm. Any ideas?Is there a way for me to efficiently render a huge pen racetrack in
There are two basic pen rendering techniques.
1. Draw individual features.
2. Scan lines, which has two subdivisions…
a. Bit map
b. Go to points
For 1. you would have to travel the map screen by screen. No smooth scrolling in other words, but it's by far the easier to do.
Use 2. for smooth scrolling, but more difficult to do. It happens to be something I've been working on. My method was to make lists and each item of the list represents one line of the scan using 2b above. In other words, the list contains the places where the pen either changes color or does a pen up or pen down. Note that this is a line by line rendering, so the real task is creating the list in the first place.
To create the list, I have done it both manually and automatically. For automatic, I play with a project that scans a black and white drawing line by line and creates a list of pen ups and pen downs. Such scanning projects are very slow which is why it is in black and white. Color would literally be impossible. As it is, it takes 360 x 480 x 1/30 seconds to scan a full screen B&W drawing and store it in a “go to points” list of 360 items. That equals 96 minutes, so I usually scan much smaller drawings.
I recommend you do a project with a map that is twice the stage size. if you can get that to work, then you can expand the size of the map.
Last edited by footsocktoe (July 25, 2017 10:03:17)
SHOOT THE SPACE MONSTERS! ….. A game everyone can play! Bright colors, bonky sounds!
THE 12 BALLS OF CRAZY AL ……. New scrolling adventure game!
- TheUltimatum
- Scratcher
1000+ posts
Rendering a large pen map?
Your second method seems quite elegant. But I wonder how you keep the game from rendering offscreen elements or lines to reduce lag?this game? So far I have the camera and everything else worked out but rendering a map efficiently is out of my realm. Any ideas?Is there a way for me to efficiently render a huge pen racetrack in
There are two basic pen rendering techniques.
1. Draw individual features.
2. Scan lines, which has two subdivisions…
a. Bit map
b. Go to points
For 1. you would have to travel the map screen by screen. No smooth scrolling in other words, but it's by far the easier to do.
Use 2. for smooth scrolling, but more difficult to do. It happens to be something I've been working on. My method was to make lists and each item of the list represents one line of the scan using 2b above. In other words, the list contains the places where the pen either changes color or does a pen up or pen down. Note that this is a line by line rendering, so the real task is creating the list in the first place.
To create the list, I have done it both manually and automatically. For automatic, I play with a project that scans a black and white drawing line by line and creates a list of pen ups and pen downs. Such scanning projects are very slow which is why it is in black and white. Color would literally be impossible. As it is, it takes 360 x 480 x 1/30 seconds to scan a full screen B&W drawing and store it in a “go to points” list of 360 items. That equals 96 minutes, so I usually scan much smaller drawings.
I recommend you do a project with a map that is twice the stage size. if you can get that to work, then you can expand the size of the map.
- TheUltimatum
- Scratcher
1000+ posts
Rendering a large pen map?
This was my original idea as I have the most experience with this method using stamping or clones. I tried it once but could never quite get it to render effeciently. my suggestion would be to break it down into tiles (same as if it were using costumes) and store the drawing info for each tile in a 2D array.
depends on how big and complex the racetrack is I guess…
- footsocktoe
- Scratcher
1000+ posts
Rendering a large pen map?
Your second method seems quite elegant. But I wonder how you keep the game from rendering offscreen elements or lines to reduce lag?this game? So far I have the camera and everything else worked out but rendering a map efficiently is out of my realm. Any ideas?Is there a way for me to efficiently render a huge pen racetrack in
There are two basic pen rendering techniques.
1. Draw individual features.
2. Scan lines, which has two subdivisions…
a. Bit map
b. Go to points
For 1. you would have to travel the map screen by screen. No smooth scrolling in other words, but it's by far the easier to do.
Use 2. for smooth scrolling, but more difficult to do. It happens to be something I've been working on. My method was to make lists and each item of the list represents one line of the scan using 2b above. In other words, the list contains the places where the pen either changes color or does a pen up or pen down. Note that this is a line by line rendering, so the real task is creating the list in the first place.
To create the list, I have done it both manually and automatically. For automatic, I play with a project that scans a black and white drawing line by line and creates a list of pen ups and pen downs. Such scanning projects are very slow which is why it is in black and white. Color would literally be impossible. As it is, it takes 360 x 480 x 1/30 seconds to scan a full screen B&W drawing and store it in a “go to points” list of 360 items. That equals 96 minutes, so I usually scan much smaller drawings.
I recommend you do a project with a map that is twice the stage size. if you can get that to work, then you can expand the size of the map.
That part is easy. You are only reading 360 items at a time (for a vertical scroll or 480 for a horizontal scroll) from the list. None of the off screen things render until they are on screen. Now my method is for a 1D scroll, either side to side or vertical. A 2D scroll would become exponentially more difficult with a pen, I think. I haven't even thought about it.
SHOOT THE SPACE MONSTERS! ….. A game everyone can play! Bright colors, bonky sounds!
THE 12 BALLS OF CRAZY AL ……. New scrolling adventure game!
- Discussion Forums
- » Help with Scripts
- » Rendering a large pen map?