Search Unity

How much is too much and what are the limitations ?

Discussion in 'Getting Started' started by mueqa, Oct 23, 2019.

  1. mueqa

    mueqa

    Joined:
    Jul 6, 2019
    Posts:
    3
    Let's say for a 2D Game like Limbo or inside or celeste with many levels and everything else

    My question has two parts

    First :
    Is there a limit to the number of script files and colliders?

    Second :
    Do I have to repeat everything at every single level in my game like writing scripts for each enemy which behaves differently in each level for example in level1 the enemy breaths fire but in level2 shoots ice I can not use the breath_fire in level2 I should create a shoots_ice script? or should I use one script file and separate enemy's every behavior on its own class considering if there are 20 enemies just in a single level

    I am relatively new and I really appreciate any help guys

    Thanks
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Do you have your first script and first collider and first enemy working? The answer is "no" to both questions, to be specific.
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I'm not aware of any hard limit. The limit comes down to performance on the target platform.

    A common approach is to create a main script for enemies and just have it able to handle both behaviors, but it really depends on how different the enemies are between your levels. Most likely much of the code between the enemies of different levels will be the same though, so you'll want to just write that once.

    You could have a single script with all common functionality, and create separate scripts for any unique behaviors. It can come down to your preference for how you'd want this organized.
     
    mueqa likes this.
  4. mueqa

    mueqa

    Joined:
    Jul 6, 2019
    Posts:
    3
    Yes, I finished the first Level and it works as i expected
    To my understanding and your answer, there is no limit for the colliders and script files

    what about my second question?

    here is my story regarding my second question:
    I put everything i learned together and finished the first level of test_game project then decided to create second level, i created a New Scene and in a second i was staring at a blank scene with an empty hierarchy panel and there came the question: Do i have to start everything from zero just like the first level ?

    Note: of course i know about prefabs and reusable scripts and stuff yet I can't kick the feeling of doing everything for let's say 30 levels or more repeatedly if im wrong can you please point me to a link or tutorial or document

    Thanks
     
  5. mueqa

    mueqa

    Joined:
    Jul 6, 2019
    Posts:
    3


    Thank you very much for your time joe , i now have a clear idea about the issue i had
     
  6. Paduik

    Paduik

    Joined:
    Apr 29, 2019
    Posts:
    2
    Might be too late to make an impact here but I'll try...we lose way too many programmers to frustration, difficulty, and of course assholes online. Mueqa, it's a good question but I think it's easy to say you're overthinking it. Best analogy I can think of is this language known as Java...yeah that one, write once run anywhere. The point is, software development is tough, grueling, and by the time it's done you want it to work for an almost infinite amount of time, (updates and patches will be needed). So yes, you can use the logic and functionality on multiple levels, scenes, hell, you could reuse the code on another game and the C# concepts for business as well...to an extent. Remember to pseudocode, it's such a big deal if you're serious. If you have it all laid out before you touch the keyboard, that 'blueprint' will get you through. And indeed the scripts themselves are blueprints for functionality, logic, behavior, etc. Keep experimenting, and when you get knocked down, get back up and do a rebuild. If you haven't built it a 100 times before release you're overlooking something. If this doesn't give you a confidence boost and feather in your cap, just research more OO programming, it's all about those blueprints, reuse-ability, inheritance, etc. What everyone is saying is the workflow is up to you, there are a gazillion ways to program something that works. Some adore singletons, others think that's a huge nono. Some people hate PHP, but it's what got FB running so who is to say that was a wrong decision? Happy Hacking!