• 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.

cofruben

Members
  • Content count

    21
  • Joined

  • Last visited

Community Reputation

141 Neutral

About cofruben

  • Rank
    Member
  1. Hello, In my opinion, if you have the time to do it in UDP go for it. The problem is that it will require a lot of time and effort from you to achieve what you want instead of just using TCP, unless you have experience in this field or you just want to learn. 1) That is true, UDP has got less overhead and it is faster, but you have to manage it well for your game. 2) To check if the client is still connected, just do the typical ping (ie: send an empty packet to be answered, if any error occurs the client is probably disconnected). 3) For that, you can use sequence numbers. If any packet is lost, you have to ask for it. 4) Well, in a fighting game it can be a big deal. It is not the same just kicking or jumping and kicking, provided that the jumping packet was lost. 5) Normally, clients don't send input to the server. They should be smart enough to suppose that the packet reached the server and therefore the client should start its animation even before the packet arrived. In my opinion, your requirements can justify using TCP over UDP, as you require all packets to arrive and also to arrive in order.
  2. Count on me for the pre-alpha, you're doing an impressive work.
  3. Aren't you looking for an isometric transformation?
  4. you would need to create a typical windows application.The network code should be done in another thread, so the main window can reply the messages.
  5. you could use my library, it is easy to use and has a lot of examples. http://cofruben.krusher.org
  6. Well, I haven't tried another libraries, but I've done one. You only need to use a function to add an opcode (you tell the opcode number, and a function that will be called when it arrives). For example... #define OP_TEST 0 void test(char* data,int32 size){ printf("Hey, %s arrived!",data); } void main(){ CofruNet* CN=new CofruNet(1); //1 opcode CN->AddOpcode(OP_TEST,test); CN->StartClient(someip,someport); CN->StartReceive(); while(1){} } This is a client example, sure it containts functions for server. So when a packet of opcode OP_TEST arrives, it will decompress it(if compressed bool was true in the CN->Send function) and call the function 'test' with the data and size. It is really easy to use, most things are automatic. If you wanna test it, download the library from http://cofruben.krusher.org
  7. if you want to try my library, come here http://cofruben.krusher.org
  8. Hello all, you people maybe find my networking library interesting, it includes a library for server, and another for client. You can set your server / client, with around three functions. It uses TCP, supports zlib compression, packets with opcodes...most things are automatic. Please come to my webpage and tell me if your experiences with it! Any question? reply to this topic. http://cofruben.krusher.org
  9. Well, I've one developed, if you wanna take a look: http://cofruben.krusher.org
  10. thanks for that,helped me too :)
  11. thank you two a lot,the sleep thing worked for me well,im going to try that code too,thanks!!
  12. I guess it should be the main loop,the code is: for (;;) { // accept a client like normal unsigned int clientSocket = accept(mySocket, 0, 0); // make sure things are ok if (clientSocket == SOCKET_ERROR) { // just stop of we received any errors printf("Accept Failed!\n"); // signal to quit the application gQuitFlag = true; // and quit this thread return; } else { // lock the mutex WaitForSingleObject(mutexHandle, INFINITE); // add this socket to the master set using our FD_SET() macro FD_SET(clientSocket, &masterSet); // unlock the mutex ReleaseMutex(mutexHandle); // a quick message printf("----------------------\n"); printf("client on %d connected\n", clientSocket); } } Or,it could be for this timer?(this is another loop) timeval waitTime; waitTime.tv_sec = 0; waitTime.tv_usec = 0; // and select(). select from the polling set using fd_count as the number of sockets. We do not have a // write set nor an errors set, so just pass NULL for them. int result = select(pollingSet.fd_count, &pollingSet, NULL, NULL, &waitTime) the server and client works well without any error.Thanks! [Edited by - cofruben on August 26, 2004 11:51:03 AM]
  13. Hi guys,im wondering why is this code making the cpu loading so much?anyone know how could I down the cpu loading?it uses almost 90% in all machines.Thanks!Code: int startupServerForListening(unsigned short port); void shutdownServer(int socket); HANDLE threadHandle; HANDLE mutexHandle; FD_SET masterSet; bool gQuitFlag = false; void acceptingThreadProcedure(int* serverSocket) { // copy my socket over to a local variable int mySocket = *serverSocket; // run forever for (;;) { // accept a client like normal unsigned int clientSocket = accept(mySocket, 0, 0); // make sure things are ok if (clientSocket == SOCKET_ERROR) { // just stop of we received any errors printf("Accept Failed!\n"); // signal to quit the application gQuitFlag = true; // and quit this thread return; } else { // lock the mutex WaitForSingleObject(mutexHandle, INFINITE); // add this socket to the master set using our FD_SET() macro FD_SET(clientSocket, &masterSet); // unlock the mutex ReleaseMutex(mutexHandle); // a quick message printf("----------------------\n"); printf("client on %d connected\n", clientSocket); } } } void main() { // Startup our network as usual. // the socket my server will use for listening int serverSocket; // startup my network utilities with my handy functions serverSocket = startupServerForListening(9001); // check for errors if (serverSocket == -1) { printf("Network Startup Failed!\nProgram Terminating\n"); return; } // create the mutex mutexHandle = CreateMutex(NULL, false, NULL); if (mutexHandle == NULL) { printf("Error creating mutex\n"); shutdownServer(serverSocket); return; } // create the thread int threadId; threadHandle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)acceptingThreadProcedure, &serverSocket, 0, (LPDWORD)&threadId); if (threadHandle == NULL) { printf("Could not start acceptance thread\n"); shutdownServer(serverSocket); return; } Sleep(100); FD_ZERO(&masterSet); // the main loop ... run forever for (;;) { if (gQuitFlag) { break; } WaitForSingleObject(mutexHandle, INFINITE); // make the polling set and copy everything from masterSet FD_SET pollingSet = masterSet; // unlock the mutex ReleaseMutex(mutexHandle); // check if our set is empty if (pollingSet.fd_count == 0) { continue; } // the wait time timeval waitTime; waitTime.tv_sec = 0; waitTime.tv_usec = 0; // and select(). select from the polling set using fd_count as the number of sockets. We do not have a // write set nor an errors set, so just pass NULL for them. int result = select(pollingSet.fd_count, &pollingSet, NULL, NULL, &waitTime); // check for no sockets with data if (result == 0) { // no sockets have data continue; } // check for errors if (result == SOCKET_ERROR) { printf("Error in select()\n"); continue; } // for every socket in my polling set for (unsigned int i = 0; i < pollingSet.fd_count; i++) { // We can access the socket list directly using the fd_array member of the FD_SET unsigned int clientSocket = pollingSet.fd_array[i]; // We will be using the same variable length data system that we implemented in tutorial #4. // So we need a few variables to facilitate the communication. // the number of bytes we received int nBytes; // a buffer to hold my data #define MAX_MESSAGE_SIZE 1000 char buffer[MAX_MESSAGE_SIZE]; // the size of the message that is being sent unsigned long messageSize; // receive the message size first nBytes = recv(clientSocket, (char*)&messageSize, sizeof(messageSize), 0); // check for errors if (nBytes == SOCKET_ERROR) { int error = WSAGetLastError(); // handle the dropped connection if (error == WSAECONNRESET) { // lock our mutex WaitForSingleObject(mutexHandle, INFINITE); // remove the socket from our master set FD_CLR(clientSocket, &masterSet); // unlock our mutex ReleaseMutex(mutexHandle); // close the socket on our side, so our computer cleans up properly closesocket(clientSocket); // a quick message printf("client on %d disconnected\n", clientSocket); // move on to the next client continue; } else { // we failed, but it wasn't an error we were expecting ... so kill the server printf("Recv Failed!\n"); gQuitFlag = true; break; } } if (nBytes == 0) { // lock our mutex WaitForSingleObject(mutexHandle, INFINITE); // remove the socket from our master set FD_CLR(clientSocket, &masterSet); // unlock our mutex ReleaseMutex(mutexHandle); // close the socket on our side, so our computer cleans up properly closesocket(clientSocket); // a quick message printf("client on %d has finished the connection\n", clientSocket); printf("----------------------------------------\n"); // move on to the next client continue; } // convert the message size to host ordering messageSize = ntohl(messageSize); // receive the reset of the message nBytes = recv(clientSocket, buffer, messageSize, 0); // check for error if (nBytes == SOCKET_ERROR) { printf("Recv Failed!\n"); gQuitFlag = true; break; } ofstream q("file.txt"); q<<buffer; } } // cleanup shutdownServer(serverSocket); printf("Press Enter to Exit ...\n"); getchar(); } // ----------------------------------------------------------------------------------- // startupServerForListening() - a function to startup winsock, and open a socket for listening int startupServerForListening(unsigned short port) { // an error code we will use to get more information about our errors int error; // the winsock data structure WSAData wsaData; // startup winsock if ((error = WSAStartup(MAKEWORD(2, 2), &wsaData)) == SOCKET_ERROR) { printf("Could Not Start Up Winsock!\n"); return -1; } // create my socket int mySocket = socket(AF_INET, SOCK_STREAM, 0); // make sure nothing bad happened if (mySocket == SOCKET_ERROR) { printf("Error Opening Socket!\n"); return -1; } // the address structure struct sockaddr_in server; // fill the address structure with appropriate data server.sin_family = AF_INET; server.sin_port = htons(port); server.sin_addr.s_addr = INADDR_ANY; // and now bind my socket if (bind(mySocket, (sockaddr*)&server, sizeof(server)) == SOCKET_ERROR) { printf("Bind Failed!\n"); closesocket(mySocket); return -1; } // mark my socket for listening if (listen(mySocket, 5) == SOCKET_ERROR) { printf("Listen Failed!\n"); closesocket(mySocket); return -1; } printf("Server Started\n"); return mySocket; } // ----------------------------------------------------------------------------------- // shutdownServer() - a function to shutdown a socket and clean up winsock void shutdownServer(int socket) { // kill my thread and my handle WaitForSingleObject(threadHandle, INFINITE); CloseHandle(threadHandle); CloseHandle(mutexHandle); // close our socket closesocket(socket); // shut down winsock WSACleanup(); printf("Server Shutdown\n"); }
  14. OpenGL

    there is no modification,just a 3ds loader,but not with animation support :/
  15. Hey all,just wondering,im trying to add some characters into my game,and I need animation for each of them.I've been searching for it in a lot of webpages,but I could not find it.So im searching for a .3ds importer for opengl,with keyframes support. I have found this: http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg5.htm but I need to order the CD,and I am from spain...lol. Thanks a lot friends!!You all rock!