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 - Sub

Pages: 1 ... 8 9 [10] 11
136
Graphics / Re: Anti-aliasing causing small graphical glitch?
« on: October 27, 2013, 02:34:13 am »
Using the same code from the example above

SFML 2.0 gives me a AA of 1.
SFML Nightly from 9.27.13 gives me a AA of 16.

The graphical bugs happen in both cases so that's not it.  I'm updating my drivers right now, hopefully that fixes it.

edit:  Driver update didn't fix it.  The glitch is kind of interesting though, it almost looks like a version of Conway's Game of Life with different rules.

137
Graphics / Re: Anti-aliasing causing small graphical glitch?
« on: October 27, 2013, 02:03:15 am »
I accidentally erased the line where I added an sf::Event when I was pasting it, it's now edited back in.

Anyway, I tried your test and it's giving me an AA level of 1.  I'm not quite sure why that is, but yeah.

I decided to create a project on my laptop to see if it occurs there, and it actually works fine on my laptop, so it looks like it might just be a problem with my desktop.

My desktop is an AMD FX-6300 3.50 GHz, 4 gigs of ram, with a geforce GTX 470.  Not sure if any of that is relevant.

edit:  Considering this problem didn't occur in the past on my desktop (I have some old screenshots of SFML projects that I checked), I wonder if it's because of a video card driver update?

138
Graphics / Anti-aliasing causing small graphical glitch?
« on: October 27, 2013, 01:38:33 am »
I'm either confused on how to properly enable anti-aliasing, or it's causing a small graphical bug in my program in the form of small squares that appear randomly around the screen.  This is a zoomed in screenshot that I took to show what I mean.

http://i.imgur.com/cXX5Inw.png

And here's a small test program I made to make sure the problem wasn't elsewhere in my code
Code: [Select]
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow MainWindow;
   
    sf::ContextSettings ContextSetter;
    ContextSetter.antialiasingLevel = 16;

    const int DEFAULT_SCREEN_WIDTH = 800;
    const int DEFAULT_SCREEN_HEIGHT = 600;
    MainWindow.create( sf::VideoMode
( std::min(sf::VideoMode::getDesktopMode().width, (unsigned)DEFAULT_SCREEN_WIDTH)
, std::min(sf::VideoMode::getDesktopMode().height, (unsigned)DEFAULT_SCREEN_HEIGHT)
, 32), "Antialiasing Test", sf::Style::Default, ContextSetter);

    sf::Event Event;
    bool Quit = false;
    while (Quit != true)
    {
        while (MainWindow.pollEvent(Event))
        {     
            if (Event.type == sf::Event::Closed)
            {
                Quit = true;
            }         
        }

        MainWindow.clear(sf::Color(60, 90, 150));

        MainWindow.display();
    }
}

Anyone have an idea on what I'm doing wrong or what's causing this?  I'm using a nightly build that I last updated on 9.27.13.  I took a look at some of my old screenshots and this artifact doesn't appear to be on them, so I'm thinking it might be a recent change which causes this.

edit:  I just did a test with SFML 2.0 and it still happens, so that's not it.
edit2: This is what it looks like when not zoomed in: http://i.imgur.com/SY39cGI.png

139
SFML projects / Sins of a Hex Empire
« on: October 19, 2013, 01:59:30 am »
Sins of a Hex Empire
Disclaimer:  Due to VS2012 apparently not liking Windows XP under its default settings, this won't work on Windows XP.  It's also a poor clone of Hex Empire(http://www.freewebarcade.com/game/hex-empire/).

Download link -- http://goo.gl/wLStq7


  • Turn based strategy game
  • Your goal is to defeat three opposing AI and conquer the entire map
  • The black dots scattered across the map are cities. If you own a city, it generates one army every turn.
  • Capitals (the stars) generate two armies per turn. If you capture a capital, that enemy will be eliminated
  • Your units have two values -- armies and experience. Armies are the thin black crosses, experience is the black outline around those crosses.
  • A unit gains experience whenever it expands your nations borders
  • You only get 5 moves per turn
  • Pressing enter moves to the next turn
  • Pressing spacebar at any time spawns a new map.

I think that's about it. It was originally written with SDL, but I ported it over to SFML. That old version never had AI and never worked quite right.  I ended up drastically changing the code structure, updated a lot of old functions since a lot of my old code was terrible, fixed a bug with the pathfinding which took forever to figure out, and added in an AI. The AI is terrible, but it only has a few hours of work on it, and I don't care enough to improve it. It's managed to beat me a few times so I figure that it's good enough for a base line level. It's still mostly retarded though. If you want a harder challenge you can artificially handicap yourself by picking a terrible starting position.

I didn't really test it too much, so there are probably some bugs.

140
Weird, I got no screen tearing.

I actually got extremely bad screen tearing.  It looked like there was a drastic FPS drop, but the fps was apparently a constant 60, so I'm not sure what that's about.

141
SFML projects / Re: operation bloodshed - (WIP)
« on: October 08, 2013, 08:56:52 pm »
I don't know if you're intending to do this, but it might be cool if the levels could be randomly generated, sort of like the binding of isaac.  Regardless, it's looking good, keep it up  :)

142
SFML projects / Re: What are you working on?
« on: October 05, 2013, 09:44:41 pm »
I don't play the game, but that is very cool eXpl0it3r  :)

143
SFML projects / Re: What are you working on?
« on: September 25, 2013, 07:05:02 pm »
@Stub: That looks awesome, I'm in love with oldschool isometric graphics. Are the tiles pre-drawn or do you render them in real-time?

Thanks, I appreciate the kind words :).  Not 100% sure what you mean by pre-drawn -- The tiles textures all exist on a sprite sheet, and since I'm about as far from an artist as you can get, I went to websites like http://opengameart.org/ to find the textures.  I modified them all a bit, but eventually I want to hire an actual artist to draw some art that more closely resembles what the tile types are.  Anyway, anytime the camera moves, there's a vertex array that gets cleared and rebuilt with the tiles that are currently on the screen.  If i'm fullscreen, I think there's usually about 1000 tiles on the screen.

144
SFML projects / Re: My Sonic the Hedgehog game (goes fine, but need help)
« on: September 25, 2013, 01:37:09 am »
Another improvement, I was actually able to play it this time  :)

I'd echo everything Ixrec has said, but in addition to that, there was a spot on level 2 where I became stuck.  There was a completely vertical hill that I fell down, so I was caught between a hill that was too tall to get back up on, and one of the loops that you have to run around.  I couldn't gain enough speed to get through the loop.  I would have taken a screenshot, but printscreen doesn't seem to work with the game?

145
SFML projects / Re: My Sonic the Hedgehog game (goes fine, but need help)
« on: September 24, 2013, 11:13:48 pm »
It's an improvement over the older build, but I'm still having issues.

  • On the initial screen, I get horizontal black bars which move either up or down.  I was able to get past this screen no problem, though
  • Alt tabbing was fixed
  • Character selection was also now good
  • I still got the blue used memory screen, at which point it failed to load an image file, I can't tell which image file because the name gets cut off.  It's at this point that it crashes

Sorry man.

146
SFML projects / Re: My Sonic the Hedgehog game (goes fine, but need help)
« on: September 24, 2013, 12:19:06 am »
The first link you had crashed for me, second link work was slightly better.  I got to the point where you could select a character (which, btw, you need to put that on a delay, you almost instantly skip over the middle character) and then the game goes blue with a memory used message, at which point I alt tabbed and it crashed.  It seems to crash whenever I alt tab, actually.

The music was also way too loud, but maybe that's just me.

147
SFML projects / Re: What are you working on?
« on: September 22, 2013, 07:09:36 am »
My pet project is a Civilization-like game.  At the moment I like to think of it as a mashup of Civilization II and Alpha Centauri, but with my own twist.

Most of these screenshots are months old, and all the graphics are temporary, but it is what it is.

Testing nation borders
http://i.imgur.com/jdI4C5C.jpg
http://i.imgur.com/Kdi7REF.png

Old prototype of the GUI on the city screen
http://i.imgur.com/JiWHiqi.png

Was testing overlaying nation colors onto the map
http://i.imgur.com/aYWdFem.jpg

I spent yesterday and today trying to see if I could implement an ocean floor for aesthetic reasons.  Don't like the look of it yet, but it's not done
http://i.imgur.com/H6rgzcv.png
http://i.imgur.com/2s4Rq1J.png

It's pretty rough, but I have fun working on it.

148
SFML projects / Re: Linavalanche
« on: September 08, 2013, 08:42:00 am »
Here's a screenshot I took for anyone curious


Basically the screen always is moving forward.  Your character can only move up and down the lines on the screen, and the lines are all rotating.  You have to jump from line to line in an attempt to stay on the screen.  Pretty interesting idea and pretty well executed, I liked it.

149
SFML projects / Re: Colonies - A Retro Sandbox Survival MMO
« on: August 19, 2013, 08:22:56 pm »
This looks incredible man.  I took a look at some of your early posts on your blog, you've come a very long way in such a short time.  I'm going to keep an eye on this, keep it up.

150
Graphics / Re: I have a question regarding the best way to draw shapes
« on: August 18, 2013, 07:14:29 pm »
I took eXpl0it3r's advice and put together a terrible little test program.  Assuming I didn't make any mistakes, it should draw a bunch of tiny 10x10 rectangles on an 800x600 screen.  This one in release mode gives me 1,200 FPS, so I'm thinking I must have done something wrong in the original program.
I get 1200 FPS in debug and 1800 FPS in release mode. ;)

Anyways you should not delete and recreate the whole vertex array every frame. sf::VertexArray uses a std::vector, thus whenever you call clear() it will also call clear() on the vector. So you're basically allocating and deallocating memory in every frame iteration, which is not the fastes operation and should be reduced to a minimum as much as possible. In fact you'll most likely even run into the issue, where the vector gets moved around in memory multiple times, because it's size gets too big, to hold all the data. Such a movement takes linear time, which will add up very quickly, especially if you do it every frame iteration.

The better way to go about it, is to create the vertex array with its vertices once and then apply the changes directly to the existing vertices. If you feel like you don't have enough access through the interface of sf::VertexArray, you can also go ahead and use a std::vector<sf::Vertex> directly and use window.draw(my_vector.data(), my_vector.size()) to draw it (.data() is a C++11 feature).

To prevent moving in memory, you can either set the size from beginning with the constructor or later by calling resize() or if you're using the vector directly, you can call reserve() to allocate enough space.

After all, if you don't change the vertex array at all, then you won't have to iterate over it, every frame, constructing it once in the beginning should be enough.

First of all, thanks for the response, that makes a good deal of sense.  Part of the reason I didn't keep a stored VertexArray with all the points on it is that the very array wasn't a fixed size, the program had an 'infinite grid', which was really just a series of 800x600 boards (well, I suppose 880 x 660 with the spacing) that could be allocated / deallocated anywhere needed.

http://i.imgur.com/MBmVmds.png
http://i.imgur.com/2cNJ54f.png

Pages: 1 ... 8 9 [10] 11
anything