Wednesday 4 April 2012

Mobiles, mobs and states

While waiting on fixes for the flight-model and control inputs, putting some game into the game we talked about ranges and how performance measuring was going to work. In addition we wanted to add a little variety which required working mob AI.

So nothing fancy but I managed to rustle up a simple finite state machine FSM to get some tanks and cars running around. Our design uses a group formation system (a group is a number of individual units that share common logic, e.g a tank platoon) and if you've ever used Missioneer you'll be familiar with the concept. 

Currently tanks are driving around a small test tool I'm using to test the module, switching formations, revving engines, exhaust smoke. Performance is king so updates are interlaced, no vehicle physics are required so animation suffices.



Each group member has a goal pivot, when the formation changes the individual vehicles seek their pilot according to their driving behaviour. All the pivots are parented to a master pivot controlled by the group. This way you just need to update the group position (e.g movement orders to x/y) and the rest takes care of itself.

We can look into expanding the states later when we want them to do more complicated things, and do that on a per unit basis. Tank gunners will want to turret to target when attacking, manpads will simply turn to face. Same state but slightly different logic per unit. And this can be done in LUA level by setting the models "fsm_mode" key. That makes less work for me and gives Dave the artist some nice toys to play with. At the end of the day I at least have a tile based tank engine to play with. I'll throw up a video.

For the gunnery range we don't need anything demanding; some AI road following traffic, people in groups and the odd vehicle following a set of waypoints. Nothing spectacular or difficult there. That hardest part is turning the 3D geometry of the road network into a navigation grid. Then your mob groups need to know if they are supposed to be following the road or their own formation (switching as they move from one to the other).


Roads

The one problem I have in getting AI traffic running around is putting together a nav-grid I can work with. Our roads are large models (2 or 3 assorted) that are built in 3D Max using a height deformation modifier (the same height-map used to build terrain layers). And it mostly fits. I think we need to flatten it out so only the surface triangles can be read and turned into usable data.

Speaking of art, "Mossie" has been given some love.




Further reading:
    FSM gate scandal - Why they are old hat

16 comments:

  1. Whenever I see the picture of the mosquito I can't help but remember those monkeys with the funny noses.

    ReplyDelete
  2. Colours are good. Maybe just those FFAR rockets could remain white or grey and the container in some khaki green? Shaping up really nice. :-)
    BTW,...Im sure You use some Tablet and what soft is this? Thank You.

    ReplyDelete
  3. @AD: hehehe I agree... Just luckily they have no guns or those teeth! ;)

    @Pavel: Colours are far from definitive.
    As per SOP I first complete all the flat colouring, thus also marking zones and area layers(the head colour is a layer, the body is another one, so is upper arms and lower arms, and so on...)

    Therefore now colours look a bit flat and boring, but they also are taken from real apache reference.

    Also, that thing I can't really talk about yet is involved in my choice of colours, so...

    Thanks anyway for compliments, suggestions and the general idea of having a fan! :P
    Please keep asking, inquiring and commenting, it's really well accepted.

    I do use an old top-of-the-line-but-still-at-least-12-years-old Wacom tablet (an Intuous 2 or something) and a regularly owned Photoshop Elements.

    ReplyDelete
  4. He's looking better every week. Blue munitions are training rounds BTW.

    ReplyDelete
  5. Paolo > OK I understand.:-) The second picture with coloured FFARs and Hellfire look great. I agree, that the blue looks good in this fully coloured version. About that hardware, I have Wacom too, but only A5 size, dont remember the name of the model. Dont know about PS Elements, but I will Google it. Thanks for info and looking forward to next fine-tuning of this Folding Fin Aerial Mossie.:-)
    Do You have some sort of Showroom of Your works somewhere on the web? I would like to see some other drawings You made, if possible.

    Flex > Thank You. I didnt know that. :-o So....my apologies to Paolo. :-) BTW, I like when You put some other interesting knews and infos about helicopters in this blog. Keeping it live. Thanks.

    ReplyDelete
  6. I meant "...interesting news...". DAMN IT! :-)

    ReplyDelete
  7. @Pavel: No need to worry! No bother was meant so non taken ;) Always ready to discuss (specially if in this very constructive manner) things I do.

    My wacom is A4, had to be otherwise I get crazy. My first employer had me to use a cheap-a$$ed little A5 thingy and drove me mad.
    I do not mean to disrispect A5 tablet, don't get me wrong, but I'm +6 feet tall and hands are sized accordingly, and coming from a background of years of pencil-on-paper art, having to suddently resize my mind-set was too much.

    Had to use my hard earned cash to buy me some sized up tablet. The rest is history, or even better... here.
    Simpledisplaycase.blogspot.com

    Not much, not so interesting, but alas is more stuff from me.
    It actually should be update with some other stuff...

    Oh I'm also on DeviantArt by the name of Komemiute

    :)

    Cheers!

    ReplyDelete
    Replies
    1. Great things You got there! Very nice. I understand that A5 was very small for You. Im just an amateur and sometimes I do something for my customers or just trying things.

      OK. Enough about us or Flex will ban us for not commenting on Apache sim topics. :-D

      Delete
  8. Chatter away, I like water cooler gossip, something you miss when you don't work in 'day prison' (aka an office).

    ReplyDelete
  9. Thanks Flex! And sorry to use this board for the littlest self promotion ;)

    @Pavel: Thanks! Why don't you make a blog yourself? Curious to see what you can do! :)

    ReplyDelete
    Replies
    1. Well,...there is not much to show. A lot of unfinished things. I would have to scan the rest. :-) I dont have any drawing technique, dont know anything about it,....just sketching things and sometimes it works. :-)

      Delete
  10. Hi Flex. Sorry but, what is the current state of the development? I just dont remember, whats going on. :-) Thank You.

    ReplyDelete
  11. Sure would be great, but youre asking for to much I think. It´s still a 2 and a half men show (*grin) and only putting the basic stuff together takes sooo much time.
    Shouldn`t we allready flying on that target range? ;-)

    Youre not working fulltime on this project currently, right?
    What about that tank play video?

    ReplyDelete
  12. Is this simulation going to include single-bird co-op on release?

    ReplyDelete
  13. While waiting for the next update maybe the following video link is interesting for some of you. A group of six Apaches cruising along US pacific coast and in front of the Hollywood sign:

    http://www.youtube.com/watch?v=IwxD17fWYE8

    I hope its not a re-post of something that was already shared. ;)

    Cheers!

    ReplyDelete
    Replies
    1. BTW thats what a flyable Chinook might be good for:
      http://www.military.com/video/aircraft/helicopters/chinook-recovers-downed-ah-64d/1558891906001/

      Delete