Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411493 Posts in 69377 Topics- by 58433 Members - Latest Member: graysonsolis

April 29, 2024, 07:30:17 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsBlackfaun - creating a shockwave effect in Unity
Pages: [1] 2
Print
Author Topic: Blackfaun - creating a shockwave effect in Unity  (Read 11590 times)
tfmcmahon
Level 0
**



View Profile WWW
« on: November 04, 2014, 08:56:28 AM »

   





--About--

I'm part of a two man team (one programmer and one artist) working on an action RPG. Blackfaun is a fast paced action-RPG built on the principles of skill-based, challenging combat and replayability. Players will join a faun as she battles through unforgiving, randomly-generated dungeons on her journey of self-discovery. The game’s plot leans heavily on the relationship between the faun and her brother Pan as they traverse the dungeon environments. Full description on our site.




--News--

 In this entry I’ll do a walkthrough of creating a particle system using an animated sprite in Unity. I’ll go through using a 3D package - in this case Modo - to create a short animation using basic dynamics, and then import and apply the sprite sheet in Unity. 

 First, a quick explanation of the upcoming boss character for reference: The Relic Guardian - a static boss that the player will always face on stage 3-3 - will trigger a major plot point when defeated. She’s an important boss to the game! Since she’ll show up on every play through, I gave it my best effort to make her VFX as juicy as possible. The Guardian is a big, slow, hulking golem that swings a huge mace while calling down boulders and releasing powerful shockwaves to thwart the player. She also comes with Dampening Pylons that divert and absorb the player’s attacks.

 I’ll be focusing on the shockwave attack, here’s a work in progress gif that shows the VFX:







 The effect has three main components:



   
  • Boulder splash - this is pure juice layer; these are here to help make the effect feel impactful. Combined with some screen shake and booming sound effects, these should help make both the Guardian and the shockwave feel powerful.
  • Impact cracks - again, more juice. These help add energy and weight to the effect. This is the effect I’ll be going over how in this post.
  • Projectile - the practical part of the effect - this is what deals damage to the player. This component needed to be a ground based projectile to match the overall flavor of the effect. For this component, I used a Unity asset store pack.

 The first step in making the ground shatter was to visualize what the effect should look like. As a VFX beginner, I almost never end up creating exactly what I set out to, but it’s nice to get a game plan going before diving in on a layered effect such as this one. I decided I wanted something that would snake out from a starting area that revealed a glowing energy as it moved.

 Enter Modo. On another project, I had recently been messing around with Modo’s mesh shatter tool which I thought would work well for this purpose. The thought was, if I could use the tool to make a pre-shattered mesh, I could then use some dynamics tools to push them apart gradually to achieve a “growing ground crack” look.

 Let’s hop in to a Modo scene and make some sprites:



 Starting off, we’ve created two cubes and a camera. The larger bottom cube will act as the ground collider when we get to the simulation stage later on. The smaller, slab shaped mesh will be the one that we shatter and create our effect with. For the camera, I made a top orthographic view, since we’re only interested in the two dimensional information from the simulation, as we’ll end up with a sequence of renders that we can plug into a Unity particle system as a mesh-rendered particle. We set the render dimensions at 512 wide by 256 tall. It’s large, but we can always trim down later. To note, I did this at a 2:1 ratio so that we could get a directional effect. I may have been able to use a square, but the thinking was that I’d be able to aim it more easily as a rectangle shape (more on this when we get into Unity). With the basics in place let’s shatter …



 Here’s the location and dialog window that come with the Uniform Shatter tool. After some experimentation, I chose Uniform Shatter because it was the most straightforward of the options while creating the desired shapes. For the shatter, I used all default settings except the number of pieces. I messed around until I got what I thought was a good balance of readability and detail level. Pressing play …



 … you can see the fragmented mesh pieces. Looking good so far, but it needs some more action. Right now the pieces are all very stiff looking since they all have around 4-6 boundary faces. They need a little bit more organic-ness to them. To achieve this, we can apply some noise to the meshes. However, we need  some additional subdivisions in our shard meshes so that the new detail will register. Modo has a Fractal option that comes with its Smooth tool, which will kill two birds with one stone - both adding subdivisions and noise detail to the shard meshes:



 We’ll start by subdividing using the Faceted option with a fractal value of 50%. The Fractal value will give us some jaggedness while the Faceted option will maintain all of the sharp edges of the neighbor-facing sides. After that, I’ll switch to Smooth mode, subdividing again with a Fractal setting of 50%. In the second image above you can see the results. In the end, we’re adding a little bit of character to the edges of the shards. Also, Modo automatically assigns a new material to the edges of the shattered mesh, what a handy feature! Okay, we’re all set up to start dynamics to create our gradually spreading crack. Let’s add a Solver and a force:



 We’ve added a Solver which will control gravity and allow us to … solve the scene. We’ll set the ground mesh as a Static Rigid Body, and the shattered meshes all as Active Rigid Bodies. To get things moving around we need a force. In this case a Radial Force will suit our needs - we’ll animate in a line in order to push the shattered pieces away as it moves over them - nothing fancy here. Now let’s prep for animation and tweak some dynamic values:



 Above, from left to right: First is the Radial Force moved into position in a perspective view for reference, ready to be animated across the shards (disregard the shading errors in this screenshot). Next, we give our Radial Force a value of -150% so that we can push the other Active Bodies away. On the right, for each active shard body, I’ve reduced the Bounce value and upped the Friction value to simulate heavy, slow movement. Lastly, I set the Mass Source to Local Mass with a value of 1kg - I arrived at these settings through trial and error. Essentially I was tuning the simulation so that the shards felt heavy and massive while making sure they still moved enough to register from an estimated in-game camera. All that’s left before solving is to set a couple of keyframes on the Radial Force …



 8 frames of pure ground cracking mayhem! You can see the force pushing the shards away as it moves past. To note, this was a super quick solve! Again, disregard the shading errors on the meshes, I’m not sure what happened here - but it doesn’t matter for the render since all we’ll need is an alpha:



 We’ve assigned an alpha render pass to each material - the shards, the edges of the shards, and the ground plane.  Here you can see the ground plane alpha, which reveals as the shards move across it.  There are some shading errors happening here because of some non-planar quads which allow the ground to show through, but I think it adds to the effect so we won’t mess with it. Now we can take our 8 frame animation into a compositing package of our choice, I’m using After Effects this time around:



 I ended up just using the ground alpha, again through trial and error. The frame composites are essential a light blueish solid layer masked out by the alpha we generated. It has additional layers using the same alpha but with blurs and matte chokes. We ended up with a sort of blooming effect due to the blurs. From here, I cleaned up the left side of the frames as we don’t want that blue vertical line, we need to assemble the frames into a texture sheet for use in a Unity particle emitter.



 The 512x256 images assemble neatly into one 1024x1024 laid out as two columns and four rows. As before, we can resize as needed! The sheet goes left to right, top to bottom. Almost there, on to Unity:



Here we are in Unity, finally. We’ve created an emitter and are tweaking settings: Start Delay is set to a value of .25 because we want the crack effect to appear just after the boulder splash component starts so that it has a bit of time to shine on its own after the boulders die out, but isn’t seen in isolation. The rest of the settings in the top section are scene dependent - size, lifetime, etc. For Emission, we’re doing 1 particle as a Burst right away. If we used the Rate setting instead, we’d have additional built in delay which makes the timing of the particle birth more difficult to control. I find that using Start Delay in combination with a Burst at time: 0.00 gives great control over timing of the emitter. The Color over Lifetime is just a fade in/fade out black to white to black alpha.

For Texture Sheet Animation, we’re plugging in the tile values that we created when we assembled the texture sheet. I made 2 columns (X value) of 4 rows (Y value). So X = 2 and Y = 4, Unity will play the animation going left to right, top to bottom - just as we see it in the compositing package. The rest of the settings in this section are defaults. For the Renderer, we’re using the Mesh setting which is using a flat plane with a 2:1 width to height ratio (this matches our render settings from back in our 3D package). The exact dimensions of the rectangular mesh don't matter - we can control that with Start Size in the emitter - so long as it's 2:1. I’m using Mesh as the Render Mode because I find that meshes can be ‘aimed’ whereas billboards are always camera facing.

