Posts Tagged ‘videogame’

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.

}

Epistory: Fluffy Friday #2 – Adding critters.

Tuesday, June 2nd, 2015

More on IndieDB

Bite sized news for small stuff. Today: Adding critters.

header

After our world building, level crafting & dungeon inaugurating, we were left with a grim realization. For all the beauty in display, we were missing something crucial. We had a beautiful but empty painting. A canvas ready for: Life! *crackling thunder*

critters idle2

So, here they are presented with their idle animation. Minding their own business until you come along:

critters run2 text2

They’ll spawn in small groups where it’s relevant and flee when you come close. Now that the system is in place we could add more variety if we find the time. It’s not completely done but I can already tell you it adds a lot to the look & feel of the game.

We’ll show more soon and I wish you a nice week.

Epistory: Fluffy Friday #1 – Tile appearing

Tuesday, May 26th, 2015

More on IndieDB

Bite sized news for small stuff. Today: Tile appearing.

header

Today I present you a new kind of post that we will try to do regularly. As an introduction I’ll simply say that we have a lot of small juicy stuff to show that would feel lost in a bigger article. It will take the form of a few gifs or pictures and a bite size article. The topics should range from fluffy things to weird but funny glitches and all that stands in between: gameplay shorts, animation tests and so on. Now that it’s out of the way, let’s continue to…

Fluffy Friday #1

During your wandering in the world, you will slowly uncover more and more of it. Akin to a blank page filling up with words. We wanted that event to be enjoyable to watch because it marks progress in the game. So we did something like this:

tiles reveal

While this gif is not the final version we had at the time (I can still see a few bugs) there was no sense of accomplishment. Just another chunk of land coming in.

So we decided to wait. Once the gameplay mechanism is in place, your priority shifts to another gameplay element. Polish can come later, right? Yes! And we did a pass of polish on that system along with better graphics overall, I’ll let you see the differences for yourself.

tiles reveal2 part1tiles reveal2 part2

There you have it. Of course the final version could differ slightly from this and the gif doesn’t show the best framerate and color. I hope that this is already enjoyable and that you will want to see more posts like this.

Epistory: Handmade vs randomized level design in Epistory

Tuesday, May 26th, 2015

More on IndieDB

The constant dilemma between more control (but time consuming) and more automatism (but never perfect) in Level Design, and how tools can help.

The problem

As in most puzzle / adventure games, Epistory’s level design, is designed manually from the world layout to the smallest puzzle. But to save time and money, we need the automation of everything else, like generic and repetitive patterns or effects that give life to the world. That is what this article is about: the level building of all the things that are not unique or designed for a specific purpose.

A good example of that is the placement of every tree in a vast forest. We know what we want (a group of trees), where (a delimited zone), and how (dense and diversified). So we have parameters that could drive a procedural generation of trees. By the way, game engines have similar tools for vegetation generation.

But in the same time, we want to draw a path in that forest with a specific level design, and the trees’ shape and position influence that design. This is where lies the dilemma: a full control allows us to place each tree as we want but takes a lot of time, and a full procedural gives results that will never be perfect.

If you want a metaphor – everyone loves metaphors – imagine you are drawing a diagram or taking notes. If you use one black pen, the result is not as clear as if you use a color code. But if you have full rainbow pens at your disposal, you are always tempted to choose the right color for the right thing and, inevitably, you lose time. Limitations can have a positive effect, be it saving time & money or coming up with creative solutions.

Our tools

Before explaining our solutions to that problem, I need to talk about the tools we are using and a bit of our level building workflow. Epistory’s level design is tile based and we use the Tiled editor, which is perfect to prototype, create and edit tilemaps really quickly.

The essential criterias when choosing a tool are its usability and the level of control it allows (or in reverse, its constraints). Of course there is also the cost to buy or develop that tool, but I will not talk about that aspect here as I am focused on design (plus Tiled is free and Unity plugins are relatively cheap).

