Unity Game Development Catch-All

So I've been working sporadically for the last several couple of years at learning Unity3D for game development. I say sporadically only due to a huge amount of hours being spent on my day-to-day web development job, but now things are smoothing out at work and I'm ready to get serious about designing and releasing my own game. The obvious choice for a beginner game developer is Unity, although I have started some projects in Gamemaker Studio and Construct2 as options for 2D development. However, now that Unity has upgraded their 2D development workflow significantly, I've decided to plunge 100% into that platform.

So to start off the discussion, I've planned my own initial attack on game development by creating a 2D game for Android and iOS. It's a bit of a cross between a roguelike and an endless runner, with a retro feel. My approach is to get a prototype working in its most basic form (placeholder sprites, no animations) so that I can get the gameplay fun and engaging as quickly as possible. Then and only then, I'll add features and polish to flesh everything out into a complete (wait for it) for-sale-for-reals PRODUCT.

My biggest struggles so far have been learning the new animation features in Unity, and specifically synchronizing them with the player movement and interactions in the world.

Some resources I've found particularly useful are:
- http://answers.unity3d.com/
- http://www.unity3dstudent.com
- https://www.udemy.com/unity-3d-game-development/#/
- https://www.youtube.com/user/Unity3D
- https://www.youtube.com/playlist?list=PLX2vGYjWbI0SLoX3q1tUf3RJU_WzcLcHL
- http://unity3d.com/learn/tutorials/projects/2d-roguelike

Can't wait to hear about the games that other GWJers are working on in Unity!

I've been meaning to tinker with Unity and these resources will be very helpful. Thanks! While I know some coding, I don't know enough to do it professionally. How easy/hard is it for a coder of moderate skill?

I've been meaning to get started for awhile, though I'm currently doing Handmade Hero.

RooksGambit wrote:

I've been meaning to tinker with Unity and these resources will be very helpful. Thanks! While I know some coding, I don't know enough to do it professionally. How easy/hard is it for a coder of moderate skill?

Pretty easy; I know some artists who have made games by using pre-existing scripts. Knowing even a little bit of programming will take you a long way. Now, if there's something super-specific you want to do, that'll be harder, but any concept you can implement with the basic Unity components doing the gameplay work will be fairly easy to implement.

I actually tried to start a very similar thread to this a few days ago

I recently decided to try to get back back into game making (had a few concepts in development back in the early days of XNA).

Gremlin wrote:
RooksGambit wrote:

I've been meaning to tinker with Unity and these resources will be very helpful. Thanks! While I know some coding, I don't know enough to do it professionally. How easy/hard is it for a coder of moderate skill?

Pretty easy; I know some artists who have made games by using pre-existing scripts. Knowing even a little bit of programming will take you a long way. Now, if there's something super-specific you want to do, that'll be harder, but any concept you can implement with the basic Unity components doing the gameplay work will be fairly easy to implement.

Even though my own experience is limited so far in GAME development, I can tell you that it really depends on the complexity of what you are trying to develop. For example, I am a very experienced web developer, and from that perspective, if I wanted to create a website, there are many toolkits and ready-made scripts and libraries (i.e., shortcuts) that would make the creation of a fully-functional site relatively simple. But the moment you want to do something with your website outside the scope of those shortcut mechanisms, you would run into trouble and have to dig into some coding.

Similarly, my experience so far with Unity is that I've been able to get started doing some relatively simple things, but when I have gotten to my own specific game design ideas, I've had to dive more deeply into code. So in my opinion, coding knowledge becomes more important the more deeply you go. That's why I am personally working hard to not just solve specific problems with tools and shortcuts as I progress through the development of my own individual game, but to also understand the foundational concepts of solving the problems, so that I will be better equipped in the long run.

ALL OF THAT BEING SAID, I do still agree that you would be a fool to ignore some of the amazing tools available in the Unity Asset Store. One of the best ones that allows you to start putting some game logic together without code is Playmaker: https://www.assetstore.unity3d.com/en/#!/content/368

Hope this helps!

Bonus_Eruptus wrote:

I've been meaning to get started for awhile, though I'm currently doing Handmade Hero.

