Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

174 Neutral

About wortel

  • Rank
  1. wortel

    networking engine question

    I'm also currently busy with my first networked game, got it to send packets back to For help starting, look at the networking forum's FAQ, they've got some great links. I'm using the ENet library and i really like it. It's easy to use as well. There's a link to it somewhere in the FAQ as well. Somewhere in there's some links to how the Q3 networking system works, check that out, as well as the Unreal one, to hear how the pro's do it. Really worth the read. Good Luck.. =]
  2. I know Java and C++, and the difference isn't *that* big (compared to basic etc). I like C++ more because it feels like I have more control over the pc, and it's easier to hack code :)). Also just the number&variety of libraries available are real nice. However IMO coding java is more fun, it's cleaner, and goes faster (I also felt it was easier to debug, although this is quite dependant on what IDE etc you use). What i hate about java is that it's such a mission to get people to play your games, however, a game of mine ran absolutely fine on a mac (without me ever testing it on one!) which is not quite possible with c++. (Said game didn't run at all on linux, tho). Basically, if you feel like making a small 2D game just for fun, I'd go with Java. If you want to make a bigger, distributable, possibly 3D game, I'd go with c++.
  3. wortel

    Picture war (56K Warning)

    Quote:Original post by ViLiO
  4. wortel

    Dev C++ and DirectX 9

    There is a devpak for directx 9, although i don't believe there's one for the october version. I have it on my pc, although i didn't use it (I chickened out and switched to allegro =]). Should be easy to use though, i haven't encountered a devpak that gave me trouble. If you can't find it let me know..
  5. Hi, Basically, I'm writing a 2D networked arcade type game, with players shooting each other soldat - style, using Allegro and Enet, but I'm having a lot of trouble getting my program to compile using Dev-C++/ Mingw. I really think I've tried everything, but I keep on getting the following error: [Linker error] undefined reference to `vtable for S_Object' I have no idea what a vtable is (i'm inexperienced with c++), but AFAIK I'm doing everything right. The compiler log gives the following: Compiler: Default compiler Building Makefile: "C:\Dev-Cpp\stick\Makefile.win" Executing make... make.exe -f "C:\Dev-Cpp\stick\Makefile.win" all g++.exe Server.o Arena.o Client.o main.o S_Client.o Warrior.o S_Object.o Project1_private.res -o "Project1.exe" -L"C:/Dev-Cpp/lib" -mwindows -lalleg -lenet -lws2_32 -lwinmm S_Object.o(.text+0x8):S_Object.cpp: undefined reference to `vtable for S_Object' S_Object.o(.text+0x16):S_Object.cpp: undefined reference to `vtable for S_Object' collect2: ld returned 1 exit statusmake.exe: *** [Project1.exe] Error 1Execution terminated I don't want to include too much source with this, but since i can't find anything wrong with S_Object.h/S_Object.cpp, and I'm guessing that the problem lies with the class thats derived from them, I'm going to include all four, so bear with me :) Both the client and server uses these classes to represent objects, although they have different functions to perform operations on them. I know, this might not necessarily be the best way to do it, but I think it's nice and structured. I've mangled them a bit, trying to find the problem, S_Object used to be abstract but that didn't make a difference, I got the same problem. Ok, S_Object.h: #ifndef S_OBJECT_H #define S_OBJECT_H class S_Object //abstraction for all object stored in list { public: S_Object(); int getID(); S_Object *next; bool removeMe; int ID; //Serverside only virtual void Supdate(); virtual int pack(char*);//pack hele object void netPack(void* addr,int n,char*buff,int counter); //pack 'n variable //Clientside virtual int netUpdate(char*); virtual void update(); void netRead(void* addr,int n,char*buff,int counter); protected: int type; float xpos; float ypos; int dir; int status; }; #endif S_Object.cpp : /* Shared S_Object functions */ #include "S_Object.h" #include <string.h> S_Object::S_Object(){} void S_Object::netPack (void* addr,int n,char*buff,int counter) { memcpy (&buff[counter],addr,n); } void S_Object::netRead (void* addr,int n,char*buff,int counter) { memcpy (addr,&buff[counter],n); } int S_Object::getID() { return ID; } Warrior.h (Warrior is a type of object stored in a list) : #ifndef WARRIOR_H #define WARRIOR_H #include "S_Object.h" class Warrior:public S_Object { public: Warrior (); int ownerID; bool isAlive; int color; //Client functions virtual void update(); virtual int netUpdate(char*); // void netPack(void*,int,char*,int); //Server virtual void Supdate(); virtual int pack(char*);//pack hele object //void netRead(void*,int,char*,int); private: float xspd,yspd; }; #endif And finally, Warrior.cpp #include "Warrior.h" #include "S_Object.h" #include <string.h> Warrior::Warrior() { isAlive = false; next = NULL; } void Warrior::update() { xpos+=xspd; ypos+=yspd; } void Warrior::Supdate() { xpos+=xspd; ypos+=yspd; } int Warrior::pack(char*buffer) { int counter = 0; netPack(&ID,sizeof(int),buffer,counter); counter+= sizeof(int); netPack(&xpos,sizeof(float),buffer,counter); counter+= sizeof(float); netPack(&ypos,sizeof(float),buffer,counter); counter+= sizeof(float); netPack(&xspd,sizeof(float),buffer,counter); counter+= sizeof(float); netPack(&yspd,sizeof(float),buffer,counter); counter+= sizeof(float); netPack(&dir,sizeof(int),buffer,counter); counter+= sizeof(int); return counter; } int Warrior::netUpdate(char* buffer) { // Kyk hierbo, dieselfde in reverse int counter = 0; netRead(&ID,sizeof(int),buffer,counter); counter+= sizeof(int); netRead(&xpos,sizeof(float),buffer,counter); counter+= sizeof(float); netRead(&ypos,sizeof(float),buffer,counter); counter+= sizeof(float); netRead(&xspd,sizeof(float),buffer,counter); counter+= sizeof(float); netRead(&yspd,sizeof(float),buffer,counter); counter+= sizeof(float); netRead(&dir,sizeof(int),buffer,counter); counter+= sizeof(int); return counter; } Any ideas would be appreciated. Unless I'm making some silly syntax error (which im 90% sure is the problem, though i can't find it), I don't see anything wrong here.
  6. wortel


    I didn't want to post a new thread for this, still getting enet to compile. In the meantime, how does the polling system work? i.e. what happens if a packet arrives in a time outside a enet_service_host timespan? do net events just queue up so that you have to call while(enet_host_service(...,0)) thanks..
  7. wortel


    Hi, I'm having some problems getting ENet to work with Dev-c++/mingw. Whenever i try to compile my project I get strange errors in the ENet files themselves (in the vein of "trying to convert *int to *u_int32", more or less, though other weird conversions as well). I tried to compile ENet into a static library using MSVC (MSVC's compiler gives those errors as warnings), which i managed after disabling warnings, but i cant seem to get it to work with dev-c++. I think I'm probably just installing it wrong, I'm a bit inexperienced with c++ (I'm used to java), if anybody is using enet with devc++ would you mind writing a quick nOOb friendly guide for using enet? :) Failing that I guess i'll just switch to the codeblocks/.net combination, but I still can't figure out how to get enet to compile without warnings. Which library would you recommend that's similar to enet? It seems to be a real nice library, if only i could get it to work... Thanks...
  8. wortel

    How do I detect key presses

    Get a nice library, i recommend allegro, i think it's probably the most underrated game library out there,especially for beginners. It has nice examples & very good documentation. Good luck
  9. Hi, I'm planning to write a game over Dec/Jan break, basically a 2D action shoot-em-up in the vein of soldat/liero. I've done 2D action games before, but i want this one to be playable over a network. I have someone to help me with the physical net code. However I'm not sure how to structure the client/server in terms of workload, How much should the server calculate, and what should be left for the client? OK a bit more info (the game is in concept stage mkay) - 2 to 4 players on a map with hard surfaces (i.e. wont be able to blow holes in walls), each player has hp/armor, and weapons (that can be picked up) with unique ammo for each, players run around and shoot each other with (mostly) projectile weapons. I'm planning to use UDP, comments/suggestions/tutorial links will be appreciated :) Now, should the server send each players full status with each update? or should it keep track of what has changed since last confirmed packet reception by client? should the animation frame each player is in be sent, or left for the client? and for projectiles being fired? pickups? I know the question is kind of vague (it's in beginners forum ok), but I'm looking more for a way of doing this than set algorithims. Any thoughts welcome...
  10. I just registered, but I couldn't enter my real city, because your database knows of about 2 cities in south africa.
  11. wortel

    Newbie Problem

    Just for future reference, a more specific topic would be nice :)
  12. wortel

    beginner, college..

    I'm pretty much at the same point, except I pwn maths & CS :))). I'm first year B.Comm Maths with CS as my major, but I don't think i'll learn enough here about game programming (don't think we're doing any 3D), so if i want to get into game design I'll have to go study that elsewhere. Also I'm only doing up to maths 2 (calc and lin alg combined). Game design seems a looong way off from the south tip of africa.. :) So, what i'm getting to, is anybody here in a game school? I heard a bit about these a while back, but never heard anything from anybody who actually went there. Then I only need a green card or something..
  13. Hey man, first of all don't be ashamed to ask stupid questions. All of us were noobs at one time or another and we're here to help. animation is not too tough, i had a counter to count the loops and id % it with the number of frames i were working thru (could be modded again if one image is on more frame). As for physics etc., only help i have is a game called stickduel I wrote. I left it somewhere on the net, google for it, if you can't find me email me. I'l email it to you. my email is 14584808 at sun dot ca dot za. It's a platform based 2 player animated combat game, pretty fun. HTH dude
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!