I just wanted to say hello - migrating here from Torque and others...

Hello,

Welias D. here. I have been a hobbyist for years, never published anything. Owned a profitable indie company that was based on licensed game technology for years, sold it, traveled around the country for a year or so, settled down to write my own game so that I wouldn’t be caught up in the $64,000 license game again. Came close to launching a game a couple of years ago based on the Torque engine and for some reason after I tested it with dozens of friends and family, I just turned the computer off and stuck it under the bed. My wife thinks I was scared. Who knows.

Anyway, I guess I really didn’t think Torque had the options I wanted for growth at my own hands or at least in my own comprehension levels. So here I am, landing firmly in the community of Unity. I have said my goodbyes at Torque and started my plans to get Unity Pro and I am even looking to build relationships with those I can hire to help me from time to time (boy have I spent tons on help from other coders over the years) and threads I am qualified to respond and give back to the community whenever I can.

I have watched Unity grow for years, albeit from afar. Remember the days when it was Mac only? Well it was surprising that it came on my radar back then… hard core pc man here… but I do believe in cross platform capabilities. I have tried out every version of Unity available for PC over the years, for one reason or another I didn’t make the jump. So, at last, finally, here I am, I spent this last week (almost with no sleep I might add) digging my heels in, learning the entire 30+ hours of GamerToGameDeveloper.com tutorials, integrating the SQLite mono wrapper, installing the master server and playing around with raknet!

Now that I have a code base that is multiplayer, sql capable, and can even instantiate prefabs inside the game and amazingly even grab objects from the big ole’ interweb, I am hooked!

I do have one question. In every game engine I have played with over the years (and I have played with almost all of them) they all seem to be missing one simple item that makes you scratch your head and go, “really, what were they thinking by leaving THAT out!”.

Well in Torque it was the lack of support for Platforms. Sure there were community efforts and some of them were amazing but as soon as Torque released an update, all the efforts of us citizens went down the tubes and platforms broke.

So after a week of getting a decent prototype game up and going in Unity I just have one question… Why is there no easy Unity Core FileIO? Not really looking for an answer as I know the answer already… .net 2.0, MSDN, Asset Store, and boy are there some great products for Serialization (the free one on here is amazing) but they are not really what I am looking for so for me, I got my SQLite going and I am reading, writing and arithmetic’n my way into everything I need at the moment! Man, has anyone played with that UnidDatabase… that looks amazing!!!

I hope I do not aggravate you guys. As you can see from my one big SQL post already, that yep, I make stupid mistakes but at least if I make 'em and I ask the community about it, I will post as much as I can so that the next fool like me that goes looking will find the answer he is looking for!

So…

Hello Everyone!

Hi.

It already exists: System.IO.File. It’s not in the Unity docs since it’s not Unity-specific; see the MSDN docs. The only thing you need from Unity specifically regarding this is Application.dataPath or Application.persistentDataPath.

–Eric

Exactly, you have the whole (almost) .net framework at your fingertips : )

Hello right back at you Welias!

Do you happen to have twitter or a blog so I can follow your journey?

Hello Guys. Thanks for the welcome.

@Lukas, you know I never thought of blogging my journey but I guess it is not a bad idea and may even help keep me grounded this time around so, sure, I created a blog that I will post to regularly. Right now it is simply about what lead me to Unity but I plan on posting updates of the technical challenges and development goals I am working on.

http://derekrayburn.blogspot.com/

@Virror, I have already read dozens of your posts and have enjoyed them all.

@Eric5h5, thanks for the recommendation. I have already implemented Streaming and basic FileIO as well as a working C# wrapper for SQLite and Unity’s implementation of wrappers, plugins and dll access is very impressive. I do not see much that could get in my way, other than myself or my amateur coding skills.

I am also taking up Gigi’s challenge to finish a game in 12 weeks. That will be extremely challenging! I just hope my Wife and my Client’s do not kill me because I have a tendency to get obsessive about game development!

About IO and sqlite for storing things…

A method that is not immediatly obvious and you’ll have to dig a little to come across is that you can use the .net binary writer to write out any instanced class to a binary file format on disc. The nice thing about this is, if you are doing iOS development, the binary writing function on the micro mscorlib file, so using this method does not require the addition of any new DLL’s like sqlite or XML.

Here is an example:

using UnityEngine;
using System.Collections;
using System;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;

[System.Serializable]
public class ColorSetData
{
	[SerializeField]
	public string colorSetName;
	[SerializeField]
	public string[] surfaceName;
	[SerializeField]
	public string[] selectedTexturePath;
	[SerializeField]
	public int[] selectedTextureIndex;
	[SerializeField]
	public int[] selectedColorIndex;	
	
    public void Save ()
    {
        FileStream myStream; 

        string savePath = Utility.ExternalDocuments()+ProjectGlobal.staticThis.levelName+"_"+colorSetName+".colorset";
        myStream = new FileStream (savePath, FileMode.Create); 

        BinaryFormatter binFormatter = new BinaryFormatter (); 
        binFormatter.Serialize (myStream, this); 

        myStream.Close ();
    }

    public static ColorSetData Load (string colorSetName)
    {
		Debug.Log("Loading Color Set: "+Utility.ExternalAssets()+ProjectGlobal.staticThis.levelName+"_"+colorSetName+".colorset");
		
        ColorSetData returnObject; 
        BinaryFormatter binFormatter = new BinaryFormatter (); 
		
		string savePath = Utility.ExternalDocuments()+ProjectGlobal.staticThis.levelName+"_"+colorSetName+".colorset";				
			
        FileStream fs;
		
		if (File.Exists(savePath))
		{
            fs = new FileStream (savePath, FileMode.Open);
            if (fs != null) 
			{
                returnObject = (ColorSetData)binFormatter.Deserialize (fs);
                return returnObject;
            }
        } 
		else
		{
            Debug.Log ("Save File Not Found: "+savePath);
        }

        return null;
    }
}

there is some code in their specific to my project, but thats easy to change and make it generic

you came to the right place. I would argue unity is one of the worlds best engines currently. And the support here is superb , the admins actually listen to us and take in our input. I have checked out torque in the past and i can confidently say that i prefer unity much much more. Welcome to the community :).

@techmage - Thank You! This is a perfect example of why community is so vital to an engine! You are correct, that was not immediately obvious to me and I will be the first to admit that I learned programming in college when Fortran and Cobal were the world’s requirements so today’s amazing cross platform solutions and .net wrapping really sends me into a dark forest sometimes. I will absolutely check that out!

@jin76 - I would have to agree with you on the best engine comment and I have noticed that Unity does listen to it’s users. I love the vote on new implementation suggestions feature of the web site.

It listens, but the voting system is not a guarantee, it’s an indication for unity, as they may have a lot more pressing matters we don’t know about. So don’t take that site as gospel for what unity will work on next. It’s not a democracy, if that’s what you’re thinking :slight_smile:

Good point hippocoder. I am sure they have their own roadmap but when massive amounts of users vote on a request, just knowing they take that in consideration is more than most companies do.