• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Exiled

Members
  • Content count

    12
  • Joined

  • Last visited

Community Reputation

105 Neutral

About Exiled

  • Rank
    Member
  1. Argh! So many SDL_net problems! This one is probably the most important one. I have a basic chat working. However, I'm not sure how to have clients remotely connect. I have port forwarded on my server port (9001), and replaced "localhost" with my external IP address. However, the clients are still unable to connect. If you need any code, just ask. Have you guys had the same problem? Thanks in advance. -Exiled
  2. [quote name='Tribad' timestamp='1339006839' post='4946829'] As I said before. You do not analysed the traffic. This only makes it a better guess. Between you clients and the server you have the TCP/IP stacks of two machines and the wireing between them. Or if they run on one machine you even have the TCP/IP stack between the two application and the operating system anyways. If you have a hardware with multiple cores running you have parallel execution of the two applications. That a lot of stuff. And as long as you do not check the traffic between your clients and the server you are only guessing. You are seeing misbehaviour and you do not have a clue whats wrong. So you worry about whats wrong but you must prove your result. This is how failure analysis is done. And while developing software you will do this all the time. If you are not proving your idea about the failure you cannot exclude things. What you are doing right now is excluding without knowledge. This is fatal and not best practice. [/quote] "I do not analysed the traffic".... You have no direct point, Telnet is developed by Microsoft. Both my client and Telnet disconnect when the server receives something. This means the fault is with the server; it cannot be with the client.
  3. [quote name='Tribad' timestamp='1338983035' post='4946729'] So I take from your words, that you have not analysed the traffic. This is only an indication. Only if you analyse the packets transmitted you have knowledge. It is a guess that telnet does not terminate the session at will. [/quote] It is not a guess; it happened with my game client as well.
  4. [quote name='Tribad' timestamp='1338977538' post='4946706'] Aha And what is the servers code posted then. I think that the client code is needed for review. It is absolutely ok that the server gives you a -1 if the client send an RST or FIN. The question is what is wrong in the client code that it closes the connection after sending. If the client dies before the packet has been processed by the server the client sends a RST. That clears anything that already has been received by the OS socket code. This is why termination should first shutdown, FIN, the connection. This allows the receiver to process any data already received. And if that is done the socket gets closed, RST. So I would think the client dies and the OS skips the shutdown, FIN, so you are getting a close, RST. [/quote] I am using Telnet as a test client. Therefore, the code problem is with the server.
  5. [quote name='Tribad' timestamp='1338965745' post='4946672'] I would suggest to install a network sniffer like wireshark to see what your connections do. So you can see who is disconnecting, the client or the server. [/quote] I already know the client is disconnecting, the server can easily handle more connections.
  6. [quote name='hplus0603' timestamp='1338962697' post='4946664'] It looks like the server falls off the end and exits its process when it receives something. If it does that, the socket gets automatically closed by the kernel, and the client will be disconnected. [/quote] Hmm. That makes sense - any ideas on how I can fix it?
  7. I'm aware I just made a post about SDL_net; however, I have run into a new problem. Packets are sending and getting received. However, when the server receives the data, the client simply disconnects. The SDLNet_TCP_Recv(...); function returns -1. I cannot find the error, for SDLNet_GetError(); isn't working for me(it returns nothing). Has anybody run into this problem before? My code is below. //Receiving Code [CODE] result = SDLNet_CheckSockets(player_sockSet, 0); //loop through each client for(int client = 0; client < maxPlayers; client++) { //check the socket for activity int clientSocketActivity = SDLNet_SocketReady(players[client].sock); if(players[client].connected == true && clientSocketActivity > 0) { //attempt to read from the socket. //non-positive return values indicate error int bytesRecv = SDLNet_TCP_Recv(players[client].sock, msg, 256); if(bytesRecv > 0) { //display the result stringstream ss; ss << "Received " << bytesRecv << " bytes from client " << client << "!"; consoleOut(ss.str()); } else { //there was an error stringstream ss; ss << "Player " << client << " has disconnected."; consoleOut(ss.str()); players[client].connected = false; connectedPlayers--; //disconnect the socket } } } [/CODE] Please excuse the bad indenting, it's because of copy + paste. Thanks in advance! -Ex
  8. [quote name='BeerNutts' timestamp='1338927940' post='4946571'] [quote name='Exiled' timestamp='1338922235' post='4946545'] [quote name='BeerNutts' timestamp='1338908351' post='4946461'] You check if player_socket has data available, but then you try to receive from player[x].sock. I believe you should change the check to player[x].sock [/quote] I check if player_sockSet has data available. A sock set is exactly what it states: a socket set. I have a socket set of all the player sockets... I check it every loop of the for loop. [/quote] My bad, I read it as "player_[b]socket[/b]" not "player_[b]sockSet[/b]" [/quote] Ah, it's all good.
  9. [quote name='Xanather' timestamp='1338892085' post='4946374'] Uhh, Ive never used SDL but where is the call to consoleOut? there is no other methods/calls in the sending code you have provided? SDLNet_TCP_Send(sock, "EX_DC", 6); /* *** this is placed at the end of int main(), to determine a disconnect. (EX_DC = Exiled(prefix), Disconnect(action). *** */ [/quote] consoleOut(); is just a function I made for outputting stuff to a console I made with graphics rather than a console window. I'm actually using Allegro 5 for graphics and SDL_net for networking.
  10. [quote name='BeerNutts' timestamp='1338908351' post='4946461'] You check if player_socket has data available, but then you try to receive from player[x].sock. I believe you should change the check to player[x].sock [/quote] I check if player_sockSet has data available. A sock set is exactly what it states: a socket set. I have a socket set of all the player sockets... I check it every loop of the for loop.
  11. I've been working on a server for a game I'm working on. I'm having some trouble with sending and receiving packets... Here's my sending code... [CODE] SDLNet_TCP_Send(sock, "EX_DC", 6); /* *** this is placed at the end of int main(), to determine a disconnect. (EX_DC = Exiled(prefix), Disconnect(action). *** */ [/CODE] ...and here's my receiving code. [CODE] for(int x = 0; x < connectedPlayers; x++) { int ready = SDLNet_CheckSockets(player_sockSet, 0); if(ready != -1) { result = SDLNet_TCP_Recv(players[x].sock, msg, 256); consoleOut("Received data!"); } } //This is placed inside of a for loop that loops through an array of clients. [/CODE] When I send the data, the server doesn't print anything to the console. What am I doing wrong?