Voilà! Here it is again in game again:






That’s it for this post, what do you guys think? How would you have done it? I’m still getting used to writing down my workflow so if anything is unclear or confusing, let me know!



--Goals--

I want to present some of our development process here in the hopes of improving at our craft via explanation and feedback. I’m also planning to get involved in the feedback process on the other side as well - hopefully I can provide useful feedback to others Wink. Let me know what you think!
    



--Screenshots--












--Gifs--

Timberwolf Idle cycle title=Timberwolf Idle cycle




   
« Last Edit: January 13, 2016, 10:31:54 AM by tfmcmahon » Logged

tfmcmahon
Level 0
**



View Profile WWW
« Reply #1 on: November 04, 2014, 09:04:26 AM »

Here's my GUI write up, copied from our devlog:

We just finished a big GUI overhaul. The following is my thought process while making big edits!

I want to start off by explaining a little bit about why we’re working on this project — it will hopefully help explain how we got to where we are with the GUI. Why make a game? A few reasons why I took the plunge (YMMV):

•Connect with people via providing an experience.
•As a game consumer, it is natural to want to make games.
•Making things is rewarding.

I love playing games of all kinds – traditional RPGs, Arcade beat-‘em-ups, 2d fighters, Metroidvanias, tactics, racing, RTS, Moba, the list goes on. I’ve wanted to make a game for many years. I won’t lie, I’ve tried a number of times with varying degrees of success. I’ve mostly participated in game development as a freelance artist, but this time I wanted to be behind the wheel. What kind of game do we want to make? After working on a string of 2D projects I really wanted to try out something in 3D since that’s my primary skill.

We instantly agreed upon an action RPG. We both share a love for the genre. We feel like we have a good grasp on ARPGs after logging so many hours playing, so we thought we could keep the scope under control. It’s also no secret that we are really into the Diablo franchise. I have to be honest here, I really want to work on a project similar to it.*

When we were first mocking up the GUI, the thing that came naturally to us was using health globes as resource measurers. They exist in a number of popular games in the genre (Torchlight, Path of Exile, Diablo, to name a few).


(pretty globes)


Our thinking at the time was that we wanted a very low barrier to entry to the game via the GUI. We wanted players to immediately know exactly what kind of game they are playing, know the controls, know that they’re killing monsters and finding loot. One of the primary advantages of them is that they are a very fast subconscious read for the player; they communicate approximate resource values very well. Using existing conventions is a powerful tool! Plus semi-recent indie games used it to great success! I’m looking at you, Path of Exile! Wink

But, if they exist in a lot of games in the genre, isn’t it bad to just reuse the same trope? Well, in short, yes. At least the way we executed it. Through feedback we’re finding out that people aren’t crazy about using conventions that are already established in popular games in the indie community. I tried a number of layout and globe configurations but ultimately we ended up too close to existing games.



(oldUI)

 
With the reboot we set out to address some of the criticism while sticking to our roots. On to the GUI changes:

•We decided the scrap the globes entirely
This was the toughest decision for us. At first, when we received negative criticism we wanted to stick to our guns. We felt like we would be parting ways with one of our biggest influences while also losing the immediate familiarity that comes with it. Frankly, we also just really liked the way it looked. However, as we were implementing and testing more and more, we found ourselves continuously pushing the game to feel more and more arcade-y. It just made the most sense with the mechanics of the game. While the globes don’t necessarily conflict with the arcade genre, we felt like we could present the player’s resources in a different form while maintaining similar subconsciously readability I mentioned before.

We took a page out of the beat-‘em-up book and went with an elongated health bar. Since health is the most important resource — we have no character classes that prioritize mana** — we shifted the health display to be front and center.  We also moved to a Streets of Rage style temporary health display which overtakes the health display as the player builds up said temporary health. I also applied some of the behind the scenes technical effects to the new globe shape so that we maintained the sweet look.***



(Shoryuuuuuuuken – I mean, high five, Axel!)




