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

mklynge

Members
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

112 Neutral

About mklynge

  • Rank
    Newbie
  1. Would it have anything to do with the way the coordination system is made? A normal coordinate system would have x positive to the right and y up positive. In Android (like XNA) its x positive to the right and y down for the positive values.   There is no x where it should be y and the other way around (double checked the Vector3 class I use/made). Only one method is working with these values (the update) except when something needs to get a new position (at collision or key event etc).   EDIT: Had to check the Vector3 class again and found the bug! Thanks for the help!
  2. Ok, found something strange. Using this code:   a.vel.x += (acf - aci) * n.x; a.vel.y += (acf - aci) * -n.y;   b.vel.x += (bcf - bci) * n.x; b.vel.y += (bcf - bci) * -n.y;   The balls going up and down is now responding as expected (like the balls going left/right). But if a ball going down is colliding with a ball going left, all hell breaks lose. They add an insane amount of speed to each other for some reason.   I also simplifed the method that handles the collision:   public void Collision(PhysicsObject a, PhysicsObject b) {   Vector3 n = new Vector3(a.pos.x - b.pos.x, a.pos.y - b.pos.y, 0); double d = n.length();   n.x = n.x / d; n.y = n.y / d;   double aci = a.vel.dot(n); double bci = b.vel.dot(n);   double acf = bci; double bcf = aci;   a.vel.x += (acf - aci) * n.x; a.vel.y += (acf - aci) * -n.y;   b.vel.x += (bcf - bci) * n.x; b.vel.y += (bcf - bci) * -n.y;   }   Edit: And the update loop pr. PhysicsObject: (in case anyone was wondering if something is being added)   public void updatePhysics(long frameTime) {   oldpos.x = pos.x; oldpos.y = pos.y;   pos.x = pos.x + (vel.x * 0.5 * frameTime); pos.y = pos.y + (vel.y * 0.5 * frameTime);   }
  3. I found a error that made the oldpos of a object not work correctly, but still the problem is there. I have edited my code so when a collision appears the objects gets set back to their old position. Even with tons of balls on the screen they always stop (in the applyObject() I just set velocity to (0, 0) for both objects). But with the function named in my first post the y-factor seems screwed somehow. The balls still add speed instead of "swap" speed and direction.   Hope someone can help me here.
  4. To simplify the update method I rewrote it into:   public void updatePhysics(long frameTime) {   pos.x = pos.x + (vel.x * 0.5 * frameTime); pos.y = pos.y + (vel.y * 0.5 * frameTime);   }   The problem is still there. Ball A and B going from left/right and right/left, meeting in the middle is perfectly bouncing off each other. Ball C and D going from top/bottom to bottom/top is actually not bouncing off each other but only adding speed to each other (made it so each ball only collide once to test the direction of all balls).
  5. Hi, thanks for your reply.   The new position is done for every object like this:   public void updatePhysics(long frameTime) {   oldvel = vel; vel = vel.add(acc.mul(frameTime).add(friction)); oldpos = pos; pos = pos.add(oldvel.add(vel).mul(0.5f * frameTime));   }   The acceleration and friction is both a vector with values: (0, 0).
  6. Hi all,   The last week I've been re-working the physics system in my little android (Java) ball game and I have bumped into a little problem. I am clearly not good enough to figure out the vector math behind it! I have searched around a bit, but haven't found any solutions to my problem.   The system for collision is pretty simple, I check all possible collisions once pr. ball set (so with 2 balls its 1 collision, 3 balls its 3 collisions etc) and call a method in my physics class (a physics class is linked to each Actor class - so each ball is represented by a PhysicsObject).   What I have now is when I detect a collision and call the method applyObject(PhysicsObject t) on one of the balls (only call it once pr. collision):   public void applyObject(PhysicsObject t) {   Vector3 n = new Vector3(this.pos.x - t.pos.x, this.pos.y - t.pos.y, 0); double d = n.length();   n.x = n.x / d; n.y = n.y / d;   double aci = vel.dot(n); double bci = t.vel.dot(n);   double acf = bci; double bcf = aci;   this.vel.x += (acf - aci) * n.x; this.vel.y += (acf - aci) * n.y;   t.vel.x += (bcf - bci) * n.x; t.vel.y += (bcf - bci) * n.y;   }   Here comes the tricky part, when two balls are colliding the x-velocity is calculated correctly (one ball from left to right, other from right to left with the same y position). But the y-velocity is acting all up and making the balls go way too fast (especially if they have the same x, but different y). Is there something obvious I am missing here? From what I can tell it might be something about missing a 2nd dimension check, but I simply can't find a solution for it.   Hopefully someone can help me out, thanks.