I am doing a SNES style platformer, and right now I use tile based graphics. Each tile is a 16x16 pixel png that uses a transparent color (no alpha channel). This works quite well, but I would like my backgrounds to be more varied and dynamic, so I wonder if it's a plausible idea to paint 256x244 sized background images, using transparent background obstacles to handle collisions?
Tile based graphics versus using full screen pictures. How is performance affected?
Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.
A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.
Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!
Clickteam.
A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.
Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!
Clickteam.
-
-
I also wonder if it's best to use one, screen sized image that is using one color only (+ transparency color) to use as a collision mask, or if it's better to fill the entire screen with 16x16 tiles to use a collision blocks.
Edit: I added a picture to show the different solutions.
-
I tend to prefer use Collision Mask and full background image instead Tiles.. Why?
Because with Tiles work is more intensive.
(need to dev ArrayMap)In the other side, in your case I think Tile-based must be the better solution.. Why?
Because with Tiles you can easily move one object (tile) in other place.. This thing is less easily doable within a Full background and collision mask where you must redraw the image!In your case then, by elimination: Tile-Based.
-
Ah.. And for performance, Tile based are (from I know) more CPU intensive since the event MUST check and parse all tile based on an ArrayMap or whatelse.
-
Actually, I'd say that tile-based is the best option there is. Just make sure you handle it with the Tile map object, which is perhaps the best way to handle this in the first place. It even lets you use a separate layer (in the object (the object supports multiple tile layers), not in MMF2) for collision detection, which is one of the things you wanted.
-
Thanks for the answers!
In the solution I am testing right now I save every "room" in a different animation frame of an active object called "Collision masks". When the game begins, I create the active object at (0,0), change it's animation frame to the first frame, paste it into the background as an obstacle and then delete the object (thus freeing memory, I suppose?). When the character enters a new "room", I create the "Collision masks" object again, change it's frame to the room I just entered, paste it as an obstacle and delete it again.
I don't know if this method will end up being bad for performance, but it has some serious advantages over a tile based approach when it comes to workflow efficiency. For example, I don't need to load and store tiles with a level editor. All level editing is done directly in Photoshop, where I can freely draw any shapes I want. The drawing of a new room is handled with only one event, in which the frame size is set to the height and width of the newly loaded picture (allowing for scrolling rooms). Also, drawing graphics over the collision mask can be done the same way, using a "Room graphic" active object, in the same event.
I'll make sure to take a look at the Tile map object, though, as I want to explore as many options as possible before going to far with the project
-
Using tiles will be more memory friendly, as all frames of an object are loaded into memory at the start. If there's a lot of repetition in your animation frames (the same tiles over and over again)... then MMF2 is loading it into memory twice... or 10x if you have 10 rooms, 100x if you have 100 rooms.
If memory is not a big concern, such as if you're not planning a mobile release, then I think you'll get away with it because of 256x244 is quite small. I've loaded about 100 frames at 320x240 in an active object and got good speeds in normal and flash... However if you wanted to do a highdef game (such as 960x640), I'd say this is a terrible idea. 100 rooms is basically the same as opening 100 high-def photos on your desktop.
-
Using tiles will be more memory friendly, as all frames of an object are loaded into memory at the start. If there's a lot of repetition in your animation frames (the same tiles over and over again)... then MMF2 is loading it into memory twice... or 10x if you have 10 rooms, 100x if you have 100 rooms.
If memory is not a big concern, such as if you're not planning a mobile release, then I think you'll get away with it because of 256x244 is quite small. I've loaded about 100 frames at 320x240 in an active object and got good speeds in normal and flash... However if you wanted to do a highdef game (such as 960x640), I'd say this is a terrible idea. 100 rooms is basically the same as opening 100 high-def photos on your desktop.
You raise valid points. I made a check for the collision mask, though, and surprisingly enough, a 1920x1080 png that was two colors only ended up being a bit less than 15 kB in size, so unless MMF2 somehow converts the image into something much less memory friendly, I think it's safe to store masks of any size in frames.
Room graphics, however, would of course require a lot more planning, since a high res photo png of the same size will end up being several MB in size.
With limited amount of colors, and the size I am working with, each room ends up taking up roughly 50 kB. So, with 100 rooms, that's 5MB to load as the game starts, which I suppose should pose no big performance issues.
Edit: I hope I am not sounding too dismissive when it comes to the tile based solution. It's just that they seem to require a lot more time to work with than the method I am currently testing. Since I am a lone developer I feel that's it's acceptable to sacrifice some (but not to much) performance if it means I can spend more time on drawing graphics, making music and all the other stuff that's needed
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!