I've been watching some of your Twitch videos! GREAT STUFF! I deeply appreciate the time and detail you put into them.

kstress71 wrote:
Bonus_Eruptus wrote:

I've been meaning to get started for awhile, though I'm currently doing Handmade Hero.

I've been watching some of your Twitch videos! GREAT STUFF! I deeply appreciate the time and detail you put into them.

Oh, that's not me. I'm following Casey's videos, too.

I'm a HUGE fan of Unity's 2D system for my side projects, especially with the new UI features in 4.6. I was getting really frustrated building 3D art assets and decided to move to a pixel / minimalist design aesthetic and now I'm actually getting projects done. I haven't tried to sell anything yet, I mostly work on game jam games (for Ludum Dare and Global Game Jam) or tech demos to learn new things like controller inputs and shaders. I'm in the planning / idea stage for an X-Com style hybrid board game with app now.

Not quite sure what resources to recommend... Jesse Freeman and Mike Geig are always posting interesting Unity related things on Twitter. Walking through YouTube videos, pausing as needed to practice, has gotten me through a lot of Mechanim headaches as well. I don't recommend buying Unity books anymore because their tech changes so fast. Also, a lot of devs are streaming their Unity work on Twitch as well. It's a bit fast paced but there's usually conversation going on that can be interesting and they usually share their project code or snippets afterwards too.

https://twitter.com/jessefreeman
https://twitter.com/mikegeig

Since no one has mentioned it yet, I need to link to the super-useful Unity Patterns site. Lots of little practical things that make some common tasks way easier, plus tools and tutorials.

I've been running through the Catlike Coding tutorials. It's really helping me learn Unity, even though it's a bit out of date.

LockAndLoad wrote:

I'm a HUGE fan of Unity's 2D system for my side projects, especially with the new UI features in 4.6. I was getting really frustrated building 3D art assets and decided to move to a pixel / minimalist design aesthetic and now I'm actually getting projects done. I haven't tried to sell anything yet, I mostly work on game jam games (for Ludum Dare and Global Game Jam) or tech demos to learn new things like controller inputs and shaders. I'm in the planning / idea stage for an X-Com style hybrid board game with app now.

Not quite sure what resources to recommend... Jesse Freeman and Mike Geig are always posting interesting Unity related things on Twitter. Walking through YouTube videos, pausing as needed to practice, has gotten me through a lot of Mechanim headaches as well. I don't recommend buying Unity books anymore because their tech changes so fast. Also, a lot of devs are streaming their Unity work on Twitch as well. It's a bit fast paced but there's usually conversation going on that can be interesting and they usually share their project code or snippets afterwards too.

https://twitter.com/jessefreeman
https://twitter.com/mikegeig

Great stuff, thanks!

I've been enjoying digging into the new 2D workflow as well. I had previously tried out the 2D Toolkit from the Asset Store, but I like how this is much more integrated into the system than a project-specific asset.

I'd love to hear more about your game as its development progresses.

One of the challenges I'm running into currently is the best way to implement endless level generation in-game. What I'm working on is SORT OF like an endless runner, but with different mechanics. There is ever-increasing pressure to progress deeper into the level, but the player also has the strategic option of BACKING UP if they have the skill to accomplish it while still avoiding death. Similar to the way in Crossy Road that the level will continue to progress indefinitely as long as you don't die, my game needs to generate ongoing procedural level content without killing the game's performance. In addition, the movement and level design in my game is grid-based, and I want to keep control of how many GameObjects (tiles) are being managed at one time, so rather than instantiating (or spawning with PoolManager) an ever-increasing number of tiles, I'm working on a clean way to only keep active a RANGE of tiles around the player. Crossy Road specifically has the luxury of not allowing the player to go backwards, and I might have to go that way in the end, but I want that decision to be made for gameplay reasons, not because I can't figure out how to make it work technically.

Any suggestions would be appreciated

Gremlin wrote:

Since no one has mentioned it yet, I need to link to the super-useful Unity Patterns site. Lots of little practical things that make some common tasks way easier, plus tools and tutorials.

This is EXACTLY what I've been looking for recently. Thanks!

