Home Artists Posts Import Register

Content

Hey everyone!

New video is coming along nicely, but I just wanted to chat about something else I've been doing. And that's learning Unity! It was my new year's resolution for 2021, and I've been doing a little bit every week all year.

I started with tutorials. I found Tom Francis's tutorial series to be pretty helpful, and enjoyed following along as we made a top-down stealth shooter with vision cones and spawning enemies. It took weeks and weeks to follow these hour-long episodes, but it was an enjoyable experience.

But then I tried to make something myself and realised... none of it had really gone in! I had a few of the fundamental ideas of Unity under my belt - like making "prefab" versions of objects, and making "public" variables that you can see and change from the editor - but most had gone in one ear and out the other. I was lost!

So today I decided to try something different. I was gonna make a game from scratch, using what I could remember from Tom's tutorials and then Googling (and asking on the GMTK Discord) for everything else.

I decided the best thing to do was to recreate an existing game. This is a really good way of learning, I think. You don't need to come up with ideas or change the design as you go. You know exactly what you need to make, can plan ahead, and you can play the real game to see what the final outcome should look like.

I decided to recreate the iPhone game "Pop the Lock". It's an incredibly simple game: a cursor automatically rotates around a circular track. There's a coin on the circle. Tap the screen when your cursor's on the coin to score a point. At which point the cursor changes direction and speeds up, and a new coin appears.

It's super simple, but that was in my favour. I should be able to make the whole thing myself without too much trouble.

And... I did it! 

2D games are actually 3D in Unity.

I started by making the simple graphics in Photoshop and putting them into Unity as sprites. I used a handy function called "RotateAround" to have the cursor rotate around the middle of the screen.

I made a coin appear, and then used Unity's collision detection system to check if my cursor was colliding with the coin. If the player hits the space bar when this is true, the score goes up.

The hardest bit was placing the next coin. It was easy to have it appear in a random point on the ring, but that's not how the iPhone game works. Instead, it should appear slightly ahead of where your cursor is now heading, at a random distance away. Rotation is always a bit tricky - especially because Unity works in quaternions: a barmy three-dimensional (four, maybe?) unit for describing axis-angle rotation. Luckily, there are some functions to make it simpler.

Anyway: that was about it. I just needed some logic for score and failure and it was done. I could have added particle effects and sounds and screen shake, but that wasn't really the point of the exercise.

Really, I was trying to learn the overarching structure of Unity. One of the tricky things with the engine is having two things talk to each other. Say: making the score go up when you win: that's my "Game Logic" object chatting to my "Cursor" object. In Game Maker, that's effortless - in Unity, there's a bit more to it as you need to essentially wire up a custom phone line between these two objects.

But anyway. This might look like a really simple project (especially to any programmers reading!), and I'd totally agree. But it was more of an exercise for me - can I make something work in Unity without just following tutorials and replicating code?

Because ultimately I want to get to the point where I can have an idea for a game and then wire up a prototype in a few days. That requires a lot of confidence in how things work, and a knowledge of many parts of the engine. And so I'll need to do more experiments like this before I get to that point.

But I'm happy with today's efforts. Baby steps and all that. And I'm looking forward to my next project. Any recommendations for games I should try and recreate?

Speak soon

Mark

Files

Pop the Lock Recreation

Comments

Will Kommor

Congrats on finishing a Unity project! For the next one: never too early to start practicing 2d platformers...

Anonymous

That's great! I highly recommend to take GameDev.tv courses (https://www.udemy.com/user/gamedevtv/). I think that the way they teach and the exercises they give are the best for learning. Also, each module it's a project, so you will be recreating simple games:) Good luck with your next project and enjoy the journey:)

Anonymous

I spend alot of time making grid based puzzle games, so building a game world, whether it uses physics (platforming), grids (puzzles, strategy etc, RPGs), or transforms (arcade games like pong, astroids, top down racing games) something else is worth trying.

Anonymous

Awesome work Mark! The most important thing is to finish something. And don't worry, getting used to the way of doing things in Unity takes time and repetition. For the next game, try to do a platformer and play around with the rigidbody system of Unity

Anonymous

also remeber that theres always lots of ways to code something, so dont get to caught up in the meta of sending messages around unity or structure until you want to make something your going to "release" (e.g. sink alot of time into)

Anonymous

One of the classic Windows mouse tutorial games (minesweeper/solitaire) would probably be a good choice for directed learning of mouse input. PacMan is probably a good choice for directed learning of path-finding/simplisitc AI.

Anonymous

Congratulations. 'Flappy Birds' (now or later) is a good training program

Anonymous

Consider making a REALLY simple simulation game. Currently you have a clear view of all the "actors" in the scene: cursor, dot, etc. With simulation, each "unit" (whatever it is in your game) has to have "internal state" and observe the world, so you can't have a clear "top down" view of everything in the game and have to figure out how to debug when it's not obvious "who" is doing "what".

