Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by Miaw666 · Nov 07, 2020 at 04:19 AM · preformance

How does less code affect a game?

Background (Skip to "problem" for the question): I really enjoy making games in Unity, but, even though I've been using it for months, I haven't finished a single game yet. It's mostly because I only use it when I have time, and being a science student doesn't give me much time. But another reason is that I'm a perfectionist and also an extremist. Whenever I do something, unless I do it in the best way possible, I don't get satisfied, and therefore get frustrated and stop doing it. I've worked on many projects so far, an FPS for the most part, but whenever I compare what I started working on like 3 days ago with something like Call of Duty, I get extremely disappointed and delete what I've done. I'm far from 100% in learning the coding language.

Problem: The same thing is also with coding, I always want to get something achieved with the least amount of code possible. But I'm wondering, does less code have an effect on the game in any way? For example, is there a difference in the effect on the game between 2 lines and 50 lines of code? Is it ok if I write a really long code instead of a short code, that has the same exact effect?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Owen-Reynolds · Nov 07, 2020 at 05:13 AM

The amount of code won't matter. It's only a few kilobytes compared to Megs and Megs if you have any pictures. It's like buying a diamond ring and worrying about how much the box costs.

But too many lines of code may cause problems in other ways. Suppose you have 30 bricks and you cut-and-paste the code for 1 brick 30 times. That will work. But it's going to be a huge pain if you want each to be 1.2 from the next, typing in 30 #'s by hand. Better to put the bricks into an array and use a loop with x=brickNum*1.2.

But none of that matters, since an actual perfectionist is screwed as far as programming and games. No matter what you do, it could always be faster, or more elegant, or whatever. And games are worse. You throw away lots of things that aren't fun until finally you've got something good enough. Look at MMO's. There's always a few classes and combos that are too good, get nerfed, then something else is too good -- those games are constantly broken in some way or another. But people play them when they're good enough.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

137 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Byte vs Int 3 Answers

Lights in Scene reduce farms per Second(FPS) 1 Answer

Unity Line renders taking up 80 ms 0 Answers

2D game - Really Huge Scrolling Background 0 Answers

Unity lags in play mode but works well after building the game ? over 100 fps ? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges