Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

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

April 20, 2024, 12:14:59 AM

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



View Profile WWW
« Reply #100 on: April 20, 2016, 05:18:35 PM »

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

All good adjectives. Thanks!

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.

Ah, thanks so much, that really means a lot to hear. As many problems as they still have, I'm really pleased with how they're coming along and I'm so excited to see where they'll end up.

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!!

Thank you! So glad it's been interesting!


Brief update from last night (because today probably isn't gonna result in anything for me to show). I got in some very early behaviors for solo play and sleeping. This is obviously very sped up, but they'll romp around a bit, tire themselves out, and then go to sleep until they recover. Super not balanced or polished, but it's cool to have a little bit of statistical interplay going on finally.



Ton of polish I wanna do with the sleeping but I have a lot of other stuff to rough out first. Eventually I'd love for them to walk in a lil circle before laying down, simulate the possibility for dreams (sleep kicking and noises), put in some chest movement, etc etc.
Logged

ActualDog
Level 3
***



View Profile WWW
« Reply #101 on: April 27, 2016, 01:06:46 PM »

Ok, so let's talk turning a little?

I'd been doing a lot of general dog stabilization work and at some point it kind of destroyed my previous strategy for turning. In the past I had just been torquing the front of the dog's body towards the target angle. This worked ok when dogs were light and easier to knock around, but it doesn't anymore. Dogs are heavier, have a lower center of gravity, and stabilize more intelligently than they did previous.

I always thought I'd need a way to get the dogs to turn in place without walking, so I used this as an opportunity to tackle both issues at once.

The result is FAR from perfect or done but it's functional enough for me to move ahead with some other stuff.

First thing I did was to spend some time trying to figure out how to get these guys to turn in a circle. Initial attempts at this, while hilarious, were not easy to control and were a little goofier than I actually want for such a base piece of functionality.

(Oh, and please ignore the super janky walk below. Walking is, once again, in the middle of some changes.)





After some deliberation, I decided my life would be a lot easier if I made a core change to their structure. I added in some Y-axis body bend. Not only does this make it easier to approach turning, but it opens up the door to some additional motions and behaviors.

After some trial and error, I got something basic up and running.



I was pretty pleased that, all things considered, their leg stability code compensated pretty well for these crazy turns and while not perfect, there are a few somewhat natural stabilizing steps going on there without any additional code. Of course, I still definitely need to improve this. Specifically for larger turns, the legs don't compensate as well as they should and it looks pretty unnatural.

After a bit more tweaking, I got some turns that kept decent accuracy on the ground, in the air, and while walking.







When a turn is needed, dogs loosen their body tension and call into a secondary animation system I built a little while back. The system lets me define target rotations in a keyframe sequence for specific objects. Because I don't have absolute control over all the forces (body parts affect each other in hard to predict ways), the system isn't perfect and is better for general motion than it is for finer-tuned stuff like this, but it's generally been ok so far. I have two separate animations depending on how large the turn needs to be, and the system switches between them as needed.

It's not perfectly accurate, especially for smaller turn windows, and it's got its fair share off issues, but it's enough to prove out behaviors and let me get back to the AI for a bit.

It's frustrating having to spend non-trivial time re-implementing base functionality, but the turning is better and more flexible than it was before, and it was only necessary because other parts of the dogs got better too!
Logged

ActualDog
Level 3
***



View Profile WWW
« Reply #102 on: April 29, 2016, 05:36:32 PM »

bloop bloop lots of invisible AI work. I started in on a system for praising and punishing dogs, and I even set up a spreadsheet so I can balance behaviors using real numbers and math instead of arbitrarily setting things off the top of my head. It's been nice working on some actual content and it's making me excited to expand the number of behaviors I currently have. It's sort of hard to show this stuff off with gifs but once I have some more content in maybe I'll try out a video or something!

---

Today was actually completely lacking AI work because I got sick of the game's performance issues. It had memory leaks and as I've been adding systems, it had gotten to a point where I really couldn't have more than 5-10 dogs doing their thing without framerate dips.

I was able to get rid of some excess raycasts to deal with performance, but the memory leak issue was harder to figure out. I eventually tracked it down to my "animation" code. I use Unity's AnimationCurves to define torque-based movements for my dogs, but because it's not a direct mapping of position/rotation @time, I do some stuff involving averaging currentTime and lastTime curve values together. To make that accurate I also loop through the curves and average in any skipped keyframes between the two times.

Because all my dogs's motions come from this, the function that does this is called a lot every frame. There isn't any hardcore math or object creation going on, so I never thought it'd be an issue. What I discovered, however, is that every time I accessed the keyframe list from an AnimationCurve, Unity allocated memory. Even with some optimizations, I was easily checking a few hundred keyframe values per dog per frame, and the garbage collector just wasn't able to keep up.

Just doing this a few hundred times per frame was enough to cause GC spikes. (Time is a float here, and is instantiated once per frame).

time = curve.keyframes[0].time;

I don't know what's going on behind the scenes here, but it's nothing I want any part of. Calling Evaluate() appears to be basically free, and that seems like it should be more expensive if anything.

Anyways, google wasn't helpful and I don't have the ability to change, or even look at, unity's source code, so I just took the gross route and wrote up a custom wrapper for AnimationCurves. Because I just need the keyframe times, each time the curve is updated the wrapper stores off a separate list holding all the keyframe times so I can access those without causing mystery memory allocations.

Today's end result is that I can now barf up 33 simulating dogs before the framerate dips below 60, and without any memory issues.



At this point the biggest perf culprits are PhysX itself and my raycasts. I already have a few thoughts about how to reduce my raycast footprint, but for now I'm happy with where this is at. When I started today, the goal was just to support 10 simulating dogs without memory leaks taking things over, and I've surpassed that so I'm happy.

Oh, and here's one last bonus gif of my dog spawner causing mayhem when I accidentally set it to spawn dogs slightly below the stage.

Logged

ActualDog
Level 3
***



View Profile WWW
« Reply #103 on: May 02, 2016, 05:48:18 PM »

Having fun with the perf improvements.



Right now I'm working on getting some basic eating and toy playing behaviors in the game, which should help solidify the targeted behavior flow and give the dogs/player more to do.

Indiecade submission deadline is on the 15th. Getting a solid demo ready by then is gonna be really difficult, but it's a good deadline for me to try for regardless. I've got a little checklist of things all set up and I'm gonna try my best and see where I can get!
Logged

ActualDog
Level 3
***



View Profile WWW
« Reply #104 on: May 03, 2016, 08:08:05 PM »

I kinda went down a rabbithole today but it ended up being really productive.

I revisited the dog's leg structure and walks because I was getting frustrated with a few problems that came up when trying to get them to walk over to food.

I was originally thinking the issues would be quick to fix, but in solving them I discovered that my joint limit damping code was working super bizarrely. "Working" might be an overstatement, actually. The issue was easy enough to fix, which helped out with my walk cycle updates, but it also completely destroyed stability steps. I spent a few hours trying to re-tune them with the correct code, but eventually reached a point where I realized that I wasn't going to be able to get them to work as well as they had been without a complete overhaul. In an effort to work towards my deadline, I left the original broken function in and allowed the stability step code to use it.

It's pretty disgusting, but as wrong as that code is it's been giving me excellent stability steps for a while, and leaving in tact for them is the best thing I can do for now. It's definitely something I want to revisit in the future, however...

After that, it was dog tweaking as usual. The pups got a bit of an overhaul.



They're a little shorter now, but they walk and stabilize better. As usual, I doubt this'll be their final form.

Speaking of, I also experimented a bit with extreme body changes just to see what my system was capable of.





Honestly, with a bit of tweaking I think I could get these things pretty solid. I still don't know if the game has a place for horrific dogmorphs like this, but it's something I want to think more about now that I know it wouldn't be too crazy to build a few and get them to at least walk around.

Finally, an eating update.



This is actually from last night. Multiple dogs can chow down on one piece of food simultaneously and it's fun to watch. Once I have this a bit more solid I'll post an example of what that looks like. I'm aiming to be able to get this and basic toy playing checked off my list by tomorrow.
Logged

ActualDog
Level 3
***



View Profile WWW
« Reply #105 on: May 04, 2016, 07:32:12 PM »

Lots of work on eating today. It took a little longer to get to an acceptable point than I thought it would because of two major-ish issues.

First of all, dogs are very wobbly. It's not very easy to keep them in one place and they tend to wiggle around. It's especially unpredictable during animations. This is fine in most cases, even desirable, but it's not fine when I want them to be in a specific place, like in front of a block of food.

My temporary solution to this is to fix their feet to the ground when they start eating and release them when they stop.



It's actually fairly robust when I don't accidentally tell them to try and turn around while this is going on like in the above gif, but it's also absolutely the most overt thing I'm doing so far to cheat the physics. I'm leaving it in for now because it makes my life way easier, but I'd like to revisit this at some point and see if I can figure out a better way to get this working.

The second problem I ran into was that dogs are very reckless as they stomp around. The original food objects were small and light and dogs would kick them as they walked up to them and get stuck in a loop of chasing them around the pen. It was pretty funny, but also a great way to guarantee that all the dogs will starve.

My solution for now is to make all the food blocks large and heavy. I kind of like this regardless since it makes it more likely that multiple dogs will chow down together, but I also think it's a problem I'm going to have to solve further down the line for other features.



After these problems, the rest was just general systems bugs and edge cases. Stuff like making sure dogs stop eating if the food moves or is destroyed, getting the particle effects to show up individually for each dog near their mouths, adjusting the behavior tuning so eating feels nice, etc.

At one point eating was so attractive to the dogs that they'd just all hang out by the block of food and take a bite or two whenever they got even the tiniest bit hungry. Now I have it feeling fairly good, though. Dogs are actually proving pretty adept at keeping their needs in check!
Logged

TheCams
Level 0
**


View Profile
« Reply #106 on: May 05, 2016, 03:07:59 AM »

I love this thread, each gif is hilarious  Tears of Joy
Logged
Shephf
Level 1
*



View Profile WWW
« Reply #107 on: May 05, 2016, 11:49:13 AM »

This is absolutely awesome! But I also wonder what will gameplay look like exactly. I mean, raising those things, but how ? And how do you play with them afterwards ?
Logged

ActualDog
Level 3
***



View Profile WWW
« Reply #108 on: May 05, 2016, 06:02:34 PM »

I love this thread, each gif is hilarious  Tears of Joy

Thanks!

This is absolutely awesome! But I also wonder what will gameplay look like exactly. I mean, raising those things, but how ? And how do you play with them afterwards ?

Thank you! For the time being I'm focusing on the base systems and there isn't a ton of interaction beyond throwing them around and praising/scolding them, but I want the player to ultimately be able to have a pretty hands-on approach to training. Lots of encouraging/discouraging certain behaviors, pen setup and maintenance, making sure the dogs are getting along, feeding them, teaching tricks, etc. I also have some pretty big plans for external competitions and such for the dogs, but I don't want to talk too much about that stuff until I'm further along.

---

This morning I spent a little bit of time on some visuals. Nothing about them has changed for around 2 months and I want to add a little visual flair for the Indiecade submission deadline. So far I've added a little bit of color correction, and I also added a focused DOF effect for when dogs are picked up. The idea's that it should help focus the player's (and anyone else watching's) eyes on the dog they're trying to move around.



I also started doing some tests with multi-tiered rooms.



The above setup was created in-editor, but my next task is to get this sort of thing possible in-game. I'm really excited about this, tbh. Even the simple setup above is actually really fun (at least for me) to drop dogs into and I'm pumped to get this stuff user-buildable. I wasn't sure if I was going to fast track this feature or not but after testing it out, I'm absolutely making it my highest priority.

If I can get the basic building features I want in, I actually think I might have a solid little demo build. Granted, the dogs themselves are still pretty basic, but I think it would legitimately be fun to play around with and would showcase everything I've built so far pretty well!
Logged

ActualDog
Level 3
***



View Profile WWW
« Reply #109 on: May 09, 2016, 07:48:13 PM »

I've been working on the pen builder and it's coming along.

On Friday I got in some basic grid-snapped placement with collision, movement, and deletion. The pens also highlight red when they're in invalid locations, but this gif was recorded a little before I implemented that.



Since then I've been working on getting the pipes into this tool as well. They're proving to be a little harder because they need to be able to tunnel through pens. I got it working though! I spent most of today fooling around with dynamic mesh creation for them, but I ended up forgoing that in favor of building the walls up from multiple scaled cubes. You can see some seams in the gif below as a result of that. The seams should hopefully be easy enough to fix but I'd still like to revisit this and experiment more with a mesh-based approach in the future. Dealing with the triangulation (with holes) and colliders (I don't want to use mesh colliders, so I'd need to dynamically set up compound box colliders or something) is kind of a huge pain though.



