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

Friday, 23 March 2012

Mossie Mascot update...

Meanwhile in Comknat-Helo...colouring update for Mossie...



In other news

Caught this video a few days ago but made it to the BBC today courtesy of Military.com

A demonstration of the dangers of thin mountain air in Afghanistan. Someone should check oxygen levels and how it can effect judgement at those altitudes. Performing a "return-to-target" turn in low density air.

Tuesday, 13 March 2012

More vintage helicopter material and custom dynamics

Struggling to find some progress to demo, the past week has been picking up threads and licking Combat-Helo back into shape with a HTR flight model update and repairs from my aggressive (frantic?) debugging sessions from a while back (mostly sorted now). Almost done with the HTR update, some small things came out while doing it which I might as well share.

During a recent visit into the attic to dig out research material I came upon some of the more interesting clippings from World Air Power and assorted journals. Including one glossy sales leaflet from Boeing which I've scanned in and posted below (showing rear page). Bypassing the somewhat aggressive tone, if you examine the "Baseline Performance Specification" table it does illustrate the effect of temperature on performance. It's worth noting that published data like this varied greatly especially after upgrades to engines and rotor system. This leaflet from an air-show is a little old.


One of the cool aspects Helicopter Total Realism (HTR) for FSX is it enables pilots to tweak and test how their helicopter flies in a simple manner. For example

[Helicopter] 
helicopterType= 1
simType = 0
length = 50.74
velocityNeverExceed = 172
emptyWeight = 10670
simEmptyWeight = 10670
maxGrossWeight = 14415
meanAerodynamicChord= 6
emptyWeightCOG = 0.48
...
...

The dynamics of each helicopter are edited easily enough with HTR by changing values in the .CFG file that lives in each helicopters "dynamics" directory. As this file is likely to updated at our end and therefore updated during any pushed game update it was prudent to add a check for a "aircraft_user.cfg" file so any edits should be saved into this file which should remain untouched. Good news if you want to plug in WHA-64 specs.

It should be possible to hot-swap between the two in game via the chat/command console to make comparisons.


A quick shout out to "Pixel Perfect" who has been working on his own flavour of lip-sync in Leadwerks (Facial animation test) which I think would be a really nice touch for our crewmen and seems pretty simple enough once you have the datafile containing all the phonemes and timing data. It does require some extra bones in the heads (Leadwerks does bone animation not vertex). That hard part I think is sorting out the model conversion but the concept seems to work. And it has to be slightly better than flapping heads. Although I'll have to run the details past Dave since it's his dept. see if we can't shoehorn that into the roadmap somewhere.



And now, from Fort Rucker a sweet introduction film (and rare in that it's been encoded in HD)


United States Army Presents: Sikorsky H-19 Helicopter Flight Training (30mins)




Parting Shot

Thanks for the feedback on last weeks video, the mini-tutorial on using the KBU Keyboard Unit (I keep wanting to type Unity which is another 3D engine I use from time to time). I've since found FOUR functions for it, the altitude bugs low and high, manual range input and .... barometric pressure. Which is right next to the bug settings. See the default pressure of 29.92 which represent inches of mercury inHg at sea level. You shouldn't need to set this at all as boarding the aircraft sets the value to the ambient pressure outside (we use the standard atmospheric model in Combat-Helo).

Also in the video I set the high bug to 3,000 feet. I realised a couple of days later that this setting is for the RADAR altimeter....and at what altitude does the radar alt disappear? (AH64 trivia question there for you Janes junkies) Answer, about half that. So 3,000 didn't make a lot of sense however if you want to enter silly values you can. I decided to leave it unless I find data that says otherwise.

Wednesday, 7 March 2012

Mossie concept art

Just a short post since I'm busy being pulled in a dozen different directions; I got roped into helping someone create a short health and safety film, drafting a project proposal, raising finances and even managed to fix a long standing bug in Combat-Helo. Now the sensors, line of sight and all that guff is now WORKING again,  Hooray. A quick background on that, an engine update needed to fix some occlusion issues slightly changed the Model hierarchy in a subtle way that changed how actual filenames of models were retrieved, long story short, they no longer matched the ones in the vehicle database as they had "lod1" suffixed to everything . But hey it was a quick fix once traced, I digress as usual.

Talented Paolo, creator of many a fine mascot has been working on some fictional nose-art and patches for the squad mascot in Combat-Helo. We knew we wanted it to feature a mosquito, the mosquito is the nickname allegedly given to the AH-64D by Taliban forces. Incidentally it was also the aircraft my father was attached to during World War II so I felt it had a double meaning.

The character will be visible on squad patches and eventually be available as nose-art.

"Mossie" copyright 2012 Paolo Pomes

Below is an earlier draft of "Mossie" to help decide on nose style, the nose later became the Apache's signature Bushmaster cannon.


Please post your thoughts and comments on "mossie", suggestions for what he can hold in his left hand are invited.


*edit*


Finished adding additional features of the KBU, namely auto pop-up and closure of the unit when you click on an MPD function that requires entry; setting hi and lo bug. And manual range entry. Now comes complete with blinky cursor and key highlight when you move the mouse over the keys. All command entries are pushed back into the TAvionics message handler, there's an optional message history buffer (currently inactive).

Friday, 24 February 2012

US Army presents "Mast Bumping"

I know it's a little late for Valentines Day. Excessive flapping, bumping and separation is discussed in this priceless US Army video from 1980. If only they had "RotorCam (tm)". The Apache has a fixed rotor, mast bumping isn't an issue but it's all part of helicopter theory.




I've been forced to continue hunting for other employment to deal with a mounting debt crisis. As a result  work was put on hold the past two weeks (hence the lack of updates). I apologise for letting my post slide, the project really is taking a toll. I've been ordered to get back to Combat-Helo ASAP (taxes and all that business stuff needed to be done too), I'll be updating as well as I can. There's an engine update to finish rolling into the project (I started on that earlier in the week, this fixes a problem with terrain and I hope the EntityUserData and hierarchy problem).

A Twitter follower suggested I post some Gun Cam footage, I had a look at that and found vegetation range/LOD issues in the MTADS camera need dynamic adjusting (not sure what the most efficient method will be yet).

I'll just round this entry off by stating that raising funds in the UK for technical entertainment projects is very difficult if not near impossible. Bank staff/accountants take one look at video of Apache cockpits and give you funny looks like you're some kind of gun nut (that actually happened).

In the meantime, enjoy the technical detail of the above video.

Another Example

Here's a great example of ground resonance, link provided by reader Christian.

Thursday, 19 January 2012

Stuff you thought was going to be simple but wasn't

Swimming was one.

Setting up controllers in XPlane is another.

Yes the things you thought were going to take a few days which turned into a week and a bit (you could almost say 'two weeks'). Josh at Leadwerks gave me a leg-up on how to put an MMO style launcher together and I've almost done wrapping up all the security for the necessary database, key code generation, CVS style updates and all the stuff we need to match individual content to clients. We'll make available downloadable content (DLC) such as new maps and the occasional helicopter (the planned CH-47D), not to mention the odd mission pack.

No, this key won't work, it's a fake
So there was a lot to do to make a simple one shot MMO style launcher. The back-end server stuff had to be built from scratch. The launch .EXE calls home, applies on-demand updates and preps game settings for launch. For simple security sakes I layered server-side scripts for handling the updates, admin and audit. Auditing is handled by triggers, SQL injection is futile since only one procedure is exposed to clients.

Any DBA will tell you Auditing is an important part of any security. If you build any kind of database exposed to the internet and you don't build your own layer on top of any default transaction logging then you're kind of asking for trouble. The database engine used here is not known for keeping detailed logs so it was necessary to build one anyway. Things you might want to think about if you ever need to create systems like these are making log indexes suitable for frequency analysis (this one method Twitter uses to spot spamming), fake open doors and keys and silent alarms. My favourite trick in the past was a fake database that gives the intruder a high and makes them believe they have walked away with the crown jewels while evidence is collected. That sort of none-sense is not required here, I kept this one functional with a tiny footprint.

The Pilot ID we'll be sending out is the key to your content; install once, play as you like. If you share copies around on your network you can launch 'offline' no worries, no need to be connected to the internet until you want to update. It's nice if you want to buy multiple copies for your network and support the effort put into this project but I'm poor too so I know how it is.

Little bit of script consolidation and testing to do before we let this loose in the real world.

Friday, 6 January 2012

Nothing serious but one reader sent in this...

From an Australian gaming mag (and those guys are tough cookies) at the bottom of a review of Take On Helicopters...


Thanks for the mention guys :) the picture is a bit out of date though, but what the hell.