Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

1164 Excellent

About Ezbez

  • Rank
  1. Wikipedia tells me that this requirement to have the leading non-zero term be a 1 is not universal. I suspect that it's just done in order to make the echelon form unique. If you don't specify that, then depending on how exactly you carry out the reduction, you could get different results from someone else also reducing that same matrix.   (I'm not 100% sure that it does in fact make the echelon form unique, but it feels like it would to me.)
  2. Ezbez

    Radical equation

    sqrt(x)^2 = x is true in general, even in the case of negative or imaginary numbers. What is the difference between squaring the "side" sqrt(x) and squaring the "term" sqrt(x)?   I'm a graduate student in math and this thread has been more convoluted than most of my textbooks - why is everyone making such a simple thing so difficult? Alvaro has the right of it.
  3. Ezbez

    Dividing by zero, on purpose

    The very first game I wrote I didn't know how to handle events well enough to get it to quit in a natural way. So I had the escape key just divide by zero so that it would exit.   My proudest moment.
  4. Ezbez

    New Kickstarter Game from the creators of Myst

    This is the first Kickstarter I've backed, despite being quite enthusiastic about a lot of them. I did this because if any genre needs a second chance, it's the Myst-likes. That, and massive nostalgia. But the point of Myst was never the particular characters, it was the exploration. They didn't show much in the Kickstarter, but they've made it pretty clear that we'll be given weird and wonderful worlds to traverse. That's all I want, and is half the reason I loved Fez which despite being a platformer has as much in common with Myst as with Mario.   For those who are saying that Myst is a niche game, reconsider your thoughts. It was, until 2002 when The Sims over took it, the best selling PC game of all time. It spawned 4 direct sequels and the URU-spinoffs. Myst was a massive force in the gaming world at the time and there were countless knockoffs of it made afterwards. I've played a lot of those knockoffs but most were varying degrees of bad. And oh god they were so inconsistently compatible with PCs back then: every one required the installation of bizarre software to play animations that had generally a 50/50 shot of working.
  5. We are trying to solve for the constants a,b,c so that the polynomial a+bx+cx^2 gives the appropriate points. Suppose those points are (x1,y1), (x2, y2), (x3,y3).   The typical way to solve this is by using some linear algebra (I know! linear algebra lets you solve quadratics? It's somewhat surprising but we actually know x here and so we don't need to worry about any quadratic behavior. The things were solving for are a, b, and c which are only used linearly in this equation.). If you aren't familiar with this then you'll have to solve it out entirely (and may want to either way if you're not already using a linear algebra library). What this means is that we can plug each point (x,y) into the polynomial and this gives us a constraint on the possible values of a,b,c. So we get:   a + b*x1 + c*x1^2 = y1 a + b*x2 + c*x2^2 = y2 a + b*x3 + c*x3^2 = y3   These are three equations and we have three unknowns a,b,c so it should be solvable, at least so long as the three points permit a unique solution (almost all such points do). You can now solve these three equations for a,b,c.   If you know linear algebra, then this is just solving the matrix-vector equation:   The matrix M =  | 1 x1 x1^2 | | 2 x2 x2^2 | | 3 x3 x3^2 | The vector Y = {y1, y2, y3} (a column vector) The vector X = {a,b,c} (also a column vector). Solve M * X = Y, or X = M \ Y if you're in a language or package that support matrix math directly. Most such languages will also have built-in functions to do this sort of thing. Look for polynomial fitting or least squares (though least squares would technically be overkill).   Or, like I said, you can solve this any other way that you want, such as substitution that most people learn by highschool algebra.   Edit: Actually, I feel like doing that substitution out right now. Starting with the last equation: a + b x3 + c x3^2 = y3, so a = y3 - bx3 - cx3^2 Substitute into the second equation for a: (y3 - bx3 - cx3^2) + bx2 + cx2^2 = y2 Solve for b: b = [ y2 - y3+ c (x3^2 - x2^2) ] / (x2 - x3) Substitute into the first equation for b and a: (y3 - [y2 - y3 + c ( x3^2 - x2^2) ] / (x2 - x2) - cx3^2) - [y2 - y3 + c (x3^2 - x2^2)] / (x2 - x3) x1 - cx1^2 = y1 Solve for c: c = oh gosh I don't really feel like doing the rest of this I guess, but you get the idea. It's pretty long! So I decided to cheat and use Wolfram|Alpha to solve it for me.   This gives us some beautiful solutions: Let C = 1/ [ (x1-x2) * (x2 - x3) * (x1 - x3) ]. a = C * [ x1*x2 * (x2-x3) * y1 - x1*x3 * (x1-x3) * y2 + x1*x2 * (x1-x2) * y3] b = C * [-(x2 + x3) * (x2-x3) * y1 + (x1 + x3)* (x1-x3) * y2 + (x1 + x2) * (x1 - x2) * y3] c = C * [ (x2 - x3) * y1 - (x1 - x3) * y2 + (x1 - x2) * y3 ] Gives us the coefficients!
  6. One algorithm that should work in this situation to break the shape into convex hulls that can be drawn more easily:   1. Pick a point, add it a list A which shall be our first convex sape 2. Cycle through points going clockwise 3. Check each such point to make sure that it is further clockwise than the previously checked one 4. If it's not clockwise not, then ignore add it to a list of points left over 5. If it is clockwise, add it to the convex hull 5a. If it is clockwise and the previous one was not, run this algorithm recursively, making a new convex shape by iterating over the list of left-over points (clear left-over point list when done) 6. Continue until all points have been checked   I hope that's clear. Basically, anything that isn't still going clockwise is a new convex (recusively, since this might also need to be broken up), but anything that is, is. This isn't guaranteed to have the best possible break-up of convex shapes and I'm sure you could come up with weird shapes that it would break up inefficiently. But I suspect it will work for the vast majority of things. It is guaranteed that for any non-self-intersecting shape it will fill exactly its interior and none of its exterior. Don't expect it to work sanely with self-intersections. Also, your choice of initial point will affect how it makes the convex shapes.   Note that a convex shape can be drawn by picking any point and drawing a 'triangle fan' out from that point, like the (out-dated?) OpenGL function for that.
  7. Ezbez

    Project update - new demo

    Sorry for the late reply, I've gone back to college and hence have a lot less time for this project. If you download the zip file, extract to a folder, and run the server.exe program in the 'dist' folder, it should run. If it doesn't, please let me know and post any errors or behavior that you get so that I can try to resolve the issue. It will only run on Windows.
  8. Ezbez

    Technically... a demo is written... errr....

    [quote][color=#1C2837][size=2]Of course, that all sounds spiffy, but the one demo I have written now shows a blank, empty blackness (no, it's not suppose to be blank).[/size][/color][/quote] Aww, we don't even get a screenshot?
  9. Ezbez

    Path finding

    Since the last update I've been working mostly on path finding. I thought I'd show an image of the pathfinding algorithm running. The enemies (in red) show their paths (in magenta) calculated by A*. The large magenta dots show the furthest along target that the enemy can see - this is what it actually moves towards in order to take shorter, diagonal paths that A* doesn't find. You can see that the process still has some bugs in it - notice how two enemies are moving directly toward the player (in green) despite a wall being in the way. One problem I encountered was that enemies kept on getting stuck on walls. This was due to their looking ahead and 'seeing' the waypoint just across the corner, when in actuality their non-zero radii meant that they would get trapped on the corner trying to take a diagonal path. To fix this, I used the common technique of enlarging all collision objects by the radius of the enemy before doing the line-of-sight test. Since I only use the static level geometry for line-of-sight tests, I simply make an enlarged version of it at level load.
  10. Ezbez

    Project update

    I definitely recommend Chipmunk if you need 2D physics. A video would be nice, but I don't have any easy way to make one and the gameplay isn't exactly very exciting looking right now. I'll think about doing that at some point.
  11. Ezbez

    Project update - new demo

    Since the last update, I've done a couple significant changes. First, I've fixed the client version so it's actually multiplayer again (though it still only works well with very good connections, like LAN). Second, I fixed the py2exe script, which means that I'm able to release a demo again! Try it out, please. This demo also includes fancy diagonal wall tiles for added variety and complexity of levels. This this demo, I've also been working on improved AI movement. In the demo, they are brain dead and will get stuck on the walls all the time. Now I've implemented A* pathfinding which lets them get from point A to point B easily enough, but it's fairly expensive and inelegant. Since the A* is done on the map grid while movement is continuous, they will walk an "L" shape instead of just taking the diagonal, and A* is a little too expensive to have all of them recalculate every frame, so their targets can fall behind the player's actual location. I'm working on some improvements to this. First, the enemies now scan ahead, looking for the furthest tile on the A* path which can be reached by straight-line movement. Next, I will be implementing a direct line-of-sight test on the player to see if an enemy can move directly toward the player prior to performing any A* search. Lastly, I'll need a more intelligent means of deciding when to recalculate A* paths since currently it's done randomly. Also, handling the new diagonal wall tiles for A* is tricky and currently they are simply considered entirely blocking. I am also looking at ways of providing Mac and Linux distributions of this. I might give pyInstaller a try for a future release.
  12. Ezbez


    Great work! Ran smoothly for me and played well. I was disappointed at the lack of secrets hidden throughout the level - I spent a lot longer than I needed to exploring the tip tops of the first area. One suggestion I have is to consider making spacebar a release-both-arms button. I kept finding myself forgetting which arm was which and accidentally making a second one. Spacebar was a natural thing to press when I wanted to release. I also found the blur in the background of the initial menu disconcerting until the menu popped up. That was just something that rubbed me the wrong way, I guess, not really much of an issue.
  13. Ezbez

    A case of the duhs

    Just a note: on Windows 7 and Windows Vista, you can shift-right-click on a folder and it has an open command prompt here option.
  14. Ezbez

    Project update

    In the past couple days I've made two large changes to my project. First, I've started using Chipmunk for physics (and pymunk for Python bindings). This has been a great choice so far. Integrating Chipmunk into my game was painless and the results have been very good. I had initial difficulties getting movement of the player to work well with the physics engine, but the creator of Chipmunk pointed me towards the tanks demo project that Chipmunk ships with. It uses a dummy body bound to the actual body with a pivot joint to control velocity while respecting a maximum force to keep the physics happy. It works perfectly. The second change, which prompted the first one, is the addition of maps to the game. For now, it's a simple grid of either open spaces or blocks, but I'll be expanding upon that as needed. Thanks to Chipmunk, it was easy to get this working with the existing game. However, these changes have meant that I've broken multiplayer again, and the py2exe setup needs tweaking. So instead of an executable demo, I've just got this oh-so-pretty picture. Enjoy!
  15. Ezbez

    Top-down shooter/RPG project

    Yeah that's definitely my plan (and roughly how it's going already). Procedural content all the way. I appreciate the feedback!
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!