Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

152 Neutral

About gbMike

  • Rank
  1. gbMike

    Physics at extreme speeds

    Very cool. Did you write any of your own physics for it? I'm using Unity, but I don't know it well enough to say if the default physics will be enough.
  2. gbMike

    Physics at extreme speeds

      I'm actually really glad you both mentioned this, since it would have completely slipped my mind.     Interesting. I didn't know that. Thanks! Random side thought, would that mean that in the wake of the vehicle, as the air decompresses it would become proportionately cold?
  3. Appologies, but my question is a bit general. I'm working on a completely over the top racing game, involving extremely high speeds, between 200mph - 1500mph and above. ( it is heavily inspired by the F-zero series, as well as the anime movie Redline ) Since we are really pushing this as far over the top as we can take it, I would like to pull in some real world physics where possible. For example, after a certain speed, air friction alone becomes enough to ignite an object. What type of physics based considerations would you recoment taking into account? I'm not looking for specific formulas or anything, just any thoughts that might be relavent, or worth considering. Thanks!
  4. I appreciate the feedback, I did not mean to paint the indie title idea poorly. I only meant that if I were to assemble my own team, most of its members would likely have an experience level similar to my own, as compared to a development studio, which often have 10-20+ year veterans. Regardless, I’ll check around, and see if I can’t find an existing indie group, who might be in need of another programmer.   You also mentioned this question as ‘typical.’ In the future, what would be a more acceptable phrasing for comparing the potential worth of a particular experience?
  5. I'm at a bit of a crossroads for deciding which direction to take with my programming. Specifically, what do you feel is more important for better preparing to entering the industry, a published title (aka a self-published indie game) or experience in a similar industry?   As a self-taught programmer, I feel I could learn a great deal interfacing with other developers in even a non game related, production environment, but I'm concerned that the general skill sets that I possess and want to improve, will not cross over between jobs ( 3d math, in engine scripting and UI, and other similar. This is just based on what I have seen. If this is inaccurate, I would love to know. ) Likewise, a complete, published game speaks to my credibility, but might not provide the best avenue for improving my own skills, since I would not be working with anyone more experienced than myself.   Just a quick sidenote about my experience thus far, to give a little better idea of where I stand: I started teaching myself around 4 years ago. I've completed several small flash games, but never published, or sold one. I've worked on a variety of projects in C++, and several other scripting languages, but again, no published or marketed final projects. I consider my coding ability to be solid, and I can typically pass any programming test I'm given. (at least, so far)   Thoughts? Which would you think is a more useful direction to go?
  6. That is a good point. I hadn't thought about it like that. I'll send it out as is, and see about a code review some other time.
  7. I appreciate the feedback. I've made some adjustments, per your advice. In particular, the loops have been updated with reduced function overhead, and comments have been added to unclear sections. Just to be sure, I've re-reviewed and tested the loops during memory cleanup as well, just to verify that they do work as intended.
  8. I'm putting together a job application for a generalist programmer position, and I'm in the process of selecting a code sample for my review, and I would very much like to hear any feedback before sending it off. Too simple, could be written better... ect. Whatever comes to mind if you were handed it as a potential applicant. As always, thanks for the help. [source lang="cpp"] /* Core game class. Manages the elements, start and end of a game. Instantiated by main.cpp */ #include "Game.h" Game::Game() { // Set default values gameInProgress = false; navigating = false; selectedNode = NULL; player = NULL; lastCoreTransform = NULL; } Game::~Game() { if( gameInProgress ) endGame(); delete lastCoreTransform; } // Starts a new game, if one is not already running void Game::startGame( int levelID ) { // Break if a game is already in progress if( gameInProgress ) return; gameInProgress = true; player = new Player(); // Create default cameras cameras.push_back( new Camera() ); //player camera cameras.push_back( new Camera() ); //fixed cam // Set camera offset, and set it to follow the player's ship currentCamera = cameras[0]; currentCamera->translate( 0, -30, -100.0f ); currentCamera->rotate ( 0.0f, 0.0f, 0.0f ); currentCamera->camTarget = player; // Offset the static camera cameras[1]->translate( 0, 0, -100.0f ); setCamera(0); // Generate the level, based on the passed in ID GameLevelData::createLevel( levelID ); } // Ends the curent game, and deletes all non texture assets void Game::endGame() { gameInProgress = false; if( player != NULL ) delete player; player = NULL; // Delete all Nodes, Actors and Cameras while( Node::getNodes().size() > 0 ) delete (*Node::getNodes().begin()); while( Actor::getActors().size() > 0 ) delete (*Actor::getActors().begin()); for( int i = cameras.size()-1; i >= 0; i-- ) delete cameras; } // Function to be run, each time the frame updates void Game::update( int timePassed ) { handleInput(); // Process user input updateActors( timePassed ); // Update all actors, AI, and physics updateCamera( timePassed ); // Update the current camera drawScene(); // Draw scene data drawHud(); // Draw 2d HUD elements } // Function to generate the view matrix void Game::updateCamera() { // If a game is not running, or a camera is not set, view matrix is just an identity matrix if( !gameInProgress || currentCamera == NULL ) { iGLEngine->viewMatrix->setMatrix( mat4(1.0f) ); } else if( currentCamera->camTarget == NULL ) { // Camera has no target, so retun just the cameras transform matrix iGLEngine->viewMatrix->setMatrix( *currentCamera->getTransform()->getMatrix() ); } else { // We have a camera target. Interpolate the last camera position, a set percentage, towards // the transform of the camera target. lastCoreTransform->interpolate(currentCamera->camTarget->getCoreTransform(), 0.5f, //Rot multiplier 0.25f ); //Pos Multiplier // Apply the camera's offset, to the interpolated transformation, and set it as the current view Matrix iGLEngine->viewMatrix->setMatrix( (*currentCamera->getTransform()->getMatrix()) * glm::inverse( *lastCoreTransform->getMatrix() ) ); } } // Handles user input at the game level void Game::handleInput(){ // Get a pointer to the current input state via a static accessor InputState *inputState = InputState::getInputState(); // Toggle between the two cameras with the number keys if( inputState->keyDown( SDL_SCANCODE_1 ) ) setCamera( 0 ); if( inputState->keyDown( SDL_SCANCODE_2 ) ) setCamera( 1 ); } // Updates all actors, processes AI (if any), and physics void Game::updateActors( int timePassed ) { for ( list<Actor *>::iterator it = Actor::getActors().begin(); it != Actor::getActors().end(); it++ ) { (*it)->update( timePassed ); } } // Draws the scene elements void Game::drawScene() { for ( list<Node *>::iterator it = Node::getNodes().begin(); it != Node::getNodes().end(); it++ ) { Mesh *mesh = static_cast<Mesh *>(*it); if( mesh && mesh->getParent() == NULL ) { mesh->drawMesh(); } } } // Recursive function, to delete a node, and all it's children. void Game::deleteNode( Node *node ) { list<Node *> children = node->getChildren(); for ( list<Node *>::iterator it = children.begin(); it != children.end(); it++ ) { deleteNode( (*it) ); } delete node; } // Sets the current camera void Game::setCamera( int index ) { // Verify that the passed in index is within boundaries index = ( index < 0 ) ? 0 : index; index = ( index > (int)cameras.size() ) ? (int)cameras.size() -1 : index; currentCamera = cameras[index]; // If the camera has a target, make sure to set the data for the 'lastCoreTransform' if( currentCamera->camTarget != NULL ) { // Create the lastCoreTransform if it does not already exist if( lastCoreTransform == NULL ) lastCoreTransform = new Transform(); lastCoreTransform->setMatrix( *currentCamera->camTarget->getCoreTransform()->getMatrix() ); } } [/source]
  9. gbMike

    starting game engine

    I followed a series of c++ video tutorials from http://www.3dbuzz.com/ that It includes the very basics, a simple text based, and 2d game, and culminates with a 3D renderer with openGL. They've got tutorial sets for a bunch of other languages as well. (Thought I haven't personally viewed most of them) It's worth noting, that some of them, particularly involving openGL are very dated, but at least imo, it makes things much simpler to learn the basics from.
  10. I'm having some difficulty replicating a bit of code, after switching from Euler, to Quaternions. The rotation value (a vec3) in my transform class, has each value (x, y, z) constrained between -180 and 180. So, if I was to rotate an object with 0 degrees rotation, 190 degrees, the new rotation would be -170. My camera's transform needs to be rubber banded to the player. Heres how it was setup with Euler angles (This was called each frame): vec3 posDif = coreTransform->getTranslation() - lastCoreTransform->getTranslation(); vec3 rotDif = coreTransform->getRotation() - lastCoreTransform->getRotation(); //Adjust values if( rotDif.x > 180.0f ) rotDif.x -= 360; if( rotDif.y > 180.0f ) rotDif.y -= 360; if( rotDif.z > 180.0f ) rotDif.z -= 360; if( rotDif.x < -180.0f ) rotDif.x += 360; if( rotDif.y < -180.0f ) rotDif.y += 360; if( rotDif.z < -180.0f ) rotDif.z += 360; //reduce the position and rotation by a % posDif *= 0.25f; rotDif *= 0.5f; vec3 newRot = -(lastCoreTransform->getRotation() + rotDif); vec3 newPos = lastCoreTransform->getTranslation() + posDif; Here, it is pretty easy to constrain the rotation difference. That way if last rotation was 170, and new rotation is -170, the difference will be the correct 20, rather than -340. So my question is, how do I replicate this with Quaternions? Here is the current interpolation code: //Interpolate between this transform, and the passed in 'target' Transform* Transform::interpolate( Transform *target, float rotMultiplier, float posMultiplier ) { quat thisQuat = cdata->quaternion; quat targetQuat = target->getQuat(); quat newRotQuat = glm::mix( thisQuat, targetQuat, rotMultiplier ); //check for infinities in return values if ( newRotQuat.w <= FLT_MAX && newRotQuat.w >= -FLT_MAX) { //Number is real, within boudaries. } else { //then our quat has returned overflow numbers, either to large or too small // -1.#IND or 1.#IND newRotQuat = target->getQuat(); } vec3 newRot = glm::eulerAngles( newRotQuat ); vec3 newPos = cdata->translation + ( (target->getTranslation() - cdata->translation ) * posMultiplier ); //create the new Transform, and pass in values Transform *nTrans = new Transform(); //nTrans->setMatrix( newPos, newRot, vec3(1.0f, 1.0f, 1.0f) ); nTrans->setMatrix( vec3(0.0f,0.0f,0.0f), newRot, vec3(1.0f, 1.0f, 1.0f) ); return nTrans; } It causes the camera to start spinning wildly after a certain rotation is reached. How can I properly constrain the value like I used to, while the code for quaternion interpolation is handled through GLM? (glm::mix) EDIT: Alternatively, if anyone has a suggestion, for another way to add easing animation to the camera, I'd be interested in trying it.
  11. I'm using glm already. I can't imagine being without it. I haven't used it for quaternions yet though.
  12. Hm. I had considered pulling the position and rotation values from the matrix, then calculating it, but I would have thought there would be some way to do it without needing to convert the data twice. But then again, I'm still a bit lacking in my matrix math. I'll let you know how the update goes. True. The updateViewMatrix function (that contains the above code) takes in a frameTime variable, but I had yet to integrate it here, since the current code still needs fixed. Definitely good advice
  13. I'm attempting to add a slight smoothing to the 'camera' in my 3d engine. It locks onto the player, and follows the model, exactly. However, I would like it to, instead animate slightly, as the camera catches up to the player, just so it doesn't look so stiff. Here was my semi successful fix: [source lang="cpp"] mat4 targetMatrix = glm::inverse( currentCamera->camTarget->getCoreTransform().getMatrix() ); //camera matrix is the camera's offset targetMatrix = currentCamera->camMatrix * targetMatrix; //get the difference between the new target matrix, and the current view matrix mat4 difMatrix = targetMatrix - viewMatrix; //only move a percentage of the total distance. //this will automatically ease out the movement difMatrix /= 4; viewMatrix += difMatrix; iGLEngine->viewMatrix->setMatrix( viewMatrix ); [/source] The problem is, when the object rotates very quickly the scene starts to warp and stretch. The amount of stretching is directly connected to the rotation speed. Anyone know why? Or, even better, another way to animate a transition from one matrix (the current view matrix) to another (the target view matrix) ?
  14. gbMike

    When am I qualified?

    Ah sorry, let me be a bit more specific. I'm not planning on getting feedback from the actual speakers or exhibitors there, rather I'm meeting up with a small developer group that is attending. It's mostly indie developers, but most have experience beyond that. I agree. I'm in the tail end of saving up money to afford the move out of "West Nowheresville." I figured moving after PAX would be best, since it's likely the largest networking event I'll be able to attend, and it might sway my move location. That's refreshing to hear. I understand that each individual will obviously have their own unique opinions, not necessarily representative of the group, (in this case, that group being persons in charge of hiring) but I'm always hesitant to write off advice, from someone with far more experience into the subject than myself. In any case, thanks all for the feedback.
  15. gbMike

    When am I qualified?

    I'm going to Pax Dev at the end of this month, so I'll see who I can meet up with. Maybe I can get some feedback there. Sounds good. Truth be told, I was actually intimidated out of sending out applications if I didn't know they were up to par. While listening to a talk from one of the hiring managers at Obsidian, he, as well as couple of other hiring staff from other companies, were basically saying not to shotgun out applications unless your sure they will impress, saying that if they think your work is sub par, that tends to be how they remember you. I thought this seemed a bit harsh, but it seems like basically the same as having a bad first impression. At the end of the day, it makes me more than a little bit paranoid. But, your right, I have to actually try eventually.
  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!