Sunday 23 May 2010

Low poly infantry en mass

We finally sourced a a reasonably good infantry soldier, low poly model, rigged, animated and exported. We can fill the screen with dozens of these guys, falling, shooting prone, grenade tossing. We'll give them a couple of weapons they can swap between and a range of helmets swapped in by setting an entity key.



To initially test animation sequences I populated a drop-down control for the editor dialog with the following LUA, chopped up for readability. But lets you pick which frames to loop by name (or number). This is quite compact for AI troops which need to be lightweight in processing terms, this means non-use of character controllers.



class.anim = {
{"Idle",0,49},
{"Stand and Fire",50,89},
{"Running",90,111},
{"Walking",112,147},
{"Grenade Throw",148,187},
{"Take Cover",188,213},
{"Stand to Squat",214,241},
{"Fire from Squat",242,291},
{"Squat to Stand",292,313},
{"Go Prone",314,359},
{"Fire from Prone",360,379},
{"Stand Up",380,425},
{"Death Forwards",426,532},
{"Death Backwards",533,568},
{"Jump",569,614}
}


function class:InitDialog(grid)
local choices = ""
local total = table.getn(class.anim)


for i=1,total do
choices = choices .. class.anim[i][1]
if (i < total) then
choices = choices ..","
end
end


self.super:InitDialog(grid)
group=grid:AddGroup("Animation")
group:AddProperty("sequence",PROPERTY_CHOICE, choices , "Animation")
group:Expand(1)
end



function object:SetKey(key,value)
if key=="sequence" then
object.framestart = class.anim[value+1][2]
object.frameend = class.anim[value+1][3]
end
return self.super:SetKey(key,value)
end








2 comments:

  1. Something amazing, it's REALLY a helicopter simulator?;) I'm impressed.There any chance for a small movie as it looks in motion?:)

    ReplyDelete
  2. Looks great. Not much more you can ask as AI infantry. Really amazing.

    Let me know if you guys need a low-poly 3D and texture artist. I may be able to get you one.

    ReplyDelete