Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411431 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 20, 2024, 02:46:19 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsWobbledogs
Pages: 1 ... 3 4 [5] 6 7 ... 37
Print
Author Topic: Wobbledogs  (Read 232064 times)
ActualDog
Level 3
***



View Profile WWW
« Reply #80 on: April 01, 2016, 05:50:30 PM »

Worked a little on AI yesterday and then, in a successful procrastination effort, today I made some modifications to how limbs work.

I came up with the idea a little ways back to try a simple model for leverage (I don't know of a better word?). I'm not using any sort of physical muscle system, and so something that's always bugged me about my physics was that dogs could very easily spin out of control since their limbs could exert infinite amounts of torque in any direction.

The basic idea behind this new system is that limbs should damp their torques as they extend in either direction towards their limits. So if a limb has reached its max extension in the positive direction, it won't be able to exert any more torque in that direction. It can, however, generate its full amount of torque in the negative direction. Likewise, a limb's rest position allows maximum torque in either direction. I don't know how this works in real life with real world physics, and I imagine it's more complicated than what I'm doing, but I'm happy with what I got working today.

The final results are sort of subtle, but that's because in the past I had tuned values like crazy to try and avoid what this system automatically prevents. Anyways, after I got this stuff working, I needed to go back and re-evolve the walk cycles.

Initial tests were pretty funny looking but revealed that my back leg min/max joint rotations had too small a window. Dogs weren't able to get any real momentum with their back legs with this new system.



Fixing these values got me here.



I don't know how easy it is to see, but they're lurching something crazy. The walk cycle is now made up of these awkward, lurching, monsterish movements. The reason for this is because my cycles are not context sensitive. Without this new system, legs were free to keep applying torque even after being fully extended. This meant that motion carried smoothly even if a leg fully extended before it was set to start moving backward.

With this new system, however, legs stop once they reach their max extension. This means that they reach their end point and just kinda sit there until the cycle tells them to move back again. Lurching.

For now I just lowered some max value settings and basically slowed down the cycle a bit. The lurching is still there but it's less noticeable because limbs are taking longer to reach their full extension.



For comparison, here's what the cycle looked like before today's changes.



The original cycle is more bubbly than my new one, and overall it looks nicer I think. That said, there's some huge advantages to the new cycle. For one, the new cycle gives way better balance (you can even see some of the old cycle dogs falling over). The reason for this is because limbs police themselves more now. As a limb gets to its max extension, it softens out its torques and eventually stops torquing all together. This results in more stable dogs as it's one less way for them to exert crazy forces in awkward positions. It's also more sensitive to changes in terrain and balance in general. The previous cycle moved constantly no matter what was going on. The new cycle adapts its torques based on the dog's current state.

It's a little disheartening to go backwards in terms of how good the walking looks, but it really does work better in context and I'm not done with it by a long shot. This system is promising but really highlights what I'm still lacking. Namely, I need some sort of global control over the cycle itself so it can truly adapt to terrain and dog balance. It needs to be able to speed up, slow down, or completely pause as the situation changes, and it needs to be able to do all this without the legs getting out of sync. Getting this working should look better, remove the lurching, be much more stable, and help a ton with uneven or sloped terrain.
Logged

Rojom
Level 0
***


View Profile
« Reply #81 on: April 02, 2016, 12:32:24 PM »

I think you hit the nail on the head there. The original does look more charming and fun, which I feel fits with the entire concept of the game more, but it probably isn't as versatile as the new legs because of stability issues. Did you change anything with the spine joint? Or does it seem stiffer just because of the controlled leg movements?
Logged
NoLocality
Level 1
*


AssetsAssetsAssetsAssetsAssets...


View Profile
« Reply #82 on: April 02, 2016, 01:47:23 PM »

I'm really liking what I see ActualDog.

I can't imagine where this will end but it's looking like it's going into some fun territory.


Happy dev'n sir  Coffee I'm gonna follow and see where this goes.
Logged

marcgfx
Level 8
***


if you don't comment, who will?


View Profile WWW
« Reply #83 on: April 02, 2016, 04:49:32 PM »

one thing I can think of that could improve the walking cycle: can you specify some joints to relax? e.g. if the foot would flop down when leaving the ground and then flatten out again when touching the ground this would look a lot more realistic. currently the joints seem very rigid, there is no elasticity to the walking gate.
Logged

ActualDog
Level 3
***



View Profile WWW
« Reply #84 on: April 04, 2016, 07:32:06 PM »

Did you change anything with the spine joint? Or does it seem stiffer just because of the controlled leg movements?

Nah, it's just stiffer as a result of the reigned in legs.

I'm really liking what I see ActualDog.

I can't imagine where this will end but it's looking like it's going into some fun territory.


Happy dev'n sir  Coffee I'm gonna follow and see where this goes.

Thank you!

one thing I can think of that could improve the walking cycle: can you specify some joints to relax? e.g. if the foot would flop down when leaving the ground and then flatten out again when touching the ground this would look a lot more realistic. currently the joints seem very rigid, there is no elasticity to the walking gate.

Yeah, you're totally right. It's a tough thing to balance, the rigidity goes hand in hand with simplicity within the system I have set up. I made a few changes today to get it a little nicer, actually. I'm still not done with it but you can see I modified the dog feet a bit.



The new feet are on the right. I also loosened their tension a bit and both these things combined gives them better traction when moving around. I'm not done with their walk evolving yet, but it's already looking better than the last gif! I might eventually have to write a script to handle the feet specifically, though. I might want something to tell them to flex in specific ways as they search for a foothold.

The rest of my day was spent tweaking general dog physics some more. While I was in there updating their feet, I noticed that a few of their leg parts still had angular drag set. I thought I had gotten rid of all that a while back but it turns out I didn't. Modifying drag like that is the sort of thing that mucks up everything, so along with removing their angular drag, I took this as an opportunity to dive in there and tweak a few more things that had been bothering me for a while. Main other thing is that I also increased their weight.

It's a lot of small stuff, so I won't explain in depth, but this gif showcases the results pretty nicely I think.



If you compare it with the pyramid gif I posted on the OP, the updates are more obvious.



Mainly it's that everything is weightier now and actually more stable as well (less rocking after standing up, etc). I'm still not done with this stuff, I can point out quite a few things in the new gif that I'd still like to fix and I'll probably be tweaking all this until this game ships, but I'm very happy with today's end result.
Logged

ActualDog
Level 3
***



View Profile WWW
« Reply #85 on: April 05, 2016, 07:21:55 PM »






Logged

Smerik
Level 1
*



View Profile
« Reply #86 on: April 06, 2016, 12:49:06 AM »

This topic is becoming more bizar by the day, but keep coming back  Smiley
Logged

deroesi
Level 0
*


View Profile
« Reply #87 on: April 06, 2016, 04:14:19 AM »

love it!!!! Wink
Logged

.....the computer is just a toy, you are the tool.

my cg portfolio - www.shaidacher.com
my indie project - http://moldgame.wordpress.com
io3 creations
Level 10
*****



View Profile WWW
« Reply #88 on: April 06, 2016, 08:47:52 AM »

I think we all know where this is going ... a doggy version of "The Human Centipede".   Grin
Logged

quantumpotato
Quantum Potato
Level 10
*****



View Profile WWW
« Reply #89 on: April 06, 2016, 09:03:34 AM »

Genetic algorithms for walking + cubist pets..
Looking forward to this Smiley
Logged

ActualDog
Level 3
***



View Profile WWW
« Reply #90 on: April 08, 2016, 03:12:00 PM »

Haha, thanks guys. I wasn't planning on having any jointed dogbeasts in the final game, those tests were mostly just because I was curious about how it'd work out, but they're pretty fun to play around with so who knows...


Update! I don't have a gif to show off the behavior because it's not really an easy thing to show, but I finally got the groundwork for the dog training in! It's still very early, but I was able to stop a dog from running a certain behavior by scolding it a bunch whenever it ran that behavior. I know that doesn't sound very exciting, but it's a huge deal for me. Still lots to do to get that system in a good place, but getting to this point took a bit and I'm really happy to have it working even a little!

Related to that, I also started a little behavior tool.



Pretty simple so far, but it does some nice stuff under the hood and it's getting close to a point where I can build simple behaviors without touching any code, which is where I want it.

Finally, I came up with a solution to a long-standing issue.

In the past, dogs could get stuck on ledges.



Dogs have strong enough joint tension that this sort of thing is pretty common. I had tried a few solutions in the past but nothing really worked.

The solution I'm using turned out to be really simple. Now, whenever a leg is ungrounded for a certain amount of time, it relaxes its joints. The original idea behind this was just for better-looking air movement, but it totally fixes this as well!



It doesn't look as good as I want it to yet, and there's a lot I need to tweak with it (mostly, the tension should ease into its relaxed state, not just snap to it), but it works! Tension comes back the moment a leg is grounded again or when a dog tries to specifically move that leg for some reason (walking, stability, etc). Once it's working a little more cleanly, I'll show off how it looks when a dog's flying through the air.
Logged

Fuzzy Branch
Level 0
***



View Profile WWW
« Reply #91 on: April 09, 2016, 12:01:04 AM »

The new behaviors look good! I'll refrain from comment on the demonic 16-limb creatures, but I think the improvement in the bucking behavior is pretty evident and adds to the illusion of intelligence well -- it's mostly in the eye of the beholder but when you layer all those details on top of each other I think you can get a pretty cool result - looking forward to what develops.
Also, I think you've made a wise choice investing in making tools for yourself -- I think editor tools are a seriously underrated resource, but they're incredibly powerful if done right.
Logged

ActualDog
Level 3
***



View Profile WWW
« Reply #92 on: April 11, 2016, 06:15:29 PM »

The new behaviors look good! I'll refrain from comment on the demonic 16-limb creatures, but I think the improvement in the bucking behavior is pretty evident and adds to the illusion of intelligence well -- it's mostly in the eye of the beholder but when you layer all those details on top of each other I think you can get a pretty cool result - looking forward to what develops.
Also, I think you've made a wise choice investing in making tools for yourself -- I think editor tools are a seriously underrated resource, but they're incredibly powerful if done right.

Thanks! Since I'm in this for the long haul I'm trying to be really conscious about workflow. It's something I usually don't put much effort into and I always regret it, even for shorter projects. I think I mentioned it to you already, but I'm super into the editor visualization you have going on with your project. Definitely something for me to work towards.

On that note, I spent today adding exit conditions to my behavior tool.



It's not that impressive to look at, but it was a lot trickier than I thought it'd be. The first problem was figuring out how to contextually update the view. I'm basically using two lists and branching the display path of the second based off of the contents in the first. The first list holds enums and the second holds the actual classes you're filling in.

Relatively straightforward, if a bit roundabout. The really weird part was figuring out that Serialization and polymorphism don't mix. Basically, none of the data I input would save. I won't go into it unless someone's really interested, but after a little time spent tearing out my hair I finally came up with a decent little way of preserving my inheritance structure while keeping the data in tact.

Not really my favorite way to spend a day, but it works now and this tool is gonna save me a ton of time going forward.
Logged

ActualDog
Level 3
***



View Profile WWW
« Reply #93 on: April 12, 2016, 07:09:10 PM »

More nice progress on the behavior tool, and lots of general tweaking with mid-air rotations and ungrounded joint tension. It's feeling much better, which is cool. One fix in particular stomped a bunch of weirdness I had been wanting to get rid of for a while.

While testing all this stuff, I stumbled into some neat looking behavior and just wanted to share.



Dog does a little kick off the wall here and it helps straighten it out. I didn't specifically add any code for this, it just kinda showed up because of the way my stability system works. Of course, that also means that it's not very reliable and dogs don't generally just go around jumping off walls, but it was really fun to see it happen regardless!

Also, these guys have heavy legs.


Logged

ActualDog
Level 3
***



View Profile WWW
« Reply #94 on: April 13, 2016, 04:32:30 PM »

Finally stomped a bug I'd been dealing with since the first month. I've been fairly careful to not let it show up in gifs, but it happened regularly and was getting worse because of a few recent joint changes I made.

The issue was that dogs could get their legs stuck in bad positions.





PhysX joint constraints are loose, not rigid, especially if you use springs and dampers (which I make heavy use of). Because of this, high forces can get legs to end up in bad positions like those above. The top segment in each leg doesn't collide with its attached body, but the others do, so when a leg gets into a position like this, it doesn't really come back.

I read a ton of documentation and forum posts about unity's physics system, tried a ton of potential fixes, and finally settled on something pretty solid. Dogs now get personal orbs.



Each dog's orbs are set to only collide with its leg segments (ignoring the top segments), and what this does is help the physics system figure out the correct direction to push leg colliders away towards when they inevitably tunnel.

It works like a charm, though implementing it wasn't that straightforward. I had to do some "fun" stuff to deal with rigidbody center of mass and collision/raycast management.

Feels good to have this fixed though. Absolutely was my biggest outstanding worry.
Logged

shmo
Guest
« Reply #95 on: April 13, 2016, 04:39:14 PM »

Loving this stuff! I think a physical (non-ui) breeding mechanic could be really fun, I can imaging trying to hook-up the best creatures by nudging them together (no so much that they get annoyed with each-other), confining them in pens, dressing them up, setting up romantic meals etc.. I think that would make seeing them evolve so much more rewarding. Ether way, keep at it chap.
Logged
ActualDog
Level 3
***



View Profile WWW
« Reply #96 on: April 19, 2016, 02:39:24 PM »

Loving this stuff! I think a physical (non-ui) breeding mechanic could be really fun, I can imaging trying to hook-up the best creatures by nudging them together (no so much that they get annoyed with each-other), confining them in pens, dressing them up, setting up romantic meals etc.. I think that would make seeing them evolve so much more rewarding. Ether way, keep at it chap.

Thanks! I really love those ideas. Whenever I get around to it, the goal is definitely to have breeding be physical and I definitely wanna keep it goofy (dressing up dogs for dates is A+ stuff). The fun of these guys is seeing them plod around, so I'm going to be trying my best to make sure I physically show stuff whenever possible.


Also, sorry for sparse updates lately. It'll probably be like that for a little because I'm putting in lots of time towards AI and tools work right now. I mentioned earlier that the base for this stuff is in, and that's true, but it needs content before I can really dive in and test it. Since it's all in such an early stage, each bit of content I add means more little features and tweaks.

Until I have some new feature stuff to show and talk about, here's some more gifs.








Logged

Emma Larkins
Level 0
**



View Profile
« Reply #97 on: April 19, 2016, 03:23:13 PM »

Wow, this looks great and awesome and terrifying at the same time...
Logged

Cranktrain
Level 4
****


making gams


View Profile WWW
« Reply #98 on: April 19, 2016, 03:27:18 PM »

What must be heartening is that the dogs all have so much personality already. I know you're not done with the movement dynamics, not by a long shot, but really, teams of game designers and writers and artists with tens of thousands of polygons and normal maps come up with characters that have way less personality than these Good Boys.
Logged

cloudgods
Level 0
***


im j


View Profile WWW
« Reply #99 on: April 19, 2016, 06:46:59 PM »

OH man I've seen this around twitter, and I've been curious about it. It's really interesting reading your notes + solutions for different physics problems. It's so hard not to smile scrolling through this thread god it's REALLY CHARMING just to watch these dogs putter around!!
Logged

Pages: 1 ... 3 4 [5] 6 7 ... 37
Print
Jump to:  

Theme orange-lt created by panic