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

sandorlev

Members
  • Content count

    34
  • Joined

  • Last visited

Community Reputation

193 Neutral

About sandorlev

  • Rank
    Member
  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. 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: [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); } } } [/CODE] The segmentation fault happens at the GetTileID() function. Additional data: [CODE] 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; [/CODE]
  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. [quote name='KnolanCross' timestamp='1353948332' post='5004230'] Oh sorry, complety missunderstood what you said. In this case I believe you need something like this: [source lang="cpp"]srand(time(NULL)); unsigned numberOfAsteroids = (SDL_GetTicks()/30000) + 1; // 1 extra asteroid per 30 seconds if (asteroidsOnScreen < numberOfAsteroids){ if (SDL_GetTicks() - lastTimeTriedToSpamAsteroid > 1000){ // try once per second unsigned chance = rand() % 100; if (chance >= 50){ // 50% chance to spawn an asteroid bool up = rand() % 2; if (up == false){ spawnAsteroid(x = rand()%WIDTH_OF_SCREEN, y = HEIGHT_OF_SCREEN); } else{ spawnAteroidOnLowerPart(x = rand()%WIDTH_OF_SCREEN, y = 0); } } lastTimeTriedToSpamAsteroid = SDL_GetTicks(); } }[/source] EDIT: in this case y = 0 is top part of the screen. [/quote] Thank you, that answer was worth waiting for!
  8. 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. 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. Now I must be either a terrible thinker or I just went full crazy but I cannot find out how to solve this one: [CODE] # 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 [/CODE]
  12. [quote name='Goran Milovanovic' timestamp='1344455632' post='4967502'] The collision model for the "bypassable" platforms should not apply to objects that don't have their feet above the platform. In other words: For all objects below the platform, that platform doesn't exist. So, however you're actually doing your overall collision detection, modify the algorithm to include a special pass for that particular circumstance. [/quote] [quote name='BeerNutts' timestamp='1344455708' post='4967504'] A quick thought is, if you you get a new collision (ie, it wasn't colliding in the last frame), then check the vertical velocity. If it's positive (moving up), ignore the collision. If it's negative (falling), then you need to check where the collision occurs on your player. If it collides at the feet, then you can make the collision stick, and keep the player on top of the platform. If you're player collidies mid-body (or head, etc.), then he's probably moving left to right and falling, and needs to fall through. That is just a quick thought about how I might try it, but i don't have any experience directly with this. Good Luck! EDIT: beat by Goran, but his idea is better than mine, to ensure the feet are above the top of the platform in question. [/quote] Thank you both, solid ideas, I hope I will get it right!
  13. 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: [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 [/CODE] Help is very much appreciated, thanks for reading!
  15. [quote name='BeerNutts' timestamp='1344373635' post='4967145'] I would suggest something different from what Shippou suggests. You should test the keys independently, not test if key Up and Key Right. Also, you should be applying a velocity for movement, just just moving the sprite based on keys (which it seems you are doing from looking at the python code). I must admit, it's not the easiest to follow, but, of course, I don't know Python. In another post, i gave some sample code (for C++) which shows, in general how you handle jumping. You should be able to get the gist of it form this code. The main points are: #1, you can jump if you're on the ground and hit the jump key #2, you apply an initial Negative Y velocity(which is up on the screen) once when jumping, and then subtract from the velocity every frame (to simulate gravity). #3, if you hit anything in the Y direction (your head or your feet), reset the location, and set Y velocity to 0. Good Luck! (#define values are just guessed examples, you'll have to change them to fit your game) [code] // Speed player moves left or right #define MOVEMENT_SPEED 10.0f // initial velocity given to player when he jumps #define JUMP_VELOCITY 20.0f void Player::HandleInput() { if (LeftIsPressed()) { this.xVelocity = -MOVEMENT_SPEED; } else if (RightIsPressed()) { this.xVelocity = MOVEMENT_SPEED; else { this.xVelocity = 0.0f; } // Only jump if we're not already jumping or falling if (JumpIsPressed() && this.OnGround) { this.yVelocity = -JUMP_VELOCITY; } } // defines amount to increase downward velocity every frame #define GRAVITY_FORCE 4.0f void Player::Update() { // Apply downward force to player this.yVelocity += GRAVITY_FORCE; // Move the Player this.xLocation += this.xVelocity; this.yLocation += this.yVelocity; // Check we've collide with something above or below us bool CollideBelow; if (CheckCollisionY(CollideBelow)) { // move us back to previous location and Stop Y Velocity this.yLocation -= this.yVelocity; this.yVelocity = 0.0f; if (CollideBelow) { this.OnGround = true; } } else { this.OnGround = false; } // Check if we've collided with anything on our left or right if (CheckCollisionX()) { // move us back to previous location and Stop X Velocity this.xLocation -= this.xVelocity; this.xVelocity = 0.0f; } } [/code] [/quote] 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!