Interacting with cover objects

Started by
3 comments, last by Kest 17 years, 6 months ago
Image Hosted by ImageShack.us Please excuse my terrible stickman art [smile] My custom physics engine is not advanced enough to handle something like this, with the table flopping over, so I want to completely animate it, generically, for all flippable objects. My game engine is already capable of linking static props to character animations to animate their transforms. So actually getting that to work will be easy. I also know exactly how the character interaction side of things will function. The player will press against the prop and press the maneuver command (used to crouch and wall-hug). So that's not a problem either. My problem is implementing the details about knowing when, where, and how this action should be possible. For example, in the image, the 'square table' could be flipped from all four sides. But some objects (such as a long table) will only be flippable from one or two sides. And some other objects may not be flippable at all. The first thing that comes to me is a handle object. I could define boxes in my modeling program and situate them on the top corners of sides that can be flipped. Then I can read those boxes in as invisible handle-state objects. So when the character presses against this object, the handle can be scanned, the handle orientation can be read, and the character will know if it can be flipped from that situation and angle, or not. I was also considering using these handles on ledges. The ledge-type handles would show a ledge that can be hung from or climbed on. So if I do go with the handle design, it means I get the programming aspect for free, because I can use the handles elsewhere. I'm trying to come up with alternative ideas before I start working on it. Are these handles really necessary? Would there be a simple way to do this? If ideas are really a dime a dozen, I have three dollars, so let the flow begin. Thanks for any insights [smile]
Advertisement
I'm not entirely sure how your system is set up, but I think I'd end up integrating your flipping system with the object itself, rather than having lots of handles (just to keep the number of things I had to track down).

First up, what would prevent an object being flipped. Presumbably this would be the stability of the object (centre of gravity position vs base width).
A crude test for this would be to compare the width of object at the place it is being flipped multiplied by the height of the object multiplied by density of the object with the strength of the character.
So, a large square table couldn't be flipped, a small square table could be flipped any side, a long table could be flipped sideways but not length ways, a dense object couldn't be flipped at all, but a dense tall object could be pushed over.

Then all you would have to do would be to figure out what edge the character was standing by. A halfspace test would pick up what edge the character was standing next to, unless he was standing diagonally to the object.

So: A character could attempt to flip any object they were close to. The game could figure out what edge he is wanting to flip, compare strength with the amount needed to flip it from where they are, then execute a generic flipping animation. And it would all be figured out from the properties of the object automatically. No need to specifically specify anything.
The problem is the high number of props in areas that would be worthless for this type of action. A character would want to flip an object over in this manner if the bottom was open, but the top not. If the bottom isn't open, the character can just crouch behind it. In rare cases, flipping it could make it less protective. In other cases, the object just wouldn't be useful for cover anyway. Such as a small night-stand bar-stool-like shaped object.

But I think the addition of a few extra data values added to my static objects would allow turning this flip-action on and off without much effort. So I like your suggestion of avoiding adding extra complexity, just along with the ability to partially control the situation.

I was thinking of adding 4 index values to my static objects to add generic, partially-limited, but flexible, support for this.

- Type of flip animation to use for the left side
- Type of flip animation to use for the right side
- Type of flip animation to use for the front side
- Type of flip animation to use for the back side

There will probably only be about 3-5 of these animation types, related to object heights and sizes. A lack of defining one of the side-indices would represent that side as unflippable. I would want to also add a flag that allows representing round objects (such as round tables) which would be flippable from absolutely any angle.

Maybe I can use a similar technique for wall edges when climbing.

Thanks for your nudges towards a better direction.
Something to keep in mind, unless your tables are made of spaceaged super materials, or your weapons are just simply shit, most things that you could 'flip' over won't provide you with a lick of cover (somewill, most of what you see used in movies won't). They might get you a bit of concealment so the person shooting at you can't get a clear shot, but most household materials aren't at all bulletproof.

Things like a sofa aren't going to stop much in the way of modern weapons, but a 4inch thick hardwood table is going to stop smaller rounds, and reduce power of larger ones.

I'm not sure about what style of game you're making, but if you are including AI, you might want to have all objects (and doorways) include a 'concealment' value or something. This means if an AI agent rushes into a room and doesn't have a direct line of sight on a target, it then has to contend with the possiblity of something waiting for him behind that sofa, or on the other side of that little wall. Include flags for the AI hearing the player or not, and how long it has been since they did, giving the AI an idea of what the player is doing. Being able to trick an AI into thinking you're hiding in the closet by opening and closing the door, then sneaking to hid behind another already open door would just totaly kick ass. :P AI walks in, maybe turns and unloads his whole clip into the door he thinks you are behind, and you jump out and waste him.
Old Username: Talroth
If your signature on a web forum takes up more space than your average post, then you are doing things wrong.
Quote:Original post by Talroth
Something to keep in mind, unless your tables are made of spaceaged super materials, or your weapons are just simply shit, most things that you could 'flip' over won't provide you with a lick of cover (somewill, most of what you see used in movies won't). They might get you a bit of concealment so the person shooting at you can't get a clear shot, but most household materials aren't at all bulletproof.

It's funny you should mention that. My civilization is subterranean. And trees are extinct. Materials will consist of metals, glass, and some made up substances. Not all materials will stop ranged projectiles, but most will slow them down. That means less impact on your armor. Less chance of getting seriously wounded. As you mention, it also cuts off line of sight.

In other words, if you're not ready to blow someone away as soon as they stomp into your view with weapons drawn, and there's nothing better nearby, it will always be worth getting behind whatever is. The player character will flip it over and duck behind it with one button press. It should at least gain you enough time to draw your weapons and start shooting.

Quote:Things like a sofa aren't going to stop much in the way of modern weapons, but a 4inch thick hardwood table is going to stop smaller rounds, and reduce power of larger ones.

Just the loss of sight would be an advantage. The player could crouch-move over to the opposite side of the couch if projectiles are flying at his ducking-entry point, then run over to a wall or safer location. I think anything would be better than running around as an easy target, or standing in plain view while you pull out your weapons, reload, or whatever it is you need to take cover for.

The thing about a sofa is that it doesn't really need flipped to use for cover. In reality, tables are about as useful as this flipping will get. Most other prop objects will be fully ready to use as cover. But considering how often bottomless tables and stands show up in areas, it should still be worth adding.

Quote:I'm not sure about what style of game you're making, but if you are including AI, you might want to have all objects (and doorways) include a 'concealment' value or something. This means if an AI agent rushes into a room and doesn't have a direct line of sight on a target, it then has to contend with the possiblity of something waiting for him behind that sofa, or on the other side of that little wall.

I've had this stuff in mind for a while. From my own limited experience with AI programming, this will probably be a pain. Objects can conceal characters from any angle. The only way I can imagine doing something where the AI literally searches out a character would be to give AI characters internal mini-maps. Sort of a small-cell grid layout where viewed grid cells get filled in, and the goal of the AI is to fill them all in by searching out viewing angles. I suppose this design could be helped along by generating data before the game starts up, like 'good view spot' coordinates. Anyway, I'm not sure how far I'll take this. I'm not sure how complex the AI will become. I may just cheat and try to fake these things. If I shoot too high, I'll end up with half-broken advanced AI, which I don't think is as good as bullet-proof cheap AI.

This topic is closed to new replies.

Advertisement