Arcen Games

Other => Game Development => Topic started by: Wanderer on November 16, 2012, 12:18:48 AM

Title: Unity in general
Post by: Wanderer on November 16, 2012, 12:18:48 AM
Arcen: You guys are nuts.  A good kind of nuts, but nuts.

I know part of it is that I'm more VB.NET than C#/Java, so I'm having syntactical arguments, but still.  I'm working through a copy of Unity 3x Game Development by Example - Beginner's Guide.  The GUI components alone are head-smacking in the thousands of small pieces to using it, and they're about as obvious as a cricket hiding under the desk.  You know it's THERE... but WHERE?

Errr, oh, why the hell am I going head-diving into Unity?  Three reasons. 
1) Someone recently pointed out an article of game engines and Unity's price (FREE! ... until you actually can make some money) made me curious enough to dive into this engine.

2) I have a reasonable idea of what can be done with the engine by a handful of talented folks and I have a game idea that's been stuck in my head for YEARS.  Everyone does, the only game ideas that count are the implemented ones.  Well, alright then!  Unity also has the ability to port to phone app reasonably well from what I've read up on and said idea could be reasonably tweaked to an app... actually, it'd probably be BETTER as a portable app.

3) Well, crap, if I'm going to dive into a public engine, it might as well be an engine that built a game I love.  Maybe then I can read the code bursts that Keith drops off more often... and I have a reasonably friendly relationship with a professional developer in the engine if I get well and truly stuck.

Some personal views 7 chapters into the 'unity for utter morons' book I'm using.  Great book.  Holy depth.  Ignore the 'tutorial' with Zelph or whatever his name is, it's broken enough and Unity has too many changes since its last iteration.  And the bouncy camera will make you puke within 30 minutes... which I don't think it was supposed to do but I couldn't figure out how to fix it so I went to a more 'Unity for Morons' approach with my learning.  Need to learn to crawl.

I did some 3D modeling for an XCom remake awhile back so I have a little familiarity with it.  I suck at it for larger models, particularly animated ones, but stills I can do reasonably, so I have some 'friends' I'm working with when I want to goof around.  That's not the point.  Unity has so many unique elements to it that you have to learn for just this engine.  Just the empty game-object alone can take some understanding.  Its interfacing is both easy to use and a huge PITA sometimes.  There are a ton of internal components to the engine's library and just learning the object model might take me upwards of 3 months (or longer since I'm not really 4 hours a day gung ho about it, this is fun dammit... *whipcrack!*) before I can even really dive into anything more substantial than 'oh, I wonder if I can do this...'. 

However, with all of that said and done, this looks like it's a pretty damned powerful toolbox.  I have no idea if I'll ever actually build said game or not (doubtful), but it'll be an interesting trip nonetheless.

Just in case anyone was curious and hadn't had a chance to really dig into the engine.
Title: Re: Unity in general
Post by: x4000 on November 16, 2012, 07:42:19 AM
Cheers! Good luck to you, it sounds like you're at the early stages of a fun journey. :) My main comment is: unity 3d actually greatly simplifies a lot of things about game development. Most of your opening comments apply to game development as a whole, heh. Not to say unity isn't complex, but you're not having to deal with raw vertices and triangle faces and so on unless you really choose to; you're not having to worry about initialization sequences for the various directx sub-components, each of which is more than a little complex; you don't have to worry about completely resetting everything by hand whenever the fullscreen mode changes (having to do this is why so many older early-2000s games would crash on the switch); and so on and so forth.

Granted, that's shaving off like 10% of a mountain of complexity, but every bit helps. AI War started out in a completely custom engine that I wrote on top of Managed DirectX and then SlimDX over a period of about six years on and off. So I definitely have done it both ways, and prefer the unity way. :)

Again, good luck! :)
Title: Re: Unity in general
Post by: keith.lamothe on November 16, 2012, 11:38:47 AM
I know part of it is that I'm more VB.NET than C#/Java, so I'm having syntactical arguments, but still.
C# is superior ;)  Sorry, had to get that out of my system.  Though I'm sure it will recharge in the next 5 minutes.

Quote
I'm working through a copy of Unity 3x Game Development by Example - Beginner's Guide.
We didn't use any books (at least, I didn't) but from what you said it's helping, so that's good.