Here is another great list of quick-tips for working in Unity: http://devmag.org.za/2012/07/12/50-tips-for-working-with-unity-best-practices/

Gonna have to keep the eye on this thread. I'm the exact same as you kstress71. I tried game maker first for 2d gaming. While I liked the ease of use art and sprite wise. I hated the coding system they had. I have no game coding background but I know .net backwards and forwards. I stayed away from unity thinking it was mostly 3d stuff which I didn't want to do. Then I saw their video example of a 2d game. Looks good and way more powerful. Can't wait to give it a go.

The biggest "gotcha" of the 2D system is that you still need to think in 3D terms. The Z axis is still a factor in how things are displayed. And then sprites also have a layer value. It can get confusing at first. One trick I use is to pause a game and then click the "2D" in the Game viewport. That breaks the camera out of its flat view and lets you pivot and look at how itema are positioned.

I should share some old experiment code... let me see if I have anything on Github that might be helpful.

Found this nice tutorial. Not finished yet but giving me a decent outline on how to build a 2d game. I'm liking what I'm seeing so far. The tools and techniques I've seen have already given me a few ideas on making a few prototype games. Planning on either a mining game or a top down game. It'll be the third iteration of the first one, but every time I remake it it gets a little better.

http://pixelnest.io/tutorials/2d-game-unity/table-of-contents/

LockAndLoad wrote:

The biggest "gotcha" of the 2D system is that you still need to think in 3D terms. The Z axis is still a factor in how things are displayed. And then sprites also have a layer value. It can get confusing at first. One trick I use is to pause a game and then click the "2D" in the Game viewport. That breaks the camera out of its flat view and lets you pivot and look at how itema are positioned.

I should share some old experiment code... let me see if I have anything on Github that might be helpful.

Good points, and yes, bouncing out of the 2D mode while paused in-game to step through frames is super-helpful. I just wish that the interaction between Unity and the MonoDevelop debugger wasn't so finicky. Once you are at a breakpoint in MonoDevelop, you can't switch back to Unity to look through the Inspector.

One other thing... I prefer to code in Visual Studio, and I have installed the Visual Studio Tools for Unity in VS Express for Desktop 2013. However, nothing I do will attach to the Unity process so that I can debug in VS. It appears to attach and start the code, but will not stop at breakpoints. Anyone had any success doing that?

master0 wrote:

Found this nice tutorial. Not finished yet but giving me a decent outline on how to build a 2d game. I'm liking what I'm seeing so far. The tools and techniques I've seen have already given me a few ideas on making a few prototype games. Planning on either a mining game or a top down game. It'll be the third iteration of the first one, but every time I remake it it gets a little better.

http://pixelnest.io/tutorials/2d-game-unity/table-of-contents/

This looks like an interesting tutorial. I'll check it out

VS Express won't let you hook up an external process for debugging at all. Get the new Community Edition. It supports Unity Tools, is free for small teams and is pretty much the same as VS Pro.

http://www.visualstudio.com/en-us/ne...

And ugh... MonoDevelop is so bad. I know it can be a bit intimidating to setup but learning Visual Studio is great for a resume and it's a fantastic dev environment. Once you start working with Intellisense, you'll never want to work without it again. Even as a hobbyist, its was worth me buying a Pro license.

Some more details on VS Community Edition and UnityVS...

http://unitycoder.com/blog/2014/11/1...

LockAndLoad wrote:

VS Express won't let you hook up an external process for debugging at all. Get the new Community Edition. It supports Unity Tools, is free for small teams and is pretty much the same as VS Pro.

http://www.visualstudio.com/en-us/ne...

And ugh... MonoDevelop is so bad. I know it can be a bit intimidating to setup but learning Visual Studio is great for a resume and it's a fantastic dev environment. Once you start working with Intellisense, you'll never want to work without it again. Even as a hobbyist, its was worth me buying a Pro license.

Oh, yes, I've been using VS Pro for a long time for web development and trying to use MonoDevelop was PAINFUL. Thanks for the heads-up on VS Community Edition!

kstress71 wrote:
LockAndLoad wrote:

