Friday, July 11, 2014

So a few projects have stuck out to me recently that either struck my interest or that I feel compelled to participate in.


This amazing nonprofit teaching site that I'll be contributing to on the tutor side:
http://www.askadev.com/

Here's a scratch built game engine, Banshee, that the author is currently advertising:
https://github.com/BearishSun/BansheeEngine

And finally, a linux/mac JS based browser:
http://breach.cc/


That's all for now!

Thursday, July 3, 2014

Next

I haven't used .NET and I decided I should get familiar with it.  Especially since it's kind of a joke among some friends that I've done C# development but have never used .NET.  I have used mono, the open source variant, but only in relation to Unity.  Also I haven't used Visual Studio since college, so that will be a nice refresher.
Anywho, for my first project I have two main goals:

1. Make a web based report tool using SOA, similar to ones I've worked on in the past

2. Use a new BDD framework, I picked SpecFlow.


So, to fulfill these goals, here are the steps that I need to do, which I'll cover in this blog:

Write specs out in SpecFlow
Follow the flow to create a page in C#/ASP.NET
Create a service in ASP.NET that the page will use
Create a database with SQL Server compact for the service

And then I should be done. I'll post to youtube with a walktrhough of the finished product.


Saturday, May 24, 2014

iOS game in store

I decided to release an app to the iTunes store(it's something I've been meaning to do since...well, since I became a developer a few years ago).  It's a matching game I made to try out the iOS SpriteKit.  Previously I had just used core animation and GLkit(or did it in Unity), I had set up a library that let me do most of the same things, but it's nice to have a fully functional native option for 2D games.

That being said, if anyone has a toddler it would be a great for them. 

The code for a basic version of the game is available on my bitbucket and github accounts.



https://github.com/milam/IOSGameSample

And the actual game is available at:

https://itunes.apple.com/us/app/pet-rescue-adoption-center/id888264230?mt=8

I really need to figure out a better name =/.  And I need to find decent open source animal sounds.

Friday, May 2, 2014

Codemancer

Here's a kickstarter I noticed for a great game that is geared toward teaching coding skills in an abstract way:

https://www.kickstarter.com/projects/bobbylox/codemancer-a-fantasy-game-that-teaches-the-magic-o?ref=home_spotlight

CSS

After doing some work on a webpage of mine, I browsed around to find some more esoteric properties of CSS.  During that search I came across this nice list:

http://www.webcredible.com/blog-reports/css/css-tricks.shtml

I already knew some of it, but the ones I didn't were pretty nifty

Thursday, May 1, 2014

SleepyDEV

SleepyDev, a company I'm doing work for finally launched a site over at sleepydev.net.

They are a unity shop that does prototypes for Kickstarter projects, and also work on some minor full game projects as well meant for licensing and rebranding.  If anyone needs a service like that, you should check them out.

Friday, April 25, 2014

Just a quick note

 Procedural platformer levels seem to be a thing in some circles.  I came across this decent rundown for creating the AI and I'll probably be putting together some code for a simple one soon. 

http://www.gamasutra.com/view/feature/170049/how_to_make_insane_procedural_.php?print=1

A game released last year that made use of it to a challenging level is Cloudberry Kingdom.

Wednesday, April 23, 2014

Interesting kickstarter

 I browse around kickstarter occasionally looking for potential useful tools.  Recently I discovered this typefacing program in development, Prototypo:

https://www.kickstarter.com/projects/599698621/prototypo-streamlining-font-creation?ref=discovery

I think this could be a pretty amazing tool for UI design work, and I'll be keeping an eye on it.  It's definitely got 12 pounds from me.

Tuesday, April 22, 2014

Parallax Scrolling class.




 In my pursuit for getting all my errant scripts in to proper classes I went to some of the basic operations.  In this one, it was the parallax scrolling standard for 2D platformers and fighting games.  The class takes two background objects and scrolls their texture material depending on the players movement.  It requires a velocity property from the character, and the class method should be called from the player class, or some other attached script that has a regularly updated reference to the players actual velocity.

For anyone new to parallax scrolling in unity, all you do is setup two game objects such as cubes or quads away from your main scene, separate them by one on the Z axis, set their shaders to unlit transparent, and then place a camera of the same aspect ratio as your main camera, and then set the camera the same distance from the cubes as the distance from you main camera to main scene.Then, set up public game object properties, drag the game objects to the reference in the UI, then in the main script take those game objects and pass them to the ParallaxCamera's ParallaxScroll method along with the player velocity.


using UnityEngine;
using System.Collections;

public class ParallaxCamera{
    private float moveParallax = 0;
    private float speed = 0;


    void setScrollSpeed(float setSpeed)
    {
        speed = setSpeed;
    }


    void ParallaxScroll(GameObject firstBackground, GameObject secondBackground, float velocitySpeed)
    {

        if(velocitySpeed != 0)
        {
            if(Input.GetAxis("Horizontal")>0){
                firstBackground.renderer.material.mainTextureOffset = new Vector2((moveParallax * speed)%1, 0f);

                secondBackground.renderer.material.mainTextureOffset = new Vector2((moveParallax * (speed/5.0f))%1, 0f);
                moveParallax+=.0005f;

            }else if(Input.GetAxis("Horizontal")<0 p="">            {
               firstBackground.renderer.material.mainTextureOffset = new Vector2(((speed*moveParallax)%1), 0f);

                secondBackground.renderer.material.mainTextureOffset = new Vector2((moveParallax * (speed/5.0f))%1, 0f);
                moveParallax-=.0005f;
               
            }else{
                return;
            }
            }
    }
    }
}

