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

Pages: 1 ... 600 601 [602] 603 604 ... 720
9016
General discussions / Re: Default font removed in SFML 2
« on: December 19, 2012, 11:38:28 pm »
Please update the documentation to reflect this. It confused me for a few minutes.
Unfortunately the documentation is frozen to the SFML 2 RC release, not sure if Laurent wants to update it or create a second section for SFML 2 (current)...

9017
System / Re: SFML in the future.
« on: December 19, 2012, 08:38:27 pm »
Will there be any in the library of methods for process management and implementation of the singleton pattern?
No and no... ;)

I don't really understand what you mean exactly with process management, but that alone already shows that this topic is far too big and for every OS vastly different. On top of that I don't think it would fit anywhere into the Simple nor Multimedia. ;)

In good C++ code are singletons considered bad practice. SFML doesn't use it and thus doesn't need it, so there most certainly won't be anything in that direction. Try to avoid the singleton patter as much as possible. (Just search a bit on the forum for our various discussions from the past...) ;)

9018
SFML projects / Re: Ludum Dare 25 Entry - Hero Must Die
« on: December 19, 2012, 08:31:05 pm »
Perhaps it has something to do with the title textures not being a power of 2. However, all the UI stuff is a power of 2, which is sort of strange.
That was an issue with old graphic cards, but shouldn't be a problem nowadays. ;)

I uploaded a new version with this modification and some other potential fixes.
Okay now the intro (and I guess the outro) appear fine, but the items still don't show.

I wonder though, why have saved all the images rotated? ???

9019
SFML projects / Re: Ludum Dare 25 Entry - Hero Must Die
« on: December 19, 2012, 07:19:34 pm »
When I start NEAT_Visualizer.exe, the screen remains black.
Unfortunately I can confirm this. The rendering of the images from ui/ and transition/ don't work.
The rendering of the tiles and the robots work fine though, but I can't see the items and can only guess from the screenshots which is placed where.

Maybe some problem with ATI graphic cards?

9020
Graphics / Re: SFML and Sprites
« on: December 19, 2012, 06:36:24 pm »
The character is correctly drawn now, oddly enough.
Why should this be odd?
One character is 20px in width and 40px in height. If you cut-out a 40px by 40px sub-image you'll obviously get the character twice. ;D

With delay I mean I want some kind of short delay between the cycling frames, so they are not cycling all at once. A small delay of around 0.1 seconds would make the character walk smooth.
So you mean that the animation runs slower?

Well you can use a sf::Clock and wait till the wanted 'delay time' has passed. For example if you want the animation to run at 5 frames per second, you do:
if(clock.getElapsedTime().asSeconds() >= 1.f/5.f)
     ++animationFrame;
... or similar. ;)

9021
General / Re: Generic Game Loop
« on: December 19, 2012, 06:27:21 pm »
Quote
By saying I won't get a "fully fixed" frame rate do you mean it simply won't be 100% accurate?
Yes but also that you can get unwanted spikes that could lead to quite some strange behavior in the physics.

NEVER use setFramerateLimit() !!!  ;D
Don't exaggerate here. :P

Yes it's a good idea to use a fixed timestep, specially for physics, but for simple games where the CPU is mostly bored to death, it doesn't really matter. ;)

If one wants a more stable framerate vsync could be an option, although that can get deactivated by the driver settings.


Your code should look something like this:
A few things one should/could do different/better:
  • Don't use using namespace sf; it's only confusing and can lead to some strange compiler/linker errors.
  • Always use forward slashes for #include MSVC supports them perfectly and one can even set it as default in VS.
  • Either use a const unsigned int or cast the FPS count to unsigned int before passing it to setFramerateLimit, otherwise you'll end up with compiler warnings.
  • For float values you also need to specify the .0f for 0.
  • Passing the sf::Color(0, 0, 0) is in two ways unnecessary; 1) if you want black it's more descriptive to use sf::Color::Black, 2) window.clear() does use black as default color, so one does not need to pass it.
  • Tip: By the standard main() doesn't require a return call.
So that would turn into:

#include <SFML/Graphics.hpp>

int main()
{
    const unsigned int FPS = 60; //The desired FPS. (The number of updates each second).

    sf::RenderWindow window(sf::VideoMode(300, 300), "Hello");
    window.setFramerateLimit(FPS);

    sf::CircleShape circle(10.0f);
    circle.setOrigin(10.0f, 10.0f);
    circle.setPosition(0.0f, 150.0f);

    sf::Event ev;
    while (window.isOpen())
    {
        //Handle events
        while (window.pollEvent(ev))
        {
            if (ev.type == sf::Event::Closed)
                window.close();
        }

        // Move stuff
        circle.move(1.0f, 0.0f);

        // Draw stuff
        window.clear();
        window.draw(circle);
        window.display();
    }
}

9022
Graphics / Re: SFML and Sprites
« on: December 19, 2012, 06:03:17 pm »
Followed your suggestions, now I see two sprites at the same time.
You're probably not cutting out double the width of the character instead of just once (e.g. you cut-out a square instead of half a square).

And speaking of time, there is no delay for the animation.
I don't know what you mean with delay or what you're expecting...

9023
Graphics / Re: SFML and Sprites
« on: December 19, 2012, 05:22:23 pm »
A glimpse at the documentation, would've probably already resolved your confusion. ;)
Quote
Represents a time value.
sf::Time encapsulates a time value in a flexible way.
It allows to define a time value either as a number of seconds, milliseconds or microseconds. It also works the other way round: you can read a time value as either a number of seconds, milliseconds or microseconds.
By using such a flexible interface, the API doesn't impose any fixed type or resolution for time values, and let the user choose its own favorite representation.
Time values support the usual mathematical operations: you can add or subtract two times, multiply or divide a time by a number, compare two times, etc.
Since they represent a time span and not an absolute time value, times can also be negative.
In short: sf::Time only represents a value and doesn't increase or decrease. It also is a class and not a function.

