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

peibol

Members
  • Content count

    12
  • Joined

  • Last visited

Community Reputation

354 Neutral

About peibol

  • Rank
    Member
  1. It was the origin term what mislead me. Everything is clear now. Thanks for the explanation.
  2. Just one clarfication to Alvaro's otherwise fine answer: both for 2x2 matrix and 3x3 matrix determinants equal to 0, it doesn't necessarily mean the actual lines or planes contain the origin. However, as vectors alone don't have information about their placement, you can think of your vectors as being placed in the origin if you like, for these calculations at least. Or maybe I misunderstood the notes between parentheses.
  3. Don't know anything about pygame but after looking the internet I think in the for event in pygame.event.get() loop you should do if event.key == pygame.K_LEFT instead of if pygame.event == pygame.K_LEFT and the same for the other key (K_RIGHT).
  4. I have no experience with 3D collision but I think you don't need it for this simple scheme. I liked the overall concept very much. Let's assume AI height h1, height of layer h, player height h2 and distance from AI to border d1, then the player will be visible when its distance from border is d2 or greater, with: d2 = d1*(h-h2)/h1 This is basic trigonometry from the following diagram: [sharedmedia=gallery:images:4266] You can use any units with this formula, tiles, for example: h1 = 1 h2 = 1 (player is as tall as the AI) h = 3 (layer height is 3 times AI and player height) d1 = 2 (AI 2 tiles away from border) Player is visible if his distance from border equals or is greater than: 2*(3-1)/1 = 4. So player visible if it is 4 or more tiles away from border.
  5. From the album for posts

  6. Quote:Original post by BattleMetalChris By the calculations you've given, in both spinning cases the stationary sphere ends up with exactly the same new angular velocity after the collision. However, in the case where the angular velocity is zero, it has zero angular velocity after the collision. This is clearly nonsense. You are completely right here. I thought the equations behave differently, but now I see it. I should have checked more carefully before. Sorry.
  7. [quote]Original post by BattleMetalChris Quote:Original post by peibolMoreover, none of the solids in the collision is free to move linearly as a result from the collision, the momentum is not conserved Quote: They are free to move linearly, and momentum is conserved, it's just that the earth is so big compared to the car that you don't notice it move. They are not free to move linearly in relation to each other: the brake is hold in position by the rest of the car, and the wheel is held in position by the axis. I didn't think you would include the friction of the wheel with the earth. Are they also colliding? I think there is a misunderstanding between collisions and contact forces. I'm pretty new to physics engines so maybe anything in contact is treated as a collision and I'm completely wrong. I really don't know.
  8. Yes, the car argument is valid if you consider that one of the solids in the collision can be externally forced to stay in place (speed 0), and that the collision can last for a few seconds, if needed. But thats not how collisions work. Moreover, none of the solids in the collision is free to move linearly as a result from the collision, the momentum is not conserved, all the kinetic energy is lost in form of heat/deformation so you don't need collisions at all to modelate it. I'm not sure what is what you are trying to model: something like the spheres colliding or something like the wheel and brake? I hope the videos will be revealing :oD Going back to collisions, the contact points dont't need to reach the same speeds at all: the friction force disapears because the solids are no longer in contact, not because the points in contact have the same speed. Again, if you are forcing the solids to remain in contact, it is not a collision. It is something else. As a result from the collision, the solids can have gained/lost angular momentum. If the solids had no lineal speed before collision (so it is very unlikely they could collide :oD) then both of them could not reverse their spins, but one of them could. If any of them had linear speed, then both of them could reverse their spins as a result from the collision. It seems our points of view have collided :oD [Edited by - peibol on September 1, 2010 5:20:25 PM]
  9. It was part my fault for not understanding. The word tangential is the one to use, like in "tangential component". It was the "tangent to the normal" what made me think you had the component in the wrong direction, sorry. I still think that there is nothing wrong with the colliding objects having their relative spins completely reversed as a result of a collision: imagine 2 non-rotating spheres. One of them stationary, for simplicity's sake. The trajectory of the other doesn't pass through the center of the first ball. When they collide, if friction forces are taken into account, they will both adquire angular speed. If the spheres started with a small angular speed, they could end with their spin reversed after the collision. There is no problem at all with that with current physic laws. And I'm affraid they are here to stay for long :D. The example of the wheel and brake is not valid because it is not a collision. It is just the result of the friction force between two solids in contact. It always oposes relative movement between the solids, so if they somehow inverted their relative movements, the friction force would also be reversed. If no external forces are trying to slide one solid against the other, they will stop sliding instead of changing their direction. Anyway, it is your model, so if you have found a model that behaves the way you like and satisfies you, it is up to you to keep with it. It would be great to see these videos.
  10. Hello, I have read the paper and the procedure described there seems complicated to me. Before trying this, maybe you should try a simpler aproach: You can greatly simplify things considering the collision to be instantaneous and forgetting all the dynamic friction thing. You can find the ecuations here. The reply of the post only says that there is no need to include friction forces in the calculation of the impulse. The ecuations in the post are for rigid solids, but can be simplified if you only want to use particles. Bourg is right, so just another pair of things, to make sure you understood the tangent component of the impulse due to friction: -The component is not tangent to the normal, but tangent to the normal surface, so it is perpendicular to the normal. As the post says, it is calculated as follows: -The tangent normal is calculated with this equation. t = [(n x Vr) x n] tangent_normal = t/|t| All the variables in the ecuations are vectors, and x is the vectorial product (or cross product). With this, I think the odd behavior you saw should dissapear. I hope this helps.
  11. Hello, the calculations in the book are right, but made in a strange way, because it happens to be very easy to implement them this way. For example, the author uses the inverse mass version of the formulas instead of just using the mass, because the ecuations are simpler at the cost of being less intuitive. One of the tricky parts is calculating the totalInvertedMass. Example: mA = 5, mB = 1 intuitively, you could be tempted to calculate the totalInvertedMass as 1/(1+5) = 1/6, but this is wrong. In fact, the calculation is done as follows: totalInvertedMass = 1/5 + 1/1 = 6/5 (that is, the sum of the inverted masses of the particles) You are right saying that momentum is conserved, so impulse is 0. But this is only true when applied to the whole system: different particles can change their velocities without changing their masses and the total momentum still remain the same. Example: A( m = 5, v = 1 ) B( m = 1, v = -5 ) COR = 1.0: initial momentum = mA*vA + mB*vB = 0 vA_after = -1 m/s vB_after = 5 m/s KE_after = 15 J (sorry helloworld992, but kinetik energy is 1/2*m*v^2, not m*v^2 :D) So final momentum = 5*(-1)+1*5 = 0 and the total impulse is final momentum - initial momentum = 0. In this example, both initial momentum and final momentum are 0 but it is just coincident, not a requisite. They could be any value (but both the same), and the total momentum would still be conserved. What the book calculates as impulse is really the impulse per inverted mass ( the inverted mass weird thing again) applied to each of the particles. Strictly talking, each particle gets the same impulse applied, but in oppossite directions (this is done when multiplying by the contact normal and the -contact normal). Your calculations were right untill the impulse calculation. From there on: impulse (per inverted mass, remember) = deltaV/totalInvertedMass. deltaV = separatingVelocity-finalSeparatingVelocity = -6-6 = -12 totalInvertedMass = particleAinvertedMass + particleBinvertedMass = 1/5 + 1 = 6/5 so impulse = -12/(6/5) = -10 vA_after = vA_before + impulse*particleAInvertedMass*contactNormal = 1-10*(1/5)*1 = 1-2= -1 vB_after = vB_before + impulse*particleBInvertedMass*(-contactNormal) = -5-10*(1/1)*(-1)= -5+10 = 5 If you still want to calculate the velocities using the impulse and forget all the inverted mass and separating velocities thing, you must solve the following system of equations: COR = -(vB_after-vA_after)/(vB_before-vA_before) (this is COR's definition) mA*vA_before + mB*vB_before = mA*vA_after + mB*vB_after (momentum conservation) this is 2 ecuations with 2 unknowns (vA_after and vB_after) so it is solvable and has unique solution. From these ecuations you would get the solutions for vA_after and vB_after. Surely you can solve yourself or find the solutions in the web, if you insist in doing the calculations on your way. Hope this helps.
  12. Hello, I understand you want the SDL application to make another application "think" some other key has been pressed when certain condition has been met and the user presses a certain key. In Linux. It seems the solution depends on the windows (not Windows :oD ) system used. Maybe this thread can help you. Good luck!
  13. Hello, I'm new to the Forums. Hope the following helps... First thing I think is you should limit your for cycles to the minimum of iterations. It seems each for goes from i=0 to MAX_SCENE_COMPONENTS. If MAX_SCENE_COMPONENTS is a big number.... your cycle goes slow even if you have a little number of components. Maybe you should have a variable with the actual number of components at any time and do the for cycles for the number of actual components. Be aware that this would only work if the actual components at any time ocuppy the lowest possitions in the array Components[]. You can not just "load" all the components in the array and have, for example, only Components[4] and Components[7] "active". You can try if this helps improve performance, just changing the value of MAX_SCENE_COMPONENTS to 1 or 2, the number of components in your example.