Anonymous

Checkers is probably a good bet for experimenting with multi-player. Chess could also work, but the game rules are harder to encode.

Anonymous

Tetris is another simple and rewarding game to make.

Anonymous

As a professional programmer, I can confirm "what you remember + Google" is 100% how it's done Congrats on the progress!

Anonymous

Congrats man!!!! As a coder I found Unity very fun to play with. I continue to dream of making my "great game" on the side, but my life gets too busy and I'm terrible at idea making I think.. but one day I will... Feel free to ping me if you ever need any coding help (15 year pro coder here)

Anonymous

Very much this. If I'm programming, I've almost invariably got one window with the code I'm writing on it, and somewhere between 1 and 5 with reference material, most of which is discovered via google. Also, I almost always offer to let people treat me as google as part of my spiel when introducing the problem during a coding interview. No one is expected to actually remember the names of APIs.

Anonymous

This takes me back, I remember doing the same when I was first trying to teach myself to make games. My first was recreating minesweeper (with randomly generated levels) in the command console. My second was space invaders, except instead of enemies appearing above they appeared at the sides and spiralled in, while the player, in the centre of the screen, rotated instead of moving side to side. I think doing something like this is useful: taking a simple game and then adding a little twist of your own. This makes it a little more exciting to work on, and gives you a way to exercises your creative game dev skills as well as the technical. With each subsequent project I would try pick something that focused on a new area that I wasn't yet familiar with e.g. 2d platformer movement, simple lighting, 3d rendering etc. These days so much is provided out of the box by unreal and unity that the problem is often less needing to know the technical ins and outs of what you need to do, and instead just knowing which features of the engine/editor you need to wire together to make it happen. This for me just came with experience, which is easy when it's your full time job to do it! More practically, some really interesting resources for developing this sort of knowledge are youtube channels like 'Mix and Jam', and 'Makin' Stuff Look Good In Video Games'. These can be quite technical if you're not familiar with the techniques involved, but if you take the time to follow along and understand everything they do a good job of exposing you to lots of different techniques and features you might not otherwise ever be aware of. Good luck with your journey! Making games sometimes feels like the ultimate video game, in many ways :)

Anonymous

You remind me of the first Global Games Jams I participated in. It looks simple but without any experience it takes some time, and the best way to learn is doing what you are doing right now I believe. Great luck with that and I look forward to seeing your end result!

Anonymous

Great job, Mark!

Anonymous

Wow awesome! Is Unity suitable for people with no programming background?

GameMakersToolkit

There are certainly game making programs out there that require no, or very little programming. Unity will require you to code. But, with so many tutorials and forums out there, it's one of the more accessible to get into!

Anonymous

Nice! I'm looking forward to more.

Anonymous

Good job, Mark. Coincidentally I'm working on the same project right now - learning Unity and trying to go game dev as a hobby. I have a bit of coding experience already, so learing the creative part (graphics, music, design) will be the tougher challenge. But that's what I like about solo game design: you can be creative in so many ways. I would recommend the "Junior Programmer Pathway" on the official Unity Learn site, at least the first two parts of it where you build five different prototypes. Also I love the Youtube channel of Sebastion Lague - great coder even though a bit advanced for beginners. So once you're ready for your first game jam (as a participant) and are looking for someone to team up with, hit me up! :)

Anonymous

When you created the "custom phone line" between the Game Logic object and the Cursor object did you use an event handler, or just make a hack to give those two objects the ability to access each other's methods? For a smaller game like this, the hack will be easier to code. But if you want to adapt it to a larger, more complicated game, learning event handling will make things much easier in the long run.

Anonymous

Congratulations on your first Unity project!

Mikhail Aristov

My first Unity experience was an art school project. We had two coders, three artists, and a composer on our team, and we were soooo certain we'd make a great 2D horror game... and we actually did. Eventually. Almost a year later. :D

Aadit Doshi

Nice work Mark! As with everything, it takes a little repetition and practice to get a handle on new tools. I used to tutor game dev students in uni and would recommend setting your own goals to make sure you're satisfied with your progress. I have a few benchmarks I like to hit to make sure I at least understand how to work in a new game engine. This helped me make jumps between xna, unity, unreal. 1) spawn an object that when you click on or aim at, it gets destroyed and spawns a new one. Use raycasts and colliders for this. Make sure it plays sound and spawns some vfx. 2) make a counter to update the number of times you've done this. 3) use input modifiers (like changing weapons or holding crtl etc) to change what click or aiming at the object does. 4) make the object move around randomly (depending on the engine, you're either looking for AI nav movement or grid based movement) This usually covers enough for me to start experimenting with other features of the engine.

Anonymous

Congratulations on your first game! This is such a cute post, it's nice to see somebody move the first steps. Ask away if you get stuck!

Anonymous

Mark, if you ever think of 2D game, there is a tutorial made by mister Taft that is very very good