You can get used to Tiled pretty fast and come up quickly with a rough prototype. It saves you time while doing repetitive tasks and is easy to edit. In sum – as long as you stick with tiles – its has no big usability flaw.

GD_article_img_1.png

So I start by creating the map with Tiled. But the game is in 3D and developed on Unity. So here comes theTiled to Unity plugin that uses the exported tilemap to generate the level in the Unity editor. It simply places the right 3D asset at the right place.

GD_article_img_2.png

For more specific features, we modified the plugin source code to add more functionalities. An example: when you progress in the game, new zones of the world will appear. So we need to be able to delimit those areas. The easiest way to do it – from a level designer point of view – was in a specific layer on Tiled. So the plugin can also add the generated tiles to a tile manager, and determine to which zone it belongs from that “Zones” layer.

GD_article_img_3.png

Finally, I place interactive elements and puzzles manually in Unity. It is easier and more editable this way because they all have specific behaviors and parameters. Unique decors used as landmarks and localized visual effects are placed the same way at the very end.

GD_article_img_4.png

Some solutions

Controlled randomness
In my opinion, the best solution to the “control vs automatism” problem is the more obvious one: a random (or procedural) generation in the editor, which is corrected manually only where it is needed. Note that the random aspect only exists in the editor, it cannot be regenerated in game. As long as you do not change everything, that controlled randomness has a good time / quality ratio.

For a concrete example in Epistory, I will use the example of the forest again. I use the random mode on Tiled to randomly paint with elements from a selection. Then I change some of them manually in Unity if it creates strange looking patterns. I try to have a continuous border for smooth collisions. And I place a few mushrooms, again with a bit of randomness.

Localized procedural
Another solution is to use a more ordinary procedural generation but limited to a very few parameters and/or a small area. Here the randomness happens in game, but not on the key elements of the design. That localized solution allows a correct placement at macro scale without having to place small elements one by one.

In Epistory, we use that method to spawn critters. Potential spawn points are defined and only some of them are chosen a game start. They are not always at the same place but always at a suitable one.
There also are large zones in which groups of particles are randomly spawned. That lets us quickly define the areas in which you will find butterflies, fireflies, fog and so on.

Item variations
Finally, only one attribute of an element can vary randomly. This way, you can use item variations that keep – for example – the same size and function in game but can look a bit different. You do not have to bother about the small variations if they do not affect the design.

On Epistory, we made little use of that but we consider adding variations like size and texture for trees and rocks, rotation on tiling textures, ripped paper effects on some tiles, and so on.

I am sure there are plenty of other solutions and applications to them. I hope that you found those ones interesting and that they could be useful elsewhere.

Thanks for reading.
More on IndieDB

Epistory: Lessons learned while switching to Unity

Thursday, April 16th, 2015

More about the game on indieDB

epistory_c_to_unity2_455px

 

Paradigm Shift

When we started working on Epistory, we had to choose whether to use our proprietary engine or not. For reasons that go beyond the scope of this post we decided to go with Unity. While the prospect of working with a tool as streamlined as Unity was stimulating, after five years working in a workflow dominated by C++ my C# habits were rusty if not inexistent.

After some time with C# I remembered and saw some of the neat tricks you can do with this language. I also received and read a few tips for Unity itself that can do wonders to keep performance high and coding time low. I will keep this as code free as possible and direct you to the relevant documentation -if necessary- to get all the juicy details that would needlessly blow up the length of this post.

Stay organized

While Unity is very flexible and lets you do basically anything, it can be a blessing as well as a curse. If you don’t force yourself to organize the project and the code from the start, it will become messy really fast. One performance hit that is negligible at the beginning but can grow into a big problem later down the road is the caching of your GetComponent(). Basically each time you ask for a specific component in a GameObject, Unity will go through its component list. In most cases you can safely cache the result and keep a reference. If you start adding components at runtime you’ll have to decide whether to cache it or not.

Leave no warnings behind

