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

Pages: 1 ... 3 4 [5] 6 7 ... 9
61
SFML projects / Dwell - A Retro Sandbox Survival MMO
« on: June 16, 2013, 09:28:45 pm »




What is Dwell?
A cross between creativity, horror, and adventure, Dwell aims to be an MORPG like no other. Settle, create a village, and defend your friends from the horrible creatures who lurk in the forests. You can change the landscape, farm, or hunt in order to survive the conditions-- it's all up to you.

How can I play?

Dwell is currently in its closed Alpha 1.0 stage. You can download alpha here (our temporary forum). Please register on the forums so we can track bugs and errors :)

http://www.youtube.com/watch?v=rkBnF3X-5Ig

What features are planned?
-An ever-changing world shaped purely by the players
-Villages created and governed by the players themselves
-Basic jobs, like farming, mining, fishing, woodworking, cloth working, and cooking
-Advanced building, allowing you to make a personalized home for your needs and profession
-A simplified stats system, reducing grind and improving players' experiences
-Skill-based combat (no more button bashing or complex combat systems!)
-Diplomacy amongst villages and villagers
-Children and Family NPCs (spawned based on your stats and living conditions)
-Pets and farm animals

What platforms will Dwell be available on?
At the moment, Dwell is only available on Windows (XP, Vista, Win7, and Win8 successfully tested). After our early testing phases, we aim to have a solid build out for everyone to enjoy, including those on MacOS and Linux. Please be patient-- we want everyone to play ASAP!

Who are the developers?
Jungletoe (Programming), ICT (Pixel Art), LegendWeaver (GUI Art), and Allen Calmes (Music). We're informally part of the development group Giraffes. Dwell is currently our main project.

Where can I find more info?
Website - http://playdwell.com
Youtube - http://www.youtube.com/user/MrJungletoe
Twitter - http://twitter.com/JungleTheDev

What libraries did you use?
SFML, libnoise, TGUI, and pugixml.










62
Network / Re: TCP packet corruption in non-blocking mode
« on: June 07, 2013, 12:54:22 am »
Thank you very much for investigating this. I'm happy we are finally able to move towards a fix after these months! Binary, I don't have money to repay you after what you've done, but if there's ever anything I can provide to you (doubtful), I am forever in your servitude :)


63
Network / Re: Sound freezes
« on: June 06, 2013, 09:24:45 am »
Edit: Yeah it seems there is a really nasty bug that is causing this ::). I'll start a separate thread when I get home today.

Ah, finally!  :D

64
Network / Re: Sound freezes
« on: June 06, 2013, 09:16:14 am »
I think delaying the sending of large packets quickly prevents the problem from happening.

EDIT:
Nope.

65
Network / Re: Sound freezes
« on: June 05, 2013, 06:37:09 pm »
Ah ok, so after watching that video, the send() in the server will return NotReady if the receive buffer is full?

What if I already handle that? Here is my code for sending packets:
void Connector::sendPacket(sf::Packet* spack)
{
        if(packets.size() <= 0)
        {
                sf::Socket::Status status = socket.send(*spack);

                if(status == sf::Socket::NotReady || status == sf::Socket::Error)
                {
                        packets.push(*spack);

                        if(status == sf::Socket::Error)
                        {
                                std::cout << "E1E\n";
                        }
                }
        }

        else
        {
                packets.push(*spack);
        }
}
 

and if it pushes the packet back, it'll eventually return with the retryDroppedPackets() function and do this:
if(!ent::connectors[i]->packets.empty())
                {
                        sf::Socket::Status status = ent::connectors[i]->socket.send(ent::connectors[i]->packets.front());

                        if(status == sf::Socket::Done)
                        {
                                ent::connectors[i]->packets.pop();
                        }

                        if(status == sf::Socket::Error)
                        {
                                std::cout << "E1E\n";
                        }
                }
 


Also, when the send() buffer is full like you said, would it only stop sending packets to ONE socket (the socket it was sending to)? Not the sockets of every person connected to the server?


Edit
I just read this over on GameDev.net

