• Advertisement
Sign in to follow this  

Unity Things that are "bad" to do, but go unnoticed

This topic is 1930 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

Hey,

I've been scripting/programming for a few years now, and I seem to be progressing rather well. I can do things comfortably and a lot easier than I could before.
I've used C# with XNA a bit, and UnityScript/C# with Unity. I'm familiar with the Unity engine.

However, I didn't really go by the suggested routine: make a simple game and move up. People here frequently suggest that new programmers make a small game, like a Pong game, then move on to something a bit harder. I didn't do that; I just stumbled around making some pieces of a dozen different projects without ever finishing any of the projects. I didn't focus very well, and got sidetracked on lots of stuff.

Now I'm wondering if maybe this entire time, I've been making a lot of mistakes in programming that I couldn't notice, due to my indirect approach at programming.


However, I'm not entirely sure how to go about figuring out if I actually am making mistakes that I don't notice.
I can't just dump a bunch of code on the GameDev community and say "Hey, is there a more efficient way of doing all of this?", and if I try to show smaller blocks of code, how would I know which pieces to show?


So the question is, am I just being paranoid, or should I be worried that I might be doing things wrong without even realizing it? If the code works, does it really matter if I could have done it in 3 less lines, or with 1 less 'if' statement?

Hopefully this doesn't sound completely stupid...I'm just fretting because I've been coding alone for a while, thinking I've been learning and getting better, without really having any 'confirmation' of that by more experienced coders.

Thanks for reading, any help you can give would be appreciated!

Share this post


Link to post
Share on other sites
Advertisement
Start reading books.. They will teach you alot about how to do things right.. Read forums.. use chat.. join a project or start one with a friend or someone online..

Whenever you are unsure of some piece of code, post it on the forums here and describe what you are thinking and ask for suggestions for improvements.

Its always a good idea to start on a project thats possible to finnish. Then its easier to keep the motivation and focus.

You'll never know how to do everything 100% correctly. Keep coding and you'll continue to learn untill you die ;) Edited by Nanook

Share this post


Link to post
Share on other sites
Thanks for the advice and reassurance!

I think I've picked up on most of the stuff as I went. I don't have as many problems with syntax anymore.

I didn't want to read a tutorial because I didn't think I'd need it, since I already knew a good bit of the general programming syntax from my previous experience. When I was getting into C# from UnityScript, I had noted on a few of the syntax differences already from reading other people's C# code briefly; for example, I knew how to declare variables and functions in C#. So I went with it, looking up the errors I got as I went. Using Google, I soon learned that C# was a bit more strict with value types, and I learned how to typecast and put the 'f' suffix at the end of doubles to turn them into floats. So I picked up simple stuff like that as I went on, rather than reading a tutorial from the get-go (which would probably be a 'cleaner' way of learning).

I'll get into the MSDN tutorials as suggested to fill in the gaps.

Share this post


Link to post
Share on other sites
Hi.
How to tell if your a good programmer.
if(project is woking how it was designed too 100% of the time)
if(computer is in the same state it was in before you start exe)
return yes you are going ok.
else
return read some books

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 NDraskovic
      Hey guys,
      I have a really weird problem. I'm trying to get some data from a REST service. I'm using the following code:
       
      private void GetTheScores() { UnityWebRequest GetCommand = UnityWebRequest.Get(url); UnityWebRequestAsyncOperation operation = GetCommand.SendWebRequest(); if (!operation.webRequest.isNetworkError) { ResultsContainer rez = JsonUtility.FromJson<ResultsContainer>(operation.webRequest.downloadHandler.text); Debug.Log("Text: " + operation.webRequest.downloadHandler.text); } } The problem is that when I'm in Unity's editor, the request doesn't return anything (operation.webRequest.downloadHandler.text is empty, the Debug.Log command just prints "Text: "), but when I enter the debug mode and insert a breakpoint on that line, then it returns the text properly. Does anyone have an idea why is this happening?
      The real problem I'm trying to solve is that when I receive the text, I can't get the data from the JSON. The markup is really simple:
      [{"id":1,"name":"Player1"},{"id":2,"name":"Player2"}] and I have an object that should accept that data:
      [System.Serializable] public class ResultScript { public int id; public string name; } There is also a class that should accept the array of these objects (which the JSON is returning):
      [System.Serializable] public class ResultsContainer { public ResultScript[] results; } But when I run the code (in the debug mode, to get any result) I get an error: ArgumentException: JSON must represent an object type. I've googled it but none of the proposed solutions work for me.
      Also (regardless if I'm in the debug mode or not) when I try to do some string operations like removing or adding characters to the GET result, the functions return an empty string as a result
      Can you help me with any of these problems?
      Thank you
    • By nihitori
      The Emotional Music Vol. I pack focuses on beautiful and esoteric orchestral music, capable of creating truly emotive and intimate moods. It features detailed chamber strings, cello and piano as the main instruments, resulting in a subtle and elegant sound never before heard in video game royalty-free music assets.

      The pack includes 5 original tracks, as well as a total of 47 loops based on these tracks (long loops for simple use and short loops for custom / complex music layering).

      Unity Asset Store link: https://www.assetstore.unity3d.com/en/#!/content/107032
      Unreal Engine Marketplace link: https://www.unrealengine.com/marketplace/emotional-music-vol-i

      A 15 seconds preview of each main track is available on Soundcloud:
       
    • By RoKabium Games
      Another one of our new UI for #screenshotsaturday. This is the inventory screen for showing what animal fossils you have collected so far. #gamedev #indiedev #sama
    • By eldwin11929
      We're looking for programmers for our project.
      Our project is being made in Unity
      Requirements:
      -Skills in Unity
      -C#
      -Javascript
      -Node.js
      We're looking for programmers who can perform a variety of functions on our project.
      Project is a top-down hack-and-slash pvp dungeon-crawler like game. Game is entirely multiplayer based, using randomized dungeons, and a unique combat system with emphasis on gameplay.
      We have a GDD to work off of, and a Lead Programmer you would work under.
      Assignments may include:
      -Creating new scripts of varying degrees specific to the project (mostly server-side, but sometimes client-side)
      -Assembling already created monsters/characters with existing or non-existing code.
      -Creating VFX
      -Assembling already created environment models
      If interested, please contact: eldwin11929@yahoo.com
      This project is unpaid, but with royalties.
       
      ---
      Additional Project Info:
      Summary:
      Bassetune Reapers is a Player-verus-Player, competitive dungeon crawler. This basically takes on aspects of dungeon crawling, but with a more aggressive setting. Players will have the option to play as the "dungeon-crawlers" (called the 'Knights', or "Knight Class", in-game) or as the "dungeon" itself (literally called the 'Bosses', or "Boss Class", in-game). What this means is that players can choose to play as the people invading the dungeon, or as the dungeon-holders themselves.
      Key Features:
      -Intense, fast-paced combat
      -Multiple skills, weapons, and ways to play the game
      -Tons of different Bosses, Minibosses, creatures and traps to utilize throughout the dungeon
      -Multiple unique environments
      -Interesting, detailed lore behind both the game and world
      -Intricate RPG system
      -Ladder and ranking system
      -Lots of customization for both classes s of customization for both classes
    • By RoKabium Games
      Custom coffee mugs have arrived... More caffeine!
      Have a great weekend everyone! 
      #gamedev #indiedev #sama #caffeine
  • Advertisement