Game Development Community

Ai animations looking at my cam

by Michael Merlange · in Torque 3D Beginner · 04/12/2013 (10:47 pm) · 7 replies

Hi,
I got a new set of animations for my ai: stand, walk, run,.... The animator made a good job but...
I use them like the boombot of the rts prototype. So a 2 lines constructor and à datablock defaulting on defaultplayerdata but the shape file.
And I get a weird effect: they(the ai players) always stare at my controller
First impression: humm is there local/global settings somewhere?
Any idea what I should set up?
Thanks and good we to everyone!
Michael


#1
04/13/2013 (8:47 am)
"they(the ai players) always stare at my controller "

what controller?
better u show a pic or video.
#2
04/13/2013 (12:29 pm)
"at my cam"
if that is the case may be your player model was exported with wrong axis rotation.

do a test:
replace ai player's shape model with stock soldier model.
or
select that aiplayer then from inspector change it's datablock to defaultPlayer.

if it looks ok then sure problem is in your model exporting.
#3
04/14/2013 (11:26 am)
Hi,

Thank you very much Ahsan,
Yes, default soldier and "boombot" in the rts prototype work fine.
I put a video on http://youtu.be/7bQ1-7vg3xE
I will show the video to my animator for info. But if you have an hint, please tell me.
Nothing to do with my animator but I noticed instabilities in shadows of my building (appear/disappear) and "amount" of light.

Thanks for your expertise and have a good week end end...
Michaël
PS: for info,
I used the exact same piece of code to insert the boombot and my worker in the scene. Just changed the datablock name.
As for the datablocks, they're minimal:
datablock PlayerData(BoomBotData : DefaultPlayerData)
{
shapeFile = "art/shapes/actors/BoomBot/BoomBot.dts";
boundingBox = "1.1 1.2 2.5";
pickupRadius = "1.2";
};
datablock PlayerData(FSA_Worker : DefaultPlayerData)
{
shapeFile = "art/shapes/actors/FSA_Worker/FSA_Worker.dts";

};

TSShapeConstructor is also minimal (copy/modify of the boombot)
singleton TSShapeConstructor(FSA_WorkerDts)
{
baseShape = "./FSA_Worker.dts";
sequence0 = "./FSA_Worker_root.dsq root";
sequence1 = "./FSA_Worker_idle.dsq idle";
sequence2 = "./FSA_Worker_run.dsq run";
sequence3 = "./FSA_Worker_walk.dsq walk";
sequence3 = "./FSA_Worker_crouch.dsq crouch";
sequence4 = "./FSA_Worker_death.dsq death1";
};

#4
04/14/2013 (7:19 pm)
" http://youtu.be/7bQ1-7vg3xE"
with stock ai code,i never saw aiplayer to adjust his head rotation.
even not when i am using setaimloaction().
did u make any source changes related to aiplayer?
which aiscript you r using?


"Yes, default soldier and "boombot" in the rts prototype work fine."
if those r working fine,then i think problem is in this specific model's animation.


#5
04/15/2013 (10:52 pm)
no script I think
%player = new AiPlayer()
{
datablock = "FSA_Workerdata";
};

%player.setTransform("-26 -26 3");

And I tried to remove my aiplayer.cs. Nothing changes.
I do think it's the model export but...
I donwloaded milkshape and gave a try. No succès.
If you have some experience in model export, please contact me (mmerlange@yahoo.com) so that we find an arrangement.

Thanks anyway for your support Ahsan!
Michaël


#6
04/16/2013 (3:54 am)
OK Ahsan,
You're great. I did as you said and it works perfectly.
"simple mistake.
artist forgot to
disable double siding.here is the solution:
put "materials.cs" file into the same folder with all textures(jpg) files."


thanks again, you saved me a lot of pain!!! Now we have a chance to show something nice
Micha�«l

materials.cs

singleton Material(DefaultMaterial)
{
mapTo = "Worker_Head_512_TX";
diffuseMap[0] = "Worker_Head_512_TX";
doubleSided = "1";
};

singleton Material(DefaultMaterial2)
{
mapTo = "Worker_Body_1024_TX";
diffuseMap[0] = "Worker_Body_1024_TX";
doubleSided = "1";
};

singleton Material(DefaultMaterial3)
{
mapTo = "Worker_Head_256_TX";
diffuseMap[0] = "Worker_Head_256_TX";
doubleSided = "1";
};

singleton Material(DefaultMaterial4)
{
mapTo = "Worker_Body_512_TX";
diffuseMap[0] = "Worker_Body_512_TX";
doubleSided = "1";
};

singleton Material(DefaultMaterial5)ile into the same folder with all textures(jpg) files.

{
mapTo = "Worker_Head_128_TX";
diffuseMap[0] = "Worker_Head_128_TX";
doubleSided = "1";
};

singleton Material(DefaultMaterial6)
{
mapTo = "Worker_Body_256_TX";
diffuseMap[0] = "Worker_Body_256_TX";
doubleSided = "1";
};

singleton Material(DefaultMaterial7)
{
mapTo = "Worker_Head_64_TX";
diffuseMap[0] = "Worker_Head_64_TX";
doubleSided = "1";
};

singleton Material(DefaultMaterial8)
{
mapTo = "Worker_Body_128_TX";
diffuseMap[0] = "Worker_Body_128_TX";
doubleSided = "1";
};

#7
04/16/2013 (7:50 am)
You know - I thought it looked more like the model briefly turned "inside out" rather than like it was actually tracking the camera.... The video was playing rather choppily for me and I couldn't be sure though.