Quote
The GUI components alone are head-smacking in the thousands of small pieces to using it, and they're about as obvious as a cricket hiding under the desk.  You know it's THERE... but WHERE?
Of the parts of Unity I've used extensively, the GUI part is the one I hate most.  It's tenable enough that we used it, but the unfixable bugs just kept on coming up (largely related to textboxes, but also with display order and so on) and we almost completely removed all references to the GUI class in AVWW (and thus Valley2 and Shattered Haven; AIW hasn't been fully converted to use our new gui approach because it caused problems when we tried and we lacked time for that kind of brawl).

But that said, it is actually usable, if you're not too perfectionistic and are well practiced in the general form of "bang head against brick wall until it comes down", and if you've been programming that long I'm sure you're pretty good at that.

Quote
Unity also has the ability to port to phone app reasonably well from what I've read up on and said idea could be reasonably tweaked to an app... actually, it'd probably be BETTER as a portable app.
We've only used the PC support, Mac support, and web-browser support (for Tidalis Lite), but I have to say it's incredibly good.  Not without some pain (Tidalis's release was our first official mac support, and there were some unity bugs that did awful things... but those bugs have been fixed since then, it was the late 2.x days for unity), and since Chris handled most/all of the porting itself I'm sure he's probably less unanimous in his praise for it... but all told, the porting works, and it works well.

One thing to bear in mind when making inferences from our stuff is that we deviate substantially from the path that Unity tries to guide you down usage-wise.  I think the only GameObject's we use are:
- the camera MonoBehavior's themselves (and only one camera matters for what you see, iirc, at one point we toyed with an alternate camera for something but I'm not seeing it in the AIW code)
- the audio clip GameObject's

The graphics we handle entirely by lower-level calls (Graphics.DrawMeshNow and Graphics.DrawMesh, there was a substantial shift in what we did towards less batching, iirc, during the "Pony Incident" in AVWW's beta), since we aren't making 3D games, we're making 2D games.   Structurally it's still polys and meshes and technically 3D, etc, but the overlying assumptions are very different.


But yes, we're nuts, it's the only way we stay sanenuts :)
Title: Re: Unity in general
Post by: TechSY730 on November 16, 2012, 11:49:15 AM
Pretty interesting that technically, any N-D engine can simulate a M-D graphics model (for M <= N) by just setting the N - M dimension of your various stuff to 0 (or as low as you can go before rendering artifacts start kicking in, or the engine stops rendering your stuff), and fixing the camera to be orthogonal to the M dimensional space/plane/whatever that your actual stuff will live on.

Yea, I know in practice it tends to be more complicated than that, but mathematically it is equivalent.


Ever thought about some sort of 2.5D graphics or graphic effects? Or "layered planes" for some fancy stuff that way?
Title: Re: Unity in general
Post by: x4000 on November 16, 2012, 11:52:48 AM
We do layered planes all the time in our games; all the parallax effects are that. But with an orthographic perspective there's no in-engine sense of depth. That all has to come from the art.

In terms of 2.5d, that opens up a whole other can of potential bugs, new artwork challenges, etc. But it can be useful for certain effects and certain kinds of animation. We might explore that someday, but I don't have any large incentive to start messing with it honestly.
Title: Re: Unity in general
Post by: TechSY730 on November 16, 2012, 12:01:16 PM
We do layered planes all the time in our games; all the parallax effects are that. But with an orthographic perspective there's no in-engine sense of depth. That all has to come from the art.

Oh cool. I should of figured that you already used one of the most classic uses of layered planes. :)

Quote
In terms of 2.5d, that opens up a whole other can of potential bugs, new artwork challenges, etc. But it can be useful for certain effects and certain kinds of animation. We might explore that someday, but I don't have any large incentive to start messing with it honestly.

Yea, 2.5D (ugh, horrible abuse of notation that is) you kind of have to design a game's art around, and it is tricky to make it look decent.
Plus, you don't gain all that much from it other than things like more realistic, dynamic lighting and some fun occlusion effects that would be hard to emulate with layered planes alone. Aka, cool, but ultimately doesn't help much with the gameplay (as opposed to graphics) unless you really focus the game around it. (Super Paper Mario on the Wii is one example that played around with this sort of stuff in a meaningful, gameplay related way, but sadly that sort of innovation tends to be the exception these days)




Speaking of game engines, any recommendations on Java (or at least JavaVM based aka .class file based) game engines? I know the graphics pipeline of Java used to be really terrible, but recent UI libraries have made Java actually usable for more sophisticated graphics.
Title: Re: Unity in general
Post by: keith.lamothe on November 16, 2012, 12:06:12 PM
In terms of 2.5d, that opens up a whole other can of potential bugs, new artwork challenges, etc. But it can be useful for certain effects and certain kinds of animation. We might explore that someday, but I don't have any large incentive to start messing with it honestly.
The isometric world map in Valley2 is a light form of 2.5D.  Though I guess it's all up to the definitions there.