Quote
If [send()] doesn't block, it will buffer whatever it can and return that length.

So could this be the problem? Could the send() just be stuck with the overflow of data? Is there any way to avoid this?

66
Network / Re: Sound freezes
« on: June 05, 2013, 06:12:14 am »
After a lot of reviewing and labor, I can't reproduce the same errors again unless I use the exact networking structure I use in my project. Would it be okay if I posted it all here?

I will try to keep it as minimal as possible.

67
Network / Re: Sound freezes
« on: June 05, 2013, 03:12:49 am »
I think it is obvious it won't work? The whole program will finish execution in less than 1ms on a decent system because the sockets don't block and the data will have just left the network adapter... Also if you send that fast, you might even overflow the send buffer because there might be latency between your application and the operating system or hardware. You would have to check the return value for the send as well in that case to determine if the data was properly queued for sending.

Check the edits. The problem appears to be with the non-blocking connect.

Edit
Never mind, this appears to be the same issue. I misread what you said.
I did check the return value, as I showed here: http://en.sfml-dev.org/forums/index.php?topic=11221.0

Edit 2
So what do you suggest I do? I think I'm overflowing the receive buffer in the client because of all the data I'm sending extremely fast.

68
Network / Re: Sound freezes
« on: June 05, 2013, 02:37:52 am »
Your snippet works perfectly, but this doesn't:

int main ( int argc, char *argv[] )
{
        sf::TcpSocket socket;
        socket.setBlocking(true);
        socket.connect("192.168.1.14", 41013);
        socket.setBlocking(false);
       
        for(sf::Int32 j = 0; j < 5; j++)
        {
                //      SEND
                {
                        sf::Packet pack;
                        for(sf::Int32 x = 0; x < 3000; x++)
                        {
                                sf::Int32 num = 1;
                                pack << num;
                        }
                        socket.send(pack);
                }

                std::cout << "Sent packet #" << j << "\n";
        }

        for(sf::Int32 j = 0; j < 5; j++)
        {
                //      REC
                {
                        sf::Packet pack;
                        socket.receive(pack);

                        for(sf::Int32 x = 0; x < 3000; x++)
                        {
                                sf::Int32 num;
                                pack >> num;

                                if(num != 1)
                                        std::cout << "corruption";
                        }

                        std::cout << "Recieved packet #" << j << "\n";
                }
        }

        system("PAUSE");
        return 0;
}
 

Just use the server from your example and use the above as the client.


Edit
Aaaaaand I just discovered the problem. Switching from blocking to non-blocking after connecting SEVERELY distorts packets. I thought non-blocking connect() doesn't work?

Edit 2
Non-blocking connect() does not work. It returns NotReady.

Edit 3
Related topic: http://en.sfml-dev.org/forums/index.php?topic=7435.0


Edit 4
This doesn't corrupt it. My bad-- one second please.


69
Network / Re: Sound freezes
« on: June 04, 2013, 05:01:15 pm »
I assume Jungletoe is reporting about these problems while running the server software on only a single host and thus can only evaluate a single environment. I will test sending and receiving different packet sizes on multiple hosts at my disposal and see if I can come up with anything.

Awesome, thanks!

70
Network / Re: Sound freezes
« on: June 04, 2013, 01:11:38 am »
you should think about tidying up that code first.. until then im not even going to bother to look at it.

How much more clear can I make it? I commented it and provided a rational on what it does.

71
Network / Re: Sound freezes
« on: June 03, 2013, 02:18:07 pm »
Ok, here is some code that will replicate it.

Send this from a server to a client:
if(recievedPacket) // Treat the client-sent packet as a request for the server to respond
        {
                for(sf::Int32 j = 0; j < 5; j++)
                {
                        sf::Packet* spack = new sf::Packet;
                        sf::Int32 packID = 99;
                        *spack << packID;

                        for(sf::Int32 x = 0; x < 2050; x++)
                        {
                                sf::Int32 num = 11;
                                *spack << num;
                        }

                        socket.send(*spack);
                }
        }
 

As you can see, it sends that large packet 5 times. It will work the first 2 times. The third and fourth time, it will be distorted. The fifth time, it will be dropped (along with any packets of any size sent afterwards-- thus the recv() freeze).

72
Network / Re: Sound freezes
« on: June 03, 2013, 01:59:47 pm »
I tried running the client. I couldn't notice any strange behaviour regarding the traffic, then again all the packets being sent and received were smaller than 200 bytes.

Is there a way to make the client send/receive larger packets? Maybe something you would have to do in game...

I recently broke down the packet sizes a bit. Freezes usually happen when people are walking and loading new chunks, or loading the game. They seem to happen a lot more frequently when loads of people are on at once.

Try relogging multiple times in the forest right next to spawn. Spamming chat messages also increases the frequency (if you need someone to spam chat, let me know).


Also... is there a reason why you need to send such large packets over the network? Generally sending such large data chunks at once and letting lower layers take care of fragmentation is an unhealthy practice...

Map data chunks. Basically, there are 20x20 chunks which each hold a tileID (Int32) and a transitionID (Int32)... and those are just the map chunks. It also has to send animal chunks, object chunks, and dropped object chunks.

Before I broke down the object chunks and made it send each individual object alone (instead of large chunks), it would often start distorting around object chunk sending. Now it seems that dropped item chunks and animals seem to crash the client a lot more.

I'm working on replicating the bug through a minimal and complete example at the moment.

73
Network / Re: Sound freezes
« on: June 03, 2013, 05:18:26 am »
Yeah, I had a lot of university work to do over the last week so I wasn't able to do any SFML related work.

Ah sorry. I've been stressed out as well between this problem and exams. Sorry if I sound annoying or pushy, it's just that I'm really mad at this whole situation. My anxiety is catching up with me :(

I tried to download the client however it just gave me a 404 error? :-\

Sorry, use http://colonies-game.com/downloads.php

Oh and in case you are completely restless, I can tell you it is unwise switching to BSD sockets until you have determined where the exact problem really is. In the worst case you might end up having the same issue even when using BSD sockets and wasted a ton of time needlessly rewriting a lot of code.

That's my fear. My constant problem is just lack of control in this situation though, which I guess is what happens when I chose a highlevel library.


Just on a side note, how much bandwidth does the client require to function properly, as in be played without too many strange things happening?

How would I test this (I'm nearly 100% certain it has to do with bandwidth now)?

EDIT:
Ran some more tests. Apparently it only starts screwing up if you send multiple huge packets, not just one.

EDIT 2:
It appears that the max size of a packet I can send repeatedly (more than 2 times) without corrupting/stop receiving/dropping is 65472 bytes. If I make the packets smaller, they won't error out, but will error out after being sent more times than 5.


74
Network / Re: Sound freezes
« on: June 03, 2013, 03:23:26 am »
...and I can't find a fix. Can you guys provide some support on this? It's obviously a large flaw that's been ignored for quite some time.

I've been asking for support for 2 months on this issue and have gotten nowhere. My friend who's a fan of BSD sockets has been telling me to switch away from SFML for some time now, and I'm starting to trust him more and more. I'm extremely pissed off that all of the work I've put into the backend for my whole game is now defunct, so I would really like an immediate explanation. Months of putting up with complaints of my community is starting to take a toll on me. This is embarrassing for both SFML and harmful to me financially now that players have left the game due to the freezes.

75
Network / Re: Sound freezes
« on: June 02, 2013, 05:51:14 am »
Screw it. I ran my own tests. It seems that it's a problem with my object packets being too big.

I ran a test where I sent 20 very large packet (20,000 bytes) and the client suddenly stopped receiving packets and corrupted/dropped most of the packets (except 1).

Next, I sent 20,000 packets with 20 bytes. No problems.

Overall, the same amount of data was sent, but bigger packets seem to corrupt and get trashed. Wireshark picked up that the packets were still being sent around, just the rec() funct wasn't working correctly. I believe this is a bug with SFML.

Why does this happen? Beats me, but I'd like an answer and a possible solution. Thanks.

Pages: 1 ... 3 4 [5] 6 7 ... 9
anything