How taxing would a game map grid be to a web browser?

Posted by Vilx- on Stack Overflow See other posts from Stack Overflow or by Vilx-
Published on 2011-02-05T15:24:16Z Indexed on 2011/02/05 15:25 UTC
Read the original article Hit count: 208

Suppose we're making a strategy game (think Civilization) in a web browser. The game has a visible map portion - say 30x30 squares. Each square is 30x30px and has several overlaid images - the terrain, resources, units, roads, etc. The classical way of drawing this would be with a huge <table> where each cell would contain absolutely positioned images. It would probably be rendered in Javascript to reduce traffic. But it's still several thousand images and a huge table.

Can the browser take it? Will the performance not drop below any acceptable limits? Alternatively I could keep a pre-rendered map image with as many overlays as possible, but that would be more work, I think.

© Stack Overflow or respective owner

Related posts about Performance

Related posts about web