Sign in to follow this  
pink_daisy

Need help with 2-D top-down tile sizes

Recommended Posts

I've been working on a web-based 2-D tilemap using javascript and ajax. I have a scrolling background with objects rendered ontop. My game has dynamic terrain so i often need to send tile info from the server to the client. I'm trying to decide what size terrain tiles i should use. Terrain tile size will also influence the size of my game objects. On the one hand i would like to use smaller tiles (say 32x32) so i can fit more tiles onscreen. Smaller tiles require more bandwidth to be sent to the client when there are terrain changes (and movement) and thus larger tiles would minimize database/connection load (say 128x128). Also, browsers were never designed to work as game graphic engines and scroll speed degrades when using smaller tiles. The minimum browser resolution i'm targetting is 1024x768 so it needs to look good at that resolution and up to 1600x1200. Smaller than 32x32 will cause lots of server/bandwidth load so i don't want to go smaller than that, and anything larger than 128x128 will not give enough fidelity so i don't want to go over that. Thus in the 32x/64x/96x/128x what do you guys think would you suggest? Also, since i'm programming far away from the hardware there's no need for my textures to have 2^n power dimensions. I'm not an art person; would making the tiles say 100x instead of 96x make it easier on my artists or are there other reasons i would still want to use 2^n dimensions? Regards, ~PD

Share this post


Link to post
Share on other sites
You've also gotta consider what kind of scrolling is gonna be happening; is it predominantly side-scrolling, or 4-way? Do you have discreet sections no larger than 5 or 6 screens on a side, or a more continuous and massive area of travel?

If you're predominantly side-scrolling, you can batch in 'columns' at a time, and the tile size won't matter. If you're 4-way, try a block division to reduce the number of individual requests.

As far as graphic tile size, go with whatever works if you're not targetting hardware. Browsers and java-based engines don't care whatsoever about the size of an image for optimizations, so there's no point in trying.

Share this post


Link to post
Share on other sites
Quote:
Original post by Wyrframe
You've also gotta consider what kind of scrolling is gonna be happening; is it predominantly side-scrolling, or 4-way? Do you have discreet sections no larger than 5 or 6 screens on a side, or a more continuous and massive area of travel?

If you're predominantly side-scrolling, you can batch in 'columns' at a time, and the tile size won't matter. If you're 4-way, try a block division to reduce the number of individual requests.


Thanks for the reply. Originally i used the keyboard for 8-way scrolling, but the performance of my ajax calls degraded considerably from polling the keyboard via javascript. So i changed movement to a point and click affair and thus you can move in any arbitrary direction onscreen.

This is a seemless world with thousands of tiles. There are no segmented areas. When i make requests i'm only sending the bare minimum number of tiles to fill the area of the screen that a player has moved to (plus about 1-tile buffer to cut down on missing tiles (from a slow ajax request) when you are moving fast onscreen.

Quote:

As far as graphic tile size, go with whatever works if you're not targetting hardware. Browsers and java-based engines don't care whatsoever about the size of an image for optimizations, so there's no point in trying.


perfect, just the answer i was looking for.

regards,
~PD

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this