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

Pages: [1]
1
Network / Re: Difference in sending small and big packets.
« on: September 08, 2014, 09:24:42 pm »
Thanks guys  :)

2
Network / Difference in sending small and big packets.
« on: September 08, 2014, 08:41:18 pm »
Hello guys. Just wanted to ask if there's a significant difference in speed between sending packet like this one:
packet << "movement" << "moveRight" << "moveLeft" < "blablablabla";
and this one:
packet << 1 << 2 << 3 << 4;

Thanks for response!  ;D

3
General / Re: Smaller window = better performance
« on: August 27, 2014, 10:08:15 am »
Guess no.

4
General / Re: Smaller window = better performance
« on: August 26, 2014, 12:08:24 pm »
@Laurent I'm using windows. It's only slow if the window is the same as desktop or really close desktop size.
@Nexus That's only a test app so yes, I update it as fast as GPU allows.

I found out that if I use the app resized to cover whole screen CPU usage decreases from 30% to 20%. Mind blown.

I also found this thread http://en.sfml-dev.org/forums/index.php?topic=8747.0 and I think that in fullscreen mode there is no performance drop. Can u help me guys?

5
General / Re: Smaller window = better performance
« on: August 26, 2014, 11:36:04 am »
I don't think it has anything to do with optimalisation.
@Nexus They don't.
I found out that if I resize the window(maximum width, almost maximum height) or (almost maximum width, maxium height) the program doesn't slow down. But if I make it just a little bit bigger it sloooows.

6
General / Smaller window = better performance
« on: August 26, 2014, 10:41:30 am »
So I have this problem that if I resize my sfml window its performance changes. For example I have a window 400x800. If I resize the window to cover whole screen sprites move 5 times slower. Why is that?

7
Network / Re: UDP socket.send and socket.receive collide
« on: August 14, 2014, 09:47:08 am »
The problem was in:
socket.receive(packet, serverIP, serverPort);

I was overwriting serverIP and serverPort everytime I used this function. I know I shouldn't do this, but to be honest I don't know why is it such a problem(serverIP and serverPort stay the same). I guess it may have something to do with ports as I'm launching client and server from the same machine. Anyway: changing serverIP and serverPort to senderIP and senderPort solved the problem.

8
Network / Re: UDP socket.send and socket.receive collide
« on: August 13, 2014, 11:44:17 pm »
EDIT: Problem solved. Thank you very much for your effort  ;D

9
Network / UDP socket.send and socket.receive collide
« on: August 13, 2014, 06:00:34 pm »
Hello guys! I have a problem with a client: if I only use both socket.send and socket.receive like here:

socket.setBlocking(false);

    sf::RenderWindow window(sf::VideoMode(800, 600), "Game");

    while(window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }
       
        if(sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
        {
            packet << "action" << me.name << "right";
            status=socket.send(packet, serverIP, serverPort);
            packet.clear();
        }
       
        socket.receive(packet, serverIP, serverPort);
        if(packet.getDataSize()>0)
        {
            packet >> type_receive;
            if(type_receive=="movement_x")
            {
                packet >> name >> x;
                packet.clear();
                std::cout << name << "\t" << x << std::endl;
            }
        }
           
        window.clear(sf::Color::Black);
        window.display();
    }

The programme doesn't send nor receive. If I delete the socket.receive part like here:

socket.setBlocking(false);

    sf::RenderWindow window(sf::VideoMode(800, 600), "Game");

    while(window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }
       
        if(sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
        {
            packet << "action" << me.name << "right";
            status=socket.send(packet, serverIP, serverPort);
            packet.clear();
        }
           
        window.clear(sf::Color::Black);
        window.display();
    }

The programme works. Do you know why is that? I tried almost everything  :'(

Pages: [1]
anything