cosmogonies.net Blog of cosmogonies.net

home
rss
13Apr/150

Unity’s Mono maniacs

Be sure of one thing: I love Unity and cannot let a day end without doing something with it^^.
But: there's a but.
I'm very disappointed about the transparency regarding its mono version, integration and... modification.
Everything in Unity is well documented, tutorialized, blogged and tweeted... everything but Mono !

What are we talking about exactly ?

Unity is using the C# language, but it stand on top of a modified version of Mono 2.6 .
Mono (http://www.mono-project.com/) is a framework : a utility toolkit that extends the language/compiler by high-abstraction primitives, like List, Dictionaries, garbage collector, Self-Introspection.
Mono was made as an open-source alternative to the .NET Framework, made by Microsoft (which also became open-source recently ! sources here )
You can see Mono as the foundation of Unity's kernel, and its secret recipe for its huge portability.

So, I have one request and one only:

As Unity provides its manual documentation : $INSTALLPATH/Unity/Editor/Data/Documentation/en/Manual/index.html
... and its API documentation : $INSTALLPATH/Unity/Editor/Data/Documentation/en/ScriptReference/index.html
Why do you not provide your framework documentation ?
I'm quite sure 90% of Unity users uses MSDN website when working on their games.
But think about it; That's like reading MS Word's help when using LibreOffice right ?

So you can find documentation of classes or methods that are not available in unity, especially when integrating other c# library, external to unity.
I found myself unable to use the namespace "System.Threading.Tasks", System.Drawing.Image or also all LINQ-relative syntax that are not available also.

What can we know ?

So, "Internet" says Unity runs a modified Mono 2.6, but from my own very very old post here :
http://answers.unity3d.com/questions/259448/how-to-determine-mono-version-of-unity-.html
I tried to get dynamically the Mono version, and that is a mess :

#$INSTALLPATH\Unity\Editor\Data\Mono\bin\mono.exe" -V
>Mono JIT compiler version 2.0 (Visual Studio built mono)
>Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
>TLS: normal
>GC: Included Boehm (with typed GC)
>SIGSEGV: normal Notification: Thread + polling
>Architecture: x86
>Disabled: none

To be more precise :

#$INSTALLPATH\Unity\Editor\Data\Mono\bin>monop2 --runtime-version mono.exe
>runtime version: 2.0.50727.1433

In script you can also :

//you will need "using System.Reflection;" in your file header
System.Type type = System.Type.GetType("Mono.Runtime");
if (type != null) {
System.Reflection.MethodInfo displayName = type.GetMethod("GetDisplayName", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
if (displayName != null)
    Debug.Log(displayName.Invoke(null, null)); // On Unity5.0 it printed "2.0 (Visual Studio built mono)"
}

Worse a dedicated "Mono Compatibility page" has disappeared since 4.1.2 :
http://docs.unity3d.com/412/Documentation/ScriptReference/MonoCompatibility.html
http://docs.unity3d.com/ScriptReference/MonoCompatibility.html => page not found !
Apparently, the modified version of Mono is open-source, but the github link seems quite frozen to me...
So please, help us at least find the real and correct documentation of our everyday framework !

By the way, taken how things move fast :

I know the biggest feature in Unity is its huge portability, and it was named from that, but maybe we can improve our workflow by following the two main directions of .NET and Mono ?
When you looked at the history of Mono releases  (Yes Mono 2.6 is dated from 2009) and the Microsoft's ones (.NET 4.0 and .NET 4.5 ) there is great features and Unity could benefits from them.
(To follow the equivalent rule between these twos, Let's say Mono 2.6 is equivalent to C# 3.0 (in terms of language features). Mono 2.6.1 started adding .NET 4.0 features).
But what about the "modified version" Unity uses ?
Did it evolves along side of the Editor ?
Maybe I'm wrong, and if this kind of documentation exists, I will be  very thankful to anyone who can link it to me !
But if not, please please provides us something to work with ^^.

trademarks
Tagged as: , , No Comments
information
5May/141

Funfact, some lines of code for “Ghost of a tale” are writen from Alcatraz !

Ghost of a tale, coded from Alcatraz

Let me set the scene here :

The GDC14 was just finished, I only had the saturday to visit San Francisco a little more.
Last year I've done a great tour, but couldn't reach the Rock !
What a great opportunity to capture all sort of textures, of rotten and twisted metals to the famous decaying prison^^.

But, on my way to it, I just crossed the visitable WorldWarII submarine, the mighty USS PAMPANITO .
I was like a kid in a toy-store ; you can't imagine how many pictures of pipes and "steampunk devices" I took !
Enough to drain a lot my camera's battery...
So the boat was boarding, and I had no juice left to make my camera work... but I have always my work with me ^^.
... I just sat in Alcatraz library, refilling my camera on my computer, while killing time... on Unity's game development of course !
Wanna hear more about the game ? Have a look at : http://www.ghostofatale.com/

Ghost of a tale, coded from Alcatraz

Ghost of a tale, coded from Alcatraz

 

about
Tagged as: , , 1 Comment
21Nov/120

Bloody Typing (my second smartphone game) is realeased !

Bloody Typing

My second game is realeased on both Apple and Android Market !

It is a typing game: you kill ennemies when you type their "names".
It is fun, it is arcade, and it WILL improve your typing skills !

Apple iOS App Store link    &     Android Play Store link
It is done in Unity3d, in c#.


It contains:

MODE STORY: unlock one by one all words categories to unlock next levels.
4 environments are currently infested by evil vampires !
Words categories are:
Graveyard: "Color","Sport","Common"
Misty Forest: "Animal","Stars","Plants"
Ruined Castle: "Body", "Bitter biters", "Phobia"
Mad Lab: "Science","Dino","Extinct species", "Medical"

Each story levels end by a BOSS, that can be only killed by a famous quote!
MODE ARCADE: Scoring challenge to type faster, making big scores on longer words.
TIMED CHALLENGES: Beat your score on a fixed duration, perfect mode for public transports!

To have tested my game myself, I can assure you it will really help you to type faster.
It helps memorize the keyboard layout, and on top of that you also learn some vocabulary !

Three difficulty modes assures that casuals could access every corner of the game,
by the way hard difficulty and scoring let the game "Easy to learn, Hard to master".

3 Virtual keyboard layouts are available right now: QWERTY, DVORAK, AZERTY
You also had the option to hide the keyboard, for a very challenging blind game !
Learning or improving how to type with fun ! Write enemies names to kill them.

feed
6May/122

Acronym is EVIL

I really enjoy all my experience in python-coding because I find it very readable and transparent.
Yes we're math guys, but honestly 80% of our time is dedicated to one single process:
BECAME UNDERSTANDABLE by theses f***ing stupid machines.

Python is really great for that, re-usability, factoring stuff,
building framework, and all your applications can be read like a book.
BUT, and I mean it, all theses efforts are useless if we are fuzzy, imprecise or the worst of it: concise.
I'm pretty sure that nobody will advice to call a variable "a, b , toto", but better to stick to "currentRootJoint", right ?

So why I see sooooo many acronyms along the internet snippets ? Around templates or also in python mechanics ? (Cf my APyTA post on python referencing)
Python does not recommend using import *, to avoid collapsing names.
We're writing to machines, who only recognize keywords, so please do NOT complicates things and shorcut your code.

Yes, "pmc"  is shorter that "pymel.modeling.core" but do you well remember it ? One year later ?
How can you be sure that you will not require an external module, in a distant future, who will have pmc as acronyms  too?
You have "dof" everywhere for your "degree of freedom" in your character-rigging tollkit,
and six month later, you are dealing with rendering and "depth of field", so.... "dof" also ? Is this readable really ?
Same thing in c# and Unity3d, for Random for example (Do you mean UnityEngine.Random  or  System.Random ?)

Therefore, I strictly forbid any acronyms in my personal naming convention. And I mean it.
So yes, my code is wider. But I was taught to not make functions too high, not too large !
We code now on the same workstation that infographists, so 24inches is not an issue at all !

Long import, long call of function (I always write pymel.core.modeling.polyCube() , but like that I am precise. I know where I come from (notion of namespace like in c#).
And when I am dealing with my own framework (which is multi-contextual, and manage several workflows, as Mobu;Maya, etc., with an external asset manager), I really need this "full package path".

On top of that, when you are tinying your names (function, var, import) you just keeping your knowledge for yourself.
(And for the yourself of 'right now'). That's selfish.
A future reader, coming from a non-CGI world, would most probably do not understand you. From the "not so different math-world" there is many ways of splitting our point of view (like the Y-axis definition)...
I know that I 'm quite alone on this fight, and my coding style appears weird or preposterous, and are not like all others API, but I kept this philosophy which suits me.

notice
rss
   
trademarks
notice
home