User Tag List

Results 1 to 8 of 8

Thread: Tile based graphics versus using full screen pictures. How is performance affected?

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Yima's Avatar
    Join Date
    Feb 2008
    Location
    Sweden
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Tile based graphics versus using full screen pictures. How is performance affected?

    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?

  2. #2
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Yima's Avatar
    Join Date
    Feb 2008
    Location
    Sweden
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    Images attachées Images attachées

  3. #3
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)
    BackStaged's Avatar
    Join Date
    Aug 2010
    Location
    France
    Posts
    693
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  4. #4
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)
    BackStaged's Avatar
    Join Date
    Aug 2010
    Location
    France
    Posts
    693
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    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.

  6. #6
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Yima's Avatar
    Join Date
    Feb 2008
    Location
    Sweden
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  7. #7
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  8. #8
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Yima's Avatar
    Join Date
    Feb 2008
    Location
    Sweden
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ryan View Post
    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

Similar Threads

  1. Performance versus Frame size.
    By diefox in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 20th July 2011, 06:10 PM
  2. Tile-based movement
    By Rabagast in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 12th December 2009, 01:54 PM
  3. Tile-Based Movement Scheme
    By SuperChiken in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 30th September 2009, 03:56 PM
  4. Tile based extension idea discussion
    By vortex2 in forum Extension Developers Lobby
    Replies: 13
    Last Post: 25th May 2007, 05:47 PM
  5. Tile-based level editor
    By Gabriel in forum File Archive
    Replies: 9
    Last Post: 7th March 2007, 08:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •