Jump to content
  • Advertisement

grom_3

Member
  • Content count

    11
  • Joined

  • Last visited

Community Reputation

122 Neutral

About grom_3

  • Rank
    Member
  1. grom_3

    Porting hq4x to 24 bit color

    I have managed to fix the code by chaning the Interp functions. Result here. [Edited by - grom_3 on March 26, 2010 1:49:29 AM]
  2. I've been trying to port hq4x code to work with 24 bit color bitmaps. The original code converts the bitmap to 16 bit before applying the hq4x algorithm. Here is the original code and its result And my attempt at making it 24 bit with this result. Entire source code here What I don't get is the original version converts the 16 bit color to 32 bit before it starts writing to the destination (lines 313-314). As far as I can tell it only uses the 16 bit color to convert from RGB to YUV (actually its YCbCr). So I replaced that the conversion to go from 24 bit RGB to YUV (per YUV - RGB Color Format Conversion). Thinking the fault may have been the chance of RGBtoYUV code. I tried converting the 24 bit to 16 bit color on the fly and using the original RGB to YUV code. Still produced the same result. So I'm thinking the problem is that the Interp functions don't work across the whole range of 24 bit color values. Whereas in the original code the conversion to 16 bit then to 32 bit reduces the possible values and hence it works. But if that is the case I don't understand why or how I could fix them to work with all 24 bit color values.
  3. grom_3

    Angular motion and CCD

    The spin will make the ball curve when on the cloth of pool table. Which is what I'm trying to simulate, and so the path of the ball is not straight. So I was wondering if you can determine the Time of Impact when the path of the circle is not straight without using Conservative Advancement.
  4. grom_3

    Angular motion and CCD

    I been researching how to handle angular motion in Continuous collision detection and was wondering when only dealing with circle-circle collisions if there are any other ways besides using Conservative Advancement (from thread http://www.gamedev.net/community/forums/topic.asp?topic_id=556189). Without angular motion I have the following algorithm for finding Time of Impact: double testBallCollision(Ball b, double t) { if (t == 0.0) { return -1; } // Calculate the movement vector a for t Vector movea = current.velocity * t; // Calculate the movement vector b for t Vector moveb = b.current.velocity * t; double deltaX = b.current.position.x - current.position.x; double deltaXSquared = deltaX * deltaX; double deltaY = b.current.position.y - current.position.y; double deltaYSquared = deltaY * deltaY; int sumRadii = radius + b.radius; int sumRadiiSquared = sumRadii * sumRadii; double distSquared = deltaXSquared + deltaYSquared; // Reduce dynamic-dynamic collision to dynamic-static Vector movec = movea - moveb; // If the length of the movement vector is less // then the distance between the objects, // then there is no way they can hit if (movec.length() < sqrt(distSquared) - sumRadii) { return -1; // no collision } Vector N = movec.normalize(); // Find C, the vector from the center of the moving // ball A to the center of ball B Vector C = b.current.position - current.position; // D is the point along movec that is closest to ball b // D = N . C = ||C|| * cos(angle between N and C) double D = N.dot(C); // Find the lenght of the vector C double lengthC = C.length(); // sqrt(F) is the distance between the center of ball b // ad the closest point on movec double F = (lengthC * lengthC) - (D * D); // If the closest that A will get to B // is more than the sum of their radii, there's no // way they are going collide if (F >= sumRadiiSquared) { return -1; // no collision } // We now have F and sumRadii, two sides of a right triangle. // Use these to find the third side, sqrt(T) double T = sumRadiiSquared - F; // If there is no such right triangle with sides length of // sumRadii and sqrt(f), T will probably be less than 0. // Better to check now than perform a square root of a negative number if (T < 0) { return -1; // no collision; } // Therefore the distance the circle has to travel along the // movement vector is D - sqrt(T) double distance = D - sqrt(T); // Get the magnitude of the movement vector double mag = movec.length(); // Finally, make sure that the distance A has to move // to touch B is not greater than the magnitude of the // movement vector. if (mag < distance) { return -1; // no collision } // Return the time it takes ball A to travel this distance double collision_t = (distance / mag) * t; if (collision_t < 0.0 || collision_t > t) { return -1; // no collision } return collision_t; }
  5. I have problems implementing frustum culling in my Quake 3 BSP map viewer. Faces near the left and right edges sometimes are incorrectly getting culled by the frustum culling code. If i turn off the frustum culling the map is rendered correctly (although slower). http://pastebin.com/m5fce5afa - Frustum. Setups the frustum planes and tests where a leaf is inside frustum http://pastebin.com/m2cf93fae - BSPPlane. Used to test if a point is behind, in front or on plane http://pastebin.com/m5f99adbe - BSPMap. Calls the frustum culling code to elimate leafs http://pastebin.com/m2402a3a3 - BSPViewer. Handles the rendering of the map http://pastebin.com/m2402a3a3 - BSPFileReader. Handles reading the quake 3 BSP file. Converts from quake 3 coords to opengl coords. Coords are also scaled down in this code.
  6. grom_3

    FPS Game Engine

    Yeah, I already look at that link. They mostly just graphic rendering engines. Was looking more for complete game engine like Quake 3. I been using google and Cube and Quake are only ones I have found. Programming wise, I know dozen of languages including C, C++ and Java. Learning new languages is not a problem for me (its learning the API that takes time). My C/C++ is pretty rusty though. Quake 3/Cube 2 meet what I looking for expect, though prefer not to use GPL license. And to start with would need to use freely available maps and models, since I don't have much artist skills. I'm just more interested in the coding side. I have a friend working on maps and models. But its very early stages and its more just to learn then actually make a game. Since the effort required to make a full game is beyond a 2 man team.
  7. Does anyone know of any other free FPS Game Engines besides Quake 3 and Sauerbraten (Cube 2)?
  8. grom_3

    Collision Detection

    oh btw, I only doing 2D atm. The main parts of source code can be found at http://grom358.mygamesonline.org/bouncingballs_guide.html
  9. I followed and understood http://www.gamasutra.com/features/20020118/vandenhuevel_02.htm and manged to make demo of bunch of balls flying around colliding with each other. The collision detection code is passed a time parameter (t). It determines if a collision occurs in this amount of time and if it does it returns when the collision occurs. for (int i = 0; i < balls.length; i++) { a = balls; for (int j = i+1; j < balls.length; j++) { b = balls[j]; t = Math.min(t, a.testBallCollision(b, t, collisions)); } } So at end of this code the time variable (t) will have when the first collision occurs. All the balls are moved to this point in time and then handle calculating the physics for the collision. Repeat this until we reach the time allocated for drawing of that frame. Now I am trying to work on implementing box-box and box-sphere collisions. But I don't know how to detect when box-box or box-sphere collision occurs. I looked out couple articles like http://www.gamasutra.com/features/19991018/Gomez_1.htm but its confusing me. It says "A common approach to collision detection is to simply test for whether two objects are overlapping at the end of each frame. The problem with this method is that quickly moving objects can pass through each other without detection. To avoid this problem, their trajectories can be subdivided and the objects checked for overlap at each point; however, this gets expensive if either object experienced a large displacement. On the other hand, a sweep test can efficiently determine a lower and upper bound for the time of overlap, which can then be used as more optimal starting points for the subdivision algorithm." But I don't see how this fits in.
  10. grom_3

    RPG Battle System

    I guess what was confusing me is how to handle the various speeds. But I now realise that I can just increment them by different amounts.
  11. Trying to code a battle system similar to that in Crono Trigger, which has the following properties: * Each party member has an attack meter * Each enemy also has an attack meter * Can only issue commands when a party member has full attack meter * The attack meter fills up according to that characters attack speed * Ability to pause all attack meters (eg. when selecting an item or target) What is the best way to handle all this? I was thinking of using threads but with threads not sure how I could pause all meters or notify UI/battle engine when attack meter is full.
  • 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!