•We tweaked the offhand mechanics
Early on in development, we decided to eschew having hordes and hordes of enemies in favor of more close-quarter, precise combat.**** We wanted enemies to be difficult mechanically rather than through sheer number. While this concept in and of itself doesn’t necessarily push us towards arcade-y-ness it helped us realize that having a mana system which functions on increasingly large numbered integers (think a 500/500 mana pool) wasn’t working. We previously had all offhand items function as ‘glyphs’; the player would right click to cast an AoE spell which would effect enemies negatively and the faun positively. These glyphs would consume mana when cast.

We decided to shift over to a cooldown-based system for offhands that simplifies the mechanic. We gave the offhand a parent mechanic that gets augmented by each new item, rather than each individual offhand item contain a unique mechanic (as before). That mechanic is a push. The player now has a little bit more freedom to evade enemies without having to kite them. We feel like this frees up some space in the enemy movement speed department – we can make enemies a little quicker knowing that the player has a little more soft mobility*****. Now the faun’s offhand functions with no item and regains charges over time.





•We ditched the symmetry of the GUI
 Finally, having the twin statue motif was too close to Diablo. Looking back, I dun goofed! I dropped Pan for the faun’s UI and vice versa. Pretty little rocks took his place. My aim for this edit is to help our GUI differentiate even more from other games in the genre.

In closing, I’m optimistic that we’ll be successful with this version of the GUI. We lost some of the prettiness of the globes, but in the meantime we simplified things and reworked some mechanics*****. Lastly, we left the center part of the GUI the same.  We’re okay with how money, candles, and keys are displayed. We also think that the options and inventory buttons are the most elegant solution for the functionality they provide.



(Here it is in all of its sparkly glory!)


Through all of these changes, I’m hoping that we will be able to set our project apart from others while still providing some familiarity to players.Thanks for delving deep with me on our GUI! Love it? Hate it? Let me know in the forums!

