×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    16

    Tiles in 6600

    Hi,

    I'm making a tile based game for Nokia 6600 (MIDP 2.0) and have a question.
    Is there any "best" size for the tiles and sprites, or is 20x20 as good as 16x16, regarding performance?

    Thanks,
    Jon
    Last edited by zono666; 2004-01-13 at 14:19.

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    Using sizes that are a power of 2 (like 16 and not 20), is usually better since the code can be optimized to take advantage of it in many places by using bit shifting instead of division and multiplication.

    shmoove

  3. #3
    Registered User
    Join Date
    Nov 2003
    Posts
    16
    Thanks,

    Is this also true when using MIDP 2.0 tiledLayer Class?
    Hopefully it is also optimized in this way, what do you think?

    And how big can the differences be? The game runs around 18 fps with sprites and tiles not power of 2.
    Last edited by zono666; 2004-01-13 at 14:26.

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    I didn't implement the TiledLayer class so I can't say for sure. But it's possible. There can also be optimizations you'll find possible in your own code. In general it's always better to use powers of 2. Don't you like to do calculations better when your numbers of powers of 10?

    shmoove

  5. #5
    Registered User
    Join Date
    Nov 2003
    Posts
    16
    I also use MIDP 2.0 Sprite Class, so there really isn't any place to do my own optimization.

    Does anybody know if MIDP 2.0 Sprite and TiledLayer Classes perform better with images that have heights and lengths measured in powers of 2?

  6. #6
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    Why don't you test it for yourself. Implement a simple scene with tiles and sprites that are powers of 2 and use the system timer to check the performance. Then run the same example with tiles and sprites that are not powers of 2.
    But I will say it again: unless you have a good reason to make your tiles 20x20 there is no real reason not to use a power of 2. What exactly do you have to gain by using 20x20 tiles?

    I also use MIDP 2.0 Sprite Class, so there really isn't any place to do my own optimization.
    The game logic could have code that could be optimized this way.

    shmoove

Posting Permissions

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