Unity Standard Shader is Pretty Good

I decided to do the subscription to Maya LT and relearn 3D modeling. The first thing I tried to do was modeling the treasure chest. I lost the old file for some reason, so I thought this would be a fun exercise.


It has 120 Tris with 128×128 texture. It was rushed and it looked terrible. I just wanted to test it out to see if it works in unity.

When I imported it to Unity…


Hmm… I think i’m just going to keep it as the final version…



ScrollRect and Unity UI

The new Unity UI is great. There are just some things that I wished were on by default. With a list of buttons, Unity’s ScrollRect does not automatically scroll to the selected button if the button is out of bounds.

I never found a quick way or a component to emulate it, so I turned to scripting. I found one on the Unity forums for centering the selected object (Unity Forum Link), but that doesn’t seem to be the one I wanted.

So after pounding my head on the keyboard for three days, I finally figured it out.

It scrolls on the edges when the selected button is out of bounds on the mask.

For setting up the scroll list, I suggest watching this Live Session: Unity Live Training Link

And here’s the code. Just add it to the object with the ScrollRect:

using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;

[RequireComponent( typeof( ScrollRect ) )]
public class ScrollToSelected : MonoBehaviour {

public float scrollSpeed = 10f;

ScrollRect m_ScrollRect;
RectTransform m_RectTransform;
RectTransform m_ContentRectTransform;
RectTransform m_SelectedRectTransform;

void Awake() {
    m_ScrollRect = GetComponent<ScrollRect>();
    m_RectTransform = GetComponent<RectTransform>();
    m_ContentRectTransform = m_ScrollRect.content;

void Update() {

void UpdateScrollToSelected() {

// grab the current selected from the eventsystem
    GameObject selected = EventSystem.current.currentSelectedGameObject;

if ( selected == null ) {
if ( selected.transform.parent != m_ContentRectTransform.transform ) {

m_SelectedRectTransform = selected.GetComponent<RectTransform>();

// math stuff
    Vector3 selectedDifference = m_RectTransform.localPosition - m_SelectedRectTransform.localPosition;
    float contentHeightDifference = ( m_ContentRectTransform.rect.height - m_RectTransform.rect.height );

    float selectedPosition = ( m_ContentRectTransform.rect.height - selectedDifference.y );
    float currentScrollRectPosition = m_ScrollRect.normalizedPosition.y * contentHeightDifference;
    float above = currentScrollRectPosition - ( m_SelectedRectTransform.rect.height / 2 ) + m_RectTransform.rect.height;
    float below = currentScrollRectPosition + ( m_SelectedRectTransform.rect.height / 2 );

// check if selected is out of bounds
    if ( selectedPosition > above ) {
        float step = selectedPosition - above;
        float newY = currentScrollRectPosition + step;
        float newNormalizedY = newY / contentHeightDifference;
        m_ScrollRect.normalizedPosition = Vector2.Lerp( m_ScrollRect.normalizedPosition, new Vector2( 0, newNormalizedY ), scrollSpeed * Time.deltaTime );
    } else if ( selectedPosition < below ) {
        float step = selectedPosition - below;
        float newY = currentScrollRectPosition + step;
        float newNormalizedY = newY / contentHeightDifference;
        m_ScrollRect.normalizedPosition = Vector2.Lerp( m_ScrollRect.normalizedPosition, new Vector2( 0, newNormalizedY ), scrollSpeed * Time.deltaTime );



Note that it only automatically scrolls vertically. You might want to extend it if you want it to work horizontally.

And that’s it. Let me know if you found a better way of doing it, or if there’s a simple way of doing it, like a hidden component I missed.

Edit: You can download the unityPackage here: Download

RPG Engine

Hey! Sorry I haven’t been updating regularly on the project’s status. I’ve decided to drop ORK framework and create my own RPG framework from scratch based on the Crystal Story II gameplay. I thought it would be fun to port the engine I had and make it better. The work was mostly on code and there were no visual changes, so I thought that the updates might be boring. I’ll try and condense them to fewer, but meatier updates.

A few changes to the enemy mechanics were added to make use of the more powerful Unity engine:



Enemies still havethe same detection system as Crystal Story II, but will now only be included in battle if the enemy is within a designated range to the player. If anyone has played Last Remnant, it is pretty much similar to that.

New DB_Spells02

I had to write my own tools to handle the database in the game and the loot data. This is way better than the old system I had working on Crystal Story II.


I’m also currently working on improving the AI of the enemies and considering putting auto-battle in the game. Not sure yet what to make of it though.

I’m currently playing around with the Unity 4.6 beta and the new UI. It’s a bit difficult since there are only a few examples available, but it’s really nice. I think I can still implement the unified timebar like the one on Crystal Story II. Here is a rough look at what the battle currently looks like with placeholder graphics: (Everything is not final!)

01 04

Until next time!



Level Editor

Playing around with the game last month, I realized that I have to downscale it by a lot. What I initially have in mind was too big for a one man project.

tomb1 tomb2 tomb3


I created this tomb dungeon area by hand and it took about a week. It had a lot of complex shapes, a lot of lights and uneven terrain. The textures were also a pain to setup. It took way too long and I had to think of another way to create levels quickly.

I ended up importing and modifying the Random Dungeon Generator from Crystal Story II. The code rewrite took a bit of time to get used to, but I ended up making it work. It’s now a mix between the room generator of Crystal Story and Crystal Story II.

Here is the initial test for the maze:

testTower0 testTower1


t1 t2 t3

The Unity engine helped made data input easier. With this new process, I can just specify the type of wall needed and It will create it on the editor. I can then edit them freely and create custom rooms, put in treasures, npcs, etc.

I will be reusing the textures from Crystal Story II, so the levels will be similar. Here is the cave level I’m playing around with:


c3 c2 c1



Some Progress? Maybe…


The past month has been a bit hard with vacation stuff and then getting sick. The game has been seeing some progress. I still can’t decide if I should go with a turn-based or an action rpg gameplay, so I decided to work on the other stuff first.

I decided to work on enemies and animations. I still need more practice which resulted in a lot of rework and scraps. Here are some of the completed ones:


I’ve also planned out the areas and possible enemy distributions. More details probably on future updates.

I’m looking to try and finish a prototype as soon as possible then plan out what to do from there. If people get interested with the prototype, I might be able to get help with the project. If not, I might have to scale down the game since I find it too hard working on it alone.

Anyway here is what the turn based and the arpg looks like: One of them might not see the light of day!

scturn scarpg

New Characters

Here is a first look at the new characters for the new game. They are still not final, and I would love some feedback. (I disabled comments on this website because of spam. Please check out the facebook post or email me for any feedback.)


I wanted a simple story, so I decided to do a mercenary story arc again. The middle character is the Boss and wants to hire two minions to do her bidding. I can’t think of any names yet, but I think the boss is going to just be named Boss.


I’m also open to other story ideas and the possibility of a fourth character. Everything is still pretty open. Here is the early sketch of the characters.


Running animation is also done on the main character.


The Rush for a Prototype

I decided to get ProBuilder for Unity to make building dungeons easier. I want to finish a prototype of the game as soon as possible to make it easier to test the initial gameplay. Everything is pretty rough so far and most of the things you’ll see here are not final.

Here is a look at the prototype dungeon I have:


And here it is with the in-game camera and a placeholder (slime) hero:


Some of you might have noticed the reused textures from Crystal Story 2:

Sequence 01_6

This prototype dungeon will help me test how the enemies will behave. It will be the same as Crystal Story 2 where they are visible and roaming around the area. Huge bosses will also be blocking the exit of the map. This time though, I will be making the levels by hand instead of randomly generating it, so that mini puzzles can be implemented inside the dungeon.

Here is a look of the prototype battle scene :


I still have to learn a lot on placing it lights to make the areas look pretty.

I’ve also made a prototype town and prototype NPC. This will help me with testing the shop and armory to see if they are working properly.


Details for the textures are still needed to be done, but I think testing the initial gameplay is more important for now.



RPG Framework

I finally found a good RPG framework for unity. It’s called ORK framework (http://orkframework.com/). It finally went on sale and I just went in and bought it.

It came with basic features for turn based RPGs. It’s really awesome since I wont have to code the whole game from scratch. It just needs a lot of data tweaking just to get things right. I am about halfway through the tutorial and I’m having fun setting up the monsters and abilities.


The framework is really powerful and there’s a lot of things you can do with it. This really speeds up the development process of the game, but I have to be careful not to spend too much time on adding more features. I just have to figure out what I need and try to make a game out of it.


On the art side of the game, I have been doing animations for the monsters. There are currently 4 monsters with completed animations. I decided to make it simple and just animate idle, run, attack, and special attack. Death, hit, and evade will be handled using code.

I’ve also played around with texturing and made a treasure box.


The left side has the texture on and the right side is the poly mesh. It also animates when opening.

I guess that’s it for this week. I’ll post more progress in the future. :)


New Game Update


Hey! Here’s an update on what’s happening.

I just graduated and now I have to find a real job to sustain myself. I will be working on a new game in the meantime while looking for one. I don’t know what to call it yet or if it’s going to be a sequel. It’s still a long way to go. It might take longer if I find a job since I might have to put it on hold or just work on it on my free time. I will try to post updates on the status of the game though.

Thanks again for the support guys! I really appreciate it. :)

Remember you can still buy the android and the pc/mac version on the store: