Jun 11, 2015

It's been long time since last post on the blog, many things changed. Started new project and helped out local group with game they are creating. As always I try to supplement videos which are more interesting then pictures :)



I've created simple random dungeon generator for the club game, heres some results.





I've also changed the game idea from strategy to puzzle block game. I wished to make something easier and I think block game would be easier to make. I am planning to implement some kind of multiplayer in it but first I need to get some basics down like animating blocks etc.


Here is some simple puzzle game logic: moving blocks, check for matching rows or columns and give points accordingly.

Jan 28, 2015

After long while I had some time to finally make something for the game. As i was planning before, I've implemented the group moving behaviour to the engine. Although it still needs fixes to be of good use, its still a good start

Here's video that I've recorded to demonstrate:

Jan 8, 2015

Today I've implemented character selecting (same way as in any rts game). Most interesting upgrade was to create raycast from cursor position rather then just directly raycasting from camera. I used the guide located in here: Mouse Picking with Ray Casting

Since I am using glm and glfw, my function looks like this:
glm::vec3 GraphicsMain::GetMouseRay(){
    // Get mouse position
    double xpos, ypos;
    glfwGetCursorPos(window, &xpos, &ypos);

    float x = (2.0f * xpos) / res_x - 1.0f;
    float y = 1.0f - (2.0f * ypos) / res_y;
    glm::vec3 tmp_vec3 = glm::vec3 (x, y, 1.f);

    glm::vec4 tmp_vec4 = glm::vec4 (tmp_vec3.x, tmp_vec3.y, -1.f, 1.f);
    tmp_vec4 = glm::inverse(ProjectionMatrix) * tmp_vec4;
    tmp_vec4 = glm::vec4 (tmp_vec4.x, tmp_vec4.y, -1.0, 0.0);
    tmp_vec4 = (glm::inverse(ViewMatrix) * tmp_vec4);
    tmp_vec4 = glm::normalize(tmp_vec4);

    tmp_vec3 = glm::vec3(tmp_vec4.x, tmp_vec4.y, tmp_vec4.z);

    return tmp_vec3;
}

After failing a ton of time with overlapping query in PhysX, I've decided to just roll simple check to get selection for models. I guess the check could be somehow more simple but this will do for now:

if(x_min <= models_list.at(i)->position.x &&
models_list.at(i)->position.x <= x_max &&
z_min <= models_list.at(i)->position.z &&
models_list.at(i)->position.z <= z_max)

I think next I should try implementing moving the group in formation, or at least in a way where all the models are not trying to move on to each other. But that will be implemented on the next post.

Models trying to move to same position, quite dumb result