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

peterbone

Members
  • Content count

    26
  • Joined

  • Last visited

Community Reputation

133 Neutral

About peterbone

  • Rank
    Member
  1. Attached is a Windows demo of what I'm trying to do. This is an old version. Drag the green dot to change the line angle and drag with Ctrl to bend it. It will always stay the same length. Notice that the cursor moves away from the end as you bend it, and the end jumps when you go back to bend a bent line. That's what I'm trying to fix. If I get my new method to work with a numerical method then I'll post it as well.
  2. ferrous, when dragging P2, the cursor won't always stay on P2 if it's dragged to a different radius. Notice in my diagram that Pc is not at P2. The cursor will be at P2 to start dragging but not necessarily during the drag. This allows the arc to stay circular with a constant length. My app works similarly when dragging a straight line to change it's angle to keep its length constant. This is for a vector graphics drawing / animation app. I want an intuitive way to position and bend constant length lines.
  3. That's the nice bit about this technique. If you want to draw e.g. a Bezier curve given the user-dragged point and some other control points, you have to do extra work to calculate the curve.   If you want to draw the curve after having simulated those particles, you just connect the dots. They already form a curve. They form an approximation to a curve. Drawing it requires multiple calls to a drawing function instead of just one for the arc.   I know I didn't mention this previously, but I also need to store the bent line in memory in a scalable and compact way. The arc lends itself to this much better.
  4. That sounds like a nice alternative Crossbones. Although I'll have to think carefully about how many particles there should be at different scales and also how to quickly draw the curves from the set of particles. I may need to draw hundreds of these curves per frames, so just drawing an arc may be the faster method.
  5. Thanks for your help. Raigan, P2 is unknown. Ferrous, yes r is unknown too. I've already played with Bezier curves but they require even more numerical solutions because the length is not constant. You need a numerical method to work out the length and another to move the control point until the length is the value you want.   I think the way I'll have to do it is to work out the endpoint P2 with no curvature (a1=a2), then work out the angle to the cursor (Pc) from P2, then work out P2 again, and repeat until it converges. I think it will converge quickly this way.   I've already done it a different way where a2 is calculated from Pc and the midpoint of the unbent line. The problem with this is that the cursor leaves P2 while dragging when the line is bent. When you go back to adjust P2 again it will jump to different position.   Edit: I've added an image to my post above.
  6. I'd like a user to be able to bend a line by dragging the end. The line will be an arc when bent. The length of the arc (L) needs to stay constant. The other end of the line, not being dragged, is at known point P1 and angle a1, which shouldn't change when the other end P2 is being dragged. The way I want it to work is that the angle at P2 (a2) should be such that that end of the line points towards the cursor when being dragged (Pc). The difficulty is that I can't work out P2 without knowing a2 and and I can't a2 without knowing P2. I have an expression where the only unknown is the radius r of the arc, but can't solve for it because of the complexity. I want to try to avoid numerical solutions. Has anyone done anything like this before? Is it possible to solve for r?  
  7. Thanks Alvaro. I will consider numerical solutions but I prefer the simplicity of a formula. My main reason for posting here was to check if I had missed something in the maths that would lead to a simple formula. It seems that that is not the case, so I will look at numerical solutions.   This is not actually for a game. I'm developing software for creating animations. Objects are constructed from primitives such as lines, circles and images and then moved using pin joints. Bendy lines will be a new primitive. They need to stay the same length because they will be bendy, not stretchy. If a bendy line is used for an archer's bow for example, you wouldn't expect it to change length.   The number of times the calculation needs to be performed depends on the animator. In a complex scene there could be thousands of these arcs needing to be drawn at up to 33fps when the animation is played. I would prefer to do the calculations on the fly.
  8. I know I could use a numerical method, but I'll try everything before I have to resort to that. This needs to be fast.   I've thought about using a quadratic bezier curve, but even keeping them a constant length requires a numerical method to work out the length and another numerical method to offset the control point to get it to the length you want. I thought about using arcs because it's easier to keep a constant length. The constant length is the most important aspect. It shouldn't just appear to be the same length - it needs to be exact.
  9. I'd like to make it possible for a user to drag the end of a line so that it bends in 2D. The line will be an arc when bent (section of a circle). The start point of the line will be fixed in terms of its position and angle/direction. The length of the line/arc will also remain constant. The angle/direction at the end of the line will point to some point P (the cursor position). That should be enough to define the arc fully. However, it seems non-trivial to work out the parameters of the arc. This is because to work out the position of the end of the arc requires knowledge of the radius or angle at the end of the line and visa-versa. If I could just work out the radius the rest is easy.   Here are some relations: angle at end = angle at start + length/radius circle centre is perpendicular to start direction at distance radius from start position circle centre is perpendicular to end direction at distance radius from end position end direction is vector from end position to point P.   I need an equation for radius in terms of the arc start position, direction, arc length and point P. Putting the equations into Maxima to find a closed form solution using 'solve' didn't seem to come up with anything.
  10. I'm looking for 2D coordinates for alpha-numeric characters made from simple polylines in a basic font. I'm most interested in the number characters. I could make them myself but thought that some data like this must already be available somewhere. Does anyone know where I can find this?
  11. This sounds like a good idea enabling me to draw to the off-screen bitmap with the CPU and use the GPU for blitting. How would I go about drawing my bitmap to a texture?
  12. Thanks. This is what I suspected but I'm not exactly sure what you mean by 'opaque'. Does this mean there's no way to write to the DDB data from outside of the device? I assume this means there's no way to write a software renderer that blits quickly. Pete
  13. Someone must know about this. Why can't I access the raw data in a DDB when GDI can. Is it the device that does the actual drawing and GDI is just the interface between the application and the device? Peter
  14. I have written a software rasterizer (a 3D software renderer). I rasterize to an off-screen bitmap by writing to the bitmap scanlines and then blit the bitmap to the screen. The problem is that the blitting is slow because I have to set the pixel format of the bitmap to a 32 bit DIB in order to write to the scanlines - it then has to convert to the pixel format of the device (monitor) when blitting. If I set the bitmap pixel format to device dependant it will blit very quickly but then I can't write to the scanlines correctly - even if my screen colour depth settings are 32 bit. Is it possible to write to the scanlines of a device dependant bitmap without using hardware? The GDI routines in Windows are capable of doing this so how do they do it? Are they using hardware? Thanks Peter Bone
  15. Thanks, that's helpful. A second order equation makes it sound like a differential equation. I assume you mean a quadratic. I guess that after moving the spheres to the computed collision time, the calculation for collision response will be the same as you gave before? If you knew this method, why do you not use it in your code? Just wondering. I'm a bit confused by your code. Where is m_position defined? Should it be m_centre? Pete