*Pardon my tenses in this section, I still feel all of these things! Also, bear with me, I’m still green at this writing thing.
**Or any at all, for that matter. Scope is key!
***Huge credit to Simon Schreibt (@simonschreibt), his invaluable blog on game art tricks is here(http://simonschreibt.de/game-art-tricks/)
****I really wanted to write “skill-based” combat here, but just because there are more enemies doesn’t make things any less skill intensive. Just … different!
*****Here we go with the skilled-based thing again.
******Hopefully for the better!!

« Last Edit: November 08, 2014, 06:54:15 AM by tfmcmahon » Logged

tfmcmahon
Level 0
**



View Profile WWW
« Reply #2 on: November 08, 2014, 06:55:16 AM »

Here are some animations of one of our forest enemies, the Timberwolf:

Timberwolf Idle cycle title=Timberwolf Idle cycle  Timberwolf Idle cycle title=Timberwolf Idle cycle  Timberwolf Idle cycle title=Timberwolf Idle cycle

He's our basic forest enemy that'll appear in multiples and chase after the player.  They'll also have a fear on death mechanic that causes them to flee if a nearby enemy is killed. They also give a howl when alerted.
Logged

MereMonkey
Level 2
**


Creator of Music


View Profile WWW
« Reply #3 on: November 08, 2014, 07:00:26 AM »

This is looking awesome Tim! Can't wait to see more of it!
Logged

My Site  -  My Twitter - *GASP* MY SPINACH PUFFS!
tfmcmahon
Level 0
**



View Profile WWW
« Reply #4 on: November 15, 2014, 08:56:26 AM »

Quote
This is looking awesome Tim! Can't wait to see more of it!

Thanks!  Hand Thumbs Up Left

Another set of animations for this week, the Goblin Dreamsnatcher.  She'll run around casting darkness and shooting projectiles at the faun.



   

and here's a taunt for fun

Logged

HopelessComposer
Guest
« Reply #5 on: November 15, 2014, 05:15:14 PM »

This is some nice, professional looking work. Don't know why you're not getting more comments. I like the way your forest looks, and your models are looking cool, too. Nice work!
Logged
tfmcmahon
Level 0
**



View Profile WWW
« Reply #6 on: November 16, 2014, 02:20:39 PM »

Thank you, HC! I appreciate the kind words.  Cave Story
Logged

Netsu
Level 10
*****


proficient at just chillin'


View Profile WWW
« Reply #7 on: November 16, 2014, 02:41:58 PM »

The models are awesome and the environments remind me of Diablo 3, which is a very good thing in my opinion Smiley
Logged

Mittens
Level 10
*****

.


View Profile WWW
« Reply #8 on: November 16, 2014, 02:42:05 PM »

I just made and animated a wolf for my game,
yours looks much better, good work
Logged

tfmcmahon
Level 0
**



View Profile WWW
« Reply #9 on: November 22, 2014, 08:16:35 AM »

Quote
Insert Quote
The models are awesome and the environments remind me of Diablo 3, which is a very good thing in my opinion Smiley

Thanks! D3 is definitely a big inspiration.  Hopefully there's an audience for more of it, though if not, I love doing this stuff.

Quote
I just made and animated a wolf for my game, yours looks much better, good work

Your game looks pretty sick, no sweat  Hand Thumbs Up Right



We've been super busy getting a playable build to IndieMega Booth for PAX east in 2015. Nothing like deadlines to motivate a team. Coffee Hopefully I'll have some gameplay footage at some point.

Anyway here's another set of animations for the Goblin Greatsword (working name):




This guy hulks his big sword around the thicket (walk) until he can muster enough strength to run (run) at the player and heave the sword at her (attack1&2). Needless to say all that exertion tuckers him out, so he has to rest for a bit (tired). Now's your time to strike! (death).
Logged

EdFarage
Level 2
**


I can upload avatars


View Profile
« Reply #10 on: November 22, 2014, 08:30:13 AM »

everything looks great about this game, you have my attention
Logged
HughSJ
Level 1
*


'allo there


View Profile WWW
« Reply #11 on: November 22, 2014, 10:45:16 AM »

Really impressed you guys have managed this volume of work with only a team of two people, it's looking good. I'll pop back in later and give some proper feedback once I've had a chance to read the full posts  Gentleman
Logged

tfmcmahon
Level 0
**



View Profile WWW
« Reply #12 on: November 22, 2014, 12:21:51 PM »

Thanks. I've been lucky enough to have some sick freelance help, specifically in the animation and environment art departments so that's helped speed up asset progress.  We've been plugging away since mid 2013 as well Wizard. I'm definitely late to the TIG party, but better late than never!
Logged

Derek
Bastich
Administrator
Level 10
******



View Profile WWW
« Reply #13 on: November 22, 2014, 01:09:07 PM »

Beautiful artwork. Just a suggestion: you can post your screenshots at full resolution and people can click them to make them fit in the boundaries of the post.
Logged
BSKgames
Level 0
***


View Profile
« Reply #14 on: November 23, 2014, 06:49:00 AM »

Looks really amazing! I hope to see full game asap :D
Logged
tfmcmahon
Level 0
**



View Profile WWW
« Reply #15 on: November 23, 2014, 07:26:06 AM »

Thanks for the heads up, I edited the screenshot code.

BSK -Thanks! We're going as fast as we can. We've got a hard deadline in March (PAXEast) so we'll have a demo in some form by then.  Smiley
Logged

tfmcmahon
Level 0
**



View Profile WWW
« Reply #16 on: December 06, 2014, 08:14:23 AM »

Hey all, I'm back with some updates after taking some much needed time off. I spent some time with family while we were on holiday here in the US (hope everyone had a good one!)

Back to it. I mentioned in my UI blog post that we changed the offhand mechanic into a push effect. Check out the visuals:


Working on this project has really tested my limits in the VFX department, I didn't have a lot of experience with effects coming in and I have to admit that it has been challenging trying to achieve pleasing results. I feel that effects will continue to be the biggest hurdle for me to overcome in order to get the game to unified, polished state.

For this effect I settled on using a sphere mesh with a refraction shader on it to emulate a shock-blast effect as the hero. It look while to realize that the refraction shader was being darkened by Unity's basic fog effect- so much so that it made the effect look weirdly dark. After tons of tweaking, I decided to remove basic fog from all of my scenes and relight them to compensate rather than try another effect. I made this decision because refraction shaders would become nigh unusable with basic fog.

Here it is again being used on an enemy :lightsaber:. We added a little bit of a time slow effect when it affects an enemy - we made need to tone it back a bit, but there it is. (large file) :


Lastly on this mechanic, I'm super happy with how it feels in testing.  It really adds a great escape mechanism to the player's tool box. While playing in later levels movement really felt a lot smoother overall - I just felt like I had more control over the enemies and environment.



Wrapping up the regular forest enemies with the Goblin Brute (working title):



This guy was a "palette swap" of a later enemy as a test from earlier on in the project. The two enemy meshes share the same skeleton and thus have similar statures. I tried this in order to save time/money on animations, since they both have the same joint setup they can reuse common animations (e.g. walk, run, roar, attack, etc) and they each have a couple of unique animations that the other doesn't use for variety's sake. Overall, the experiment was successful, but not without its faults.



We've been wrestling with how to present the controls of the game to the player while being minimally intrusive. Currently we are using an overlay that looks like this:


It appears upon game start and then fades out after a few seconds with an option to turn it off in the main menu. This solution comes with some pros and cons - I go back and forth on it.  Any thoughts?




Final update for today - I'm super excited to say that we'll be at PAX East in March 2015. We recently were accepted for a 10x10 space!! We're hoping to time the trip to Boston with our Greenlight campaign. We've got a long way to go but I think we can make it happen. Time to start prototyping the booth.
Logged

tfmcmahon
Level 0
**



View Profile WWW
« Reply #17 on: December 13, 2014, 07:21:54 AM »

I've got some forest boss GIFs for a quick update this week. You'll have to use your imagination for the VFX for now Wink:

Ide:

Fly:

Radial attack:

Radial attack alt:

Summon:

Summon2:

Here's the plant that she'll summon which blocks player shots and explodes based on proximity:
 
I...am...Turok!:


I apologize for the darkness of the GIFs, I couldn't get her to look perfect on white but hopefully the form is conveyed. She'll have plenty of fairy dust and wind blasts in game, but I can't get those (quickly) out of my 3D package.
Logged

tfmcmahon
Level 0
**



View Profile WWW
« Reply #18 on: January 10, 2015, 08:35:35 AM »

...and we're back after a looooong holiday break. Happy new year everyone! Hope it's another great one for all! Toast Right

Status of the project: We've implemented everything for our second tileset except sound effects. After that it's bug fixing and polish. That'll put us up to three (roughly) completed tilesets; where we had planned to be for our demo.  We've fallen a little bit behind on boss encounters and equipment, but we'll still have a decent amount of content for our demo leading up to Greenlight and PAX. So, hopefully sooner rather than later I'll be able to post the demo!!! Exciting! (also nerve wracking Droop)

Anyway, here's a temple enemy for this week, Temple Shade (working). Animations from top left to bottom right

Idle, Move, Attack1 (firing a homing shot), Attack2, Channel (leashes the player), and Death:

   


Here's a shot of the channel in game to give you an idea of the final visuals with effects:



This guy will act as a "leasher" in the Temple. The idea behind the mechanic is to dissuade the player from kiting enemies 100% of the time. While the shade channels, he doesn't otherwise attack or damage the player.  The leash changes color from light blue to red as the player moves further away from the shade, signaling harm. If the player moves too far away, the leash breaks, damaging the player.

In other news our composer should be uploading some of the sweet tracks he made for us shortly. Also, I've made some headway on booth crafting for PAX - I'll be posting pics of our loot as soon as I get it.

Logged

Rebusmind
Level 3
***


Game Designer


View Profile WWW
« Reply #19 on: January 11, 2015, 11:13:40 AM »

Cool project. I have to admit, it's not really my type of game, but I will follow to see more of those awesome animations. :D
Logged


<a href="http://www.indiedb.com/games/life-on-mars" title="View Life on Mars on Indie DB" target="_blank"><img src="http://button.indiedb.com/popularity/medium/games/65022.png" alt="Life on Mars
Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic