Disabling screen plates in an isometric engine

For a university project, I am working on a graphic roguelike (I know the contradiction in terms: P), which uses an isometric display. What I'm trying to understand is that since all the tiles look stupidly expensive and unnecessary, I want to find a relatively quick algorithm to determine which tiles should be drawn to fit into the NxMpx window, given that the XxYpx graphics tile .

I am not doing a smooth scroll for this, so this is not a problem. I also do not worry about being perfect - a small unnecessary draw is beautiful, I just do not want to draw a huge amount of unnecessary plates that will not appear in the game.

+3
source share
1 answer

You need to think about two concepts: screen space and world space. This is very important in 3D engines, but they apply to all but the simplest games. In an isometric engine, your world space is a 2-dimensional array of tiles.

, , , . , , , 45 . , , , , ( 8- , , !). , , , : -

  • , , O ( ) - , , .
  • , , + 1X -1Y ( -).
  • . O -1X .
  • 2 3, -1 X Y , 2, .

: -

  • , , . , , - , .
  • , , , .. , . , , "", ( ).
  • , iso, . , ( , ), , .

, , , , , .

+3

Source: https://habr.com/ru/post/1728372/


All Articles