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

Pages: [1]
1
Thankyou

2
Network / [SOLVED] does pre-SFML-2.3 have problems with partial tcp sends?
« on: November 19, 2015, 01:08:21 am »
Hello everybody.
I was reading the tutorials on this website for "communicating with sockets". I noticed the disclaimer down the bottom which read:
Quote
When using sf::TcpSocket in non-blocking mode, calls to send are not guaranteed to actually send all the data you pass to it, whether it be as a sf::Packet or as raw data. Starting from SFML 2.3, when sending raw data over a non-blocking sf::TcpSocket, always make sure to use the send(const void* data, std::size_t size, std::size_t& sent) overload which returns the number of bytes actually sent in the sent reference parameter after the function returns.

I was just wondering if this problem of partial sends (with unblocking tcp sockets) happens with all versions of SFML and has only been presented with a solution for SFML2.3, in which case I should update to SFML2.3. Or is this problem only in SFML2.3 so I'm fine to stick to my older version?

thankyou.

3
Network / Re: a good method for client/server communication
« on: July 17, 2014, 04:18:30 am »
thankyou will do.

4
Network / a good method for client/server communication
« on: July 17, 2014, 03:29:16 am »
Hello everyone!

so the first two times I have tried implementing networking features into a game I did something along the lines of have the client send the server info then the server disperses this information to all clients.

this worked fine, but quickly I realised that I needed a method to define which types of information was being sent and received from both the server and the client, by this I mean the client might send the server the player's x position, but then the server wont know what to do with it, it would just be a random number which could represent anything like the players x or y position or it's velocity etc.

Then I created a kind of "index" that defined what all the types of information being being sent and received meant. So say the client was sending the server it's x position then there would be a 1 at the beginning of the package that the server could then read and thus know what type of information the package contained. and if the client were to send it's y position it would have a 2 at the beginning of the package so the server knew it was a y position that it was receiving.

okay so what my question is really asking is, is there a better way to do this? after having more than a few different types of information being sent and received it started feeling a bit chaotic, or is this the correct method and should I be working on cleaning up my code and making improvements to make it less chaotic?

I'm using UDP and sfml2.0 by the way

5
General / Re: event delay on linux
« on: March 05, 2014, 09:33:19 am »
Yes, thankyou, you were right, I was using:
if (window.pollEvent(event))
 
instead of:
while (window.pollEvent(event))
 

6
General / Re: event delay on linux
« on: March 05, 2014, 07:55:18 am »
I have an std::vector of sprites, and I add a sprite to the vector.
I figured it wasn't a coding problem because it worked fine on windows...

7
General / event delay on linux
« on: March 05, 2014, 07:03:14 am »
hello everybody
So I'm using:
linux mint 16 - 64 bit.
sfml2.0
code::blocks
GNU GCC compiler

so I will press a button then about one second after it will register I pressed the button, then about one second after I stop pressing the button it will register that the button has stopped being pressed, this also happens for mouse events.

this is an examaple of what I use:
    if (event.type == sf::Event::MouseButtonPressed)
    {
        if (event.key.code == sf::Mouse::Left)
        {
            //do stuff
        }
    }
 

oh and the lag gets longer the longer the program is running.

I compiled it on window 8 using code blocks and mingw and this problem was not present.

Thankyou for any help.

8
General / Re: window only updating when moving mouse...
« on: February 14, 2014, 11:37:01 pm »
oh wow, I feel so dumb, you're right!
anyway, so I just moved the all he update function out of the where the events are handled and it works fine

thankyou

9
General / window only updating when moving mouse...
« on: February 14, 2014, 11:01:53 pm »
Okay so here's my problem...
previously I had my game loop like this:

        sf::RenderWindow window(sf::VideoMode(600, 800), "sfml game");
        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        /* update */
                }
        }
 

and this didn't work because my sprites would only be updated when I was moving the mouse, I figured this was beause it was not polling events and thus wasn't updating, so then I added this "|| true" to the loop, so it will be updating and checking events:

while (window.pollEvent(event) || true)
 

and this worked perfectly... until I moved to linux mint.
when I dont have the
|| true
it has the same problem as I did on windows, but when I do have it, I compile it on code::blocks and it compiles, but when I try to run it, it shows up like the terminal where all the
std::cout <<
commands go, but not the actual game window.

information:

window 7 home premium:
microsoft visual studio 2010 express edition

linux mint 16:
code::blocks, compiled with GNU GCC compiler

thankyou very much.

10
Audio / Re: error C2039: 'Sound' : is not a member of 'sf' vc++ error
« on: January 27, 2014, 06:02:38 am »
Strange, I managed to fix it, but I don't know why it had this problem to start with.
first time I defined my sf::sound in the header file, this gave me the "'Sound' : is not a member of 'sf'" error.
but when I define it in the .cpp file it works fine and as expected.

oh well I'll just have to put up with it, atleast I managed to fix it at all.

11
Audio / error C2039: 'Sound' : is not a member of 'sf' vc++ error
« on: January 27, 2014, 02:55:22 am »
Hello Everyone
I only started using the sfml audio module today, and when I try to define a sound and compile my code, visual studio gives me an error saying "error C2039: 'Sound' : is not a member of 'sf'"

normally on vc++ it  underlines a word in red if it has found an error, but with this it only gives me an error when I compile.

I have included SFML/Audio.hpp, but indirectly, meaning I'm including a header file that's including SFML/Audio.hpp. If that means anything.

I've also added sfml-audio-d.lib as an additional dependency, in the linker properties.

another curious thing is when I try to run the example programs for sound and sound capture a window pops up saying "the program can't start because openal32 dll is missing from your computer"
perhaps that's the reason, if it is I have no idea how to fix it...

I'm using sfml 2.0, on windows 7 home premium, and compiling on microsoft visual c++ 2010 express edition

ThankYou c:

12
Window / Open A Directory Search Window?
« on: December 31, 2013, 11:30:25 pm »
The topic pretty well explains it all, in my game I need the player to locate an image on their computer, and I'd like there to be a browse option rather than them having to copy and paste the address of the image.

and if sfml can't do this can someone point to a c++ library that can? (the most light weight)

Thank You.

I'm using sfml 2.0

Pages: [1]