If you want something that increases with time, you'll have to use sf::Clock. It will start counting as soon as it's created or when you call restart(), but keep in mind that you can't pause it.

To use a spritesheet you simple load the image into a sf::Texture and pass it to you instance of sf::Sprite. Then you 'cut-out' a sub-rectangle of the whole spritesheet with setTextureRect(). If the spritesheet holds an animation, you'll have to move the texture rectangle accordingly to the sprite position and time.

9024
SFML projects / Re: Ludum Dare 25 Entry - GiTA
« on: December 19, 2012, 05:06:04 pm »
Okay so my actual score is 151 with 39 people, but then took advantage of some AI bug I got up to 248.

I think to have noticed two bugs:
  • After a while playing it (idk 10min?) I came to the cross section, see image below.
  • I'm not sure if people who got killed spawn again, but it seemed to me in two situation that they did and that they haven't forgotten that I killed them, or better that they saw me kill someone. Is such a bug even possible?


Also would it be possible to disable the sound, because the looped crowd noise get annoying quickly.

9025
SFML projects / Re: Ludum Dare 25 Entry - GiTA
« on: December 19, 2012, 03:09:47 pm »
This is really great but also challenging. :D
Nicely done!

9026
Window / Re: Writing a config file/converting string to sf::Event?
« on: December 19, 2012, 02:08:57 pm »
I've quickly recorded a video and showed how to build SFML and Thor with Visual Studio 2010 (it's the same process for any other Visual Studio version).
It's really not hard once you get used to it and you can make it even easier by utilizing the command line. ;)

(Watch in 720p to actually see what's going on :D)
http://www.youtube.com/watch?v=nSMjXycPhs4

I'm not sure though how long I'll keep that video up, since it's better to read and understand the official tutorials, rather than possibly outdated YouTube videos... ;)

9027
General / Re: Generic Game Loop
« on: December 19, 2012, 12:54:46 am »
Well you actually can do this much easier with SFML: window.setFramerateLimit(60);
But both your and the SFML version have the same problem (since they're actually quite identical in the implementation), that they use sleep (or sf::sleep which calls sleep) and sleep() isn't as accurate as one could want it to be, also there could be some process killing the whole performance and the sleep call wasn't long enough (or something like that). Anyways you won't get a fully fixed frame rate value, but then again you maybe don't need a fixed one.

In short: Use setFramerateLimit (or your implementation) and if you have any major troubles with it, look out for different methods. In most cases it's fine though. ;)

9028
General discussions / Re: Unofficial Nightly Builds
« on: December 18, 2012, 11:15:34 pm »
Do you do something similar for these? If not you could probably save yourself a lot of time :-D Could even set it up to automatically ftp the binaries onto a website so the whole process is automated...
Yeah I'm aware of Jenkins (I'm using it to build the nightly builds for SFGUI), but I didn't set it up for SFML and simple wrote a few batch files for each compiler, which pull the source from git, build every version copy stuff around like I want/need to and then automatically packs it with 7zip. If I wanted to I could also upload it to the server and make changes to the website, but since I can't always be certain if the connection is stable, I don't want to directly do that.

The advantage of using my own batch files is that I can fine tune it for every compiler and don't need some partly bloated software to do the same thing. The downside is that it needs a bit more work, but I'm fine with that. ;)

So here is the latest version of SFML 2 beta but innoficially? And its an .exe or an already maked librarie( without using CMAKE)?
I just compile the source from GitHub, pack it with 7zip, upload the archives and release them here. It's unofficial because I'm not the developer of SFML. The archives contain all the possible builds of the library (debug/release static/dynamic lib/dll etc.) with the header files, as well as all the examples (.exe) build in release and statically and the automatically generated Doxygen documentation.
So you won't have to use CMake, since you'd only need CMake if you'd compile SFML on your own.

9029
General / Re: AlexxanderX problems...
« on: December 18, 2012, 04:22:41 pm »
I revised your code and I think you know, because is only a test for what I needed, your app have sam bugs.
I guess you mean 'some bugs' right?

Yeah I know that and I've also mentioned it. ;)
Keep in mind it's an example and not production code, it should give you an example you can read and understand into its last detail.
And I don't want to hear the question at all how one would go about fixing the 'teleporting' problem when bumping into the box, that's for you to figure out. ;)

Good luck!

9030
Network / Re: [SFML 2]Networking game
« on: December 18, 2012, 04:17:54 pm »
... what's the best way to ...
Stop asking such questions, because there's never the best way. ;)
It all depends on how your game works, what it should actually do, etc. etc. There are thousands of possible way to do things, but not all of them will fit your needs. It's the same thing with game engines, don't build general game engines but build an engine around a game.

For the calculation it also depends on the game, because if the game is time critical, you have to handle things differently as when it's turn-based or similar.
You can for instance calculate the real position on the server, but also let the client calculate the physics to interpolate between the syncs with the server, so the client kind of guess where everyone is moving and when the new positions come from the server, they get reset.

Threads are not some paradigm one should use whenever wanted, but when the make sense. Threads execute code side by side and thus can bring some high complexity into the code. For rendering/updating it's often nearly impossible to use and thus I'd probably only use it where you need to do things at the same time and the 'things' are not directly connected to the outside, e.g. loading new textures in the background, playing music in the background, communicating over the network, etc.

There are many many tutorials on multiplier games, if they are good I can't say and also don't have any experience there, but I guess since you don't have much knowledge on the topic, nearly very tutorial will do the trick for now. ;)

Pages: 1 ... 600 601 [602] 603 604 ... 720