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


  • Content count

  • Joined

  • Last visited

Community Reputation

165 Neutral


  • Rank
  1. I've been getting bogged down by being referred to THE BEST GAME LOOPS EVER which are extremely accurate yet way over the top for what I need. Honestly for what I'm doing it just needs to be a super simple, rigid grid-based movement with somewhat smooth motion when moving between tiles (interpolation).   I was just getting the gist of your frames class, so ignore anything I've said about my own game loop since I don't really know much about them and my implementation is broken anyway. How can I set it up so that it uses frames instead of time? I really just want a game tick which is x length of time, so then I can base everything off of the tick. So like, walking one tile could take 4 ticks, running takes 2 ticks, fade to black when transitioning somewhere could take 10 ticks, auto-regen health starts after idling for 5 ticks.. Basically a solid variable which I can use to control how long everything is taking, which works alongside your nice little class. I would cry happy tears.   I really appreciate the help you're offering by the way, it means a lot. I hope I'm being clear with what I want to achieve so you don't end up explaining things that I have 'no interest in'.
  2. Yeah I think I get the concept now, you're really helping me out. I also like and understand your idea of doing it backwards, since you're always going to end exactly at the destination and any leftover decimal value would be lost at the start / during the movement instead of being left at the end right?   I'm not 100% comfortable with handling time yet, and knowing exactly how fast my program is running. I think if I make a clock then do dt = clock.restart() (which also returns the current elapsed time) in my game loop then I'll know how fast my loop runs? Bah.
  3. So if I understand exactly what's going here..     The values aren't identical but is the theory correct? The player moves left 32px to the targetTile, then move back to the original position -4px, then back etc, to give the effect that the whole time the sprite was just moving at a steady -4px rate? Interpolation is where I get lost off but your walkthrough just now may have made it clear what's going on, with the whole wavey pattern thing.
  4. I think I understand all but one part of the function: sprite.y = tileYPosToScreenYPos(tileY); sprite.x = tileXPosToScreenXPos(tileX);What exactly are these functions doing? Also, FRAMES_FOR_SINGLE_TILE_MOTION would be the number of frames for a single animation cycle and STEPPING_FRAME_DISTANCE would be the width of a tile (16px)?
  5. Sorry for the confusion, you're correct. I just tried to think of some example where the direction would basically choose an operator and an axis (+/-, y/x) and not necessarily hold its own value like your example seems to. Khatharr thanks a ton for posting that class. I'll read over it a few times to make sure I understand.
  6. I have a couple of questions which would help clarify, if you could answer them. I'm really new to this.   So I could just make a Vector2i offset(50, 50) right? endPos = player.pos + offset? This bit confused me. All I'm doing at the minute is:if(keypress == down) player.y += move if(keypress == left) player.x -= move .. kinda thing. I'm not really sure what values for direction you're thinking of here, sorry. See above. I can see how moveVector = distance / duration would work though.
  7. I read the dewitters article and that one other article people always suggest multiple times but a lot of it goes over my head. They explain how the loops work, but since I've never done game loops before, I'm not sure what each variable is supposed to represent. Eg. Skip ticks. It confuses me, so does interpolation.   I'll look that up now, thanks for the suggestion (:
  8. I want to code something similar to how the animate function works with jQuery:   var duration = 500, moveY = "50px", moveX = "70px"; $("#someBox").animate({top: moveY, left: moveX}, duration);   Here I have a box or container which would move right 70px and down 50px, and that animation would take 500 milliseconds. Now to make this relevant to my game, I'm attempting to make Pokémon style, grid-locked movement:   - Press right --- Player loses control --- Character runs through one animation cycle --- Moves right one tile (eg. 16px) --- Happens over 0.5 seconds --- Character stops, player gains control   Right now I can make it so that the character moves in a direction for X amount of time, but it doesn't explicitly move a set amount of pixels per say.. I have a float for moveSpeed and it's just playerPos.x += moveSpeed for the amount of time. I also tried doing playerPos.x += GRID_SIZE, which guarantees that he moves the exact amount of space, but it just teleports and doesn't animate in a transitional movement. It's important that the player sticks strictly to the grid and is never off-centre.   In short, I'd like to make this function:   player.move(direction, distance, duration);   I'm also having trouble with limiting my game loop / making things happen at regular intervals, so this is likely making my problem much harder. Anyway I hope this is clear enough. If not, I'd be happy to try and explain further. Thanks in advance.  
  9. It's hard to say without seeing any code or knowing what exactly you have going into the functions. As a guess though, you could make an Actor class, so each object of that class could be a monster or party member. Then you'd just send in the object by reference to the functions and you have all of those stats / items / etc in just one argument.   I'm not sure what else you'd be sending in?..
  10. Guys you're all being super helpful. Thanks for the wealth of advice, I've got a much clearer idea of where I'm headed now.
  11. My main problem is that I'm not sure specifically what I should be learning. I don't want to spend months wasting my time learning "useless math" that I won't really need specifically when programming. I'll definitely check out that link that came early on in this thread though, sounds good.
  12. So here I am, starting to make games in 2D to learn the ropes. However, I feel like I'm kind of stuck because whenever I buy a book / try to learn something like OpenGL I'm always greeted with a lovely equation that is completely alien to me. Now I know that math is pretty much essential to program in 3D and even 2D, but like, HOW essential? Would you guys recommend that I just go head on into math at the same time as programming? I mean, I'm at basic algebra level right now and it aint cutting it. Thoughts?
  13. This happened with me when I learnt stuff but didn't actually program with it. I tend to read programming books on the bus when I go to school, but unless I actually make use of what I learnt when I get back after work at night, I'll forget a good portion of it. Although I'm guessing your problem was more to do with syntax, not forgetting how the features actually work in the first place?
  14. I made thread after about an hour of trying to figure this out, then I figure it out within 2 minutes of posting. I said it's probably that the files aren't being loaded, well, they weren't. Incorrect filenames.
  15. I'm trying to make an Actor class, where in the constructor I send in a file location for the bitmap. Then I want to use a GetSprite() function to return the BITMAP and use it in the blit() function to draw it to the screen. I get no errors, but the program crashes immediately. I think this is because the image isn't being put into the address where the BITMAP *Sprite points to, but maybe not I dunno. My function call was something like: Actor Guy("image.bmp"); I ended up changing my approach since this ended up just not working, and decided to instead send in an enum. With the enum (eg. INVADER), I was going to use a switch statement in my constructor to assign the correct image there, meaning that there were no mistakes when sending in a file location when creating the object. Here's the code: [source lang="cpp"]class Actor { public: Actor(int a, int b, TEAM Type) : HP(a), Speed(b) { switch(Type) { case INVADER: Sprite = load_bitmap("invader.bmp", 0); break; case PLAYER : Sprite = load_bitmap("player.bmp", 0); break; } } void Move() { PosX += Speed; } void Draw() { blit(Sprite, screen, 0, 0, 0, 0, ScreenHeight, ScreenWidth); } private: BITMAP *Sprite; int PosX, PosY, HP, Speed; };[/source] This just doesn't work, though. If I comment out the call to Draw() in my main loop the program runs and exits fine. When I try to Draw though, it crashes just like before. What's going on, I'm kinda lost.