• Advertisement
Sign in to follow this  

Unity Things you MUST learn before coding in games?

This topic is 765 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi!  Just looking for some tips...

I've been learning to program for about a year now, but I come from an audio focused background.  My experience includes making a simple game in Unity using C# and some audio specific programs in C++.  I'm trying to focus more on indie game development now, so I was hoping to broaden my knowledge of programming here.  This would cover all aspects of game development.  I do not need to write my own game engine as I am content with Unity and Unreal for my purposes. 

Specifically I'm looking for a list of key topics to read up on that anyone who intends to make their own games should know about.  For e.g. I know nothing about 3D math because I'm able to build visual geometry using the Unity or Unreal editors without code - I'm not sure whether I ought to learn about it?  Other topics I don't know much about might be general software development concepts or conventions.  An example of something I had trouble with coming from an audio background was understanding how to #include header files, and how linkers work.  I felt when learning about these subjects I was lacking more basic fundamental knowledge, and found it hard to grasp how all of my individual code files were working together.  I'm fine with programming logic, but I could really use tips on how to structure my code according to accepted conventions.  

Anything you can think of that I should know about is worth suggesting.  I'll be able to read up on the subjects in my own time if you could simply suggest keywords to read up on and why the topic is important.  Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Writing games is quite unlike writing any other software.

Most software is written iteratively, with a lot of code reuse.

At least initially you can expect to write a game with no plans for reuse of any of the code, to write once and "throw away".

It is only after a few games you'll start reusing parts as a framework.

Don't get tripped up and fall into the trap of writing an engine from day one. This is the usual newbie mistake and will sap your creative time before you can say "design patterns".

Good luck in the road ahead!

Share this post


Link to post
Share on other sites

The best way to learn conventions and common patterns is to read code made by others, by writing code (and rewriting it for improvements), and getting your code reviewed.

 