Even though most programmers will treat warning as error -or at least minimize the amount of warnings- it bears repeating. The more serious warnings are almost always a bug waiting to be triggered. That is even more important in C# because of some leeway given to the developer. For example: you can hide a virtual function if you don’t explicitly add the override keyword to the sub-class function declaration. And a warning will remind you to make your intentions explicit. The difference between overriding and hiding is that the overridden function will call the runtime type and the hidden function will call the compile-time type.

False friend

The switch statement is a good way to keep the code readable. But in this case its behavior is slightly different in C#. You cannot fall through to the next case section. You have to place a break/return/goto… However, there is a walkaround. You can use something like “goto case 1;” to jump to another case. More details here

Missing Link

LINQ can be a powerful tool to interface a program seamlessly with a database. Even though its syntax can be off putting, you should at least try it before you leave it. You can use SQL-like statements to query an xml file, for example. You can also use it to perform operations on IEnumerable (a.k.a. Arrays and Array-like) classes. All you can eat buffet here

 screenshot_epistory_prog2_455px

Daily routine

Coroutines can be achieved in pure C# but Unity made their use very easy and intuitive. It is akin to starting a new thread without the problems associated with thread safety issues like concurrency, race condition & deadlock. The coroutine also behaves like any other member function. It has access to other functions and member variables.

I will leave the implementation details aside (see links below) but know that it can easily be used to provide easing to an object over time or calculate the next score increment. Another, more advanced, use-case is a very elegant way to implement a state machine. More information here and there and state chartshere

Eventful delegation

Event firing and registering is built into the language. Events & delegates are two sides of the same coin. The delegate provides an equivalent to an array of function pointers and the event is the message being sent. This makes for painless event driven programming and we all know how much a game can be event heavy.

This could make a post topic by itself so I leave you with the documentation and an in depth tutorial/study

Epilogue

There you have it. A non-exhaustive list of tips, tricks and gotcha. Thank you for reading and feel free to ask any question in the comments.

Weekly update #69

Wednesday, April 8th, 2015

Weekly Update #69 – The Ecosystem

Read it on the forum

Hello everybody,

Sorry about the late update, it was meant to be posted Friday but we were a bit busy… anyway, let’s have an overview of Creatures Online’s ecosystem today! 

Here’s how the player can interact with ecosystem:
- Tap on a critter to wake it up
- Critters can’t be drag & dropped directly, but it is possible to move them like decoration elements after clicking on the corresponding icon on the interface allowing you to move / sell agents
- Small critters (such as insects) generally can’t be interacted with
- …but some can still be drag and dropped (for example, fishes)
- …and you can still tap on some other ecosystem-related things, such as bee nests

And here’s how the Norns can interact with it:
- Even though the players can’t interact with every insect, Norns can. Sometimes they hit or eat some insects, which you can reward or punish.
- Flowers, mushrooms & grass patches grow naturally and are randomly placed.
- Ecosystem varies depending of the environment. For example, the Hatchery consists mostly of flowers and butterflies. Thus, placing an insectivore critter may be a bad idea as butterflies tend to stay out of reach (yes, you can see the critters eating grass / insects)

 That’s it! Have a nice day.

ecosystem455

 

Some previous updates:

Weekly Update #68 – The game’s shop

Weekly Update #67 – The Splicing Machine Video 

Weekly Update #66 – The Hatchery Machine interface

Weekly Update #65 – Explanation / recap of some game features

Weekly Update #64 – Why is debugging mandatory?

Weekly Update #63: Tweaking and answering questions about the video

Weekly Update #62: Gameplay video (mobile version)

Weekly update #68

Wednesday, March 25th, 2015

Weekly Update #68 – The game’s shop

Read it on the forum

Hello everybody!

This week I’ll simply do a summary regarding the game’s shop.

pictureShop_455

As you can see on the picture above:

(1) Spotlight: More and more objects are available in shop according to your current level. This category shows the latest items unlocked.
(2) Resources: In this tab you’ll find coins and golden eggs.
(3) Genetics: You can buy here genes pack to use with the Splicing Machine.
(4) Toys: Self-explanatory. Toys mainly relieves Norns’ boredom.
(5) Decoration: A lot of items are present here, which are purely for decoration. Though actually there may be some exceptions.
(6) Ecosystem: You can buy here plant pots (to grow fruit plants) and critters. Naturally occurring flowers, grass patches and insects can’t be bought as they depend of the world.
(7) Others: You can buy here coin machines and nests for your Norns to sleep.
(8) Hide / shows a small description of the concerned item.
(9) Upon buying an object, the game let you place it. However, you can stock objects you don’t want to place immediately. That’s why you can see a “Use” button here: I already have one of these objects in stock.

That’s all for today! Have a nice week

Some previous updates:

Weekly Update #67 – The Splicing Machine Video 

Weekly Update #66 – The Hatchery Machine interface

Weekly Update #65 – Explanation / recap of some game features

Weekly Update #64 – Why is debugging mandatory?

Weekly Update #63: Tweaking and answering questions about the video

Weekly Update #62: Gameplay video (mobile version)

Weekly Update #61: The Twitch Session Official Date

Weekly Update #67

Tuesday, March 10th, 2015

Weekly Update #67 – The Splicing Machine Video

Read it on the forum

Hello everybody,

Sorry about the absence of weekly updates! Here’s one with a short video displaying the Splicing Machine:

As you can see in the video:

  • Each Norn has 8 cosmetic genes, each one impacting the appearance of the Norn. Changing the 1st one will have an impact on the belly, the 2nd one on the pattern the Norn has and so on.
  • There are 12 possible genes
  • There are 4 body types, each gene corresponds to one of them. The body of the Norn is an “average” created from these genes. See for example how the body shape changed when I replaced Bananou’s genes with Feral genes.
  • Two Norns with the same genes will look the same in the Splicing Machine as the preview shows you how the Norn should look with these genes. That’s why Bananou and Brugno seem similar.
  • However, once spliced they can have small differences even with the same genes. If you look carefully, in-game Bananou has 2 white spots on the hips, while Brugno has a white mark on the right arm.
  • The pattern on Norn fur is defined by genes #2 and #3, but the color for these patterns are defined by genes #5 and #6.
  • Time required for splicing depends on the number of genes modified (and the type of these genes).

That’s all! Have a nice week

 

Some previous updates: 

Weekly Update #66 – The Hatchery Machine interface

Weekly Update #65 – Explanation / recap of some game features

Weekly Update #64 – Why is debugging mandatory?

Weekly Update #63: Tweaking and answering questions about the video

Weekly Update #62: Gameplay video (mobile version)

Weekly Update #61: The Twitch Session Official Date

Weekly Update #60: The Science Kit in Colour

Weekly Update #66

Monday, February 23rd, 2015

Weekly Update #66 – The Hatchery Machine interface

Read it on the forum

Hello everybody,

This week I’ll present you a small summary regarding the Hatchery Machine interface:

Creatures_Online_Hatchery_interface_455

When opening the Hatchery machine, you’ll see 2 different sections:
- The “My Eggs” section, which contains your eggs
- The “Eggs Store” section, which allows you to obtain new eggs

From the “My Eggs” section, you can see your eggs and hatch them if you want to (1). You can also see the 8 appearance genes of this egg by clicking on (2), allowing you to have an idea of how the Norn may look without hatching it. If your game is linked to a Facebook account, you can also send this egg to a friend (3).

You have a limited number of egg slots, but you can buy some more using coins or Golden eggs (4).

Click on (5) on the “Eggs Store” section to see which appearance genes each egg can contain (6). Eggs can be bought with energy, which refills automatically with time.

That’s all! Have a nice week!

 

 

Some previous updates: 

Weekly Update #65 – Explanation / recap of some game features

Weekly Update #64 – Why is debugging mandatory?

Weekly Update #63: Tweaking and answering questions about the video

Weekly Update #62: Gameplay video (mobile version)

Weekly Update #61: The Twitch Session Official Date

Weekly Update #60: The Science Kit in Colour

Weekly Update #59: Twitch news and debugging