One other thing I meant to say earlier:

3) Well, crap, if I'm going to dive into a public engine, it might as well be an engine that built a game I love.  Maybe then I can read the code bursts that Keith drops off more often...
At least 90% of the code snippets I show are completely orthogonal from the engine itself, they're just C# game logic.  When we ported Tidalis (during development) to Unity and then later AIW to Unity the vast majority of the code didn't even change at all since it was already in C#.

For that matter, a vast majority our changes to the games are so contained within the C# that we can just recompile the .dll in visual-studio/C#-express, copy that into our local test install, and test it without even having the unity environment running.  I personally keep using the unity environment for most testing because I'm chemically dependent on having line numbers in error messages, but I'm also infinitely amused that I can compile something in C# express and copy it into a mac install and it works.  The compiler doesn't know where the code's going, and the machine running the code doesn't know where it came from, but everything's happy ;)



Speaking of game engines, any recommendations on Java (or at least JavaVM based aka .class file based) game engines?
I don't recall any offhand.  Is there a particular reason you want to use Java over C#?  The syntax is quite similar.
Title: Re: Unity in general
Post by: TechSY730 on November 16, 2012, 12:14:36 PM
Speaking of game engines, any recommendations on Java (or at least JavaVM based aka .class file based) game engines?
I don't recall any offhand.  Is there a particular reason you want to use Java over C#?  The syntax is quite similar.

Mostly because it is what I started with. (Or rather, it is the first object oriented language I started with)

Something I do admire about Java is its syntactic simplicity (well, by programming language standards). There is very little "syntactic sugar". I will admit though, this is both a blessing and a curse. It does mean that usually there is no fancy "smart" language logic making it unclear about what will do what, but at the same time, it means that you have write a bunch of stuff out "the long way" where other languages would have a syntactic sugar to psuedo-automate it for you.
However, I am not against C# either. It doesn't delve too much into the "syntactic sugar" such that it starts making code hard to follow for my tastes. (Note, FOLLOW, not read)
Sadly, the implementations of the C# (and the CLI in general) on platforms other than windows are rather lacking. Mono is OK, but sadly, it doesn't seem to be as polished yet, and the non-Windows tooling (especially IDEs) for it doesn't seem as mature yet.
Title: Re: Unity in general
Post by: Mánagarmr on November 16, 2012, 01:12:23 PM
My definition of "2.5D" is a 3D game with a fixed camera point and no depth movement. Excellent examples would be Trine and Giana Sisters: Twisted Dreams.
Title: Re: Unity in general
Post by: x4000 on November 16, 2012, 01:15:12 PM
My definition of "2.5D" is a 3D game with a fixed camera point and no depth movement. Excellent examples would be Trine and Giana Sisters: Twisted Dreams.

Agreed.  Although I would extend that to some games that use 3D characters in 2D environments, such as New Super Mario Bros.

But what we're doing in Valley 2 isn't 2.5D, it's just a 2D isometric view.
Title: Re: Unity in general
Post by: keith.lamothe on November 16, 2012, 01:34:00 PM
Sadly, the implementations of the C# (and the CLI in general) on platforms other than windows are rather lacking. Mono is OK, but sadly, it doesn't seem to be as polished yet, and the non-Windows tooling (especially IDEs) for it doesn't seem as mature yet.
Unity uses mono and it works great :)  There's a few things that aren't as good as .NET but the biggest weakness in our setup is the lack of ability to do generalized line-level profiling, and that's more a weakness of the Unity setup than the mono one (I think current versions of mono have at least the necessary basic support for this).

(edit: there's also the garbage collection hoo-ha, but that's also a more-Unity's-fault-than-Mono's thing, as Mono has moved on to a better implementation and even in the older versions we'd have had more control over the heap size and other ameliorating factors using mono directly rather than through unity)

But for developing on it, yea, you're going to want C#-express or visual studio, which means windows.
Title: Re: Unity in general
Post by: Mánagarmr on November 16, 2012, 01:42:24 PM
I think there's a C# plugin for Eclipse, but as far as I've understood it, Eclipse isn't very popular among anyone but hobby-programmers. Most people I know seem to prefer Visual Studio.
Title: Re: Unity in general
Post by: x4000 on November 16, 2012, 01:43:23 PM
I think there's a C# plugin for Eclipse, but as far as I've understood it, Eclipse isn't very popular among anyone but hobby-programmers. Most people I know seem to prefer Visual Studio.

Also: professors.  Oh, wait, your group already covered that. ;)
Title: Re: Unity in general
Post by: TechSY730 on November 16, 2012, 01:55:25 PM
I think there's a C# plugin for Eclipse, but as far as I've understood it, Eclipse isn't very popular among anyone but hobby-programmers. Most people I know seem to prefer Visual Studio.