VS Express won't let you hook up an external process for debugging at all. Get the new Community Edition. It supports Unity Tools, is free for small teams and is pretty much the same as VS Pro.

http://www.visualstudio.com/en-us/ne...

And ugh... MonoDevelop is so bad. I know it can be a bit intimidating to setup but learning Visual Studio is great for a resume and it's a fantastic dev environment. Once you start working with Intellisense, you'll never want to work without it again. Even as a hobbyist, its was worth me buying a Pro license.

Oh, yes, I've been using VS Pro for a long time for web development and trying to use MonoDevelop was PAINFUL. Thanks for the heads-up on VS Community Edition!

I was just gonna google around for that. I noticed during the test app the lack of any sort of debug error which became a problem when I made a simple mistake. So thanks for that. I also avoid MonoDevelop. A good ide is worth it's wait in gold. I'm normally a vb.net developer so I hope coding games in c# will make me more comfortable in it.

On a side note I basically finished the tutorial I linked to before. So I feel I get a decent grounding now. Or at least enough to make something very poorly work.

Great idea starting this thread. I'm a total newbie, but looking forward to learning.

Just thought I'd add this. http://www.daikonforge.com/dfgui/save-on-run/

Unity doesn't auto save. So when it crashed on me twice I wound up losing some work. The little script above works well. Basically saving the scene every time you press play.

master0 wrote:

Just thought I'd add this. http://www.daikonforge.com/dfgui/save-on-run/

Unity doesn't auto save. So when it crashed on me twice I wound up losing some work. The little script above works well. Basically saving the scene every time you press play.

Thanks for posting this! Works like a charm

Glad to help. Unity does a lot of little things poorly. The lack of auto save is odd. The fact that I can't rename a lot of the objects in the GUI is also odd. If a script get stuck in an infinite loop you have to forcefull reset unity. Still it does a lot of other things right it seems. Here's my first self made prototype.

