Bundled Feature Request

Project: Armament
Role: Game Programmer
Completed: 16918.89 1stLt Lead James Fleming Game Producer
Start Date: 10/1/2017 16:15
End Date: 2/8/2018 10:42
List of Feature Needed:
  1. Being able to click and move a single unit
  2. Sounds play when action is hit
  3. Fix camera
  4. Particle effect for mouse click
Let develop the code for actually selecting a unit and making it move without animation or special effect as if it was traveling from point A to point B.
Bundled Feature Request

No Public Asset Available

Complete Task
1.23 HR.
Setup Raycasting class to find the the first asset it hits when mouse clicking.

public static bool ScreenPositionToWorldPositionRaycast(Vector2 screenPos, CameraComponent camera, Simulation simulation)
    Matrix invViewProj = Matrix.Invert(camera.ViewProjectionMatrix);

    // Reconstruct the projection-space position in the (-1, +1) range.
    //    Don't forget that Y is down in screen coordinates, but up in projection space
    Vector3 sPos;
    sPos.X = screenPos.X * 2f - 1f;
    sPos.Y = 1f - screenPos.Y * 2f;

    // Compute the near (start) point for the raycast
    // It's assumed to have the same projection space (x,y) coordinates and z = 0 (lying on the near plane)
    // We need to unproject it to world space
    sPos.Z = 0f;
    var vectorNear = Vector3.Transform(sPos, invViewProj);
    vectorNear /= vectorNear.W;

    // Compute the far (end) point for the raycast
    // It's assumed to have the same projection space (x,y) coordinates and z = 1 (lying on the far plane)
    // We need to unproject it to world space
    sPos.Z = 1f;
    var vectorFar = Vector3.Transform(sPos, invViewProj);
    vectorFar /= vectorFar.W;

    // Raycast from the point on the near plane to the point on the far plane and get the collision result
    var result = simulation.Raycast(vectorNear.XYZ(), vectorFar.XYZ());
    return result.Succeeded;


1.00 HR.
Organizing code

2.00 HR.
Upgrade Xenko to 2.1, then set the file system up in TFS to allow us to start adding module code to the project.

Also reset Xenko interface to match the file system change

And then put in some action code that will be used to select the typeof action using enum code.

1.00 HR.
Researching CollisionFilterGroups and trigger models

2.00 HR.
Implemented the debug tool on the Team Deathmatch scene to allow me to find the model XYZ cords.  The 2d screen from 3d world perspective clicking seem to be off in calculating the position of click vs asset location.

2.50 HR.
worked on created Papa branch in TFS and then organizing Xenko asset and folders.

Code a bit on the debug sync script to get keyboard input to show

3.00 HR.
Set and merged papa to main and delta branches.

Created and set the camera functionality up.

Pulled the logo asset for the splash screen

Fixed and organized the page vs file for functionality in switching pages.

2.00 HR.
worked on setting up mouse to click objects

1.00 HR.
Looking over mouse api for clicking object and setting vector for it to move.

2.00 HR.
Setup event driven action to allow for unit to move

1.00 HR.
Create particle effects

0.58 HR.
created the particle effect code base to start testing with.

0.75 HR.
the particle effect is not working so you can see where you click on the terrain

2.53 HR.
set up the navigation mesh and some of the code base API,  I need to do more research on this before moving forward.

2.00 HR.
Researching and trying a few things

2.00 HR.
Got the clicking of the unit vs terrain using the character class component to work with setting a unit to move.

0.83 HR.
reviewed the navigation doc on xenko and then made a few API changes still reviewing and researching this

2.08 HR.
got the mouse to cycle all mouse click to move uints

1.67 HR.
Research on X,Y,Z,W functionality for finding a rotation without gimble lock.

1.00 HR.
Research on Physics

1.00 HR.
Researching Matrix and Transformation

2.87 HR.
Working with blender and xenko to make a few testing sandbox items to test with to get the orientation set correctly.

0.75 HR.
Worked out some scaling issue and thoughs for the asset with jonathan.

2.45 HR.
working in blender and Xenko I have figured out that the +x cord in blender when exporting is the forward -z cord in blender.  There for all models should be facing front (-y) and back (+y) on the Y axis and left (-x) to right (+x) on the x axis.

Blender XYZ cord system with -Y as forward facing
Blender XYZ
When exporting from Blender use the following setting for Forward& Up direction

Blender Forward and Up direction

Xenko XYZ cord system with -z as forward facing
Xenko XYZ

1.60 HR.
Finally figured out what was causing the issue with not being able to rotate an object in the direction it was moving.

1.50 HR.
worked on figuring out why the navigation box cause the program to error if its 2048 * 2

1.00 HR.
Created a new plane model and found out how to export from geometry mass center.  

0.58 HR.
Researching and code tweaking for testing

0.50 HR.
Researching vectors

1.00 HR.
Got the model to move to a location after selectoin evertime

2.62 HR.
working on code and debugging to find out why it keeps repeating the path that was click the time before.

It just adds too the path then repeats the entire thing.

1.00 HR.
worked on figuring out how to get the model to stop where it needs to and stop arc its path.

0.27 HR.
Researching and submit a forum issue for Vector3 stuff

1.00 HR.
Research on forum post

1.00 HR.
Research of vectors

4.00 HR.
Coding and testing

1.87 HR.
Coding and Testing the update for navigation in xenko 

2.45 HR.
working out the unit clicking as a list of units and not just  the unit on the screen.

0.55 HR.
Added sound instance to the move method


Put this on hold to create the Debug control for testing aganda.