Hey, I use Eclipse at my job.  :)
Title: Re: Unity in general
Post by: x4000 on November 16, 2012, 01:57:48 PM
Personally, I was joshing -- I know some folks that use it at Cisco, etc, too.  It's popular among Java devs in general as I understand it.  I'm just not personally a fan. :)
Title: Re: Unity in general
Post by: keith.lamothe on November 16, 2012, 02:04:19 PM
I used eclipse for Java for a few months to help out with a game project some years ago.  It's pretty good, but it's nowhere near as good as visual studio.  That's not an insult, it's just hard to compete with the best piece of software ever written ;)
Title: Re: Unity in general
Post by: Wanderer on November 16, 2012, 02:06:19 PM
Cheers! Good luck to you, it sounds like you're at the early stages of a fun journey. :) My main comment is: unity 3d actually greatly simplifies a lot of things about game development. Most of your opening comments apply to game development as a whole, heh.

Agreed, and thanks.  Yeah, some of this is just figuring out what a Matrix is, or a Vector2.  I know what they mean... ish... but not completely what they're representing.

Quote
Not to say unity isn't complex, but you're not having to deal with raw vertices and triangle faces and so on unless you really choose to; you're not having to worry about initialization sequences for the various directx sub-components, each of which is more than a little complex; you don't have to worry about completely resetting everything by hand whenever the fullscreen mode changes (having to do this is why so many older early-2000s games would crash on the switch); and so on and so forth.
Oh, I can imagine.  I knew the pool was deep from some direct code work I did on some 2D games and programming courses WAY back (think Win 95 wayback) but um... yeah.  This pool got a lot deeper when I wasn't looking.   8)

C# is superior ;)  Sorry, had to get that out of my system.  Though I'm sure it will recharge in the next 5 minutes.
Superior perhaps, but I've been doing VBA/VBscript coding so long it's second nature.

Quote
Quote
I'm working through a copy of Unity 3x Game Development by Example - Beginner's Guide.
We didn't use any books (at least, I didn't) but from what you said it's helping, so that's good.
Fair enough, but I'm coming to the conclusion of just how much I'm a neophyte in the game implementation mechanics.  I've been theoretical FAR too damned long.

Quote
But that said, it is actually usable, if you're not too perfectionistic and are well practiced in the general form of "bang head against brick wall until it comes down", and if you've been programming that long I'm sure you're pretty good at that.
LOL, yeah, eventually head to desk impact maintenance on code performs as advertised.

Quote
We've only used the PC support, Mac support, and web-browser support (for Tidalis Lite), but I have to say it's incredibly good.  Not without some pain (Tidalis's release was our first official mac support, and there were some unity bugs that did awful things... but those bugs have been fixed since then, it was the late 2.x days for unity), and since Chris handled most/all of the porting itself I'm sure he's probably less unanimous in his praise for it... but all told, the porting works, and it works well.
That's awesome to hear.

Quote
One thing to bear in mind when making inferences from our stuff is that we deviate substantially from the path that Unity tries to guide you down usage-wise.  I think the only GameObject's we use are:
Um.  Er.  Hm.  Thanks for the warning.

Unity uses mono and it works great :)  There's a few things that aren't as good as .NET but the biggest weakness in our setup is the lack of ability to do generalized line-level profiling, and that's more a weakness of the Unity setup than the mono one (I think current versions of mono have at least the necessary basic support for this).
I have a few complaints about mono but its not mono's entirely mono's fault.  It's that I'm just not used to its idiosyncracies, like the file needs to be saved before a variable gets added to the keyword collection, or that the keyword collection doesn't always include certain items in function arguments that it'll include in a newline.

Thanks for the extra information guys.  It'll probably just back burner for a while as I dig through it and goof around.  I don't think the first stages of my project are overly ambitious other than the fact that I have absolutely no idea what the hell I'm doing yet.  :)   Luckily being in software design this long has given me a good ground state for the mixed waterfall/sprint model I prefer, and I'm tackling things in (what I currently think) is a reasonable volume of work per step.  Well, at least that's what the incomplete design doc looks like so far.  I'm still working through Chapter 9 for now!   :D
Title: Re: Unity in general
Post by: x4000 on November 16, 2012, 02:12:50 PM
I got into "modern" game programming around 2002.  I was working in C# at that time, but C# was new and wasn't used in any games at that point.  So I had to read books in C++, then figure out how to translate that stuff to C# and the managed libraries.  Fun!  Tutorials and such have come a long way since then, but the pool is even deeper now (shaders, etc) than it was even that far back.

I missed out on the windows 95 programming era, though I certainly used that OS plenty; all my limited programming at the time was DOS-focused, though.  Mostly QBASIC.  The difference in depth between that pool and the current one is... substantial, as you say. But definitely surmountable! :)
Title: Re: Unity in general
Post by: keith.lamothe on November 16, 2012, 02:16:04 PM
I have a few complaints about mono but its not mono's entirely mono's fault.  It's that I'm just not used to its idiosyncracies, like the file needs to be saved before a variable gets added to the keyword collection, or that the keyword collection doesn't always include certain items in function arguments that it'll include in a newline.
I'm not sure I follow: do you mean including symbols in the intellisense dropdowns (in VS terms)?

In any event, we're actually using a .NET coding environment, but the code is only ever run by the mono runtime.  The result is that VS gives us all the normal behavior we'd expect from working on C#.NET, up to the point where we try to run it.

Quote
Thanks for the extra information guys.  It'll probably just back burner for a while as I dig through it and goof around.  I don't think the first stages of my project are overly ambitious other than the fact that I have absolutely no idea what the hell I'm doing yet.  :)   Luckily being in software design this long has given me a good ground state for the mixed waterfall/sprint model I prefer, and I'm tackling things in (what I currently think) is a reasonable volume of work per step.  Well, at least that's what the incomplete design doc looks like so far.  I'm still working through Chapter 9 for now!   :D
There's a lot of things particular to game design/programming, yea, but having that solid background in other software development really does help a lot.  I had no professional game programming experience, and only about say 300-400 hours of amateur game programming experience, in January 2010 when I started some part-time contracting work for Arcen.  But the previous 5 years of professional enterprise programming experience was pretty helpful ;)  That, and Chris is an excellent teacher.  And if I'm honest, the fact that he's always handled the true guts of the graphics stuff helps ;)
Title: Re: Unity in general
Post by: Wanderer on November 16, 2012, 04:02:40 PM
Note to self paying from your new iphone knockoff is a serious pita.  Yeah I meant the intelligence equivalent there.
Title: Re: Unity in general
Post by: RogueDeus on May 02, 2013, 09:15:21 PM
This may be an out of left field sort of question but I am really curious how you guys handle the scene/level limitations of Unity. What little I have learned to do makes pretty significant use of gameobject scripting and the level editor, but I get the impression you barely utilize either.

How do you manage that?

And what happens when you complete your work? Do you build it from the unity tool set as though it where a normal project?

I hope I am not asking you something that has already been answered.

Title: Re: Unity in general
Post by: keith.lamothe on May 02, 2013, 09:22:14 PM
This may be an out of left field sort of question but I am really curious how you guys handle the scene/level limitations of Unity. What little I have learned to do makes pretty significant use of gameobject scripting and the level editor, but I get the impression you barely utilize either.
Right, we just have one scene and it's just one camera with the game drawn in front of it via orthographic-perfect projection.

Quote
How do you manage that?
Chris set it up, but once it's in place it's quite simple :)

Quote
And what happens when you complete your work? Do you build it from the unity tool set as though it where a normal project?
We do build the Unity Standalone Player in Unity, yes, but for an update if the changes are all code and/or graphics we don't have to rebuild in Unity because a c# build from VS will create a dll we can just copy over the c-sharp dll used by the standalone, and the graphics are stored separate from the asset bundle and are loaded at runtime.  Said runtime loading is definitely not the way Unity likes it to be done, though, as we've found it's really quite slow in 4.0 in some circumstances.

If we have to change something in the asset bundle that requires rebuilding from within Unity.
Title: Re: Unity in general
Post by: x4000 on May 02, 2013, 09:56:43 PM
Yeah, I would also add we use practically no gameobjects, and we runtime-load most of our assets via the WWW class.  I literally can go a month without opening the unity editor, while releasing daily updates to a game.