• Content count

  • Joined

  • Last visited

Community Reputation

184 Neutral

About kyc

  • Rank
  1. Hey thanks alot you two, you've been very helpful. And I'll be sure to read through that entire site :)
  2. I was wondering, is there any risk in having an instance of a class calling a function that will delete that instance? In other words: Do methods stay on the function stack even if in the middle of that method's execution its class instance is deleted? I haven't run into any problems yet, but I just want to be sure. Here's what I mean, in C++: namespace App { void popState() { // currentState points to an instance of B_State. delete currentState; currentState =; } } class B_State : public State { public: void update() { App::popState(); } }
  3. [4E4] Post yer Screenshots

    Skittleo, how are you using particle constraints for the animation system? I undertsand about creating a bunch of particles, linking them, and letting the constraint system restrict them to proper angles, but how does the timing work? Do you simply fix the timestep and framerate and at the beginning of each keyframe set say the knee's particle to have a target velocity of say 30 and let the constraint system space out the target velocity's distribution? Your progress looks great btw :)
  4. WIP: Netdeath

    Those two problems I noted have been fixed. MustEatYemen: I've been an avid player of Soldat for more than two years :) No downloads today, but I will upload most likely tomorrow with significant updates.
  5. WIP: Netdeath

    Known and Fixed Issue: switching back from the game to the main menu causes lag in the game. This is because I forgot to clear the map when you exit the game, it's fixed in the next build. Known BUG: On my laptop, the animations work perfectly (ATI). However, on my desktop, the animations are very screwy and spin around sporadically (NVIDIA). Could this be an issue with the video card? All I'm doing is using glPushMatrix and glPopMatrix. The FPS are very close on both machines. Any ideas?
  6. WIP: Netdeath

    I've decided to make a thread showcasing my WIP game, Netdeath. I will try to update this thread 2-3 times a week with screenshots and downloads. Please feel free to comment, report bugs, or make suggestions. Features: * Main menu * Server/Client connect/disconnect * Physics and friction * Animation rendering * File menu Usage: * In the main menu, choose either "Host a Game," "Join a Game," or "Edit Characters" * "Host a Game" -> click on "Start" * "Join a Game" -> click on "Connect" * "Edit Characters" -> click on "Edit Animations" * Host/Join have the same functionality to the player's perspective, use WASD to move. * "Edit Animations", press 1 to play test animation, press 2 to see null animation. * Press ESC in game/animator to go to main menu. * Press ESC in main menu to quit. * GENERAL: Press F1 to lock/unlock mouse inside window. Plans: 1) Make animation/character editor. 2) Implement multiplayer movement. Files (7z archive): netdeath_7-26-05a.7z Screenshots: Concept Art: [Edited by - kyc on July 28, 2005 2:24:36 AM]
  7. Hand-Drawn Sprites

    Well it IS a commercial product, so I assume they tweak the initial scan to make the overall animation look right. At least that's what I would do, bring up the scan in photoshop and erase any scratches and clean up the lines.
  8. $20 eh? =) I'm using GLFW, would it be alright if I stripped the SDL portions and used the rest for my game?
  9. looks great! I snuck around and found your game+src through your website. Think it was But when I try to run the game, it just crashes :(
  10. Looks just like the evolution demo shurcool had a few months ago. Looks great though, and reminds me of Cyberdogs and Crimsonland. BTW, it's very dizzying when played at 3:30 AM...
  11. advanced 2D physics engine?

    you can try my 2d engine, (~30meg .rar chronodoll download, and click on the screenshots link for an idea of how it looks). I plan on rewriting it sometime after finishing my current game, but that may be a few months from now. If you decide to take a look, make sure you check out all of the different builds. Also some of the binaries are not representative of the sources, so rebuild if you can. You can also change the map files and change the springiness and masses, etc... A noteworthy build is chronobeast (it's just cool heh). Btw the *.msp files are project files for the MinGW Developer Studio IDE, google.
  12. Ok well it took me long enough! I haven't touched the code since releasing the demo, but I'm now releasing all the sources and binaries this project entitled. It's available as a ~30meg self-extracting file, which contains .7z archives inside it. You can choose from which phase of development you want to start off with, so I hope you'll make good use out of it. Pretty much public domain, but please give me credit for my work, including the artwork. Available at
  13. Jiia, your game looks incredible! Please give us a download!
  14. Hi I'm making a 2D multiplayer sidescroller like Abuse and Soldat. I'm using RakNet. Right now the player has to wait until the server confirms its position. Movement is extremely jerky. The client sends keypresses continuously (if 'W', for up, is pressed it will constantly send packets) then waits to get an update from the server. I am completely new to network programming, and I have no idea where to go from here or how to do this better. I've tried looking at other sources but they are all too poorly documented. Binary and source: Here are the more relevant source files... main.cpp #include "Kee2D.h" #include "MultiplayerGame.h" float _previousTime = 0, _updateTime = 0.01f; list<Wall> _walls; void loadData(); void checkKeyboardInput(); void accumulateForces(); void updateParticles(float timeStep_); void resolveCollisions(); void clearForces(); void updatePhysics(); void renderScene(); int main() { Kee2D& kee2D = Kee2D::getInstance(); MultiplayerGame& multiplayer = MultiplayerGame::getInstance(); loadData(); multiplayer.start(); kee2D.createWindow(800, 600); _previousTime = kee2D.getTime(); while(kee2D.isRunning() && !kee2D.keyPressed('Q')) { kee2D.updateAPI(); multiplayer.processPackets(); // Update physics. float time = kee2D.getTime(); multiplayer.update(time); while(time-_previousTime > _updateTime) { checkKeyboardInput(); if(multiplayer.server) { accumulateForces(); updateParticles(0.002f); resolveCollisions(); } clearForces(); _previousTime += _updateTime; } renderScene(); } multiplayer.end(); return 0; } void loadData() { //_walls.push_back(Wall(Vector2D(-100, -50), Vector2D(100, -100))); //_walls.push_back(Wall(Vector2D(-100, -50), Vector2D(-200, 25))); _walls.push_back(Wall(Vector2D(-380, -280), Vector2D(380, -280))); _walls.push_back(Wall(Vector2D(-380, 280), Vector2D(380, 280))); _walls.push_back(Wall(Vector2D(-380, 280), Vector2D(-380, -280))); _walls.push_back(Wall(Vector2D(380, 280), Vector2D(380, -280))); } void checkKeyboardInput() { Kee2D& kee2D = Kee2D::getInstance(); MultiplayerGame& multiplayer = MultiplayerGame::getInstance(); Player* player = _players[_playerID]; if(!player) return; if(kee2D.keyPressed('W')) { multiplayer.addForce(_playerID, Vector2D(0, 30)); //player->addForce(Vector2D(0, 30)); } if(kee2D.keyPressed('S')) { multiplayer.addForce(_playerID, Vector2D(0, -20)); //player->addForce(Vector2D(0, -20)); } if(kee2D.keyPressed('D')) { multiplayer.addForce(_playerID, Vector2D(10, 0)); //player->addForce(Vector2D(10, 0)); } if(kee2D.keyPressed('A')) { multiplayer.addForce(_playerID, Vector2D(-10, 0)); //player->addForce(Vector2D(-10, 0)); } } void accumulateForces() { Vector2D gravity(0, -15); list<PlayerID>::iterator id = _playerIDs.begin(); for(; id != _playerIDs.end(); ++id) if(_players[*id]) _players[*id]->addForce(gravity); //printf("\n Accumulated Forces."); } void updateParticles(float timeStep_) { list<PlayerID>::iterator id = _playerIDs.begin(); for(; id != _playerIDs.end(); ++id) if(_players[*id]) _players[*id]->update(timeStep_); //printf("\n Updated Particles."); } void resolveCollisions() { list<Wall>::iterator w = _walls.begin(); for(; w != _walls.end(); ++w) { list<PlayerID>::iterator id = _playerIDs.begin(); for(; id != _playerIDs.end(); ++id) if(_players[*id]) _players[*id]->collideWithWall(*w); } //printf("\n Resolved Collisions."); } void clearForces() { list<PlayerID>::iterator id = _playerIDs.begin(); for(; id != _playerIDs.end(); ++id) if(_players[*id]) _players[*id]->clearForces(); //printf("\n Cleared Forces."); } void renderScene() { list<Wall>::iterator w = _walls.begin(); for(; w != _walls.end(); ++w) w->render(); list<PlayerID>::iterator id = _playerIDs.begin(); for(; id != _playerIDs.end(); ++id) if(_players[*id]) _players[*id]->render(); //printf("\n Rendered Scene."); } MultiplayerGame.cpp #include "MultiplayerGame.h" list<PlayerID> _playerIDs; map<PlayerID, Player*> _players; PlayerID _playerID; void MultiplayerGame::start() { clientInterface = 0; serverInterface = 0; server = 0; client = 0; printf("\n0) Client \n1) Server \n2) Offline \n___________________________________\n> "); int mode = 1; scanf("%i", &mode); if(mode == 2) return; printf("\nRunning as %s...\n", mode ? "server" : "client"); int port = 6021; printf("\nPlease enter a port: "); scanf("%i", &port); if(mode == 1) { serverInterface = RakNetworkFactory::GetRakServerInterface(); serverInterface->Start(32, 0, 0, port); server = new Server(); printf("\n Server has started."); } else { char ip[80]; printf("\nPlease enter the ip address: "); scanf("%s", ip); clientInterface = RakNetworkFactory::GetRakClientInterface(); clientInterface->Connect(ip, port, 0, 0, 0); client = new Client(); printf("\n Client has started."); } } void MultiplayerGame::processPackets() { if(server) server->ProcessPackets(serverInterface); else if(client) client->ProcessPackets(clientInterface); } void MultiplayerGame::update(float time_) { if(server) server->update(time_, serverInterface); } void MultiplayerGame::end() { if(serverInterface) serverInterface->Disconnect(10); else if(clientInterface) clientInterface->Disconnect(10); if(serverInterface) RakNetworkFactory::DestroyRakServerInterface(serverInterface); else if(clientInterface) RakNetworkFactory::DestroyRakClientInterface(clientInterface); if(server) { delete server; server = 0; } else if(client) { delete client; client = 0; } printf("\n Network ended."); } void MultiplayerGame::addForce(PlayerID playerID_, Vector2D force_) { if(client) client->addForce(playerID_, force_, clientInterface); } void Client::ProcessUnhandledPacket(Packet* packet_, unsigned char packetIdentifier_, RakClientInterface* clientInterface_) { switch(packet_->data[0]) { case ID_PLAYER_CONNECT: { printf("\nID_PLAYER_CONNECT packet received...\n"); PlayerConnect* playerConnect = (PlayerConnect*)packet_->data; //assert(packet_->length == sizeof(PlayerConnect)); //if(packet_->length != sizeof(PlayerConnect)) // return; if(_players.empty()) // This my own data. _playerID = playerConnect->playerID; _playerIDs.push_back(playerConnect->playerID); _players[playerConnect->playerID] = new Player(Vector2D(playerConnect->x, playerConnect->y)); } break; case ID_PLAYER_UPDATE: { PlayerUpdate* playerUpdate = (PlayerUpdate*)packet_->data; //assert(packet_->length == sizeof(PlayerUpdate)); //if(packet_->length != sizeof(PlayerUpdate)) // return; if(_players[playerUpdate->playerID]) { Vector2D position(playerUpdate->x, playerUpdate->y); Vector2D destination(playerUpdate->dx, playerUpdate->dy); Vector2D forces(playerUpdate->fx, playerUpdate->fy); _players[playerUpdate->playerID]->rePosition(position, destination, forces); } } break; case ID_PLAYER_FORCE: { PlayerForce* playerForce = (PlayerForce*)packet_->data; if(_players[playerForce->playerID]) { Vector2D force(playerForce->x, playerForce->y); _players[playerForce->playerID]->addForce(force); } } break; } } void Client::addForce(PlayerID playerID_, Vector2D force_, RakClientInterface* clientInterface_) { PlayerForce playerForce(force_, playerID_); clientInterface_->Send((char*)&playerForce, sizeof(PlayerForce), HIGH_PRIORITY, RELIABLE, 0); } void Server::ProcessUnhandledPacket(Packet* packet_, unsigned char packetIdentifier_, RakServerInterface* serverInterface_) { switch(packet_->data[0]) { case ID_PLAYER_FORCE: { PlayerForce* playerForce = (PlayerForce*)packet_->data; //assert(packet_->length == sizeof(PlayerForce)); //if(packet_->length != sizeof(PlayerForce)) // return; if(_players[playerForce->playerID]) { Vector2D force(playerForce->x, playerForce->y); _players[playerForce->playerID]->addForce(force); PlayerForce playerForce2(Vector2D(playerForce->x, playerForce->y), playerForce->playerID); serverInterface_->Send((char*)&playerForce2, sizeof(PlayerForce), HIGH_PRIORITY, RELIABLE_ORDERED, 0, UNASSIGNED_PLAYER_ID, true); } } break; } } void Server::ReceiveNewIncomingConnection(Packet* packet_, RakServerInterface* serverInterface_) { printf("\nA connection is incoming.\n"); static float x = -200; static float y = 100; printf("\nSpawn position is (%2.3f, %2.3f).", x, y); PlayerConnect playerConnect(x, y, packet_->playerId); // Send creation packet. serverInterface_->Send((char*)&playerConnect, sizeof(PlayerConnect), HIGH_PRIORITY, RELIABLE_ORDERED, 0, UNASSIGNED_PLAYER_ID, true); // Send data about existing players. list<PlayerID>::iterator id = _playerIDs.begin(); for(; id != _playerIDs.end(); ++id) { Vector2D position = _players[*id]->getPosition(); PlayerConnect coPlayerConnect(position.x, position.y, *id); serverInterface_->Send((char*)&coPlayerConnect, sizeof(PlayerConnect), HIGH_PRIORITY, RELIABLE_ORDERED, 0, playerConnect.playerID, false); } _playerIDs.push_back(playerConnect.playerID); _players[playerConnect.playerID] = new Player(Vector2D(x, y)); x += 25; } void Server::update(float time_, RakServerInterface* serverInterface_) { if(time_ - previousFrequentUpdateTime > 0.1f) { list<PlayerID>::iterator id = _playerIDs.begin(); for(; id != _playerIDs.end(); ++id) { Vector2D position = _players[*id]->getPosition(); Vector2D destination = _players[*id]->getDestination(); Vector2D forces = _players[*id]->getForces(); PlayerUpdate playerUpdate(position.x, position.y, destination.x, destination.y, forces.x, forces.y, *id); serverInterface_->Send((char*)&playerUpdate, sizeof(PlayerUpdate), LOW_PRIORITY, UNRELIABLE_SEQUENCED, 0, UNASSIGNED_PLAYER_ID, true); } previousFrequentUpdateTime = time_; } }
  15. OpenGL or Software Rendering?

    Mac and Linux versions? yes. In my last project, I had win32 and nix binaries compiled without any modifications. I don't have a mac, but I am considering opensourcing the game so anyone with a mac can compile it hopefully flawlessly as well. I agree with you about 2D rendering, but that's why I want to ask because apparently everyone's playing 3D games and should already have the hardware for even a simple OpenGL game. I just don't know whether the 5 year old computers are worth supporting. Something else I can do is have a rendering device class initially using OpenGL, but then implement software rendering as a post production perk.