Again if anyone needs the working script opposed to this reference, there's one in my bitbucket repo, as usual.

Monday, April 21, 2014

Raycasting in Unity and the Pursuit for more OOP


 Something that I think most developers find when they start getting in to doing complex character animations in Unity using the 2D libraries is that the built in collision leaves something to be desired.  The go to solution for getting better collision is using raycasting and essentially building your own collision detection from scratch.

Recently I've been reworking all my scripts in to solid object oriented classes.  I should have done it from the start, but with all the code examples out there being condensed into single scripts it was bothersome to do it on the fly.  Anywho, here's the class I recently made to handle raycasting for my collision detection, I thought I'd share it today. I'd also like to go over my process for improving the script and making it more useful, saving loads of effort in the long run.


using UnityEngine;
using System.Collections;



public class RaycastDetect : MonoBehaviour {
   
    public bool rayDetected = false; //set detection false by default

    bool RaycastDetection(Transform rayStartingPoint, Transform rayEndPoint, string rayLayerToDetect, bool debug) {   
   if  (debug) {
        Debug.DrawLine(rayStartingPoint.position,rayEndPoint.position, Color.green);
        }
        rayDetected = Physics2D.Linecast(rayStartingPoint.position, rayEndPoint.position, 1<< LayerMask.NameToLayer(rayLayerToDetect));

        return rayDetected;
    }
    }

So as it stands, it takes two transforms and a layer to detect and draws the line, with an option for a debug mode so you can see the lines during development.  The issues here are that for proper collision detection you have to repeat this method a lot just for one direction, and that the debug often isn't needed or desired after the first test.    We can easily overload the RaycastDetection method so that the developer can pass in arrays of transforms, and then iterate through them.  This would be much faster on the development side, and as long as arrays don't get too large the execution shouldn't slow down.  Also, we can provide an option where you don't have to put anything about the debug in.


The first overloaded class would look like this:

    bool RaycastDetection(Transform[] rayStartingPoint, Transform[] rayEndPoint, string[] rayLayerToDetect)  { 
      
        int rayArraySize1 = rayStartingPoint.GetLength;  
        int rayArraySize2 = rayEndPoint.GetLength;   
        int rayArraySize3 = rayLayerToDetect.GetLength;
     
        for(int i =0; i         {
            int j = 0;

            for(int k = 0;k < rayArraySize3;k++)
            {
            rayDetected = Physics2D.Linecast(rayStartingPoint[i].position, rayEndPoint[j].position, 1<< LayerMask.NameToLayer(rayLayerToDetect[k]));
          
            if(rayDetected)return rayDetected;
            }
            if(j < rayArraySize2)j++;
        }      
        return rayDetected;
    }


Then it would be pretty simple to swap that around to allow each option of array and two single values and two arrays and one single value, with all single values already being done.  For the debugless class overload we just delete the debug bool option and the code for that.  If we wanted to make the class useable for 3D as well, we should be able to just delete the 2D after the physics and it should work fine.

I have the full class available on my public BitBucket account:  https://bitbucket.org/milam_dobbins/milams-repo/src/

Saturday, April 19, 2014

Recently I was offered an opportunity to review some software development books, in return for getting the book and another book free.  I'm busy at the moment, but if any developers are interested and have a blog to post a review to, here is the site you can contact:

http://www.packtpub.com

Friday, April 18, 2014

Unity

I have been doing some work in Unity.  For anyone interested in getting started, here is a list of the most useful videos and tutorials I have found:

A recorded live training for 2D character controllers.  Gives a full run down of using the relatively new built in Mecanim animation tool:
https://www.youtube.com/watch?feature=player_embedded&v=Xnyb2f6Qqzg


Here's Aron Grandbergs site that includes the A* pathfinding project, which is used in just about every Unity project I've seen, as well as other useful tools and insights:
http://www.arongranberg.com/

Ray Wenderlich has some solid tutorials.  I also recommend the site for their iOS tutorials as well.  I think the tutorials are particularly good(and I believe intended) for anyone wanting to do mobile games:
 http://www.raywenderlich.com/61532/unity-2d-tutorial-getting-started

Finally, Bergzerg.  He has a great step by step walkthrough of building a complete 3D rpg similar to the latest additions to the Elder Scrolls series.  It's useful either in parts, or for building the full project if you have several days to kill:
http://www.burgzergarcade.com

I hope this helps anyone that is looking for suggestions on where to start if they want to make a transition to Unity.  I particularly value it's cross platform ability.

Friday, March 21, 2014

For anyone interested, my current stack overflow profile is http://stackoverflow.com/users/1236649/milam .

I mainly hang around the iOS section and offer help whenever something new comes out that I've worked with.  The latest was spritekit which was released with iOS 7.  More recently I've been working with Unity, but I don't have quite as much to offer in that section.

If anyone ever has questions about these or other topics, feel free to ask me in the comments section.
25 years ago, Symbolics.com became the first domain registered on the World Wide Web.  They had a clock counting from that time, apparently until an enterprising guy bought it and turned it in to a billboard.  Oh well.