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

Pages: [1] 2 3
1
General / OSX - Error when running sfml app
« on: October 10, 2013, 10:19:57 pm »
Hi everyone. I'm getting:
"Class SFApplication is implemented in both /Library/Frameworks/sfml-window.framework/Versions/2.1.0/sfml-window and /usr/local/lib/libsfml-window.2.dylib. One of the two will be used. Which one is undefined."
And some additional errors like this for other classes.

It compiles, I just get this error when I run the app. I've also tried "-L /Library/Frameworks"

I have everything running/compiling fine on Windows but I wanted to be able to work on my mac.

Any ideas? I tried using XCode as well but I couldn't get it to compile with TGUI. So I'm using sublime/make. My makefile looks like this:

client: main.o
        g++ -o client -L /usr/local/lib/ main.o -ltgui -lsfml-network -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-window -lsfml-system

main.o: main.cpp mainmenu.o settings.o connect.o multiplayer.o singleplayer.o
        g++ -c main.cpp -o main.o

screen.o: screens/screen.h
        g++ -c screens/screen.h -o screen.o

mainmenu.o: screens/mainmenu.h
        g++ -c screens/mainmenu.h -o mainmenu.o

settings.o: screens/settings.h
        g++ -c screens/settings.h -o settings.o

connect.o: screens/connect.h
        g++ -c screens/connect.h -o connect.o

multiplayer.o: screens/multiplayer.h
        g++ -c screens/multiplayer.h -o multiplayer.o

singleplayer.o: screens/singleplayer.h
        g++ -c screens/singleplayer.h -o singleplayer.o

client.o: client.h
        g++ -c client.h -o client.o

singleton.o: singleton.h
        g++ -c singleton.h -o singleton.o

player.o: entities/player.h
        g++ -c entities/player.h -o player.o

ship.o: entities/ship.h
        g++ -c entities/ship.h -o ship.o

clean:
        rm -rf *.o client
 

2
General / Re: Picking a GUI for a game
« on: April 27, 2013, 05:26:45 am »
Cool! I'll check both of those out in more detail. Thanks for the input!

3
General / Picking a GUI for a game
« on: April 27, 2013, 12:28:46 am »
It's been a while since I've used SFML; is there a consensus on which GUI to use for a game built with SFML? I've seen quite a few on the forum, but I was wondering if there was kind of a "go to" GUI that most of you use, or one that is more popular/stable than others?

4
Graphics / Re: camera in sfml 2.0
« on: June 26, 2012, 12:41:05 am »
figured it out... i was using sf::View correctly the entire time... there was an issue elsewhere in my code causing the ship not to draw. really frustrating lol, thanks for taking the time to help

5
Graphics / Re: camera in sfml 2.0
« on: June 26, 2012, 12:23:41 am »
that's exactly what I wanted to do, and it turns out I had tried that exact thing Haze, but when I try it in my code it doesn't load the player sprite. but the camera does move. i don't know what its doing, thanks for making the example though.

6
Graphics / Re: camera in sfml 2.0
« on: June 24, 2012, 11:57:40 pm »
That doesn't keep the sprite centered.

I'm not having trouble moving the sprite :P I'm having trouble moving the camera/view WITH the sprite

here I found a good example:



thanks for being patient with me thus far :)

7
Graphics / Re: camera in sfml 2.0
« on: June 24, 2012, 11:44:39 pm »
I'm not sure which Asteroids do you mean, because in the the ship didn't move at all...
Yeah that is a bad example sorry, I just want the player to be in the center of the screen as he moves through the world, but i don't want to move the world, i want to move the player and have the view/camera follow.

8
Graphics / Re: camera in sfml 2.0
« on: June 24, 2012, 11:32:02 pm »
I'm just trying to follow the player around like in asteroids or something, I want the camera to center on the player while the player moves through the world.

what you're saying helps, but I think I'm still a little confused

9
Graphics / Re: camera in sfml 2.0
« on: June 24, 2012, 10:28:13 pm »
Yes that is the tutorial I read, and I'm doing what you've said I think.

sf::View followPlayer; //private member in class
followPlayer.setCenter(512, 384); //in constructor
followPlayer.setSize(1024, 768); //in constructor



window.draw(backgroundSprite);

window.setView(followPlayer);
followPlayer.move(shipSprite.getPosition().x, shipSprite.getPosition().y);
window.draw(shipSprite);

//set back to default
window.setView(window.getDefaultView());
 

camera still not following the player :(

10
Graphics / camera in sfml 2.0
« on: June 24, 2012, 09:34:33 am »
I've read the documentation and the tutorial on the wiki but I'm still having trouble setting up a view/camera that centers on the player's sprite while it moves around. I don't want the world to move, just the camera as it follows the player moving.

I've been able to get the camera to move but then the player's sprite doesn't draw.

Could anyone help me out with some pseudo-code or something?

ex:
-set view center on player's position
-draw the background with the default view
-switch to the new view
-draw the player sprite
-switch back to old view


11
Network / Re: SFML network library vs ?
« on: June 05, 2012, 01:13:13 am »
(or make your own!)

That's what I'm currently working on :P
Well, on top of SFML.

12
Network / Re: SFML network library vs ?
« on: June 04, 2012, 09:37:12 pm »
Considering it's an ISOC article it probably holds some kind of truth, but skimming over it again it sounds like it only comes into effect if/when the TCP window grows to a certain size, which probably rarely happens?

I still kinda had the same feelings as you, since I know of a lot of games that use both, but then after reading that tutorial and that article I was kind of wondering

13
Network / Re: Is this a bug in the network library?
« on: June 04, 2012, 09:56:20 am »
aha k you win

14
Network / Re: Is this a bug in the network library?
« on: June 04, 2012, 09:42:57 am »
That fixed it, now it's sending ~700 bytes/second. I knew I did something wrong :/
Thanks Laurent. I love you :p

15
Network / Is this a bug in the network library?
« on: June 04, 2012, 04:36:08 am »
I have a pretty simple UDP client/server going - the client sends updates to the server every 30 milliseconds, so 33.333 times per second. Nothing else is being sent anywhere else in the code (except for an initial connection message and then a disconnection message)

These updates are always 19 bytes, and Packet.getDataSize() confirms this. So 19 bytes 33 times per seconds should be sending out roughly 627 bytes per second.

However Windows resource monitor says my program is consistently sending out 4,000 to 5,000 bytes per second.

Is this some kind of bug, or is sf::Packet actually much much larger than Packet.getDataSize()?
Here is the code that gets called in the game loop:

void Client::sendUpdate()
{
    elapsedTime = elapsedTime + clock.getElapsedTime();
    if (elapsedTime.asMilliseconds() >= tickrate.asMilliseconds()) //tickrate = sf::milliseconds(30) set elsewhere
    {
        elapsedTime = clock.restart();
        sf::Packet sendPacket;
        sf::Uint32 protocolID = 1885697825;
        sf::Uint8 action = UPDATE;
        sendPacket << protocolID << action << localPlayer.id << localPlayer.positionX << localPlayer.positionY << localPlayer.rotation;
        cout << "sendPacket: " << sendPacket.getDataSize() << endl;
        if (socket.send(sendPacket, serverAddress, serverPort) != sf::Socket::Done)
        {
            cerr << "Error sending player input." << endl;
        }
    }
}
 

It's entirely possible of course that I'm just not seeing something I've done wrong, but I've been trying to figure this out for a while now so I thought I'd ask for help.

Also here's a screen cap of the resource monitor and the debug/console outputting the data size of the packet

Pages: [1] 2 3