I'm super happy I got this working though, and I'm hoping to get the rest of the basics in by Wednesday!

Also, I recorded this gif over the weekend. It's got most of my systems in it in some form or another and it's pretty cool to see everything I've worked on so far all coming together!


Logged

ActualDog
Level 3
***



View Profile WWW
« Reply #110 on: May 10, 2016, 08:24:40 PM »

Still going strong on this editor. I knew it was going to be more involved than I'd planned for, but it really is a case of implement one thing and add two more to the list. There's a lot to building a usable 3D editor I wasn't really aware of since I've never done it before.

Here's a quick gif of the pipe creation. It still needs a few more features (node deletion, flow direction labeling and switching), but it's working nicely so far!




The rest I gotta upload in video form because I couldn't get my gifs small enough.





Pipe-mode ghosts the pens, I've got in some rudimentary camera control, and everything generally just works alright so far.

After the new pipe mode features, I've got some more camera work to do, and then I'll have to add some actual UI so someone other than me can figure out how to do things. It won't be "done" done after that stuff, but it will (hopefully) meet the minimum level of functionality I'm shooting for, so I think I'm still on track for Sunday!

Also, I put a camera on a dog this morning.




Logged

Juskelis
Level 1
*



View Profile
« Reply #111 on: May 10, 2016, 10:21:57 PM »

I feel like I just watched a rave
Logged

rumpelstiltskin
TIGBaby
*



View Profile
« Reply #112 on: May 11, 2016, 06:45:48 AM »

Do you use any external torque on joints, or only joint motors? Technically, a 'realistic' muscle system is only allowed to apply equal and opposing torques to both parts connected by a joint, and it looks like the dogs get some external correction torques occasionally, especially when in the air or trying to stand up. With this body shape, I'm not even sure it's possible to realistically get up on itself when lying on a side (beetles have lots of trouble doing that). One would probably need to slowly extend the upper pair of legs, and then bend them in really fast.
Logged
Thirteen
Level 0
**


@i_am_thirteen


View Profile WWW
« Reply #113 on: May 11, 2016, 06:58:40 AM »

I love this devlog so fucking much Cheesy
Logged

ActualDog
Level 3
***



View Profile WWW
« Reply #114 on: May 11, 2016, 10:27:28 PM »

I feel like I just watched a rave

Now imagine how those dogs must feel.

I love this devlog so fucking much Cheesy

Thanks!

Do you use any external torque on joints, or only joint motors? Technically, a 'realistic' muscle system is only allowed to apply equal and opposing torques to both parts connected by a joint, and it looks like the dogs get some external correction torques occasionally, especially when in the air or trying to stand up. With this body shape, I'm not even sure it's possible to realistically get up on itself when lying on a side (beetles have lots of trouble doing that). One would probably need to slowly extend the upper pair of legs, and then bend them in really fast.

Yeah, their movements are mostly from external torque. I'm mostly just using joint motors to keep tension. I do have a bunch of little systems that modify those external torques in certain ways to avoid complete lunacy, but I'm definitely not being physically accurate. Thanks for the little overview on muscle models btw, I'm not very familiar with how other games/programs do these sorts of things and I was a little curious about more accurate muscles might work! I'm definitely interested in playing around with more accurate movement systems for future stuff.

---

Finally got the pen builder to a point today where it's somewhat usable! Still need to get UI in, which is what I'm working on now, but most of the base functionality is there. The only big thing left to do is to figure out how the hell to allow user control over z-axis placement. I'm putting that on the back burner for a bit...

I'm super super happy with how this is all feeling though, and I'm having way too much fun playing around with it. Lots of little usability improvements have come from those goof sessions though, so it's all "work" ultimately.







ALSO, I woke up to a pretty nice surprise this morning. RPS wrote up a little feature on the game!

https://www.rockpapershotgun.com/2016/05/11/horrific-dogmorphs/

If you're reading this, Graham, thanks! It makes me really happy that people think this project is neat even though it's still in such an early state.
Logged

AlexVsCoding
Level 7
**


Enthusiasm at dangerous levels.


View Profile WWW
« Reply #115 on: May 12, 2016, 12:59:42 AM »

Here, this might help.
Logged

foofter
Level 4
****


MAKE THAT GARDEN GROW


View Profile WWW
« Reply #116 on: May 12, 2016, 08:30:41 AM »

I just wanted to say that I live for cute characters, and I haven't seen anything this cute in recent memoryーshoot, even in long-term memory. Wow. Watching the GIFs just overwhelms me with cute-feeling and makes we want to watch and raise and play with the box dogs.

I'm not a 3D programmer so I can't completely appreciate all the work that went into them, but it seems impressive. And I have no idea why they were jumping around and flying on floating squares, but those GIFs were so surreal and beautiful that I almost couldn't take it. I need to store these GIFs somewhere for safe-keeping when I need a pick-me-up.

The only thing for me was that I for some reason found the box dogs 50% cuter when they had straight legs. Do they have to always be visually bent so much, or could you somehow hide all the torquing details in plain rectangular prisms? Something about the simplicity drove me wild, but I also like them with bent legs, of course.

Can't wait to play it myself! Kiss
Logged


@_monstergarden (game) and @williamzwood (me)
See Monster Garden progress here: https://forums.tigsource.com/index.php?topic=56012.0
jctwood
Level 10
*****



View Profile WWW
« Reply #117 on: May 12, 2016, 08:35:32 AM »

Really really love that everything in the game is still created using the default objects like that green capsule arrow!
Logged

ActualDog
Level 3
***



View Profile WWW
« Reply #118 on: May 12, 2016, 07:58:26 PM »


 Hand Thumbs Up Left Hand Thumbs Up Right

I just wanted to say that I live for cute characters, and I haven't seen anything this cute in recent memoryーshoot, even in long-term memory. Wow. Watching the GIFs just overwhelms me with cute-feeling and makes we want to watch and raise and play with the box dogs.

I'm not a 3D programmer so I can't completely appreciate all the work that went into them, but it seems impressive. And I have no idea why they were jumping around and flying on floating squares, but those GIFs were so surreal and beautiful that I almost couldn't take it. I need to store these GIFs somewhere for safe-keeping when I need a pick-me-up.

The only thing for me was that I for some reason found the box dogs 50% cuter when they had straight legs. Do they have to always be visually bent so much, or could you somehow hide all the torquing details in plain rectangular prisms? Something about the simplicity drove me wild, but I also like them with bent legs, of course.

Can't wait to play it myself! Kiss

Thanks so much, that's all super nice to hear!! I'm sorry to say the straight legs probably won't be coming back. I need to have joints in order for them to actually be able to walk in a reasonable way, and even if I end up binding these guys to a different mesh later on down the line, I'll want to keep it fairly close to their underworkings so that collisions and movement stays as similar as possible.

I will try my best to keep them cute, though!

Really really love that everything in the game is still created using the default objects like that green capsule arrow!

Hah, yeah I'm not quick or good at 3D art, so prefabs are a godsend. I don't plan on having the entire game be made up from primitives forever, but I figure if I can make it look even halfway decent with stock unity shapes, then I should be in a good spot once it comes time to start putting legit models in!

---

More editor work today! Slightly behind schedule but I'm very happy with how it's feeling. 3D editors are tricky!

I just got 3D grid placement for pipes working and I'm so relieved about it. This was honestly really hard for me to figure out how to do, but it seems to work pretty well.



It may not look like much but it took me a bit. Default object dragging is only in the X and Z directions, mapped from the screen mouse movement to the game. That obviously doesn't work for Z movement though.

What I'm doing is raycasting from the camera to the mouse when placing pipes. If there aren't any collisions, then the pipe moves on the X and Y axis as normal. If there is a collision, then the first thing I do is create a huge invisible wall on the same axis and location as the hit pen wall. As long as the player's raycasts keep hitting that wall, the pipe will snap to it and move relative to where the mouse hits it.

Of course, that doesn't help with transitioning between walls. To make that work, I always also check for the second closest collision during these raycasts. If the second-closest collision hits a new wall, I destroy the existing invisible wall and create a new one on this new wall's axis and the pipe now snaps to that!

Relatively straightforward to implement, but it took me a while to come up with and I tried a bunch of stuff that didn't work.

There are so many seemingly tiny usability issues that've come up while making this editor that turn out to be tricky to solve. Really trying hard to make this as usable as possible.

Also, I got in some temp UI so that the entire editor can be controlled without magic hotkeys.



Pretty ugly, but it's nice to get something in. I enjoy turning ugly UI into pretty UI way more than I do creating the UI functionality itself.
Logged

supermega_peter
Level 1
*


cool


View Profile WWW
« Reply #119 on: May 13, 2016, 01:03:56 AM »

You're making some solid progress with this, really great to see!

Just wanted to say just how much I love the DOF effect on dog selection, and also dog-cam.


dog-cam



i love dog-cam
Logged

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

Theme orange-lt created by panic