Unit Tilting with Terrain

Project: Armament
Role: Game Programmer
Completed: 76.33 Cpl Heman Raj Game Programmer
Start Date: 3/31/2018 08:56
End Date: 4/26/2018 17:05
We need these items for our Units.
  • Units don't rotate with the terrain (Up, Down, Left, Right) we need them to do this for a more natural feel.
  • We also need them to stop when ever they hit another object rather then try to run them over
  • Asset should use animation when moving
  • Asset should display a movement effect like dust flying up behind them

Please use the following asset for this agenda.

Complete Task
5.00 HR.
I'm having some issues with this assignment initially. In order to get down to work on the problem of units matching the rotation of terrain, i need to get some actual terrain into the game. I've spent pretty much all my time working on this part of the task so far. I'm having two separate issues. One is that the model in the build I have downloaded is crashing the game. I drag just the model into a working scene and it no longer runs the game as long as the model remains in the scene. I'm having an FBX importer error in the stack trace. The second issue i'm having is with colliders. I've have not been able to find any form of mesh collider type. A convex hull collider is only good with simple geometric shapes and is overly simplistic for the modeled terrain. I am currently working under the assumption that using a heightmap collider with a matching piece of heightmap terrain would solve this particular issue. Since i cannot get the game to run with that model in the scene anyway I'm exploring other options to test this theory. Obviously, i'm new to the project and probably missing some piece of pertinant information. I've been told that the terrain was placed in-game with a working collider at some point so I'm assuming this to be the case. 

5.00 HR.
I have created a model in Blender to use as a control, exported to and FBX, imported into my scene and am having the same issue with it crashing the game when I run it. I'm going over the stack trace to try to find the problem. James do you have any experience with this you can pass along to save me some time, I feel like I'm missing something important. 

4.00 HR.
I scoured the Xenko forums looking for information on the collider issue and its a common problem due the the physics system being based off the Bullet Physics library and the Xenko Developers haven't implemented an easy to use system for mesh colliders. Currently, in order to do this you have to supply the mesh data to the convex hull constructor at runtime and set it to the static collider's collider shape. 

8.00 HR.
I've finished parsing the files, and have a script that loads an OBJ and parses it into a Vertex array, UV array, Normal array, and an array for vertex indices, normal indices, and UV indices. I've created a collider in code without any error but am having trouble seeing it with the debug collider visibility. Still a WIP but I have made progress. Calling it a day, for now, I need a break from this particular issue. 

3.00 HR.
The unit can now navigate the terrain and tilts as required and collisions are natural as they are being simulated by Unity's Physics engine. 

1.00 HR.
I have the agenda requirements working, dealing with MCU issues at the moment. 


I can accept this task.

How is this coming along?

Dren is everything ok I've not heard anything from you in awhile?

Dren I've not heard from you so we've reset this agenda to be completed.

Hi James, sorry, I was busy lately again, finally I have some free time now, I'll have a look into this tonight.

Ok I will get it assign back over too you.  However I will need you to request the task again as I removed the last one already.

Hi James, can you guide me, couldn't find the request button.

How is this coming along?

Wallace is it possible to finish this task without the terrain conversation part?  I think we can use what we have at this time even thought it is not 100% right as far as the unit sitting on the ground we can at least get the orientation correct, and a raycast for when it hits another object?  The last two items on this agenda have been removed an placed on another agenda for now.

Hi James,

Sorry again, I'm not getting any notifications on my email, can we enable the reminders again.

Yes sorry I did some coding changes to not spam and created a bug but it should be fixed now please let me know if you don't get a notice again.

I'll look into finishing it without the finished terrain. I'm sorry I've been out of contact for a moment, been dealing with some family issues. I will get back on this today.  

@Hemang Where is this agenda in the MCU application?

538.05 SSgt Anthony Michelizzi

I need to know which parts of the Unity Package are meant for the agenda and which parts are not necessary. There is alot extra packed into it.

There is also a compiler error which is easy enough to get around, but it brings up the issue with what version of Unity3D you may be using. We are using 2017.4.0f1-- Please grab the latest.

Will fix. The highest official version I see is 2017.3.1
Does that work?

538.05 SSgt Anthony Michelizzi

That should work, from the main page I think they give you the latest.

I updated the MCU. I purged my files using both the MCU and manually by deleting the directory, yet the MCU crashes whenever I try to "get latest." Before the crash, I get this:

"Error Detected Previously:

The path C:\Users\Public\Documents\Unity Projects\Game Armament\Hemang_Rajvanshy is already mapped in workspace HEMANGRAJVANSHY.


at Microsoft.TeamFoundation.VersionControl.Client.LocalWorkspaceCache.CheckForMappingConflicts(WorkspaceInfo toCheck, WorkspaceInfo toIgnore)
at Microsoft.TeamFoundation.VersionControl.Client.Client.CreateWorkspace(CreateWorkspaceParameters cwp)
at Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer.CreateWorkspace(CreateWorkspaceParameters createWorkspaceParameters)
at Utility.Member.Collaboration.Logic.TeamFoundationServerLogic..ctor(Boolean isSkipInit) in C:\Users\Administrator\Documents\Visual Studio 2017\Projects\Utility Member Collaboration\Utility Member Collaboration\Logic\TeamFoundationServerLogic.cs:line 162

C:\Users\Public\Documents\Unity Projects\Game Armament\Hemang_Rajvanshy"

@Hemang Please go to MCU > File > Account > Source Control > Reset Button

Then try it again.

The reset seems to have done the trick. Thanks. 

Excellent is this agenda completed as well?

Yeah, this is completed as well. I didn't check-in this yet either. I will do asap, had to go out of town for a couple of days on an emergency. I will get them both on review in under 24 hours. 

changes checked in.