Code Monkey

2.9K posts

Code Monkey banner
Code Monkey

Code Monkey

@UnityCodeMonkey

Teaching Game Development and Programming using Unity and C# https://t.co/YvPfuTJmIz

Katılım Nisan 2018
161 Takip Edilen26.5K Takipçiler
Sabitlenmiş Tweet
Code Monkey
Code Monkey@UnityCodeMonkey·
🎮Complete FREE Unity Course! For Beginners and Intermediates Learn to make a Game with high quality clean code! #unity3d #gamedev #indiedev
English
26
79
528
53.7K
Code Monkey
Code Monkey@UnityCodeMonkey·
Assets can be insanely useful, but they can also add a ton of unnecessary bloat to your project or make it really hard to integrate properly with your own codebase or make modifications. Is it worth it using those massive all-in-one game assets in a custom project? For me, when it comes to tools assets I prefer tools that do one thing and one thing only. So I like simple one-off tools, those are much easier to integrate into a big custom project. I'm not a fan of massive all-in-one tools that do a billion different things, like 100 systems for making an RPG. Because yeah the more complex the asset the harder it is to integrate into your own project with your own custom code. However that's just personal preference, some people really like having basically an RPG template to start with and just build upon that. It can be super useful for making a quick prototype to test out some game idea. I think the best advice if you really want to use those massive assets, is to just not fight it. Those assets codebases naturally will be quite opinionated, and if you do want to use them then it's probably wise to just go along with how the asset is built, rather than completely modifying it to fit your personal code style. Otherwise if you refactor everything then you're basically doing it all from scratch and you might as well not even use that asset. And of course there's an in-between. Like I said I think these massive game maker tools can be great for quickly prototyping some game idea. So you can do just that, and if the prototype works and you like the game, then you can rebuild the whole thing yourself from scratch. That way you get the benefit of quickly testing, but also get a solid custom made foundation if you do decide to take that project to the end.
Code Monkey tweet media
English
5
2
27
1.9K
Code Monkey
Code Monkey@UnityCodeMonkey·
Unique Mechanics in 30 SECONDS - Nimbatus (Ship Building)
English
0
1
17
1.1K
Code Monkey
Code Monkey@UnityCodeMonkey·
#### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### (A) Structs indeed cannot be null however in this example code myColor is not a Struct but rather a Nullable. Note the Question mark ? after the type, that marks the type as Nullable. When you make something Nullable you can make that type null, regardless of what that type is. This is all valid code: Color? myColor = null; int? myInt = null; bool? myBool = null; I have a lecture on Nullables in my C# Course youtube.com/watch?v=qZpMX8…
YouTube video
YouTube
English
0
0
12
1.6K
Code Monkey
Code Monkey@UnityCodeMonkey·
Is this valid code? Color? myColor = null; A) Yes B) No, myColor is a struct and cannot be null (answer in reply below)
English
2
0
11
5.1K
Code Monkey
Code Monkey@UnityCodeMonkey·
Quick Tip on Awake vs Start in Unity. My one Rule that helps avoid so many headaches is this: Use Awake() for local initialization, meaning for initializing the current object, and use Start() for grabbing references from other scripts. For example if you have a Player with the singleton pattern, you would set the static Instance on the Player's Awake(), but on the Enemy script, if you need to access the Player.Instance you would get that on Start(). That way you know for certain the Player has been initialized before the Enemy grabs it. Stick to this one super simple rule and you will avoid so many code timing issues!
Code Monkey tweet media
English
1
4
41
1.3K
Code Monkey
Code Monkey@UnityCodeMonkey·
What Streaming Software do you use?
English
0
2
15
1.1K
Code Monkey
Code Monkey@UnityCodeMonkey·
If you make games as a hobby just for fun, go wild! But if you want a sustainable indie business, building a game on the "wrong" genre means you're playing on hard mode! Choosing the right genre is one of the most important choices you make that will greatly impact how successful your game is, and how hard is that success. Do you want to build a 2D Platformer? It will be very difficult to find success because that genre is oversaturated, there are way more games than players. Do you want to build a Simulator game? There's millions of players on Steam hungry for this genre so finding success will be comparatively easier. This applies to eventual sales numbers but also to pre-release marketing. Trying to market a 2D Platformer will be like ice skating uphill, whereas marketing a simulator game will be comparatively easy mode. (even though of course it is never easy) So if your goal is financial success, you should pick your game idea/genre extremely carefully!
Code Monkey tweet media
English
7
6
71
5.3K
Code Monkey
Code Monkey@UnityCodeMonkey·
How to make different Levels or Maps for your Games!
English
1
4
37
1.9K
Code Monkey
Code Monkey@UnityCodeMonkey·
Some beginners see videos of Unity showcasing DOTS and they instantly want to start using it, a regular question I get is "I'm a beginner, should I learn DOTS?" And to that I say that while DOTS is absolutely amazing (it can literally make your code 100x faster!) it is very much an advanced toolset, it is not meant for beginners at all. So I highly highly recommend learning the basics with Game Objects first. They are more than enough to make all kinds of games, tons of awesome games were made before DOTS even existed. If you jump straight into DOTS as a beginner you will likely be quite confused with all the complex terminology, learning both how Unity works AND DOTS at the same time is a very tough task. So yes I recommend starting using just Game Objects, learn how they work, learn their limitations, and then learn how DOTS helps solve those limitations.
Code Monkey tweet media
English
0
4
40
3.2K
Code Monkey
Code Monkey@UnityCodeMonkey·
How to make a SELECTABLE World Map in a Strategy Game!
English
0
4
43
2.2K
Code Monkey
Code Monkey@UnityCodeMonkey·
People think indie success is all about luck or making a hit. But personally I prefer to focus on SUSTAINABILITY and being risk averse. All of my games were built on a low budget (basically just my time, which basically means just rent) which made it easier to turn a profit. For my whole career, I've controlled my expenses by not living over my means, I saved up and I did everything I could to make this normally risky endeavor (indie game development) much less risky. That's how I was able to survive for over a decade even though I had several flops in my career. When I first moved out of my parents house I was living as cheaply as possible on about 600 per month. That meant that for a 10 month project to turn a profit I just needed to make 6000. For me personally my nightmare is running a giant studio with 20+ employees that I'm responsible for. With a studio like that the monthly burn rate is in the hundreds of thousands so even if you get a million dollars in funding it can dry up super quickly. But that's just my personal view. Some people have a dream of running an indie studio and if you have that dream I hope you achieve it! Just be aware of how difficult it is.
Code Monkey tweet media
English
5
1
41
2.1K
Code Monkey
Code Monkey@UnityCodeMonkey·
How to build your MASSIVE DREAM Game! Realistically
English
2
2
43
2.5K
Code Monkey
Code Monkey@UnityCodeMonkey·
Allowing fast switching between keyboard and gamepad? It's just a "nice to have" feature until you test your own game for 9 hours, and then it becomes a must! I went through this myself with my game Dinky Guardians and it helped a ton. Remember how games are all about iteration and the faster you can iterate the better. Thankfully Unity's Input System makes it really easy to swap input methods, it even supports a virtual cursor! If you haven't used it then I highly recommend it, especially if you have gamepad support.
English
1
3
30
2.1K
Code Monkey
Code Monkey@UnityCodeMonkey·
How do you go from learning the basics of C#, like Variables and Functions, to being able to make a completely original game without following a tutorial? The answer to that is simply Experience. The more mini-games you make, the more systems you build, the more code you write, the easier it is to know all the steps you need to take to make something a reality. That's really it, there's no secret, there's no shortcut, it's a skill you gain with experience. I made my Problem Solving course exactly to teach that skill, and the course is really all about completing tons of practical exercises to gain that experience super quickly youtube.com/watch?v=Jgw5Z4… If you're a beginner it's perfectly normal to not know how to start building X mechanic, but as you gain more experience it becomes more and more natural. So you really just need to build more things to gain more experience and you will naturally gain that skill. Best of luck in your learning journey!
YouTube video
YouTube
English
0
3
21
1.9K
Code Monkey
Code Monkey@UnityCodeMonkey·
The Input Manager is marked for deprecation! Thankfully upgrading to Unity's Input System is way easier now! Most common Input Manager functions have direct equivalents, and prototyping is super fast. Check out my cheat sheet and future-proof your code!
English
1
2
43
3.5K
Code Monkey
Code Monkey@UnityCodeMonkey·
You don't HAVE to be a full-time game dev to learn and build games! Naturally the more time you have to dedicate to learning and honing your skills, the better you will become faster. But if you have a 9-5 job or school, you can still definitely learn, it's naturally harder but it can be done. Fitting game dev around a job, school is all about experimenting with your schedule. Find pockets of time (morning, lunch, evening) and keep sessions short but consistent. One hour per day beats doing a 10 hour marathon on weekends! Consistency truly is the key, if you do even just a few minutes every single day, you will learn an insane amount over the course of one year!
English
8
9
83
4.1K
Code Monkey
Code Monkey@UnityCodeMonkey·
#### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### #### ANSWER #### (D) If your orthographicSize is 70 you'll see from y -70 to +70 for a total of 140 units visible. The horizontal size (X) is dependent on the aspect ratio of the selected resolution. You can do some math to calculate it using the Camera.aspect
English
0
0
9
846
Code Monkey
Code Monkey@UnityCodeMonkey·
What is the orthographicSize in a 2D camera? A) Units visible horizontally B) Units visible vertically C) Half the units visible horizontally D) Half the units visible vertically (answer in reply below)
English
1
0
13
3.6K