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

Hairie

Members
  • Content count

    11
  • Joined

  • Last visited

Community Reputation

109 Neutral

About Hairie

  • Rank
    Member
  1. I use "bulk" C# code. I get the elapsed time by calling QueryPerformancetimer regularly...the only wrapper i have is tao for opengl.
  2. Hello, I am making a 2d ping pong game in c#. If the ball hits the net, the balls position and velocity should be reset to the initial values at the start of the game. I know that the global timer therefore needs to be reset, but I don't know how to do it correctly. All my attempts yet to reset the game have failed. Here is the call of the ball's update method by testing class update's method: [source lang="C#"] public void Update(double elapsedTime) { ball.Update(elapsedTime,yPosition,xPosition,tablesurface,netsurface,ref c, ref r1, ref r2); }[/source] Here is the code of the ball update method: [source lang="C#"] enum ballStatus{Reset,Play}; ballStatus status = ballStatus.Play; public void Update(double time, double height, double newXPos, List<Point> collisionsrfc,List<Point> netcollisionsrfc, ref Circle c,ref Rectangle rect1,ref Rectangle rect2) { if(start_timer) { timer+=time; } if((timer > 10.0) && (start_timer)) { status = ballStatus.Reset; } else { status = ballStatus.Play; } if(status == ballStatus.Play) { Xstart = newXPos; Ystart = height; Tilted_Throw(time,Ystart,Xstart,collisionsrfc,netcollisionsrfc,ref c, ref rect1, ref rect2); TotalTimePassed+=12*time; SetPosition(GetX,GetY); } if(status == ballStatus.Reset) { SetPosition(-340,70); Xstart=-340; Ystart=70; TotalTimePassed=0; resetvelocity=true; timer=0; start_timer=false; } } [/source] The variable[b] timer[/b] is not the global game timer, but the timer for reseting the game after 10 seconds, if the ball collided with the net. The global timer is the variable [b]TotalTimePassed[/b]. The values [b]-340 [/b]for[b] x[/b] and [b]70[/b] for [b]y[/b] are the initial position values of the ball at the start of the game. If [b]resetvelocity[/b] is true, than the velocity is changed to the desired initial velocity of the ball in the ball's [b]Tilted_Throw[/b] method: [source lang="C#"] if(resetvelocity==false) { _velocity.Y = (velocity_start.Y - g.gravitation * TotalTimePassed); _velocity.X = velocity_start.X; } else { SetStartVelocity(90+rand.Next(0,15),10+rand.Next(5,15)); _velocity.X = velocity_start.X; _velocity.Y = velocity_start.Y; resetvelocity=false; } [/source] With [b]SetStartVelocity [/b]I set the new starting velocity([b]velocity_start[/b])(a bit different than the initial velocity, because ive added randomness). The problem is, whenever the ball hits the net, [b]timer [/b]will first go to [b]0 [/b]and then go up to [b]10[/b], then again to [b]0[/b] and then again up to [b]10 [/b]etc. After every 10 seconds the ball will repeat its motion near the net and at this point i notice, that the ball is only displayed for 1 frame at the [b]desired position(-340,70)[/b]. Please help me or give me solutions for this problem. Thanks in advance!
  3. Hello, I am currently making a pixel based 2D table tennis game where I need to to find the exact point the ball hits the table. For simplicity reasons I have't programmed the spin of the ball yet. Can anyone help me with formulas or something else helpful? Thanks!
  4. yes your right, even if the resulting acceleration is > 0, the velocity will still be negative and only shortly after velocity will become positive and the object will rise again
  5. Okay, but, if buyancy is bigger than its gravityforce it should actually start rising with the resulting accelreation and not decelrate by (g-resulting acceleration)? Because if so, it would decelerate even if it had its maximuim bouyancy force. For example if a body had the density 0.75 and a volume 0f 1000, its gravityforce would be 7357.5N. Its maximum buoyancy would be 9819. The resulting force would be 2452.5 N and the resulting max acceleration would be 3.27 m/s², so it should rise by that acceleration and not sink by(g-resulting acceleration), right?
  6. Yea it makes sense, but you said that if the bouyancy is bigger than its gravityforce only then it will begin to deaccelerate, but what is, if bouyancy is smaller than its gravityforce? Then it should also deaccelerate or not?
  7. Okas, I get that...but how is it, if the bouyancy still is less then the gravity force on the object? How does that affect the resulting acceleration? Because it already slows down, before its buoyancy is bigger than its gravity force ...or not?
  8. Thanks again, I completely forgot to subtract the positive accelerations from g xD, so I would need to apply the new value for g int both the formulas: [b]pK * V_max * g[/b] for the bodyforce and:[b] p_fl * V_immersed *g [/b]for the buoyancy...isn't it? By the way, the object already slows down when it first enters the water isnt it? So g already then must decrease isn' it ? Or am i being wrong?
  9. My first ideas were to calculate the difference between gravity force and bouyancy and to get the resulting acceleration by dividing hte resulting force by the mass of the object. Then i could use the formular y = 0.5 * a * t² for each timestep, resulting in y+=0.5*a*t². Depending on if the resulting force is below or over 0, the object would move either up or down. Each timestep i could recalculate the immersed volume, which would be something like [CODE] v_inWater = s.GetWidth() * s.GetHeight() * (watervolume-y); [/CODE] where watervolume is current immersed volume and y is the amount added/subtracted each timestep, depending on if it is sinking or rising, after that i could recalculate the bouyancy force, then the resulting force and finally the acceleration....is this a right approach or are there some mistakes in it?
  10. Okay, thanks for all these useful responses.... now i have the following situation: An object(a quad in this case) should fall vertically from a specific position into the water with a density lower than that of water...how would I calculate its correct motion within the water, till it stands still? What formulas would i need to calculate its upward and downward motion?