Python has a python-tutor mailing list, where new programmers ask questions and discuss problems. Maybe something like that also exists for unity or unreal? (Never used those engines, it's still on my list of 'todo' :) ).

 

If it fits in your plans, you could consider finding a nice game open source project (there are only a few zillions available at the Internet), and read the code, dabble with it, perhaps fix a bug or two. Understanding and modifying existing code is however a related but different skill from writing code from scratch.

Share this post


Link to post
Share on other sites


Most software is written iteratively, with a lot of code reuse.

At least initially you can expect to write a game with no plans for reuse of any of the code, to write once and "throw away".

 

Would you agree that games reuse concepts more than they reuse code?

Share this post


Link to post
Share on other sites

The best way to learn conventions and common patterns is to read code made by others, by writing code (and rewriting it for improvements), and getting your code reviewed.


Definitely!  I learned a considerable amount from reading through the source files of an open source library I was using.  On the other hand, I feel that without a complete understanding of how the (or any) entire library works, one might be lead to incorrect assumptions or confusion over /why/ code has been structured in certain ways.  

I'm really looking for theoretical topics to study here though.  For e.g. I had trouble with including header files at first for a couple of reasons, but it can be boiled down to this...

What I knew:  typing #include 'myheader.h' will make the code from my header work in the scope of this piece of code
What I didn't know:  ANYTHING about linkers.  

This meant that when one of my included files didn't work, I didn't know how to troubleshoot the problem because I lacked core theoretical knowledge.  I think there are probably similar gaps in my knowledge - I'm just not sure what they are.  All I really know is how to code inside the C++ box, but I lack most knowledge at a lower level. Coming into game programming I at least want to make sure I know how to keep things as optimized as possible and not create any bottlenecks at runtime.  That's all I'm really looking for! 

Edited by Olliepm

Share this post


Link to post
Share on other sites

 

Would you agree that games reuse concepts more than they reuse code?


Yes definitely, and there's certainly nothing wrong with that, especially when first starting out smile.png

Pong has been done a million times and that makes it no less effective as a learning tool...

 

 

That too. But I mean concepts like 2D layering, parallax scrolling, cartesian coordinates, etc. Though they may be implemented differently depending on the hardware (ex: NES, vs PS1 vs PS4), the concept of what those are stays the same.

Share this post


Link to post
Share on other sites

This meant that when one of my included files didn't work, I didn't know how to troubleshoot the problem because I lacked core theoretical knowledge. I think there are probably similar gaps in my knowledge - I'm just not sure what they are. All I really know is how to code inside the C++ box, but I lack most knowledge at a lower level. Coming into game programming I at least want to make sure I know how to keep things as optimized as possible and not create any bottlenecks at runtime. That's all I'm really looking for!
I have an old "The C++ programming language" by Stroustrup, and it goes into depth into C++ (duh), as well as more general considerations when programming. It is also very useful as a reference.

 

As such, a modern version of that book (you definitely want a book about C++11 or C++14 !) is probably useful to you.

 

 

 

Optimization and bottleneck elimination is a big pitfall, http://www.gamedev.net/topic/661044-optimization-philosophy-and-what-to-do-when-performance-doesnt-cut-it/#entry5180845 may be helpful here.

Share this post


Link to post
Share on other sites


I mean concepts like 2D layering, parallax scrolling, cartesian coordinates, etc.


Are those by any chance things I should know about?  

Share this post


Link to post
Share on other sites

When you say '2D layering', are you talking about something more complicated than for e.g. background art made up of different image layers (so that they are independent of each other and complete a picture), or is there some context to that I'm missing?

Share this post


Link to post
Share on other sites
There is no substitute for deliberate practice.

Reading on subjects is fine if you're lacking physical access to a computer. If you can be on a computing device, you should be programming it instead of reading.

This is not to say you can't consult reference material, or study a large body of knowledge about a subject you're working with. The key phrase there is working with.


Memory retention of things we read without the context to understand them deeply is abysmal, think single-digit percentage. (I'd know the exact figure but: surprise, surprise, memory retention sucks in humans!)

So reading a ton of literature is more likely to be a chore than an actual productive use of time.


Instead? Pick a project, some goal of some kind. Doesn't matter if it's simple or hard. Think hard about how you would do it, and then go try and do it! If you get stuck, write down what concepts you were struggling with, dial back your goal a bit, and try something else. When you meet your goal, the success will me motivating, and you will almost certainly learn things along the way. If you can't name anything that was challenging or educational, pick a harder goal, and try something else.

This is the process of becoming good at something, and it's important to keep the motivation and the challenge involved. Balancing them is tricky and takes time, but you'll figure it out.


Most of all, if all this quits being enjoyable, and stays unenjoyable, then be kind enough to yourself to find another thing to enjoy.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
  • Advertisement
  • Popular Tags

  • Advertisement
  • Popular Now

  • Similar Content

    • By Manuel Berger
      Hello fellow devs!
      Once again I started working on an 2D adventure game and right now I'm doing the character-movement/animation. I'm not a big math guy and I was happy about my solution, but soon I realized that it's flawed.
      My player has 5 walking-animations, mirrored for the left side: up, upright, right, downright, down. With the atan2 function I get the angle between player and destination. To get an index from 0 to 4, I divide PI by 5 and see how many times it goes into the player-destination angle.

      In Pseudo-Code:
      angle = atan2(destination.x - player.x, destination.y - player.y) //swapped y and x to get mirrored angle around the y axis
      index = (int) (angle / (PI / 5));
      PlayAnimation(index); //0 = up, 1 = up_right, 2 = right, 3 = down_right, 4 = down

      Besides the fact that when angle is equal to PI it produces an index of 5, this works like a charm. Or at least I thought so at first. When I tested it, I realized that the up and down animation is playing more often than the others, which is pretty logical, since they have double the angle.

      What I'm trying to achieve is something like this, but with equal angles, so that up and down has the same range as all other directions.

      I can't get my head around it. Any suggestions? Is the whole approach doomed?

      Thank you in advance for any input!
       
    • By devbyskc
      Hi Everyone,
      Like most here, I'm a newbie but have been dabbling with game development for a few years. I am currently working full-time overseas and learning the craft in my spare time. It's been a long but highly rewarding adventure. Much of my time has been spent working through tutorials. In all of them, as well as my own attempts at development, I used the audio files supplied by the tutorial author, or obtained from one of the numerous sites online. I am working solo, and will be for a while, so I don't want to get too wrapped up with any one skill set. Regarding audio, the files I've found and used are good for what I was doing at the time. However I would now like to try my hand at customizing the audio more. My game engine of choice is Unity and it has an audio mixer built in that I have experimented with following their tutorials. I have obtained a great book called Game Audio Development with Unity 5.x that I am working through. Half way through the book it introduces using FMOD to supplement the Unity Audio Mixer. Later in the book, the author introduces Reaper (a very popular DAW) as an external program to compose and mix music to be integrated with Unity. I did some research on DAWs and quickly became overwhelmed. Much of what I found was geared toward professional sound engineers and sound designers. I am in no way trying or even thinking about getting to that level. All I want to be able to do is take a music file, and tweak it some to get the sound I want for my game. I've played with Audacity as well, but it didn't seem to fit the bill. So that is why I am looking at a better quality DAW. Since being solo, I am also under a budget contraint. So of all the DAW software out there, I am considering Reaper or Presonus Studio One due to their pricing. My question is, is investing the time to learn about using a DAW to tweak a sound file worth it? Are there any solo developers currently using a DAW as part of their overall workflow? If so, which one? I've also come across Fabric which is a Unity plug-in that enhances the built-in audio mixer. Would that be a better alternative?
      I know this is long, and maybe I haven't communicated well in trying to be brief. But any advice from the gurus/vets would be greatly appreciated. I've leaned so much and had a lot of fun in the process. BTW, I am also a senior citizen (I cut my programming teeth back using punch cards and Structured Basic when it first came out). If anyone needs more clarification of what I am trying to accomplish please let me know.  Thanks in advance for any assistance/advice.
    • By Yosef BenSadon
      Hi , I was considering this start up http://adshir.com/, for investment and i would like a little bit of feedback on what the developers community think about the technology.
      So far what they have is a demo that runs in real time on a Tablet at over 60FPS, it runs locally on the  integrated GPU of the i7 . They have a 20 000 triangles  dinosaur that looks impressive,  better than anything i saw on a mobile device, with reflections and shadows looking very close to what they would look in the real world. They achieved this thanks to a  new algorithm of a rendering technique called Path tracing/Ray tracing, that  is very demanding and so far it is done mostly for static images.
      From what i checked around there is no real option for real time ray tracing (60 FPS on consumer devices). There was imagination technologies that were supposed to release a chip that supports real time ray tracing, but i did not found they had a product in the market or even if the technology is finished as their last demo  i found was with a PC.  The other one is OTOY with their brigade engine that is still not released and if i understand well is more a cloud solution than in hardware solution .
      Would there  be a sizable  interest in the developers community in having such a product as a plug-in for existing game engines?  How important  is Ray tracing to the  future of high end real time graphics?
    • By bryandalo
      Good day,

      I just wanted to share our casual game that is available for android.

      Description: Fight your way from the ravenous plant monster for survival through flips. The rules are simple, drag and release your phone screen. Improve your skills and show it to your friends with the games quirky ranks. Select an array of characters using the orb you acquire throughout the game.

      Download: https://play.google.com/store/apps/details?id=com.HellmodeGames.FlipEscape&hl=en
       
      Trailer: 
       
    • By khawk
      Watch the latest from Unity.
       
  • Advertisement