Tile, sprite and level size, and FPS in a platformer


(B6ka) #1

Hi,

I am thinking of making a simple platformer in FP, and I would like to ask for an advice from experienced users on proper sprite, tile and level sizes. I have attached a skeleton of the game below (arrow keys move, x,z jump and shoot).

simplePlatformer.swf (56.7 KB)

Currently I have 16x32 sprites, 50x50 tiles, and 25x15 tiles (or 1250x750 pixels) in the level. The world is 640x480 pixels. The frame rates is fixed at 60 fps. i.e. I have something like this super(640, 480, 60,true) in engine constructor.

Here are the points I am interested:

  1. I am planning to have several levels of this size with about 10-15 enemies per level, (possibly parallax scrolling). Would this sprite and tile sizes work in FP or will the game be slow and laggy? Would it be better to reduce the sizes? What is more important level, tile or sprite sizes in this respect?
  2. The FP console indicates different values of FPS when I run the game (sometimes it is 40 sometimes 60) with no flash applications running in the background and release version of the project. Should I take the console numbers seriously or is there a problem with the console?
  3. The player flickers (or is kind of blurry) when the level is not scrolled and the player is still moving towards an edge. Is it possible to fix this?

I would really appreciate any suggestions in these directions. Thank you.

Best,

B6ka


(Stefan Langeder) #2
  1. FP will only render the part of the bitmap which is shown on the screen. Your level size should be okay.
  2. Did you build your game in “Release” mode? Also do not test the game with the debug player. I disable the console when testing the game. Players will never play it with the console. I do not know if it got significant overhead.
  3. I did not notice this.

(Ultima2876) #3
  1. You’ll have no performance problems with this. Those are relatively small levels :smile: Check out my game FlashPlok; http://www.kongregate.com/games/ultima2876/flashplok This was made years ago with an outdated version of FlashPunk and uses some heavy effects (displacement map, full screen blurs etc) as well as having much bigger sprites (lots of 32x32 blocks but also loads of images that are hundreds by hundreds of pixels). It didn’t have any serious performance issues.

  2. The console has some overhead but it’s not significant. The effect you’re seeing may be something to do with Vsyncing; it seems to happen a lot when testing on desktop for me too but if you test within the browser you may get different results (and generally a much smoother framerate). I wouldn’t worry too much about this. Also, memory usage is usually reported as being massively higher than it actually is.


(B6ka) #4

@stee Thanks, I will just probably not pay much attention to console and just concentrate on the feel of the game. The flicker is barely noticeable but it is there. Try walking towards the edge and pay attention at the moment when the screen stops scrolling.

@Ultima2876 Thanks, sounds encouraging; FlashPlok is awesome, love the effects and gameplay :), but it is not a platformer, and that may have different performance profile.