TropicalFlesh's Profile User Rating: -----

Reputation: 0 Apprentice
New Members
Active Posts:
6 (0.01 per day)
03-August 13
Profile Views:
Last Active:
User is offline Aug 07 2013 02:33 PM

Previous Fields

Dream Kudos:
Icon   TropicalFlesh has not set their status

Posts I've Made

  1. In Topic: Large Tilemap Optimizations

    Posted 7 Aug 2013

    View PostKilorn, on 07 August 2013 - 11:18 AM, said:

    How are you calculating how much time it takes to render this tilemap?

    Rendering at 170 fps means I'm using 5.8ms per update loop just for my tilemap. I have to maintain a 16.66ms or lower loop to keep the game from dropping under 60fps. That leaves me with just 10.8ms for everything else - shaders, logic, etc.
  2. In Topic: Large Tilemap Optimizations

    Posted 7 Aug 2013

    View PostKilorn, on 07 August 2013 - 08:54 AM, said:

    I don't understand where the problem is. Your current FPS is 174 in the screenshot. You're obviously not taking much of a performance hit by this tilemap, as a framerate that high is still way beyond the point at which humans can no longer distinguish between differences in framerate.

    Yes, however, I'm on a $1600 machine. I don't trust that the everyday desktop will run this fast enough. Also, I'm trying to keep in consideration the fact that I'm left with only about 10ms to do EVERY other operation necessary for a large RPG.
  3. In Topic: Large Tilemap Optimizations

    Posted 4 Aug 2013

    Posted Image

    Here's my performance, as of yet. I've actually increased the size of the tiles to 32x32 to try to reduce the draw calls, but I'm very unsatisfied with the look. In this image in particular, I've forced it to draw as if the tiles were 16x16 to show how little room I have for the rest of my game. Sure, 170 fps will do, but I'm not sure I'm happy with so much of my loop being unavailable so early.

    Am I being unrealistic with my performance desires, or am I missing something vital?
  4. In Topic: Large Tilemap Optimizations

    Posted 4 Aug 2013

    View PostSixOfEleven, on 04 August 2013 - 04:15 AM, said:

    Can you post the rendering code?

    public void Draw(SpriteBatch spriteBatch, Texture2D[] tiles, Rectangle camRegion) {
                for (int i = 0; i < map.Length; i++)
                    map[i].Draw(spriteBatch, tiles[map[i].ID], camRegion);

    I tried to use a primitive array and a for loop, rather than a List and a foreach loop to see if it'd make a difference, but it didn't seem to.

    I pass in the camRegion to cull the tiles out of the camera's view.

    The Tile.Draw looks like this

    public void Draw(SpriteBatch spriteBatch, Texture2D tex, Rectangle camRegion) {
                if (position.X < camRegion.X)
                if (position.X > camRegion.Right)
                if (position.Y < camRegion.Y)
                if (position.Y > camRegion.Bottom)
                spriteBatch.Draw(tex, position, Color.White);

    I'm even storing the position in RAM so there aren't any realtime calculations.
  5. In Topic: Large Tilemap Optimizations

    Posted 3 Aug 2013

    View PostBBeck, on 03 August 2013 - 06:10 PM, said:

    I don't know if you're aware of this, but SpriteBatch is intended to be called once per frame. That's why its a batch. There's huge overhead every time it's called. So, you want to call it once per frame. If you have a million sprites, you want to put them in one SpriteBatch.

    Of course I'm aware. I'm talking about the Spritebatch.Draw. How am I meant to draw other than with that?

My Information

Member Title:
New D.I.C Head
Age Unknown
Birthday Unknown

Contact Information



TropicalFlesh hasn't added any friends yet.


TropicalFlesh has no profile comments yet. Why not say hello?