1
\$\begingroup\$

I want to make a isometric tile game in java, like a lot of strategy games out there. What is the best approach to loading the map for this game? Would it be better practice to load one single image for the whole map, or would it be better to make images for each tile and render each tile using a int array?

\$\endgroup\$
1
  • \$\begingroup\$ Its way easier to use a spritesheet. Then just draw a section of the sprite sheet based on an array. This way you only load one image for the entire tilemap. Look into programes like Tiled if you want to tool to build tilesheets. \$\endgroup\$
    – mobo
    Commented Aug 26, 2013 at 17:30

2 Answers 2

2
\$\begingroup\$

Its way easier to use a spritesheet. Then just draw a section of the sprite sheet based on an array. This way you only load one image for the entire tilemap. Look into programes like Tiled if you want to tool to build tilesheets.

Tiled.

\$\endgroup\$
1
\$\begingroup\$

If you use multiple textures, you will need to switch them in rendering. This process is expensive. You better use a single texture and use a index to represent each tile, with that index and tile size, you can calculate UV Textures to apply in your tile meshes.

\$\endgroup\$
5
  • \$\begingroup\$ So basicely make a spritesheet? \$\endgroup\$
    – anonymous
    Commented Aug 26, 2013 at 17:50
  • \$\begingroup\$ Yes, not just tiles. Based on your problem, you can even place all your sprites in one texture. Are you using OpenGL? \$\endgroup\$
    – felipe
    Commented Aug 26, 2013 at 18:12
  • \$\begingroup\$ I don't even know what OpenGL is until you pointed it out. I am using the Graphics2D object in java. Don't laugh.... \$\endgroup\$
    – anonymous
    Commented Aug 26, 2013 at 18:15
  • \$\begingroup\$ Ok, in that case I don't know how exactly it works. You should read details about how things are done to achieve the performance you need. \$\endgroup\$
    – felipe
    Commented Aug 26, 2013 at 18:17
  • \$\begingroup\$ You can use OpenGL in java using one of several libs for it. Like JOGL. \$\endgroup\$
    – felipe
    Commented Aug 26, 2013 at 20:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .