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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jungletoe

Pages: 1 ... 7 8 [9]
121
Graphics / Re: SFML rendering issues on different
« on: December 23, 2012, 10:42:46 pm »
Ok, I'll try it out.

Do I have to glFlush() it every time I call setText() or only when the text object is created?

EDIT:
Never mind, the text bug is now fixed, but now that inventory loading bug is happening to my computer too. I'll see what becomes of it...

EDIT 2:
Seemed to be a problem with TGUI. I simply switched everything to a spritesheet instead of a picture. Works fine now. Everything is resolved :)

122
Graphics / SFML rendering issues on different computers [SOLVED]
« on: December 23, 2012, 09:37:39 pm »
I've been having this issue (on all computers except my own) for months now. The graphics for my game render perfectly on my computer (specs below), but on some other people's computers, the graphics appear to be extremely distorted and the text skips characters.

This is what it looks like:


I'm using TGUI as well, although it seems that switching from TGUI's text to SFML's text still renders improperly. 

My specs: (It works fine on my computer, 450+ uncapped FPS)
Gateway DX4860
Intel(R) Core(TM) i5-2320 CPU @ 3.00GHz 3.00 GHz
6GB RAM
Windows 7 64-bit

Person 1's specs: (Rendering problems as seen above, 30 FPS)
4GB RAM
Has AMD/ATI Graphics Card (I'll ask him for specifics the next time he's online)

Person 2's specs: (Rendering problems as seen above, 450+ uncapped FPS)
32GB Ram
Windows 7 64-bit
Nvidia graphics card


Any ideas as to why this is happening? It's currently STATICALLY LINKED and I've tried switching around the way graphics are rendered to no avail. Is this a problem with SFML or am I doing something wrong?

And no, I cannot produce a minimal example because of the overwhelming amount of code I have atm.

123
Gah, I fixed it by scaling.

I thought it wasn't supposed to work that way? Laurent said that it shouldn't work that way here.

124
The text above my sprites (or any small text around size 8 for that matter...) appears really blurred. I looked around and found this fix for 1.6, but couldn't find anything for 2.0 now that font.getImage() was removed. How do I set texts and fonts to not be smooth?


125
Window / Re: Any way to make fullscreen stretch AND keep dimensions?
« on: August 15, 2012, 01:40:36 am »
I just bought this computer in December, so I assume so.
Must be extremly complicated to quickly find out... ::)
Also December is already 8 month in the past and from my perspective 8 month in the computer world is quite a lot. ;)

I'd be still willing to test the code (even if it's a bit more complicated), if you still want to find out if it's limited to your hardware. :)

Oh ok, thanks! I checked my drivers and they're all up to date. I didn't realize how easy it was to check. I though I'd have to download tons of checking software.

Here are my project files. It's quite large, so feel free not to test it. The only libraries I use are SFML so it should run out of the box.


126
Window / Re: Any way to make fullscreen stretch AND keep dimensions?
« on: August 14, 2012, 04:25:17 am »
As you probably already know a normal game should run smoothly on 60fps, so unless you drop under that value in development state you should be fine. It's hard to predict if XXXfps in an early development state is high enough or not, what counts should be the final result.

Ok thanks :)

Have you ever switched to release mode to see if the FPS will go up?

I'm running release when I test. I only switch to debug if I'm testing for memory leaks.

Is your graphics card driver uptodate?

I just bought this computer in December, so I assume so.

127
Window / Re: Any way to make fullscreen stretch AND keep dimensions?
« on: August 14, 2012, 12:19:15 am »
Oddly enough, after doing testing, I can't get back up to 400 FPS. I tried disabling the camera, zoom, and everything but it was still the same FPS (I did notice a slight FPS increase when I zoomed though). I'm just going to announce this a mystery about how I got 400 FPS in the first place and give up.

Is 140 uncapped FPS enough though? I only render a few sprites and a few thousand vertices each frame. I'm also on a pretty awesome computer.


128
Window / Re: Any way to make fullscreen stretch AND keep dimensions?
« on: August 13, 2012, 06:33:11 pm »
I just got it running at 120+ FPS using VertexArrays (400 uncapped). I'm still wondering why that FPS drop happened though.

Sorry to question you, but if this is normal then why do I need to provide a minimal example? I'm sorry-- I know how much you hate when people don't provide the example straight away (I swear I've read through every error report thread on this forum. I use the search function more than you think ;) ), but producing a minimal example would take a while. I'm currently streaming all my tile info and everything from a server, so I'd need to rewrite how my tile maps are loaded if I wanted to provide something you could run without a server.


129
Window / Re: Any way to make fullscreen stretch AND keep dimensions?
« on: August 13, 2012, 03:35:45 am »
I'm getting some weird FPS issues using views to maintain the drawing ratio like you suggested. Are there any bugs in SFML that make this happen or is this a problem on my part? It seems really odd to me because with the zoom, it actually uses LESS render calls because I optimized it to not draw tiles outside of the view.

Main Menu State

-GUI (w/o view)
400~ FPS / 8 window.draw() calls

-GUI (w/ views + zooming)
170~ FPS / 8 window.draw() calls

Game State

-Game (w/o view)
300~ FPS / 1875 window.draw() calls (I'm going to optimize this, don't worry :P)

-Game (w/ view)
100~ FPS / 1875 window.draw() calls

-Game (w/ view + zoom)
40 FPS /  768 window.draw() calls


Every loop I go through this in the camera class:

//      Move the camera to the center of the player
        bool changedView = false;
       
        if(you->getSprite().getPosition().x <  x + ((gl::Vars::screenW / 1.5) / 2) - 100)
        {
                changedView = true;
                view.move(-1, 0);
                x-=1;
        }

        else if(you->getSprite().getPosition().x >  100 + x + ((gl::Vars::screenW / 1.5) / 2))
        {
                changedView = true;
                view.move(1, 0);
                x+=1;
        }

        if(you->getSprite().getPosition().y < y + ((gl::Vars::screenH / 1.5) / 2) - 100)
        {
                changedView = true;
                view.move(0, -1);
                y-=1;
        }

        else if(you->getSprite().getPosition().y > 100 + y + ((gl::Vars::screenH / 1.5) / 2))
        {
                changedView = true;
                view.move(0, 1);
                y+=1;
        }

        if(changedView)
        {
                //view.reset(sf::FloatRect(x, y, gl::Vars::screenW / 1.5, gl::Vars::screenH / 1.5));
                gl::Win.setView(view);
        }

It essentially gets the position of the player and if the player goes outside of the bounding box, it moves the camera accordingly.

Suggestions? 40 FPS is not acceptable for me. I should be getting around 400 considering the meager amount of tiles I'm drawing. It also is preventing me from recording my game with FRAPs, as I get only 15 FPS.

130
Window / Re: Any way to make fullscreen stretch AND keep dimensions?
« on: August 13, 2012, 01:16:57 am »
To keep the ratio you'll have to adjust the view on the window.

Ah ok, that's what I was looking for. Thanks!

131
Window / Any way to make fullscreen stretch AND keep dimensions?
« on: August 12, 2012, 03:29:44 am »
Hello, I'm developing a game with tiles that are 16x16. I want my tiles to remain a square shape when I put the game in full screen mode. I'm trying to figure out how to do this with video modes.

If I draw a square in a full screen video mode set to my desktop's standards, there isn't any width stretching, but the tiles appear way too small. I want my tiles to be stretched, but equally. If I set the resolution to 800x600, the tiles are stretched to the size I want, but are too wide for my screen and appear as rectangles. I have a very wide HD monitor.

How can I make sure that all my users get a resolution without width stretching and without it being the desktop's default mode?

132
Graphics / Trying to boost FPS to a safe amount
« on: July 30, 2012, 04:07:54 am »
I'm constantly getting a good 90+ uncapped FPS in my tile-based game, but I really want to get that number higher to allow room for more things to get rendered besides just the tiles.

As of right now, I'm storing all of my tiles in a 2D vector of a tile struct, which contains 3 ints (X, Y, and ID). Each draw call, it goes through all the tiles in the 2D vector and draws the ones that are within the camera bounds. It draws each tile separately. Here is what it looks like:

if(loaded)
        {
                sf::Sprite sprite;

                for(int x = 0; x <= width - 1; x++)
                {
                        for(int y = 0; y <= height - 1; y++)
                        {
                               
                                if ( ((ent::camera.x) <= (x * getTileH()) + 32) && ((x * getTileH()) < (ent::camera.x + gl::Vars::screenW)) && (( (ent::camera.y) <= ( y * getTileW()) + 32) && (( y * getTileW()) < (ent::camera.y + gl::Vars::screenH))))
                                {
                                        sprite.setTexture(*textures.at(map[x][y]->ID));
                                        sprite.setPosition(x * tileW, y * tileH);
                                        gl::Win.draw(sprite);
                                }
                        }
                }
        }
 

Would it be faster to render all of my tiles and changes to a sprite and then render one huge sprite at once every loop instead of 50 individual renders? My games aims to be a HUGE world (nearly infinite) and be changeable. Tons of tiles will have a chance to be changed each loop due to people either digging or modifying them in some way related to the game (I hate to say this, but think of Terraria).

What's the best way to do this for my game? It's not a typical ORPG pre-made map. There are many changes to the map on the fly.

Also, do you guys have any other tips for boosting FPS? My aim is to get it over 400 uncapped.

Pages: 1 ... 7 8 [9]
anything