MonoDevelop?!

I just installed Unity 3.0 free and noticed a new program in the Unity programs area: MonoDevelop. Opening it up I found an IDE! Imagine that!

Now, I’ve been programming for a whole 9 months in UnityScript and (recently) C# and have just been using the editor inside unity. I’m told that it’s not much of an editor compared to Visual Studio or some other products as far as debugging features, but it’s been getting it done, and opens automatically when I double click on the name of a script, and I don’t really know what I’m missing because I’ve always just used Unity’s little editor.

Could someone take a moment to mention why I would use MonoDevelop? What are its features? How can it help me debug? How can I get it to open when I double click on a script name instead of the default editor? I’m self taught so I don’t have a degree or anyone to tell me things that are obvious to you computer science guys out there…

Thanks for the help!

In the editor preferences, you can set it as default. It highlights, auto suggests, and is more “intelligent” (the case auto tabbing is driving me insane, but otherwise… it’s intelligent)… and allows actual debugging (Though I’ve not got it to work, as it just reopens Unity and says it can’t be opened twice, Derp.)… as far as reading assembly statements, and stepping through them to find the bug(s) in your code.

If you know what code refactoring is, then there´s no reason to use any other IDE that doesn´t provide it. Although Monodevelop is not as powerfull as VisuaStudio (especially if you have VisualAssist Plugin installed), it has most of the important features a good IDE needs to help a professional coder.

I have a feeling my workflow will still have me using Visual Studio predominently (I do all my C# coding in it; got all my plugins for it that make me 120% productive!) and switch to MonoDevelop only for when I need to debug and use breakpoints.

So what benefit will I get from MonoDevelop if I already track the functions firing and vars in the Inspector and Debug.Log printouts to the console? I am on a Mac so all the Visual Studio comparisons are moot. I go back and forth with code scripting between the editor and runtime and Unitron. I tried code hinting and the damned thing just seemed to get in the way. I did not consider it assistance but a PITA. Where I would really like to have Intellisense is in something like EZGUI where I am guessing the return types for controlState and similar. Should I be convinced to use MonoDevelop or am I fine with Unitron?

Also can someone explain breakpoints and how to implement, track and use them. I see this being touted as a feature. Is this just a fancy version of Debug.Log? Or something else altogether?

THX
BTH

Not fancy at all. Using breakpoints is like pausing your game and checking the the value of your variables to see which one is not behaving the way you expected (it´s much more than that, but just to give you the idea). You can argue that you can do the same thing with Debug.Log, but using breakpoints is much more flexible and you freeze the code in the exact moment things are starting to mess. Easier to find the cause of error.

Search for Monodevelop and debugging on google if you want a better explanation. There are videos explaining how to do this and why this is so important for a professional programmer.

I program on a mac too and I´ve being using MD even when breakpoints were not available. Nothing compares to a good code complete and refectoring when productivity is at stake.

Basically on Windows you do not gain much from choosing MonoDevelop over VisualStudio - semantics are different ah and of-course you get the debugging capability with MonoDevelop and Unity. This of-course means that on OS X, choosing MonoDevelop over whatever you use right now will give you almost everything people say is awesome about VisualStudio (the two products are very similar) plus the source level debugging.

As I understand it, breakpoints pause your game when they are reached and let you inspect things on that frame.

I have not used MD’s breakpoints, but I have used the Debug.Break(); from within Unity

This is great for seeing exactly what is going on at a certain point. I’ve used this for “debugging”, but I’ve also used it for things like carefully adjusting go’s where I need an exact instantiation location at a point in time. Put a Debug.Break on the instantiate and know exactly where to put the spawn point with a model who’s animation is too complex to use just child go without adjustment.

Why use MD over Unitron?

I’m a long standing Unitron user, and didn’t touch (but peeked at) MD until the late 3.0b’s.

MD is still, IMHO, a mixed bag from someone who is happy using a good text editor like Unitron.

First off, for C#, it’s a much stronger platform. Many of the advantages of working in MD are lost on Unity.js.

Pro’s:
You can open all your scripts from within MD. MD keeps track of all of your scripts in your U3D project. You don’t need to swap back and forth to Unity just to open a script.

MD has code folding*.
However - code folding is broken on Unity.js. Support is aware of it, but it’s not yet fixed.

MD has region folding*. Put in tags/markers in your code and you can fold entire sub-regions.
However - region folding does not and will not work with Unity.js as the language does not support these tags.

MD has selection, script and project wide refactoring. (Refactoring, in a nutshell, is changing the name of a function and having these changes propagate through all the scripts in a project without falling prey to generic search replace all. This may include changing the name of other items such as variables, etc., but I’ve not tried it so can’t be sure.)
I have yet to figure out how to do this, even tho’ I’ve wanted to do it.

MD has auto-completion.
This seems like a smarter version than the one in Unitron that I just turned off in disgust. I’m getting used to it, and it’s even kindov helpful every now and then.

MD allows windows to be split*.
This means you can view two parts of your script at the same time.
*You cannot, however see two scripts at the same time.

Cons:
The MD pipeline assumes you are writing in C#.
Code folding is broken for Unity.js.
Region folding is unavailable for Unity.js
Unity.js seems like it’s the younger sister that the IDE has been forced to bring along under protest.

You cannot view two documents, scripts, side by side.
The tabbing interface does not allow detaching or window splitting in a way that you can view two docs at once.
Support is aware of this and they want to fix it, but the sense is that this is def. not on the high priority list.
To view two scripts at once, on occasion I’ve had both MD and Unitron open…

The debugger is awkward.
You need to let MD launch Unity, which needs to be closed (afaict) so MD can take control of Unity and use it to run and debug the project.

Any other things of note?

Some other features of monodevelop:

Context-aware autocomplete,
Syntax highlighting,
vi integration (if you happen to be a vi fan, which I am),
Refactor support,
Go to definition,
Search references,
Document outline.

I am a fan of all of these things. I am aware that other editors may support some or all of these features, but this version of monodevelop is designed to work well with unity. If you have the featureset you want and unity integration already, you may not be interested.

A word about debugging:
In general, it is vastly superior to things like Debug.Log. However, debugging in Monodevelop with unity right now is almost completely worthless. Unless I’ve missed something, it appears that you have to launch a second instance of unity, then physically hit play, then physically tab back to monodevelop to step through. This song and dance is such a usability issue that I only use the debugger in the most extreme cases.

Worse, because it’s a second unity instance, if you happen to be developing for a device needing a unity remote, you cannot debug with input.

Hence my conclusion that the monodevelop / unity debugger is almost, but not quite, completely worthless.

I usually keep track of vars and fired functions script by script as I build prefabs. I place Debug where I need readout and comment it out after assuring I am getting values I want. I like in Unitron I have instant script reference by highlighting and searching docs. I don’t like its autocomplete. The only thing I have need of is tracking runtime dependencies so I do not get two or more things happening and not sure where they are coming from…so far… I will give MD a whirl after this project.

Thx
BTH

I also today learned that MD (Mac) won’t work if you rename the /Applications/Unity folder (something I do because I keep older versions of the Unity editor for backwards compatibility).

BTH,

Just so you know, I’m a pretty tried and true Unitron user. I’m really trying to see if I can make MD work… Like I said, it’s a mixed bag. I think if I were coding in C#*, I’d get more out of it.

That being said, MD does now have the script reference by highlighting and clicking the same keys " cmd + ’ ".

One of the things I don’t like, is that the contextual highlighting is not as robust in MD as Unitron. It does get the main items, but misses many of the important items that are successfully picked up in unitron. I believe MD does highlight classes, but does not highlight the class functions.
MD will highlight “Component”.
MD will not highlight “GetComponentInChildren()”

*I’m currently coding one project exclusively in C# to see what it’s like… Jury’s still out.

Heh, screwed me up BIG TIME. I find the directory can be renamed, but you must not have spaces or other “illegal” characters. I was renaming “Unity” to “Unity 3.0bx” (note the space). I changed this to “Unity3.0bx” and it worked fine:
http://forum.unity3d.com/threads/61733

BUT!

BEWARE! I had a HUGE 3 week long series of escalating crash squalls in Unity 3.0 related to using prefabs that completely went away in the instant when I removed that space from my directory name - so Unity itself is sensitive to the directory name as well.

You’re right, it just crashed on me too. I renamed the folder to Unity_3.0f5 and Monodevelop opened but wouldn’t close and Unity crashed. I’m back to Unitron and will likely just use my Windows machine for now. :stuck_out_tongue:

Oh - and just for the record… One of the advantages of MD over Unitron is it’s smarter about selecting with a double click.

Unitron has a tendency to highlight all of currentItem.itemData (as does this forum and most other text editors).
MD sees the dot and highlights currentItem and itemData separately, which for me is a big plus.

But to counter it, the UNDO level on MD is ridiculously small. Often it’s only one character at a time. If one makes a reasonable mistake or just wants to undo a line or two, MD counts back one character per undo press… Very Annoying.

Can I use Unitron to write code as it opens my folders of scripts correctly and use MonoDevelop during runtime debugging? Any issues with this combo such as MD not updating new scripts or similar. I would test but am integrating high scores alogrithms the rest of today. Wondering if anybody has tried it with this combo as i described.

Thx
BTH