Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

193 Neutral

About sandorlev

  • Rank
  1. Hey GD!   I was thinking about implementing an online server-client game and here is what I came up with: 1. The game is driven by events (if a player gets shot, an event is generated, etc). 2. The event is converted to some sort of format and sent to the server. 3. The server sends it back to all clients but the original sender. 4. The clients convert it back and make the necessary changes in game logic.   Does that sound like it could work? I haven't been able to think about a better solution myself.   Now the real question is (if my solution makes sense), what format should I use to send my event classes through UDP sockets? Should I just convert their data to strings? Are there popular solutions to this?
  2. sandorlev

    Co-op RPG

    Hey guys!   I'm a huge fan of the Diablos (yes, even Diablo III), and I have always wanted to make an isometric RPG. I already got some of the basics down, most importantly the basic map handling, just waiting for SDL 2.0 to come out so I can get it running on decent fps. Now, I've been thinking about making it an online game (as in anyone can make a game and 1-2 others can join). Would it take huge efforts? I have no experience in C++ socket programming, even though I figured I could just learn SDL_net.   Would I need to code everything with respect to multiplayer, or can I just add it later through some hacking?
  3. I didn't read the whole thing yet, but it seems pretty awesome!
  4. Rendering a 40x40 tilemap that has ~10 layers in SDL 1.2 is pretty darn slow, I started looking into faster options. Now my question is, is SDL 2.0 a lot faster than 1.2? I'm trying to avoid using OpenGL as best as I can, but if it's the only efficient way to render quickly, I'll probably have to use it. Any opinions on SDL 2.0 concerning speed?
  5. I'm trying to render a map with a moving camera and I get a segmentation fault every time I start moving down. Here is the code: void Map::Render(SDL_Surface* tileSet, SDL_Surface* display) const { const int tileSize = Tile::GetTileSize(); Vector2D cameraLocation = Camera::control.GetLocation(); //Checking boundaries if (cameraLocation.x < 0) cameraLocation.x = 0; else if (cameraLocation.x > width * tileSize) cameraLocation.x = width * tileSize; if (cameraLocation.y < 0) cameraLocation.y = 0; else if (cameraLocation.y > height * tileSize) cameraLocation.y = height * tileSize; Vector2D first; first.x = (int)cameraLocation.x / tileSize; first.y = (int)cameraLocation.y / tileSize; Vector2D offset; offset.x = (int)cameraLocation.x % tileSize; offset.y = (int)cameraLocation.y % tileSize; for (int y=0; y<height; y++) { for (int x=0; x<width; x++) { //Segmentation fault happens here const int index = \ rows[y + first.y].columns[x + first.x].GetTileID(); Rectangle srcRect = Tile::GetSourceRect(index); const int xOffset = x * tileSize - offset.x; const int yOffset = y * tileSize - offset.y; Surface::Blit(xOffset, yOffset, srcRect, tileSet, display); } } } The segmentation fault happens at the GetTileID() function. Additional data: width = 50; height = 200; tileSize = 96; //Variable values when the segmentation fault happens cameraLocation.x = 10; cameraLocation.y = 100; first.x = 0; first.y = 1; offset.x = 10; offset.y = 4; x = 9; y = 198; xOffset = 854; yOffset = 19004;
  6. I've been searching the internet for literally weeks and I haven't been able to locate a decent 2D isometric tutorial or book. Yes, I've read multiple articles here on gamedev, but they're either really old or they don't go into specifics at all. What I'm looking for is one that: - is recent (not older than ~3-4 years) - is preferably in C++ - covers basic tile attributes - covers basic pathfinding - covers camera movements. Looking forward to your suggestions!
  7. sandorlev

    C++ falling asteroids

    Thank you, that answer was worth waiting for!
  8. sandorlev

    C++ falling asteroids

    The movement part I already have, I'm looking for a solution to making them appear at random times with their number of asteroids onscreen capped from above and below but increasing.
  9. sandorlev

    C++ falling asteroids

    Hey guys! I recently started making a game in C++, using SDL. The idea is that you control a guy on the bottom of the screen and asteroids are falling from the sky. Now I'd like to make it so the longer the game goes, the more (and faster) asteroids are and I could really use some help with that. If anyone could show me some pseudo-code on how it's done, I'd be grateful! Thanks in advance!
  10. Hey guys! I'm trying to make a multiplayer game, but networking seems ridiculously hard. I'm looking for some tutorials about multiplayer games and sending objects, using python libaries, but I had no luck in trying to find any helpful ones. Can you point me to the right direction?
  11. sandorlev

    Going crazy, collision detection

    Now I must be either a terrible thinker or I just went full crazy but I cannot find out how to solve this one: # If there is a collision if (bottom == platformTop) and \ (left >= platformLeft) and \ (right <= platformRight): self.rect.y = platformTop - self.rect.h #if self.falling: # self.vector.y = 0 self.falling = False # ^^^ this doesn't work, you cannot jump from the platform # this is how you fall down from it elif (bottom == platformTop) and \ (left <= platformLeft) or \ (right >= platformRight): self.falling = True
  12. sandorlev

    Going crazy, collision detection

    Thank you both, solid ideas, I hope I will get it right!
  13. sandorlev

    Okay.. So.. What language(s) to learn?

    You could go with Python. If you're also planning to make a website, you can use it for CGI. Pretty sure it's the easiest way.
  14. Hey guys! I posted here yesterday, and it led me to a solution, so I'd like your help again. Now, I'm really going crazy with this, I can't even think properly. My problem is, I'm making a platformer and I'm having a *hard* time getting the collision detection right. What I want is, platforms are bypassable from the bottom and the side, but if you jump through them and your legs are on top of it, they 'become solid'. I spent hours trying, no solution so far. Here is the code: # This is a part of the Avatar class, which has a map in self.map which has platforms (their pygame.rect's) in it. for platform in self.map.platforms: left = self.rect.x right = self.rect.x + self.rect.w top = self.rect.y bottom = self.rect.y + self.rect.h platformLeft = platform.rect.x platformRight = platform.rect.x + platform.rect.w platformTop = platform.rect.y platformBottom = platform.rect.y + platform.rect.h # If there is a collision if (bottom >= platformTop) and \ (top <= platformBottom) and \ (right >= platformLeft) and \ (left <= platformRight): pass # NO IDEA Help is very much appreciated, thanks for reading!
  15. sandorlev

    Coding jump for a 2d Python game

    Although it was hardly what I was asking for, your post made me feel hopeless so I started rewriting some code that disable me from getting the jumping done. ~1.5 hours later, here I am, having a perfectly functioning jumping and moving system, so thank you!
  • 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!