Wednesday 7 August 2013

Wednesday Water Physics

Lots Done Today

My plan for today was to add jumping, enemy capsule entity, speed up the physics terrain preparation, speed up the general engine and if time, add water buoyancy.  The great news is that I have added all of the above.

Figure 1. A few pallets dropped along the shore. Some floated away!

In fact, most of the list was done relatively quickly thanks to a great Bullet SDK, but the water buoyancy was something else. It transpires there is no native support for this, and so I had to write it myself and what fun it was too.

True Buoyancy

This is not the basic 'if it's below the water line bring it up' physics, but the 'float my pallet across the river so I can jump on it' style. For this, I needed to create a small system which detected the key 'flotation points' for an object, then apply various upward impulses to the object when in the water so it would rotate and respond correctly, just like a real object would.

The time consuming part was tweaking the various velocity, dampening and water line curves to make the whole thing seam natural, and also to ensure all my objects bob evenly between above and below the water line (not easy). Still, the hard stuff is done now and I am running out of physics components to prototype now.

Ragdoll Physics

I am sure there will be a big demand for ragdoll falling, even though I don't regard it as an 'essential feature'. We have some really excellent death/fall animations now, and no ragdoll can beat them in my opinion.  I will study the remainder of my schedule for this week and make a decision whether to prototype the ragdoll into the character (which could take days) or wrap up the physics prototype with a full first person player control system including weapon, sounds, firing, health, falling, e.t.c.  This also will be the precursor to creating what will become the main 'game loop' module, which controls pretty much the entire in-game experience and the first of the final 'mega' modules that when connected with other 'mega' modules will become the final product.

I will leave my brain and your comments section open for inspiration whether it makes sense to add ragdoll now, or get more of the main game elements connected and come back to ragdoll when the time presents itself.

AI News

Some brief news from Paul and AI work, in that we have a small 'theoretical' victory on the 'hide behind a corner' behavior of the new AI entity system. This single ability will really test you as a player in a Reloaded game, as now the enemy can sneak about and peek at you from behind walls and door frames, neither of which you can shoot through!  Your sniping and blatant shooting days are over if this feature is as good as I imagine it to be.  More news on this and other AI goodies next week!

Signing Off

Probably coded a little too long today, so waking up Thursday might be a challenge but one can but try.  Remaining tasks, not including ragdoll, would be to add static and dynamic entity tests, static geometry segment geometry and the 'very small object' test to ensure our grenades, mines and small keys don't fall through the floor as they affectionately did with FPSC Classic :)

18 comments:

  1. Great to hear things are going well. To comment on the ragdoll, I agree with you that great animation trumps ragdoll anyday (I find ragdoll overrated anyway). Since it's not an 'essential feature' why bother with it now? The time could be better spent (you did after all mention it would take days to implement) polishing and perfecting the physics elsewhere and doing other odds and ends as mentioned. :)

    Hope this helps.

    ReplyDelete
  2. In my opinion ragdoll can wait until another day, add it to the ever increasing V2 list, :)

    ReplyDelete
  3. Yeah ragdoll is not entirely that important when the models already have some awesome death animations. I really gotta start getting better at my animation skills. Without motion tracking I pretty much just assume how the human body moves lol

    ReplyDelete
  4. I may have agreed with you on the rag dolls right up until you introduced this nice new terrain system. No matter how good the death animations are, if they are designed to work on a flat surface and not the edge of a mountain then they are going to look horrible under certain conditions. Also, even if you have gone all out and made quite a few death animations, their re-use will become apparent to most people.

    Another thing, though this may be a step beyond, would be that having a rag doll system in place would make it quite easy to have a system for dragging a rag doll around by creating a joint to the player allowing for hiding bodies in a stealth game...

    ReplyDelete
  5. Just as an added note, rag dolls are pretty much a staple of any FPS in recent years and not including them for the sake of a few days work could quite easily hurt more commercially than those few days of development. I would definitely argue with your point about them being an "essential feature" if the aim is to put FPSC Reloaded in contention for modern game development.

    ReplyDelete
  6. I am more interested in the water system at the moment. For instance water currents will you have a directional water flow and maybe 2 water shaders one river the other lake, ocean etc . This would help with floating objects etc. Being next to waterfalls with no drag if in water be a bit odd. As to ragdoll on flat surface not needed but falling will be required in terrain. So if you can do it without ragdoll then splendid if not v2 quick update or while still in beta testing as in us lot playing. Would be best. I think get the physics main and ai ans main engine with all what was promised then add a heap of stuff alongside strtch goals etc. Only 2 month left so a solid working nonw lag system with all environment working collision ai and all with shaders and lights working with a fast frame rate and the trinkets like inventory system and none linear game play sounds fade etc and great swimming and ladders and fantastic ai and huds and clouds and day night cycle etc etc then when all that is done add ragdoll maybe as optional.

    ReplyDelete
    Replies
    1. Sorry for double post. Ref water. Will you be adding a sort separate entity sort of like a prefab of water pools for higher up in terrain not water table. So a damn and reservoir or lake type thing. Is it possible. A separate entity from the main water but with the physics and ahaders

      Delete
  7. At this stage the Player-Module
    might just be the key part to speed up the general progress
    and in combination with the ai work - scheduled next week
    it would be the first step into a playable alpha

    but if you should decide to start with ragdolls
    you might wanna add Water-Buoyancy to the player & enemy/ when they are
    dead in water - as in how many games have you seen a character float above the water?

    anyways great work as always

    ReplyDelete
  8. All looks and sounds good to me.

    As to the Rag Doll I guess at the moment only you would be able to adjudge at some stage before anyone else if its crucially needed to add the quality of realism matching the rest of what Reloaded presents in professionalism as we cant see any of the character actions.

    I can understand some users wanting Rad Doll and perhaps better to have it as a choice than to not. However I don't think its necessarily critical at this stage unless characters without it are obviously bad enough to look out of place in situ when it may be needed. i.e death.

    Then currently I would agree that if it could be plugged in later if needed at all that would be the best option for a variety of reasons not least of all having a finished or majorly completed core to test it with.

    :-)

    ReplyDelete
  9. /RANT/
    I agree that rag-dolls perhaps are not "essential" game feature per se but it is a trend of current games much like the shadows. You did implement shadows so why stop half way though now. Imagine all those situations in FPSC where you would kill an enemy at the top of the staircase and they would play their "really great death sequence" and lie flat in mid-air. Same applies when you kill someone close to a wall. They would just fall through it. This is something that makes or brakes the product, something that distinguishes it from yet another indie game engine and a quality commercial product.

    Let's just reminisce a little. You can have rag-dolls in FPSCx9 if you download a "semi-official" death script. When I say semi-official I mean that it was made by TGC but not advertised as it broke the age restriction for the product (IIRC). So many FPSC users even didn't know it was possible and flooded forums with questions on how to implement the feature. Once again I'm afraid that if it's not in the initial release we might never get it. I don't want to sound ungrateful but much like with Reloaded there were tons of promises given for future FPSCx9 expansions, I even remember vehicles being mentioned early on. Let's avoid that shall we.

    So to reiterate. If it only takes a day or two to do it now why postpone it. Even if it means working a full weekend at the end you will have a solid commercial product spot on right from the day one. I would hate getting an expensive Merc to find out that there are no windscreen. They promise to ship out the wipers in an "expension" pack few months down the road once they engineer and manufacture it. Would you buy such car or wait until they actually produce all of the components.
    /RANT OVER/

    ReplyDelete
  10. As much as I do not like ragdolls as they are rarely ever done right in commercial games, I am inclined to agree that they might actually be more essential than perhaps you realize Lee.

    Generally, they will just help in the long run, allowing everyone to ignore death animations for the most part as long as there are considerable ragdoll settings for them to tinker with. It is just a really good, and catch-all way of handling environmental situations.

    I think it is a feature that, if you spend the time on now and get it out of the way you won't regret it later and the product will be much more complete and up to the task of creating games.

    ReplyDelete
  11. Good point olby. As I said death on terrain prob needs it. Only flat land with no obstacles would work for animated death. I remember the buzz when ragdoll was a whisper for x9. And by George it was great watching falling dudes. Admitting though the bodies would end up in odd positions. But my orcs heads would decapitate in x10 so I added neck gore for when die.and so accidental in jon fletchers fantasy pack my orcs heads fell off when dead was great. Im on the fence at the moment though. But lee will be working on the product for at least another year.

    ReplyDelete
  12. Clearly if whatever animation sets Reloaded Characters will have from the outset mean that they don't react well to their environment. i.e. their bodies don't conform to the environment shape well on say death then Rag Doll should be included from the day of official launch release at least.

    I would agree that Reloaded really cant be acceptable with bodies floating suspended anywhere or bodies half buried in walls or the landscape or enemies weapons left floating somewhere in mid air and so on.

    Clearly a Reloaded with obviously bad Character body behaviours which stand out like a sore thumb so clearly as a poor feature in ways we are all aware of in classic version for example would be a major product breaker. As AI is perhaps going to be a major feature of Reloaded it needs to be good from all points of view. Seems some of that is already in place or catered for and quality of the body behaviors need to be kept to the same kind of professionalism in death as in life so no getting stuck in world objects and decent death sequences which don't badly distract from the quality of the product and games made with it.

    on the other hand Rag Doll itself I would think in Reloaded will be quite a difficult task and Rag Doll is often over done with bodies being behaving like rubber band stretch armstrong type characters. I guess human bodies can be like that when enough force is applied but to get it looking right depending on force values and so on I should think is a very difficult and arduous task.

    I would have thought that given the line of direction towards ensuring Reloaded meets a certain level of professionalism thus far Lee and TGC would not wish to release Reloaded with under par quality Character body behaviours related to this issue to the extent that it would obviously impeed the product and its reputation and sales which a poorly implemented solution would surely do in an engine which is aimed at quite substantially upping the benchmark throughout.

    It is important to get the AI and Characters right and to the best possible level result whatever that might be.

    Presumably Lee and TGC are able to clearly see that and adjudge that too themselves just as can anyone else. I cant see how one can miss something like the kind of behaviors of character bodies that was seen in classic. I cant see how such as that can either be ignored and passed over.

    I don't think Lee and TGC will wish to bypass any issue of an obviously poor nature for Reloaded now or in the future. Again the success of the product will depend upon it.

    I think the point is clear and understood whether its Rag Doll or anything else. There is a level of quality which for Reloaded is ideally unacceptable and hopefully all will be accommodated for to maintain consistency of feature quality throughout at a level which is well - evenly matched.

    Particularly bad, naff or badly implemented things that stand out like a sore thumb in an otherwise relatively steady level of feature quality inside your game can impact badly on it and the engines perception so is best avoided.

    I think you have to trust to faith at the moment and am sure Reloaded characters will be worthy of your game at the end of the day.

    I have to admit though that I would not like to see in Reloaded a Character that when killed on top of a wall or similar simply lies flat and hangs suspended in mid air albeit displaying a pre - designed animation pose if it has no relevance to the physical environment situation around it. That would be an immediate turn off so no matter what I do hope Reloaded will have some level at least of a system to overcome those kind of body behaviour responses to their environment.

    ReplyDelete
  13. I can't believe we are having this debate.Of course Reloaded needs to have ragdoll physics with the terrain system. Also a well done ragdoll does win over a nice animation. There is a good reason why AAA games use them you know. Having enemies dying through walls and terrain will look awful so I'm afraid there will need to be some physics interactions going on there.

    Not putting in ragdolls during the physics module would be frankly ridiculous and 2 days is a perfectly reasonable amount of time for this. I'm not in favour of taking shortcuts over having a good toolset. Regardless of how good the animations are they will get old whereas seeing an enemy rolling down a cliff into a watery grave and floating down the river never gets old.

    not only does Reloaded need ragdoll physics as an essential feature it needs to be done well and I'm sure bullet ragdoll physics would look awesome. Please take a couple of days to do this.

    ReplyDelete
    Replies
    1. That means if the body floats down river reloaded would need water current to move the ragdolls. so more water and ragdoll if the only other option is die in mid air.

      Delete
  14. Yeah the only reason why I brought up ragdoll was because I don't see how any preset animation would work with a decline or incline terrain.

    Though I think the main focus now should be the player actions, enemy AI with the environment and player weapons.

    ReplyDelete
  15. I believe having ragdoll physics for enemy deaths to be an essential feature. Animations are greats, but imagine shooting an enemy off the ledge of a high building or throwing a grenade into a small group of enemies and seeing the bodies fly. You can't animate these situations and they add great moments to your scene.
    Ragdoll adds a great toy like element to levels that shouldn't be over looked.

    ReplyDelete
  16. I don't see ragdolls as an essential feature per se, but you'd be mad not to spend at most a day or two and have it in there from the get-go. As several people have already pointed out, you only have to shoot someone at the top of some stairs or on a sloping terrain and it's immediately obvious that their death was animated. In a narrow hallway or next to a wall and they die through the wall.

    Ragdolls rarely look as realistic as good death animations WHEN THEY'RE ON A FLAT GROUND, but as Ched80 rightly pointed out, "toy" is an important part of game design and you'd be amazed how many people actually love the ridiculous poses ragdolls sometimes get into.

    ReplyDelete