Posts Tagged ‘fox’

Epistory: Automating Action & Reaction

Monday, September 7th, 2015

A tale of candy distribution.

Introduction

Most games can be reduced to a series of actions and reactions. Today I would like to share with you a way to facilitate iteration and expansion of these interactions. It will sound obvious to a lot of people but I would have loved to see this kind of example 6 months ago. When I was not yet used to component based mechanics.

It all started with a simple request a few months ago, we had just designed & implemented the scoring system and we needed items in the game world to be able to give points when activated. Easy, I wrote a small script which would be attached to objects that had to add points when activated. Controlled by our item’s base class, it would be called automatically.

The buildup

As time went on, that simple “points giver” script was updated to include various behaviors like prefab spawning, door unlocking and so on. It worked well but it was not very flexible. So I changed the structure to include a parent class to have a common entry point and place each behavior in a child class.

2015 09 02 17 25 18

It’s not standard notation but you can see the rewards and the items have a base class, and only these base classes interact with each other. The same kind of effect could be achieved with interfaces but I prefer to have a default implementation.

The true power of this structure lies in the modularity. Every trigger or actionable item in the game works with any reward and you can place any number of reward in a game object. The most basic action/reaction you can do is simply “collider – trigger – reward”. The player walks in the scene and something happens (tutorial message, cinematic, …).The possibilities are exponential and a new reward behavior is very easy to add.

Polish & additional features

Over time, features were added. Like the possibility to set a delay between the action and the reward. Camera travelling firing rewards at event points… What started as a joke -“reward” as in skinner boxes- is becoming a running gag: we’ll call this one “reward_kill_player”.

I recently did the same kind of structure for visual effects. A few key points (creation, destruction, hit, …) are exposed via a base class. You just have to derive from it and you get all the hooks that an artist would need to handle animations or particle effects.

Conclusion

The system is currently powerful enough to allow our designer to create our whole in-game introduction & tutorial with only the reward system. Looking back my only regret is that this system was not put in place earlier to have more of the game relying on it. Also, calling it “reward” when it’s in fact a “reaction” was a bit shortsighted.

I can share some sample code if some of you are interested. I leave you with one of the more complex interaction that we can produce.

main schema

P.S.: As a very tangible reward after a long wait between news here’s a few free gifs. Both features were added this week:

- One of the first iteration. Nothing special…

flower power 2

 

- One of the last iteration. Circular pattern, grows from the middle and not all of them at once.

flower power 3

 

- Black mist that will block your path (first iteration, polish will come later)

ink fog

Epistory @ Gamescom 2015

Tuesday, August 4th, 2015

Hi Folks! 

After months of preparation we’re ready to unleash our demo of Epistory and let you play it at Gamescom 2015.

Come and join our adventures at Hall 10.1 Stand E040c. 

 

social_announcement

 

IMG_3147

Visit our stand and get the official bookmark of the game

 

IMG_3148

This is what the wall of our booth will look like

 

IMG_3153

We are ready for Gamescom!

Follow us on Twitter and Facebook to get day to day news about our team @ Gamescom.

@FishingCactus
@epistorygame

https://www.facebook.com/fishingcactus

https://www.facebook.com/epistorygame

Epistory: Fluffy Friday #3 – Burning Brambles

Tuesday, June 23rd, 2015

More on IndieDB

Bite sized news for small stuff. Today: Burning brambles.

fluffy_3_header

Welcome to another installment of our fluffy sweetness. If you missed our Critters gifs last week you can check them here.

Ok! To recap, we had a world quite pleasant to walk in, decent levels and dungeons, epileptic Critters… and a girl riding a giant fox fighting against monsters and corrupted nature. Fighting how? With words. I mean MAGIC FIRE WORDS!

fluffy 3 burning brambles 2 

So, here’s the fire animation, shown in our previous paper on art direction, in action. Yes, we know, burning the forest is bad but these brambles were evil, very very evil.

fluffy 3 burning brambles 3

fluffy 3 burning brambles 1 

Imagine you’re hanging around with your fox and brambles block the road: burn them! There are monsters on your way out from the dungeon: burn them! There are cute critters… wait… stop. May I draw your attention on the fine and not final spell forging animation before the girl sets the world on fire?

Hope you felt the magic. See you next week for another incredible Fluffy Friday!

Have a great week.

Epistory: Fun with bones in Unity

Thursday, June 11th, 2015

More on IndieDB

Discovery of what unity can do in terms of jiggly bones and overriding animations.

The inception

A while back, after slowly becoming mad tweaking animations and movement behavior on our avatar, I decided to have some simple fun with Unity. See where the limit was and what’s possible in a certain domain. Since I was obsessed with the character’s animation, my attention was driven towards improving what our animator gave us in terms of natural movement. Even though the animations were quite good, I wanted some physics madness in there. So I went on a quest to mess with the bones of mecanim.

It turns out it’s rather straightforward to activate the so called “jiggly bones”. A few changes in your model before export does the trick. It does however require a great deal of value tweaking and physics engine know-how. You may follow this tutorial if you want to try it for yourself.

Here’s what I could do as a quick ‘n dirty test. This will *not* be in the game. Even if the effect could be nice, It is at the bottomest bottom of our priorities.

jiggly bones 350px

 

But doing this as a playful “what if” helped me learn a lot about how Unity works with animations and physics. Even better, I would never have thought of what I’m about to show if I hadn’t gamed the system.

A few days later, the movement and animation finally polished, I found one last thing I could do, turn the head of the fox in the direction of where the avatar will go next. Providing a subconscious feedback on the movement. Using the head bone and overriding the animation, it should be possible. Right?

epistory fox head move

 

It turns out it is. This gif was taken when a bug prevented the fox to move or turn so you can clearly see that the head orientation is overridden (and a bit disturbing, sorry).

How to do it

First, you have to get a reference to your head bone:

private void Awake()
{
  HeadBone = /*find the headbone in the hierarchy*/.transform;
}

There’s nothing to do to your model. All you have to do is use the LateUpdate function which is called afterthe internal update of the animations.

private void LateUpdate()
{
  Quaternion
    look_at = Quaternion.LookRotation(Direction, new Vector3(0.0f, 1.0f, 0.0f));
  look_at *= Quaternion.Euler(-90.0f, 0.0f, 0.0f); // Our models are rotated
  HeadBone.rotation = look_at;
}

You can do all sorts of crazy stuff with this.

The result

fox turn head subtle 350px

 

Here you can see the result in game. Slowed down on purpose to make sure it’s seeable in a gif. The effect is very subtle but you can see that the head will always point to the right direction (almost instantly) and the body follows soon after.

The next time you are frustrated with a particular task or simply bored out of your mind after a day of repetitive tweaks. Do yourself a favor and just play with the tools on your workbench. Who knows what kind of gem you’ll unearth.

}