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

Pages: [1] 2
1
Window / Re: Framerate Limit not working properly on OSX
« on: July 22, 2013, 02:08:31 pm »
If you want a fixed timestep, read articles about it, there are well known implementations.

Didn't know about that, thank you, I'll search a bit.

If you want a "good" framerate, to avoid huge or tiny update times, and thus potential graphical artifacts, enable vertical synchronization.
That's actually what I do :p But I remeber there were still some OS strange behaviour, I'll recheck this

In any case, if your code is broken because of +-2 FPS, then it's badly written.
No, it's not broken :P
The +-2FPS really change the game when it's FPS fixed :P And dynamic FPS make it even worse

2
Window / Re: Framerate Limit not working properly on OSX
« on: July 22, 2013, 01:17:39 pm »
Yeah, I know that, I actually tried to hard-code the way SFML2 does the framerate limit to find a workaround.
Still, it's quite annoying having this kind of difference between 2 OS
But thank you for the answer.

Dynamic framerate gives me headache >.<

3
Window / Framerate Limit not working properly on OSX
« on: July 22, 2013, 12:55:30 pm »
Testing the same piece of code on Windows, Linux (ubuntu) and OS X (10.8.4) doesn't have the right FPS on OSX.
Here is the code sample (from base project)

#include <SFML/Graphics.hpp>

// Here is a small helper for you ! Have a look.
#include "ResourcePath.hpp"
#include "FPS.hpp"

int main(int, char const**)
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
    window.setFramerateLimit(60);

    sf::Texture texture;
    if (!texture.loadFromFile(resourcePath() + "cute_image.jpg")) {
        return EXIT_FAILURE;
    }
    sf::Sprite sprite(texture);

    sf::Font font;
    font.loadFromFile(resourcePath()+"sansation.ttf");

    FPS fps(font);
    fps.setColor(sf::Color::Black);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed || (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape))
                window.close();
        }

        window.clear();
        window.draw(sprite);

        fps.step();
        window.draw(fps);

        window.display();
    }

    return EXIT_SUCCESS;
}

This gives a framerate of 57 while it should be 60



The FPS.hpp can be found here
https://gist.github.com/posva/6052868

I created a (rejected) issue here: https://github.com/SFML/SFML/issues/433

4
SFML projects / Re: SFML Light System - Let There Be Light
« on: August 21, 2012, 01:33:43 pm »
Is there anyway to get this working without C++11 ? I'm trying to use boost to replace unordered_set but unique_ptr does not exists and I was wondering if an auto_ptr would be enough. Anyway it would be great to have this also working for non C++11 compilers. I also noticed some errors at compilation like determining a class a friend of himself.
Thanks, keep up the good work!

Edit: I tried what I said and I managed to correctly launch the example you provide. But I still don't know if an auto_ptr is enough for you or not. I can upload what I modified if you want. I really like your light and being able to use it would be great! :D

Edit: There are a lot of warning I'm trying to correct, also not used variables like m_render in convexhull and not initialized variables on constructors. Not initialized variables may give unexpected behaviours

Edit: I found this portion of code weird:
void Light_Point::RenderLightSolidPortion()
    {
        float renderIntensity = m_intensity;

        // Clamp the render intensity
        if(renderIntensity > 1.0f)
            renderIntensity = 1.0f;

        assert(renderIntensity >= 0.0f);

        float r = m_color.r * m_intensity;
        float g = m_color.g * m_intensity;
        float b = m_color.b * m_intensity;

        glBegin(GL_TRIANGLE_FAN);

        glVertex2f(m_center.x, m_center.y);
     
        // Set the edge color for rest of shape
        int numSubdivisions = static_cast<int>(m_spreadAngle / m_lightSubdivisionSize);
        float startAngle = m_directionAngle - m_spreadAngle / 2.0f;
     
        for(int currentSubDivision = 0; currentSubDivision <= numSubdivisions; currentSubDivision++)
        {
            float angle = startAngle + currentSubDivision * m_lightSubdivisionSize;
            glVertex2f(m_radius * cosf(angle) + m_center.x, m_radius * sinf(angle) + m_center.y);  
        }

        glEnd();
    }

You don't use the color created, also why calculating renderIntensity and then use m_itensity? Is that what you meant to write? :
...
Color3f(m_color.r * renderIntensity, m_color.g * renderIntensity, m_color.b * renderIntensity).GL_Set();
glBegin(....

5
General / My thread isn't running
« on: January 21, 2012, 03:58:56 pm »
Might this help, from the tutorial?
Code: [Select]
class Task
 {
 public :
     void Run()
     {
         ...
     }
 };

 Task task;
 sf::Thread thread(&Task::Run, &task);
 thread.Launch(); // start the thread (internally calls task.run())

You have to give a minimal code to let people find the errors (never give your entire project, juste paste some code)

6
SFML projects / Moonman's Xmas
« on: December 16, 2011, 10:04:05 pm »
Quote from: "eigenbom"

For efficiency reasons the world is split into chunks, which contain 256x256 blocks. These chunks are generated on demand (and eventually will be stored/loaded on disk as required). The chunks just have an array int[256*256], so block lookup inside a chunk is O(1). So doing a block lookup, I first retrieve the chunk (just stored in a std::list for now, but eventually will be in a hashtable) then get the block.. works fast enuf for simple stuff but has lots of room for improvement. I think I explain the collision routine in my devlog.

By devblog you meant http://bp.io/ ?
Anywat I searched both :P and didn't found what you was talking about.
I trie dto search for hastables but the text was too long and I'm tired lol
I asked you because I'm always looking forward efficiency issued and improvements and Unniversity is slow learning you things, I would rather take lessons by myself but I need the grade...
Well you collision system impressed me because the world is huge (it really looks infinite lol) and I also love the sky and the water (what a beauty, I though a time ago about making water EXACTLY like what you did but I never implemented it)

7
SFML projects / Moonman's Xmas
« on: December 16, 2011, 02:55:47 pm »
Quote from: "eigenbom"
Thanks for the replies guys!

@posva Yeh I only noticed the focus bug after my cutoff time, but I'll definitely fix it for moonman proper! The blocks are always aligned to a grid (they have integer coords), so collision detection is fairly simple. :D

B


But with such a big world do you check all the blocks, or do you have arrays that point to them? If so, how big is the array? xD

8
SFML projects / Moonman's Xmas
« on: December 15, 2011, 08:52:09 pm »
Looks nice! Hoewever you should use the function to get if windo lost focus to avoid keypresses when window is not active ^^

I really want to know how do you manage collision with sooooo many block? Grids? Quad trees? I reaaly wanna know :P

9
SFML projects / Secure SFML (encrypted sockets)
« on: November 30, 2011, 11:39:01 am »
That looks nice! I will give it a try! It really deserves it

Quote from: "Haikarainen"
This is cool! Is it based off SFML 1.6 or 2?

Also, i think something like ssf::Socket would be more fit than "raping" sf::


It doesn't use sf::Socket, it uses  the word 'Secure' before everything (As I saw in the example)

10
SFML projects / Grav, a hard arcade game [WIP]
« on: November 13, 2011, 11:43:01 am »
Quote from: "replicant"

Interesting. Your Kill da Ducks game is damn impressive too! :)

Just played some Grav, here is a couple of things I notiched.

- Why show console window?
- Takes an awful long time to actually launch the main window (I'm not sure why since it doesn't need to load many resources).
- Getting a connection error.


Thanks! I'm still developping the engine though ^^

The console window is something I forgot :P, it's corrected now but I don't want to update the version since it's only an alpha
I think that's because of the music, it's the biggest ressource in the game, the other ressources take only 1 second or less to load with an average computer.
You get a connection error when there is an error to connect to internet, I guess you have some problems/interference, other than that, I don't know since I'm using very basic SFML2 Network features.
Anyway thank you for the feedback, it's very kind. I will look deeper (in fact I'm already doing it) about the network connection I do, I get sometime bad access error when I quit the game and I still need to clear up these error even if they are very rare

11
SFML projects / Grav, a hard arcade game [WIP]
« on: November 13, 2011, 10:22:48 am »
Quote from: "replicant"
Did you make that background effect just using SFML graphic commands? or did you use opengl directly?

Very cool.


I used SFML commands, they're not suing very much memory even if they are 1 pixels white sprites xD
Thanks!

12
SFML projects / Grav, a hard arcade game [WIP]
« on: November 09, 2011, 07:47:32 am »
Quote from: "Haikarainen"
This is hard, got 8.65 secs as highscore in classic. VVVVVV is also a great game and its nice to see other people get inspired by it, but why cant you choose yourself when you wanna flip ? :/

You cannot flip whenever you want :P anyway it will make the game more confusing.
By the way the this the easiest mode xD Right now I'm testing the Hard mode and the imposible mode that are simply modes with faster speed.
There will also be the extra mode which have different sequences, objects, time distortion etc

13
SFML projects / Grav, a hard arcade game [WIP]
« on: November 08, 2011, 07:12:16 pm »
Quote from: "Naufr4g0"
On-line hi-scores? Very good! :D
Anyway the time's flow is not constant.


Thanks.
Did you downloaded the last version? I updated it some hours ago.
I have some serious issues with that I really don't know what to do xDD
the code I'm currently using is before the display (so after the Step and Draw)
Code: [Select]
speed=App.GetFrameTime()/33.0;
I thought it was OK like that...
I Know you had some issues too with that as when I searched for help I found your game, what did you use?

14
SFML projects / Freighter - w/Source (Updated 11/04)
« on: November 07, 2011, 11:21:42 pm »
Quote
The game is completely functional, though I will continue to add features. I apologize for using a .wav file for the background music. I am having trouble using .ogg files, none of them seem to load for me, so I need to work out that kink.

This may be because you're not using the lastest version of the DLLs located at extlibs

15
SFML projects / Grav, a hard arcade game [WIP]
« on: November 07, 2011, 08:01:52 pm »
Grav


Description:
Grav is an arcade game inspired from super gravitron from VVVVVV. I wanted to test a bit myself and make a simple but full playable game in C++

In the game you bounce between two lines and you have to dodge boxes that appears. There are online highscores, create an account it's really fast and allow you to save your statistics.

How is SFML used
SFML 2 is used for almoste everything... Graphics, sound, internet, threads, windowing
I was really confortable while making the game as SFML was really easy to use and there are a lot of tutorials, furthermore the doc is very good

Screenshoots:




Lastest Video:

Hard mode (not the usual one :P)
http://youtu.be/c9gW_xlakZY

Website:
http://www.killdaducks.com

Download an alpha version:
http://www.killdaducks.com/2011/11/grav-alpha-download.html
(Mac & windows versions, No linux for the moment, I'm sorry)

I accept any suggestion and criticism![/url]

Pages: [1] 2