Game Development Community

dev|Pro Game Development Curriculum

Player Freedom: Climbing, Swimming, Sneaking, Melee.

by Bryce · 08/11/2011 (1:01 am) · 15 comments

My blogs since August of last year have been about making/releasing/not releasing/releasing an AI kit. Now that that's finally over with, I can actually blog about something else. Like my own game, my experiences with Torque, and things that benefit the community.

Lolnope, let's advertise.

Buy the Tactical AI Kit because I need gas money. Also, it's cool.


Releasing a product has been quite the adventure. It's nice getting the occasional "payment received" email from PayPal, making fellow Torque devvies happy, and being able to put "I sell an artificial intelligence algorithm to companies around the world" on job applications. After releasing the kit for all current versions of TGE, TGEA, and T3D, I realized that I ran out of things to program. It was at that moment that I also realized I was building a game at one point in time.

Sure enough, I found evidence of said "game" in a blog I posted a little over a year ago. Turns out I've been building some sort of stealth/strategy/action game that my AI project made me forget about building.

Well, not exactly. I had the basic shooter mechanics done, and built a new level every few months or so. It was pretty much just a playpen for the AI. I'd create game-like missions with every conceivable combat scenario, so I could be sure that the AI could handle everything. Small indoor maps, large outdoor maps, hallways, stairways, ramps, islands, everything. Each new scenario would reveal something that needed to be fine-tuned or added to the AI, and that was fine with me. Now that I can say the AI is "done" (I'll be getting a round of updates out fairly soon), I've got more time to dust off that game and put some time into it.

I've always puzzled over what exactly the game was going to be. I know it's dangerous to build a game around levels, so one day I sat down and jotted down everything I expect out of the end result, if I ever get there.

I decided on a few things, the first of which being that there will be no linear maps. There are so many games out there that I play once and then never touch again. Not usually because they're bad, but because everything is predictable once you finish. Everything's carved out, assuming the player needs their hand held the entire time. A common situation that is getting real old: "Ramirez, locate [objective]. You only get a convenient little marker that tells you exactly where it is, which is challenging I think. I also saw a bad guy run into the room on the right, he's going to try to surprise you. Only now it's not a surprise anymore now that I told you, and he's going to be in that very spot every time you play this level. Hope it's still fun anyway." For a strategic shooter, the player should have many, many options. Large sandbox missions should have more than one objective that can be hit in any order, with many different paths leading to them.

Lucky for me, I'm using a [spam] powerful dynamic AI system[/spam] that makes this easier on me. I can drop them into my mission and forget about them, which is real nice. I don't have to add 60 guards in one area (something I've noticed lately is that the more enemy guards a game has, the more repetitive and boring the game gets). I can add a realistically sized group of patrols and have them randomly travel from place to place in the mission. This means that the player won't find the same patrol in the same spot the next time they play. Being the developer of my own game is a big incentive to design like that: I want to have as much fun playing it as anyone else.

Another rule I wrote down is that the player should be able to take any path that they think they could take. I'm the kind of gamer that sees a pipe leading up the side of a building and thinks "I could climb up that and have a good vantage point from the roof." I wonder why I can't just swim across the river and avoid an (inevitably scripted) firefight on the bridge. Usually, when a game has climbing/swimming mechanics like that, it's part of that linear, carved path we're all familiar with. The way I look at things, you shouldn't have to crawl through the man-sized air ducts to get from Point A to Point B. It's just an alternate route that a creative player might find. They might take the stairs (the well-traveled path with all the patrols) the first time, but then they may discover that they can slide down an elevator shaft the next time they play.

One last thing: you don't need to kill everyone. In my blog from last August, I described a point system that awarded players for interesting kills. Getting a headshot would give more points, long distance shots would give even more, and many other bonuses for a lot of different scenarios. I've decided to completely revoke this. This encourages the player to kill everyone. Even just one AI guard is a serious threat when the player has the same amount of health that he has. It's a little easier to sneak by a non-alert guard than one who's actually looking for you with all of his friends. A stealth game shouldn't encourage the player to Rambo all the guards and increase the odds of alerting everyone else. Points are given for completing objectives, with even more awarded for completing secondary objectives.

I'm now designing a very large map that takes place at a lock and dam. Objectives haven't been officially built in just yet, but they'll probably consist of things like Plant a charge at Position A, Gather intel from Position B, Take photos of high-ranking officers, Gather evidence of arms dealings, et cetera and so forth. A lot of that is programmed in, but nothing will be implemented into the level until I'm positive it's done (it never usually is).

The Mission


Disclaimer: I'm using TGE. Get at me.

img827.imageshack.us/img827/5148/15466091.jpg
This map has a lot to it. There's a small town, a bridge, a dam, a lock system (lets boats past the dam), a power station, two main roads, a powerhouse, spillways, and a big 'ole river.

A level like this is perfect for co-op multiplayer. One or more players could be the main operatives, while others could snipe from any of the many high-up locations. The bridge has a very good view of the entire map, allowing the main operatives to have sniper support from their buddies almost anywhere they go.

I mentioned that everything should be easily traversable, and there should be many paths throughout the mission. Here's what I've done about that.

Getting Around


The first thing I did was implement a good way to let the player swim. By working hand-in-hand with the player stances, I've allowed the player to wade around on the surface and smoothly swim underwater. When in the standing pose, the character will float to the surface and bob up and down with the waves. Once you decide to lower your stance, this puts you in "underwater mode." You swim by moving in the direction you're looking. After a little while of being underwater, the screen will pulse black, and you will be slowly damaged as you run out of air. The only way to stop this is to go back into the standing pose to surface and grab another breath (which is conveniently indicated by a sound effect of a deep breath). You can also substitute night vision goggles for scuba gear. By pressing N, which would activate night vision if you equipped it, your scuba mask comes over your face, and you can now stay underwater to your heart's desire.

img814.imageshack.us/img814/3493/17555964.jpg
The main challenges here were cooperating with the CG water resource, lowering the volume of the game world when underwater, playing an ambient underwater sound, and the swimming physics in general. I modified the shape/foliage replicator classes to allow me to have underwater-only clutter down there, including rocks, seaweed, and fish. A cool thing I figured out is that I can tell the foliage replicator to change the "lighting" of the foliage from dark/light quickly and rapidly, giving the illusion of the light being shone through the waves.

img191.imageshack.us/img191/8161/47374251.jpg

img534.imageshack.us/img534/4353/78726750.jpg
Introducing water that isn't just a fancy invisible wall has been very beneficial for the game. You get a new way to sneak up on the guards, a great new place to hide their bodies (it's indescribably satisfying to dump them over the railings), and a new way to travel. I also found out that through the magic of physical zones, I can realistically and brutally smash a player to the seabed and hold them there if they decide to swim over the edge of the dam. This means that this game now serves as a way to teach children about water safety, as long as you ignore that you can dive off the bridge to dodge gunfire.

To further assist in sneaking about the map and moving quickly when necessary, I've added leaning and sprinting. Leaning to the left and right is done with the Q and E keys, respectively. To balance out the luxury of not being able to have your head seen when leaning, the player is not able to fire his weapon during a lean. I'll probably work with this some more, but I think it works well as a stealth game mechanic.

img199.imageshack.us/img199/9082/24069753.jpg
Sprinting is the usual hold-Shift-and-run deal we're all used to. My additions to the sprint functionality are the ability to mantle over low objects while doing so (many thanks to Daniel Buckmaster for this great resource!), and the ability to slide into cover by crouching during a sprint.

img717.imageshack.us/img717/7480/56052937.jpg
I modified the Player class to allow me to switch into vertical move mode. This lets me bring in climbable objects, like ladders and pipes, by putting a climb trigger around it. When the player decides to climb a vertical object, gravity no longer pulls on him, pressing forward moves you up the object, pressing backward moves you down the object, and jumping does exactly what it should. While stopped on a climbable object, you can use your pistol to protect yourself, but not a primary weapon.
For ladders, climbing is automatic. Once you collide with it, you can climb it or descend it while being able to look around.

img31.imageshack.us/img31/4316/78943466.jpg

img600.imageshack.us/img600/4497/69897999.jpg

This pipe, however, is different:

img687.imageshack.us/img687/8563/29709388.jpg
There are three places that you could climb on and off. There's the first deck (can't see it in the picture), the second floor railing, and there's the window at the top of the building. A trigger at each entry point informs the player that they can scale this pipe.

img838.imageshack.us/img838/4050/76216627.jpg

img21.imageshack.us/img21/7818/72033615.jpg
Creative entries and exits allow for some good, stealthy fun.

img24.imageshack.us/img24/7213/53986998.jpg
Along with a great way to interact with the environment, I've included some ways to interact with enemy guards. Since they can find dead bodies (which sends them running about to find the killer, which is bad news for the player), the player is going to want to hide them if they come across someone who absolutely had to die. By standing over the body and pressing B (a "Press B to pick up body" prompt comes up), the player hoists the body over his back and can slowly haul him to someplace out of the way.

img807.imageshack.us/img807/286/82937142.jpg
...like into the river.

img402.imageshack.us/img402/3006/40569476.jpg
Try and sleep now...

I've also got a new melee system. By getting up close to an enemy and pressing V, you essentially punch him. This damages and momentarily stuns him. While he's stunned, a "Press B to grab enemy" notice pops up. By doing so, you put him into a choke hold, and can slowly move him somewhere where you two can be alone. The new melee system isn't actually that new. It was added by me back in February and can be found in my most recent demo if you want to play with it, but I thought I'd explain it here in detail.

img197.imageshack.us/img197/9233/53528818.jpg
img683.imageshack.us/img683/5584/75178544.jpg
His friends will be reluctant to fire on you, so you now have a handy human shield if things get rough. However, anybody who happens to get up behind you will be glad to promptly end the standoff.

An enemy must be either stunned or non-alert to be able to be grabbed. You also can stun him with a flash grenade, or by shooting him in a non-lethal location. If you just want to kill him without grabbing him, you can repeatedly press V to beat him senseless, or hold V for half a second for an instant knockout.

When you're holding an enemy, you can follow the on-screen instructions and press V to break his neck. If you've faced him into a wall, pressing V will bash his head into it. If another enemy is close enough in front of your hostage, pressing V will knock out your hostage, push him into the other guy, stunning him momentarily. This has created some interesting multi-opponent fights for me; punch one guy, grab him, throw him into his friend, knock out that friend, double tap the third guy, and then get picked off by an unseen enemy cowering 30m away...

img833.imageshack.us/img833/7038/98994305.jpg
In the future, I may expand the grab-enemy feature to incorporate interrogations. I'll save the game from my terrible voice acting and instead simplify it to marking intel on the map: enemy locations, arms stockpiles, door codes, and handy stuff like that.

Here's a little somethin'. Shows all these features in action. Forgive me for the horrendous framerate, that's the main reason I'm not able to use Torque 3D.



Thanks for reading!

#1
08/11/2011 (1:52 am)
Looks great, glad to see you working on your "Stealth" project again!
#2
08/11/2011 (4:18 am)
Wow this all looks really great.

Very nice and so many great features.

I'm truly impressed, do you plan on changing to T3D? Or do you want to complete this before moving on to T3D?
#3
08/11/2011 (4:47 am)
Hurray for TGE love!

Excellent work pieces all of those different mechanics together! Resources at some point?
#4
08/11/2011 (6:28 am)
Epic blog. It's awesome to see what you can do now you're making a game- and knowing the AI backend it's got, it's sure to be impressive! I really like some of these ideas - particularly leaning without shooting, and swimming with stances. I am actually excited to play this thing.

Another +1 for TGE here ;).
#5
08/11/2011 (6:46 am)
Bring on the sweetness! Very cool!
#6
08/11/2011 (8:25 am)
Quote:
Ramirez, locate [objective]

Caution: contains bad words - poo!
Ramirez, locate [objective]
#7
08/11/2011 (9:10 am)
Hmmm, not that there is something wrong with TGE, but why do you not use T3D? if you Don't have it then I vote GG give you a copy!

Keep the Good Work coming!


PS. if they need a reason how about "Best Dressed Avatar"? or even "Bushiest Facial-hair?" :O)
#8
08/11/2011 (12:49 pm)
Edit: Added a new video!

@CSMP: As am I, it's nice that my favorite game can be my own.

@Edward: I'd love to change to Torque 3D, but the biggest issue is that my computer is barely powerful enough to even smoothly run 1.5.2. I might get myself a change in hardware pretty soon. I'm also afraid of porting everything over, I've made hundreds of little changes to the engine and getting everything transferred is going to be a nightmare. I think it's worth a shot though!

@Maxwell: Probably in a bit. I've been getting a lot of demand for the swim code, that may come first.

@Daniel: TGE all the way. Check your email!

@Richard: I hope to keep it up, thank you!

@Steve: www.youtube.com/watch?v=tLECkV3hnYc RAMIREZ!

@Bobby: Why thank ya. That facial hair was actually more sharpie than anyone could survive.
#9
08/11/2011 (4:13 pm)
Yes I'm sure all the work you've done would be a pain to do. The main issue would be the rendering things. Everything else, changes to player class etc should be fairly easy as long as you can identify where your changes are :-P.

May I suggest that a genre pack could also be made out of what your doing here too? E.g. make game plus genre kit ;-).
#10
08/12/2011 (1:18 pm)
Fantastic blog Bryce. Reminds me of a lot of games that I have played growing up. Hopefully you are able to make the port to T3D, would love to see it in there.

Also, please talk with David, I would love to see this get up in our store.
#11
08/15/2011 (12:27 pm)
That did it, now you truly are one of coolest persons I know. I was watching the vid, basic Bryce stuff, great stuff. Then - out of nowhere - HE STARTS PLAYING AMON TOBIN ON THE BACKGROUND! (He's like the best artist ever, atleast in my books.)

We should start raising a fund for Bryce to help him get a computer that can run T3D. :) (For starters, everybody get the TAIK, worth the money.)

Keep being awesome and keep us updated on your project!
#12
08/15/2011 (7:16 pm)
@Tuomas: No fundraising, I'll just get a job ;) And the Amon Tobin stuff wasn't just background music in the video, I use triggers to change music depending on the AI alertness and a few other factors, and Displaced happened to come up once the guards figured out where I was. He's got some pretty good atmospheric stuff.
#13
10/19/2011 (7:13 pm)
@bryce..
I has buy 1.Tactical AI Kit for Torque3D 1.1 Final..
but I can't find download in my Account at http://www.hngamers.com...

Can u help me?
#14
10/19/2011 (7:20 pm)
Yes I can, send me an email and I'll get you the download link.
#15
10/19/2011 (7:21 pm)
@bryce see...
2011-Oct-19 14:47:00 GMT+08:00
Transaction ID: 0RW94577M30876244

Hello zhenguo zhu,

You sent a payment of $74.95 USD to Bryce C (tgebryce@yahoo.com)

It may take a few moments for this transaction to appear in your account.

#16
03/17/2012 (8:18 pm)
Looks awesome can't wait to play it.