Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - TekuStudios

Pages: [1]
1
Support / Combine text and images in subtitles - is it possible?
« on: January 05, 2016, 01:52:11 pm »
Hi!

I'm adding the final touches for the tutorial of our game, and I'm trying to figure out how to do some specific thing. When we teach the player about the game's controls, I'd like to combine text and images so I can have something like this:

Quote
To jump, press [JUMP BUTTON]. To run, press [RUN BUTTON]

Where [JUMP BUTTON] and [RUN BUTTON] are not text, but images (keyboard keys or controller buttons, depending on what input method you're using). It shouldn't be too difficult, but I'm not quite sure on the best approach. And the thing is that we have languages such as English, Spanish, Russian, Japanese... so the texts are completely different sometimes depending on the active language, and since I can't have a consistent text structure I need to come up with a custom solution for this.


Any ideas?

2
Support / Transparent shaders and GrabPass
« on: November 03, 2014, 07:13:42 pm »
Hi everyone,

We are trying to handle a semitransparent plane to work with 2d toolkit sprites (but the same happens with unity transparent/diffuse shader). In the example, the plane “cut” the sprites whatever we do. We are using a shader that “GrabPasses” the current scene using the proper Queue=”Transparent+1” to get painted the sprites in _GrabTexture. Later, we “mix” that texture with other process to make a water “feel” such as distortion and so on. (No Zwrite on flags)

We have tried out changing GrabPass tags, using a pre Pass with a “green” texture with 0.5f alpha value to check what is being rendered in _GrabTexture with GrabPass and this is the result:





As you can see, the Sprite, transparent shader is not correctly drawn(the green plane is semitransparent and doesn't draw a piece of the heart).

If anyone could help us, we'll really appreciate it. Love is in the air as you can see.

Thank you!

3
I'm posting this in the public support forum because I think it's important and everyone should be able to read the solution if we come up with one. I'm experiencing a very weird behaviour with custom polygon colliders for sprites lately. Let me show you:

· Step 1: create a sprite collection and draw a custom polygon collider over one of its sprites (as you can see it's a "closed" collider, not an "open" one, like a straight line or something. All vertices are connected. Notice the normals as well).



· Step 2: place the gameObject in the scene and make your character walk over it.



· Step 3: cheerfully watch your character fall into the solid object (I've triple-checked and the Mesh Collider component is NOT trigger, nor is my character).




This is also happenning to me with many walls and other limiters, if their colliders are part of a sprite collection (not Unity built-in ones). I'm using 2DToolkit 2.4.0, any ideas on what may be causing this weird behaviour? The most annoying thing is that some parts of the collider are indeed solid, as you can see in the second image I posted, it's like the box is partially solid and partially a trigger. It seems to happen by pure random.

4
Hi there! We're posting here a workaround for the new Unity layer-and-sorting system, just in case you need something similar for your games. We are developing a sidescrolling tk2dSprite-based game, but we also have some 3D elements in our scenes such us particle effects and dynamically generated meshes (faked 2D planes with deformation physics simulating water), and we are using a Perspective camera as well. This made us face a very uncomfortable problem: all our sprites were being rendered in front of every other non-sprite elements in the scenes. The new Layer and SortingOrder properties are public yet only exposed in the Editor for the new Unity sprites (or tk2d ones).

So, as some of you may be facing similar trouble, I'm sharing our solution with you. We use a modified version for the Mesh Renderer that allows you to set the Layer Name and Sorting Order for every mesh-based GameObjects:

Code: [Select]
using UnityEngine;
using UnityEditor;
using System.Collections;

[CustomEditor(typeof(MeshRenderer))]

public class MeshRendererSortingLayersEditor : Editor
{
public override void OnInspectorGUI()
{
base.OnInspectorGUI();

MeshRenderer renderer = target as MeshRenderer;

EditorGUILayout.BeginHorizontal();

EditorGUI.BeginChangeCheck();

string name = EditorGUILayout.TextField("Sorting Layer Name", renderer.sortingLayerName);

if(EditorGUI.EndChangeCheck())
{
renderer.sortingLayerName = name;
}

EditorGUILayout.EndHorizontal();

EditorGUILayout.BeginHorizontal();

EditorGUI.BeginChangeCheck();

int order = EditorGUILayout.IntField("Sorting Order", renderer.sortingOrder);

if(EditorGUI.EndChangeCheck())
{
renderer.sortingOrder = order;
}

EditorGUILayout.EndHorizontal();
}
}

You just have to create a new C# script, paste that code into it and place it inside the Editor folder of your project so everytime you add the Mesh Renderer component to an object it will allow you to set its layer and rendering priority. Unfortunately, you have to set the Layer as a string name, so make sure you don't throw any typos in that field.

Hope you guys find it useful!

5
Support / [OFFTOPIC] Unity officially unveils its 2D framework for 4.3
« on: August 31, 2013, 09:30:29 am »
Just thought you guys might find this interesting:

http://www.youtube.com/watch?v=gKYrdTZc5YE&feature=youtu.be&t=1h15m13s

The 2D features part begins at 1h15m13s.

6
Support / An incredibly noob question cencerning atlases
« on: July 23, 2013, 07:19:04 pm »
Hi there again.

We are trying to compress as much as we can every single image of our game to keep it running at 60fps. We have compressed the original PNG files a lot, and a little more using the Posterize option of Photoshop (with the appropriate setup), and we have updated all our collections with the new reduced images.

After doing that, we've checked out the new atlases of the collections, and all them weigh the same as before! So then every single level has exactly the same size to load? How does exactly the atlases work? Even if an atlas is the same size as before, if the images it contains are lighter, shouldn't it be lighter too? We are a little lost on this subject.

Thanks for your time.

7
Showcase / Candle - a dynamic graphic adventure
« on: July 02, 2013, 12:07:57 am »
Candle, which is set to be released via digital download this January on PC, is a 2D sidescrolling adventure game using  Unity 4. We describe it as a “dynamic graphic adventure”, since its gameplay combines those of the Platformer and Graphic Adventure genres. The player takes control of Teku, a young and inexperienced member of the Tumayku tribe in his journey to save his friends and unravel the mysteries of his world. Through his epic journey he will face many trials and puzzles that the player must solve using his mind and inventiveness. The key feature of Candle's gameplay comes from a very specific ability of Teku: instead of a hand, he carries a candle that can be lit at certain places, and he must do whatever he can to prevent it to be extinguished. The flame of the candle is key to solving many of the puzzles, as well as uncovering lots of secrets and clues.

Candle is being developed with a very unique and innovative process, we paint the entire graphics of the game in a traditional way with watercolors, and the we scan all that in order to build the sprites of the environments, items, menus, etc. Also, the animations of every character and animal in the game are not digital, instead we draw and paint them frame by frame, then we scan every image and build the spritesheets for the animations. Once we have all this working in Unity, we build each level, each scene and each character and so we get a nice handmade look for the visuals. Althoug it wasn't easy to achieve this result. We new since the early development stages that we wanted this to be our own art direction, but there are few-to-zero references out there on how to deal with such a process.

At first, our team consisted only in 3 people: a programmer, an artist and a composer, but now 3 more people have joined the team to help them boost the development. We will also launch a Greenlight campaign this week to get the game into Steam, and if the campaign succeeds the game will not only be available throught that platform, but also feature some key Steamworks functionalities such as Achievements and Cloud Saving. Candle will also be available through Teku Studios' website completely DRM-Free.

And if you deal well with spanish you can see some news about us in the media!

http://www.3djuegos.com/noticia/134948/0/candle/teku-studios/

8
Support / Our per-object Motion Blur solution: use it if you want!
« on: June 18, 2013, 10:30:07 am »
So, we've been working on an object-independent motion blur for sprites. We've reached a somehow useful solution, so we are posting it here for you guys, in case that someone needs something similar. It only works with the next 2DToolkit 2.2.

First, the Motion Blur script (component of the object to be blurred):
Code: [Select]
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class MotionBlurHandler : MonoBehaviour
{
        //Will it be a blur over the object, or a trail behind it?
        public bool front = true;
        //How much speed does the object need before blurring?
public float startSpeed = 0.005f;
        //How much time does it take for each 'copy' to fade?
public float copyFadeTime = 0.1f;
//The sprite object that will be duplicated (could be changed to 'tk2dSprite')
public GameObject trailMotionSpriteObject;
        //The script handles this
public Material fadeMaterial;
        //How many copies does the trail create?
public float maxCopies = 5.0f;
        //How many offset between copies?
public float offsetCopies = 0.01f;
        //How much time does it take to each copy to spawn?
public float timeBetweenCopies = 0.02f;
        //The alpha of the first copy
public float initAlpha = 0.5f;
        //The amount of alpha substracted between copies
public float alphaOffset = 0.15f;

private tk2dSprite _mySprite;
private float _timer;
private bool _createNow;
private int _currentCopies;
private int _currentLayer;
private Vector3 _currentOffset;
private float _currentAlpha = 1.0f;
private List<GameObject> _copyList;

void Start()
{
_copyList = new List<GameObject>();
_currentOffset = Vector3.zero;
_currentAlpha = initAlpha;
_mySprite = GetComponent<tk2dSprite>() as tk2dSprite;
}

void Update()
{
if(_timer <= timeBetweenCopies)
{
_createNow = false;
_timer += Time.deltaTime;
}
else
{
_createNow = true;
_timer = 0.0f;
}

if(Mathf.Abs (Vector3.Magnitude(rigidbody.velocity)) > startSpeed )
{
if(_currentCopies < maxCopies)
{
if(_createNow)
{
Vector3 tmpVelocity = rigidbody.velocity;
tmpVelocity.y = 0.0f;
_currentOffset += (Vector3.Normalize(tmpVelocity) * offsetCopies);
_currentAlpha -=  alphaOffset;
Vector3 tmp = Vector3.zero;
tmp.x = transform.localPosition.x-_currentOffset.x;
tmp.y = transform.localPosition.y-_currentOffset.y;
tmp.z = transform.localPosition.z-_currentOffset.z;

GameObject go = Instantiate(trailMotionSpriteObject,transform.localPosition-_currentOffset, transform.rotation) as GameObject;

_copyList.Add(go);
++_currentCopies;
if(front)
++_currentLayer;
else
--_currentLayer;

FadeInTime fit = go.AddComponent("FadeInTime") as FadeInTime;
(go.GetComponent<tk2dSprite>() as tk2dSprite).RenderLayer = _currentLayer;

go.renderer.material = renderer.material;
fit.SetInitAlpha(_currentAlpha, this);
go.transform.parent = gameObject.transform;
}
}
}
else
{
if(_currentCopies != 0)
{
(_copyList[_currentCopies-1].GetComponent<FadeInTime>() as FadeInTime).StartFading(copyFadeTime);
_copyList.RemoveAt(_currentCopies-1);
--_currentCopies;

if(_currentCopies == 0)
{
_currentOffset = Vector3.zero;
_currentAlpha = initAlpha;
_currentLayer = 0;
}
}
}
}

And the other one. This is a script that the previous one adds at runtime to each copy:
Code: [Select]
using UnityEngine;
using System.Collections;

public class FadeInTime : MonoBehaviour
{
public float fadeTime = 0.5f;
public Transform followPosition;
private bool _ready = false;

public tk2dSprite mySprite;
private float _timePassed = 0.0f;
private float _initAlpha;
private MotionBlurHandler _motionHandler;

void Start ()
{
//mySprite = gameObject.GetComponent<tk2dAnimatedSprite>() as tk2dAnimatedSprite;
mySprite = gameObject.GetComponent<tk2dSprite>() as tk2dSprite;
}

void Update ()
{
if(_ready)
{
_timePassed += Time.deltaTime;

if(_timePassed < fadeTime)
{
Color myColor = new Color();
myColor.r = mySprite.color.r;
myColor.g = mySprite.color.g;
myColor.b = mySprite.color.b;
myColor.a = Mathf.Lerp (_initAlpha,0.0f,_timePassed/fadeTime);
mySprite.color = myColor;

//Movement
// delayed follower
/*float distance = Vector3.Distance(transform.position, followPosition.position);

if(distance>0)
{
Vector3 nextPosition = Vector3.Lerp (transform.position, followPosition.position, _timePassed/fadeTime);
transform.position = nextPosition;
}*/
}
else
{
Destroy (gameObject);
}
}
}

public void StartFading(float fTime)
{
fadeTime = fTime;
_ready = true;
}

public void SetInitAlpha(float initAlpha,MotionBlurHandler mh )
{
_initAlpha = initAlpha;
_motionHandler = mh;
//mySprite = gameObject.GetComponent<tk2dAnimatedSprite>() as tk2dAnimatedSprite;
mySprite = gameObject.GetComponent<tk2dSprite>() as tk2dSprite;
Color myColor = new Color();
myColor.r = mySprite.color.r;
myColor.g = mySprite.color.g;
myColor.b = mySprite.color.b;
myColor.a = _initAlpha;
mySprite.color = myColor;

//MeshRenderer m = gameObject. GetComponent<MeshRenderer>() as MeshRenderer;
//renderer.sharedMaterial = mat;
}
}

What this system does is fairly simple: the first script instantiates copies of the original sprite with a very tiny offset, and gives them a certain amount of alpha. This creates an illusion of blurriness over the gameobject, and it only works when it is moving. The second script just handles some fading effect for the copies.

Hope you guys find it useful! :)

9
Support / Assigning new material to a duplicated sprite
« on: June 11, 2013, 05:46:21 pm »
Hi, here we come with yet another question.

We are coding some custom faked "per-object" motion blur. We don't want a blur effect that affects the whole camera, but one that only applies to specific gameobjects. Since our game is 100% sprite based, we've came up with a peculiar solution.

When a gameobject is moving with certain velocity, we instantiate 4 sprite objects that have the same sprite as the original, give them a tiny X-Axis offset from the original position and -20% alpha each, so this creates an illusion of a "trail" that progressively fades when a object is moving fast.

This works and creates a rather nice visual effect, however all the sprite clones are rendered OVER the original sprite due to perspective issues, and we want them to be rendered behind it. Since our camera is special, we can't just displace them in the Z-Axis to hide them. To control the drawing order of the camera, we assign each "layer" of a scene a unique "Transparent" shader (Transparent+1, Transparent+2...), so the grater ones are drawn later.

So, when instantiating the sprite copies, we assign them a material shader that's 1 layer behind the original sprite material's shader to keep it drawn behind, but it instantly changes into the original's material, so the copies are drawn over the original again due to those perspective issues. Is there a way to prevent this from happening? e.g. copy a sprite, keep the original sprite but change the copy's material shader.


Sorry about the lame explanation, I know it's hard to understand. If you need it I can post a screenshot later. Thanks.

Pages: [1]