Thursday, 21 October 2010

Environment Completed ... Sort Of ---> oh wait ...

Environment Completed ... Sort of - oh wait ... haven't I already used that blog title? And actually it's the same level! But things have slightly changed ... if "slightly" really meant "quite a jolly lot". 2km of open game world, with 838 random AI spawnpoints - count 'em.

Click the pics to view them full size if you're squinting.

Right-ho, so what have we got? One 2km map with full drawdistance. 88 buildings, 34 of which are fully open, furnished and lightmapped for a bit of extra vavavoom - because blank shadowed interiors are boring on the eye. 178 random props such as telephone boxes and pillar (post) boxes - it just wouldn't be England without big red things in the street - regardless of the fact that the red telephone box has been killed off and replaced by things that look like transparent urinals ... which they often become at 2am on a Friday night.

Bus stops, benches, litter bins with amusing messages, petrol (gas) stations with amusing messages, other stuff with amusing messages, old style lamp-posts (which you can still find in places - in fact I know a pub that doesn't have electricity, but is still using Victorian gas lighting! It's as dark as hell and you get stoned off the fumes but it's "quaint" and they do a good pale ale) ... and then there's trees and shrubs, which all gently rustle in the wind thanks to the wind vertex shading. In fact there's 1600+ of them ... thank Sickhead for imposters.

LOD like hell!

And then there's the actual gameplay kinda stuff. I did promise ... possibly just myself ... brain far too frazzled by all of this, for correct retrieval of memories ... to have something resembling the randomized gameplay which I'd conceived.

So to such an affect, I had a good long hard think about how best to do it. Spawning a shedload of AI at the startup seemed out - both in terms of playability and performance. So I decided to split the whole level into areas - 5 of them.

So, there's 5 areas, and the player starts off in one of them - randomly. That area then becomes active, and spawns a random number of enemy Ai which seek to defend that area. They're randomly armed depending on their goal position - so if they've got a long view they'll have a long range weapon (rifles, lmgs), and if they're hiding in a small room away from the windows they'll have a short range weapon (shotguns, smgs). And there's a random chance of them having grenades. Each area has between 150 and 200 random spawn/goal nodes. So there's a fair bit of available randomization.

Never let it be said that I'm not a sucker for a crap joke :P

There's a random number of these Ai spawning, anywhere between 5 and 24, so each play-through an area will be different, sometimes a "bughunt" with lots of jumping around corners quietly hunting the enemy down at close range (which does get quite tense when the prolonged silence suddenly shatters with closeby gunfire), to large scale firefights at multiple ranges from many directions. There's also the trouble of spotting and identifying targets at long ranges, often a case of following the incoming tracer back to it's origin, the enemy all but hidden, crouched behind a window cill or lying under a bush at 200-300 metres, so at long ranges you end up putting a lot of fire down on "areas" rather than targets, a la Full Specturm Wariior or IRL as it's also called. :P

It does give the feel of battle which I've been looking for ... dangerous and confusing without being unfair (ArmA I'm looking at you!). It's coming along and as much as "one bloke, in his bedroom, trying to make computer games" can create the halfway house between the arcade style of Call of Lawyers and the anal (if blatantly unfair) realism of ArmA/original-OFP.

And this style of working gameplay also showed up a few issues with my Ai. Mainly that it took a while for them to go through their attention routines at close range, they'd hear you walking up the steps, but it'd take a while to increment through their thought processes to become panic-range alert, and a fast moving player could confront them before they were as ready as they should have been, and thus get a few seconds drop on them. So this, I fixed, and instead of incrementing the alert, they jump to which ever is neccessary (but not from full unalert status so they can still be surprised - though in this type of "all action - non narrative" gameplay I use a hack so they're always on-guard).

The slogan was going to be "Bringing Oil To Your Shores!" but I thought that joke might be too subtle

Once one area is clear, you can choose another by simply moving into it. And to give you some help, there's a map which shows the areas ... in fact an entire SitRep overlay, where your weapons/ammo and mission status are displayed. The map shows all tehhe roads and major buildings as well as anything else of interest (first aid stations!), but it's a static map, no updating dynamic object positions. You have to use your view of the objects around you to orientate yourself to where you are ... just like real life! And yes, I am a cartographyvert. Google Earth ... oh baby ... you're so hawt ... show me those hillocks ...

Okeedokee, that's what I've done ... now what I still need to do.

Models - still need a church, and one other "special building" that can get reused for a few things, think slightly grand, I still need a train station, a general building with an open interior and internal balcony (like a pub I know in Scarborough).

A couple of other props, a coach/minibus which I'll probably convert from a truck and a police car, which will be a USAFB Security car with a different paint job.

AI - Currently my Ai is static, there's no pathfinding in this level, and the sheer size and openness of the environment is gonna take a bit of extra thinking about ... not least how to get a gazzilion pathnodes in there in the easiest manner possible - though limited early tests went fairly well.

Then it's sorting out a friendly Ai system, and I don't think the classic system of "trigger-directs-to-nodes" is going to work on something of this scale ... or they'd be a whole lot of triggers and nodes ... and there's already plenty of them. So I'm currently thinking of having the allied Ai as a sort of "escort force", dynamically keeping themselves to pathfinding within a short distance of the player, and then rushing off to target threats which reveal themselves. I've also thought long and hard about "lastguy-itus", where the player has swept through an area but just missed the final, lone enemy. If it gets down to just one badguy left, I'm thinking of having the ally Ai just charge his position. There is nothing as annoying as searching for one last asshole hidden behind a closet ...

As for the enemy Ai, I need to stop them spawning where the player can see them when a new area is activated - easy enough to have them spawn away from their goal and then move to it. I also need to setup a counterattack situation where hostile Ai may randomly enmasse charge the player team. I also need them to be more proactive at defending their own positions, thus randomly again, having some short-range based Ai hunt the player down through their house when they hear them enter it, rather than just wait for the player to run into their room.

And that's about it so far. I do have "some" kind of gameplay in a large, 2km open area. And performance is good for it all too, looking at the magical 60+ fps at x1080 with normal settings.

And here's a little vid of said randomized gameplay, looks better in 720 HD @ youtube of course. I've been toying with a "zoom/ADS mask" which features in this vid, but I've since changed it as the original restricted vision way too much. This is unedited and lasts about 8 minutes.

No comments: