Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [C#] TileMap renderer  (Read 16517 times)

0 Members and 1 Guest are viewing this topic.

shackra

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
    • http://swt.encyclomundi.org
Re: [C#] TileMap renderer
« Reply #15 on: January 29, 2013, 06:51:42 am »
Try this: http://pastebin.com/SrBE69EC

Krazt, May can you add more commentaries to your source code? I got lost at some parts of it! :(

GNU User
Python programmer
Blog

krzat

  • Full Member
  • ***
  • Posts: 107
    • View Profile
Re: [C#] TileMap renderer
« Reply #16 on: January 29, 2013, 11:21:02 am »
Done.

If you want this to work in your game, you have to write custom provider function.
SFML.Utils - useful extensions for SFML.Net

Turbine

  • Full Member
  • ***
  • Posts: 102
    • View Profile
Re: [C#] TileMap renderer
« Reply #17 on: June 05, 2013, 09:58:56 am »
Hmm, maybe you don't realize how my implementation works.

I don't update everything every time view changes(btw. you should know that it is fast enough for most games). I update only rows or columns that appeared on the screen since last update. I would say, that it is even faster than static array,  cause I draw only tiles that are visible and with only one draw call. Your approach would draw whole chunk even if we see only one tile from it.

Sorry for resurrecting this thread, this method is of particular interest to me. I've looked around to find what this technique is called or any algorithms, couldn't find any info on it.

Awhile back I thought of this too for not just activating/deactivating objects but dealing with tile data over a network. I'd be very interesting in seeing your method, mine was a little bulky. Having to consider multiple tile skipping, all angles while making sure it's faultless.

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: [C#] TileMap renderer
« Reply #18 on: August 04, 2013, 09:49:11 pm »
I think "culling" might be the term you're looking for, and I think there are a handful of specific algorithms used for certain types of culling. In particular I remember "depth buffering" from the OpenGL tutorial I read.

 

anything