Monday 30 August 2010

Saitek Instrument Panel test

Had a quick play with Saitek's DirectOutput SDK, results are mixed but not bad. The MFD resolution in Combat-Helo is a native 512x512 and the Saitek Flight Instrument Panel is VGA 320x240, there's a bit of difference.


Sampling the buffer down to a smaller surface and then adding a suitable BMP header to send over to the device. Remarkably easy. I'll have three more please Saitek :)

BUT please can you make an FIP version two with a 512x512 square ratio display? Or at least increase the vertical resolution to 256?


Text is near impossible to read, but the general layout is recognisable. I don't know if we're going to support these devices in game, it's just one more thing to go wrong and support, and the default button locations don't match up so it would need code to move functions over to the left side, there are only 6 six buttons. But it's interesting to play around with.

Sunday 29 August 2010

Summer Sim, ups and downs but great fun

I want to thank Komodo Simulations for inviting me down for Summer Sim 2010, even though it didn't go according to plan we all learned a lot, I certainly did and this was really a chance to meet people and forge connections.

Rich was clearly deep in thought and concerned about hardware performance. I was lost in deep thought and concerned about software. Everyone else didn't seem to mind very much. What happened was, early in the day while I was re-compiling the demo to fix a stupid inverted axis problem, FSX was running a helo demo and a visitor came and stomped on the left pedal, ripping out the weld and smashing the Hall sensor. We had to make do with alternative hardware (thanks to Flightstore for the loaners etc.)

The "Virtual Blade", but nothing virtual about it, very real.
What you would have seen today.

If you came along, thank you very much to coming up and saying hi, I'm really sorry you didn't get a chance to see (much) of the game. Things just conspired against us from the start. But we'll get a new movie done showing some of the things we wanted to show this weekend but didn't. Oh, please email me if you were there as I'd like to get your names for future reference.

Laptop demo, not a flying toy :(

I came away with a Saitek X62; a stupidly knobbly joystick that has more buttons and hats than you thought was possible to put on a joystick. And also a Saitek Instrument Flight Panel which are those little LCD panels with VGA resolution (320x240). This morning I installed the Saitek OpenOutput SDK on my laptop (which continually gave me a memory errors after compiling till I rebooted *grrrr*) and got the 512x512 MFDs in Combat-Helo supersampled down to 240x240 to fit Saitek's panel. It was readable, not great, but certainly readable. The SDK is quite nice, a lot of callback hooks and functions for sending JPGs, BMPs and text to the screen. It's actually a good resolution for the Upfront Display, some nice chap at the show asked about (sorry I forget your name, even though I asked I'm pretty terrible with them). I'll post a pic later when I get a chance.

I'm going to have to get a new stick of RAM for the demo laptop, it was one more thing letting me down. Yesterday it was crashing randomly when trying to run the demo and same again today when compiling. What's more the changes I made to fix one issue caused enough which I didn't notice till later (collective at 230%??), silly typo.

The Komodo team comes equipped with a deadly "nice-guy", a chap so full of charisma he could (with apologise to Douglas Adams) charm all four legs off an Arcturan mega-donkey except perhaps the manager of a local restaurant who insisted it was perfectly normal to wait two hours for your starter. But at least the conversation was good and I learned fascinating things about horses.

Thank you "Cyclic" (aka Rob) for being my point man again, have a good trip back to Saudi. Phil, I know you couldn't make it but the photo you sent of the Blackhawk Down fish pond decoration was a real ROFL. Every pond should have a crashed helo in it. (Rob, can you send it to me?)

Day two and the chair was fixed, sorry I couldn't stick it out the whole day but there was a lot of interest in the chair and it was a really busy Sunday. We'll be looking to have a special Combat-Helo software/hardware package with a replica Apache control system consisting of a cyclic with magnetic force trim and full length collective. Unless it all goes pear shaped of course. How much will it cost? We'll you know but estimates  sounded reasonable and not far off a certain A10 replica stick soon to arrive.

Actually we all had a long chat about the Thrustmsater A10 and while Rob in particular voiced how nice it looked, the fear is that they will drop the ball again like they did with the Cougar. The trust isn't there anymore. A scary thought.

*edit* The X65 force sensors are amazing, apart from the crap plastic HAT2 and POV (also plastic) it's pretty slick. Most of it's metal including one of the HAT, so why skimp on the rest?

Sunday: the Komodo Simuations camo tent "FARP"
(Rich, forground left looking pensive)

(and YES I finally got my bloody PC Pilot subscription, can you spot where?)

Thank you to my hosts, Rich, Mac and the nice lady who needed chocolate. Good luck at Duxford next week (it's also Battle of Britain weekend there so it's going to be mental). Take a spare :)

Friday 27 August 2010

Summer Sim 2010 pre-flight

All the things we want to show but can't. Still making some final hour changes to get a robust demo working that can be operated by Joe Public (I'm told he's coming along). A simple flying demo that will show the technology, Afghan map, lighting and cockpit. It has the mark 1 flight model I keep tweaking. sounds could be better. I wish I had time to do the landing gear joints, it's hard to land without wheels.

Better stop with the bloggin and get back to writing.

Exterior lighting in place complete with programmable strobe sequence and interior cockpit light visible from the exterior. Spotlight will be steerable eventually. The so-called "slime-lights" or formation lights will have to wait. Nav lights are probably too bright, but as they say, on stage everything is bigger. Movie rain is way bigger than real rain so it shows up on camera.



Wednesday 25 August 2010

Atmospheric screen-shots

AD made some atmospheric screen-shots when playing with lighting and environment settings. SimHQ Diary
Starting with the only major airbase in the region. AD is responsible for some Strike Fighter mod aircraft models, one of which is a Tornado GR1 (?). He will apparently need to get permission from *himself* to use it.



This is our early version of Camp Stone complete with a half-court basket. You wouldn't have a pair of M1A1s on the doorstep but they do look interesting.


Poster child..."never alone"


We have been hard at work on getting a simple flying demo ready for a public showing, we've had to make it playable and gave me an excuse to put some more time into the mark 1 flight model which is a much simpler easy to fly model for general consumption. This approximates the mass of the helicopter, rotor thrust from engine power and semi coordinated turns. The landing gear desperately needs some joints to make it easier to land but I don't think I'll have time for that.

Following the road north our of Camp Sone you eventually approach Herat, our version is perhaps more idyllic taxi-free version, and perhaps more green to make efficient use of geometry. Enough to fill enough area to represent a small city.


No orange sunset here. Looks much more natural.


Freecam mode lets you move anywhere you want to take snapshots. Contemplating broadcasting a regular call to prayer from the towers at the appropriate local game time.



Nice choice of sky. You can see what we had to do to the rivers to prevent a lot of clipping and z-buffer fighting. Hence the "Death Star Trench" name we use.

Tuesday 24 August 2010

Exterior night lighting

These are placement tests for the Apache model in the editor, getting a feel for colour, levels, position, range and angle. The left nav light (red) on the Apache model needs to have the fullbright material applied to be visible in dark conditions.  One pilot was telling me that the ground on the left side on the helicopter appears brighter than the right with night vision. Interestingly our night vision shader amplifies lighting levels based on final pixel colour and gives a boost to red values so you should also experience the same effect.



Same again but with the nav strobe blinking, ever so short flash that should be visible 2km away in game terms. It uses a corona and not a real light source for performance reasons. It's highly visible and does it's job. Although it will probably flare-out or clip in NV mode. I experimented adding two point lights in the cockpit area, these lights currently exist in the internal cockpit mode but I'll see about adding them to the external model if it can be easily done. On the whole, performance would be better just baking that light onto the texture but the exterior cockpit is really simple, the canopy doesn't cast shadows and the light range is short.


Final shot is the retractable spot-light, which we were going to model, maybe we did already but can't remember...(check notes). It's supposed to be steerable and there's a toggle switch for it somewhere. I think  using a 3D cone mesh to add a bit of fake 'haze' around it might be an idea.


I shall get these coded up into the game model now. Pretty pleased with the overall layout.

Monday 23 August 2010

Internal views

Added some fixed internal views for 'quick' look downs and drama shots.

Wiper dash...this has a little vibration.


Pilot displays...


Over shoulder...


Pilot engine controls (startup and lighting)...CP/G similar (not pictured)


Co-pilot target panel (TEDAC)...


I think a 'foot-well' cam will come when we get a pilot model in game so we can see the crew looking around. And I think we could use an ADI/Comms panel view. Feel free to suggest a few more.

Sunday 22 August 2010

Herat city, almost

This is months of painstaking trial-and-error, optimisation and experimentation. I said months ago, "We don't have the resources or time to build a whole city, just a close approximation". Well it's an approximation but it's more than what we anticipated was possible. Given that the old girl Longbow 2 had a small village, a dozen or so muddy cubes, this is 2010 and we can afford to push it a little.


Putting the demo together for Summer Sim 2010 next weekend, the updated map includes Herat city which is not a center for our first campaign map, geographically or strategically as it's close to the north-west corner of the map. But it is a regional feature, the city is the gateway to Iran. One of the campaign scenarios involve a armoured invasion by Iranian forces in an attempt to do something about a deteriorating security situation in which NATO led US forces are caught in the middle and ultimately you decide which way that goes. The city will present a real challenge for pilots, not only is it a maze of structures and narrow streets, there are not many open areas to perform an emergency landing should the need arise.





I don't think we want to build another city like this. Hopefully you'll be able to appreciate the amount of work that's gone into the environment. Flying over the rooftops and sat dishes in the pilot seat with a full HOTAS is a dream come true, I certainly never expected anything like this when we started last September. It has the feel of an old familiar sim mixed with the new and we're not finished yet. AD has done an outstanding job in realising the setting. If there's one criticism I can level, there's not enough of it. I'd happily fly for longer than I perhaps normally would in other sims as the detail is better. There's always something interesting over in the next valley, or a nice low level route to challenge your flying skills.

We chose from the outset not to put the player in Helmand which is where the worst of the troubles are. It's a question that's been asked, why not?

It limits what you can do with scenarios and we wanted the Apache to do what it does best, spank heavy armour. Italy is currently the occupying security force in this region which is set to pass on to the US in the near future. Here we get to play out two different kinds of warfare. And what starts as one kind, if you do really badly in one campaign, may step things up and move you into the second. And if that happens you'll be flying over Herat, weapons hot.


*edit* Just tried FPS mode. Well FPS is overstating it, Combat-Helo allows you to roam around and explore but our environments are not tailored for that vantage point.

But trying it out I realised that our vertex shader that aligns the road geometry to terrain doesn't work for the physics. Which means I'll have to bodge a raycast on the player controller to allow you to walk on road surfaces. Well this is how vehicles were going to drive on it anyway. The PHY (physics model) for the road mesh is actually burried deep under the terrain when you reach the city.

And a lot of the basic buildings and compounds in the city have simple PHYs which perhaps need a little work to get them to match the volume of the city block. Once you fix one, it fixes all instances so theres not that many to do.

WAH-64D Replica Controls

Summer Sim 2010 is nearly here. Komodo Simulations, makers of replica helicopter controls for virtual training are sadly not going to have their replica controls ready in time but a recent news update on their web site shows the current collective at the pre-mould stage.

Komodo Simulations WAH-64 collective WIP

Looking good so far. Combat-Helo will be there to show a build of some kind. Although like the controls we're perhaps not going to have all the goodies ready to go into a demo build. We're still working on getting the new flight model ready, going to be a bit hit and miss that one.

Saturday 21 August 2010

Camera views askew

Taking a little time-out from debugging to recharge my batteries, something slightly less frustrating, camera views.

Not helped by my original program flow which had camera commands in-line where needed, and I still have to go through and fix up TrackIR to work with the new class but shouldn't take long. TrackIR is really simple to implement in this kind of software.

Crew positions are parented to a pivot and then offset so it was important to retain any camera/parent relationships, add offsets to source entity location and target entity location (in case the view needs to point-at some object but add some fudge factor, such as trackIR offsets or something).

So I untangled the inline camera code and added a new class with SetPostion() Move() SetParent() SetOffset() etc.. and added GameCamera.Update() which does the final camera positioning. Now changing cameras is as simple as updating the GameCamera class you wish to render the viewpoint from. It will be possible to add camera views from an external source with a bit of extra code.

These screens are not using the current terrain so still a bit washed out and using the old veg (will update my test build in the next few days, it just takes longer to load which doesn't help testing).

Blade tip cam will be added again shortly. And I need a key to toggle the canopy doors (yes they do swing open and closed).





And I remembered to increase the TADS camera range to 6km, I'm not using deferred lighting on the TADS buffer, just shader effects for light amplification and edge detection but need some atmospheric fogging to fade into the distance. Scratching my head on best way to implement that one.

*edit* Hellfire cam on the test range.

PC Pilot, published in the UK but have to buy from US

It's ridiculous, I'm seemingly unable to purchase from the UK, PC Pilot, a UK based flight simulation magazine . The only way I'm able to obtain copies is via ebay sellers in the US.

Local stockists are non-existent and repeated attempts to buy them online results in emails informing me that they are unable process my details. The same details which seem perfectly fine for US ebay vendors.

Two weeks now.

I give up, I'll stick with US postal charges. More reliable.

Friday 20 August 2010

Flight model Mk2 update and roads

At no point before have I felt so much under pressure as I do now. Hence the lack of blog updates. The new physics engine is still being problematic but these are issues relating to -ff-math and tracking down typos, the odd logic error and other errors that occur when programming.

In a flight model, such errors result in numbers quickly blowing up, which they do. So I'm currently tracking down each issue, one at a time until, eventually, it should just all click into place.

I finally configured my Combat-Helo input map for my Saitek X52 and apart from my shocking oversight of an inverse axis option it was a nice experience using the old mk1 flight model. It's frustratingly hard to get up to speed and it still flies in a nose down attitude. I may fix those points and retain it as a 'rookie' flight model.

All this debugging and testing is taking up all my time, the goal is to have it in place for the show on the 28th. It's looking hit-and-miss atm. We're supposed to be working on some FSX stuff as well but that's had to take a back seat due to holidays and other things. Hopefully will be able to spend some time looking at that in two weeks time.

AD did well finding an OK solution to paved roads. They work, efficient but they require a lot of work.

To quote...
Just to elaborate a bit. The key component is a vertex shader that takes the Z value (height) from the terrain and applies that to the Z value of the road vertices. The road itself is built in 3dsmax as a primitive mesh, a meter high and 20 meters wide. It's flat and the vertex shader sets the height at the end of each section of road.

40960M's of road can be bought at the cost of about 2500 polys which is outstanding in comparison to the native road system which costs tens of thousands of polys for short distances, doesn't work most the time, creates massive slow-downs, and flickers like a 1950's TV in a washing machine.

The only real down-side is the amount of work it takes creating the road mesh itself. It took me about an hour to lay down 10KM's, debug the path and smooth-out the ground underneath it. Therefore it probably won't be a suitable method for the dirt roads.
I would add that the native road system is fine for small areas, it's perfect for small FPS style levels but non-instanced geometry will always have a huge performance hit if there's a lot of it.

Using static meshes for the road system makes it easy for collision testing to flag "onRoad=True" and the model can use this value to adjust sound and emitter properties. For example, running across sand will sound different to running across a road surface. More dust will be kicked up. Those things are more complicated to do using texture splatting or a giant texture overlay to represent these kinds of features.

Here are some pics of the roadworks.




Tuesday 17 August 2010

Some more architecture

I think these have been on the SimHQ forums for a couple of days but I've been too busy to post any updates. Here AD has been adding some gardens to the Friday Mosque and adding it to the city.

To overcome scale/zbuffer issues of having a large scene,  AD has buried the the tiled gardens into the terrain, just like the river sections. The  gardens sit on a large slab that is quite deep, this also accommodates uneven terrain. 





No paved road surface currently. While Leadwerks supports roads that are baked into terrain geometry they are not efficient for our large scale map. One of the reasons we're looking to build our own terrain streaming system after Combat-Helo is released. We might be able to squeeze in another texture layer to splat a paved surface in.




A high altitude view of the city shows the west side is still waiting to be populated. This was the area most damaged during a previous regional conflict.

Monday 9 August 2010

AD has been building some of the historical monuments found in and around Herat in his SimHQ diary here.

Below as a work in progress of the magnificent "Masjid-e Jame" or Friday Mosque of Herat.



Photograph courtesy of Wikipedia for reference:
See http://en.wikipedia.org/wiki/Friday_Mosque_of_Herat


In game version, wip.




Some gardens and maybe a few water features :)