IMAGE(http://s13.postimg.org/twpykdc1j/Test.png)

Cool bits. The ground is randomly generated. I can easily tweak it so certain ores show up more or less. The camera follows the player when he moves around. This took me a while to setup but it was a good learning process. Like it was said before unity's 2d is not really 2d. So you have to really make sure it's setup right or you'll fall through the ground.

Next step is figuring out how to make the player dig through the ground. Not entirely certain about that step but I'll figure it out sometime.

edit: Oh and I made all the sprites via GameMaker. It has a nice little sprite maker that allows for some nice simple designs.

master0 wrote:

Found this nice tutorial. Not finished yet but giving me a decent outline on how to build a 2d game. I'm liking what I'm seeing so far. The tools and techniques I've seen have already given me a few ideas on making a few prototype games. Planning on either a mining game or a top down game. It'll be the third iteration of the first one, but every time I remake it it gets a little better.

http://pixelnest.io/tutorials/2d-game-unity/table-of-contents/

Thanks for this. This one is very good. Jay, who is doing the video tutorial that is linked on that site has done many tutorials for Corona SDK which I have developed with in the past.

Godzilla Blitz wrote:

Great idea starting this thread. I'm a total newbie, but looking forward to learning.

Totally agree. I have been developing iOS apps for several years now with the Corona SDK which uses the Lua language.
However, I feel that I have hit a brick wall with Corona.

I have been porting my Touch Trains app to the newest version of Corona. Nothing seems to be working right anymore. Totally frustrating. Their new scene generating API just seems cludgy. After all these years they still don't have a decent IDE.

I have decided to switch over to Unity and not look back. Wish me luck.

Once again, thanks for this thread. Timing is everything.

master0 wrote:

Glad to help. Unity does a lot of little things poorly. The lack of auto save is odd. The fact that I can't rename a lot of the objects in the GUI is also odd. If a script get stuck in an infinite loop you have to forcefull reset unity. Still it does a lot of other things right it seems. Here's my first self made prototype.

Cool bits. The ground is randomly generated. I can easily tweak it so certain ores show up more or less. The camera follows the player when he moves around. This took me a while to setup but it was a good learning process. Like it was said before unity's 2d is not really 2d. So you have to really make sure it's setup right or you'll fall through the ground.

Next step is figuring out how to make the player dig through the ground. Not entirely certain about that step but I'll figure it out sometime.

edit: Oh and I made all the sprites via GameMaker. It has a nice little sprite maker that allows for some nice simple designs.

Wow, this is eerily familiar, as in extremely similar to the game I'm making. I currently also have a grid based, procedurally-generated world where the player moves around and digs into the ground, exploring. I first set up my camera to stay on the character, but changed it to an approach where the camera only moves to track the player if they are moving outside of a bounded region in the camera range. I watched a Youtube video to see how that was done, but implemented mine slightly differently. I grabbed placeholder images for development sprites from Google searches.

So one thing that I'm currently working through is smoothly switching between (a) manually controlling player movement through the grid when digging or drilling in some direction and (b) leaving player movement up to the 2D physics engine when the player is moving through an area that is already drilled (or encounters an open region underground). So, for example, they dig down to an randomly-generated open region (cave), and immediately the player GameObject switches to be controlled by physics, letting gravity control the player dropping to the surface below.

Oh, and I'm using the Hulk as my placeholder Player sprite

IMAGE(http://s5.postimg.org/ox0negpaf/prototype1.jpg)

Goonch wrote:
Godzilla Blitz wrote:

Great idea starting this thread. I'm a total newbie, but looking forward to learning.

Totally agree. I have been developing iOS apps for several years now with the Corona SDK which uses the Lua language.
However, I feel that I have hit a brick wall with Corona.

I have been porting my Touch Trains app to the newest version of Corona. Nothing seems to be working right anymore. Totally frustrating. Their new scene generating API just seems cludgy. After all these years they still don't have a decent IDE.

I have decided to switch over to Unity and not look back. Wish me luck.

Once again, thanks for this thread. Timing is everything.

Good luck to you! I hope that we can all be resources for each other in our common assault on Unity.

So I was struggling with how to force my orthographic camera to exactly fit a region of the game world, as I'm building my 2D scene dynamically (the level is always procedurally generated, but seeded, so that it can be repeatable if desired). My first game is targeting mobile, playable specifically in a one-handed portrait viewing mode. For anyone interested, I found this excellent forum post that did the trick for me. In my case, I simply set the desired aspect ratio to 9 x 16, although in the long run, I'll have to dynamically set that for the detected device's actual aspect ratio. Here is the link to the original forum post with suggested code.

I made some changes and now call InitializeCamera in the Start() method of an empty GameObject in my world simply intended to house a script for the overarching gameplay controller. This is ugly and I make no statements that this is the best way to do it, but this script solved my camera setup problems:

private void InitializeCamera()
{
// set the desired aspect ratio (the values in this example are
// hard-coded for 16:9, but you could make them into public
// variables instead so you can set them at design time)
float targetaspect = 9.0f / 16.0f;

// determine the game window's current aspect ratio
float windowaspect = (float)Screen.width / (float)Screen.height;

// current viewport height should be scaled by this amount
float scaleheight = windowaspect / targetaspect;

// obtain camera component so we can modify its viewport
//mainCamera = GameObject.Find("Main Camera").camera;
mainCamera = Camera.main;

// if scaled height is less than current height, add letterbox
if (scaleheight < 1.0f)
{
Rect rect = mainCamera.rect;

rect.width = 1.0f;
rect.height = scaleheight;
rect.x = 0;
rect.y = (1.0f - scaleheight) / 2.0f;

mainCamera.rect = rect;
}
else
{ // add pillarbox
float scalewidth = 1.0f / scaleheight;

Rect rect = mainCamera.rect;

rect.width = scalewidth;
rect.height = 1.0f;
rect.x = (1.0f - scalewidth) / 2.0f;
rect.y = 0;

mainCamera.rect = rect;
}

mainCamera.transform.position = playerGO.transform.position + (Vector3.down * blockHeight * Constants.CAMERA_BLOCKS_OFFSET_Y) + cameraZOffset;
mainCamera.orthographicSize = (Constants.GRID_COLS_COUNT - 1) * dirtBlock.renderer.bounds.size.x;
cameraStaticX = mainCamera.transform.position.x;

UpdateCameraForPlayerBounds();
}