Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 /
avatar image
0
Question by Rebelo_22 · Jul 20, 2021 at 11:39 AM · rpglevelsupgradinglevelingupgrades

Opinion on this level upgrading system?

Uhh there's not much details to it, I made this level upgrading system, and I was just wondering what the community thinks of it!

Btw this was made in visual studio with forms. Just because it was easier, and I rly just wanted to create a level upgrading system.

And just so it's clear. That double "experience", would be the necessary experience to upgrade to the next level.


 public partial class Form1 : Form
     {
         // todas as variáveis / All variables
         int level = 0;
         double health = 100, baseHealth = 100;
         double damage = 30, baseDamage = 30;
         double experience = 1000, baseExperience = 1000;
 
         double healthGap = 10;
         double damageGap = 5;
         double experienceGap = 50;
 
         double exponentialHealthGrowth = 1.5;
         double exponentialDamageGrowth = 1;
         double exponentialExperienceGrowth = 1;
 
         /// NAO INTERESSA AQUI
         public Form1()
         {
             InitializeComponent();
 
             levelLbl.Text = "Level: " + level.ToString();
         }
 
         /// NAO INTERESSA AQUI // This was a btn that ups one level
         private void up1Btn_Click(object sender, EventArgs e)
         {
             level++;
             updateLevel();
         }
         /// NAO INTERESSA AQUI // This was a btn that downs one level
         private void less1Btn_Click(object sender, EventArgs e)
         {
             level--;
             updateLevel();
         }
         /// NAO INTERESSA AQUI // This was a btn that sets a level. Used a textbox for this one
         private void setLvlBtn_Click(object sender, EventArgs e)
         {
             level = Convert.ToInt32(setLevelTxt.Text);
             updateLevel();
         }
 
         /// <summary>
         /// IMPORTANTE HERE
         /// </summary>
         void updateLevel()
         {
             // Velocidade em que os stats do player evoluiem / Velocity in which player stats evolve
             exponentialHealthGrowth = 1.1;
             exponentialDamageGrowth = 1.07;
             exponentialExperienceGrowth = 1.05;
 
             // aumenta todos os valores da gap entre os níveis / calculates the new gap diference between the levels
             expectedLbl.Text = "Expected: " + (healthGap = baseHealth + Math.Round(Math.Pow(exponentialHealthGrowth, level - 1))) + " / " + Math.Round((experienceGap = baseExperience + Math.Pow(exponentialExperienceGrowth, level - 1))) + " / " + Math.Round((damageGap = baseDamage + Math.Pow(exponentialDamageGrowth, level - 1)));
 
             levelLbl.Text = "Level: " + level.ToString();
 
             // reseta todos os atributos / resets all stats to level 1
             health = 100;
             damage = 30;
             experience = 100;
 
             // Vai adicionando os atributos novamente para ter uma evolução mais fácil e controlável, ou seja passa por cada nível / Adds all levels one by one, since im using this "gap system"
             for(int i = 0; i < level; i++)
             {
                 healthLbl.Text = "Health: " + Math.Round((health += healthGap));
                 experienceLbl.Text = "Experience: " + Math.Round((experience += experienceGap));
                 damageLbl.Text = "Damage: " + Math.Round((damage += damageGap));
             }
         }
     }



Results:

  • Level 10 - health: 1120 | experience: 10116 | damage: 348

  • Level 20 - health: 2200 | experience: 20151 | damage: 702

  • Level 30 - health: 3580 | experience: 30223 | damage: 1143

  • Level 40 - health: 5740 | experience: 40368 | damage: 1790

  • Level 50 - health: 10450 | experience: 50648 | damage: 2906

  • Level 60 - health: 22720 | experience: 61167 | damage: 5079

  • Level 70 - health: 57360 | experience: 72128 | damage: 9587

  • Level 80 - health: 157060 | experience: 83876 | damage: 19195

  • Level 90 - health: 443800 | experience: 97020 | damage: 39832

  • Level 100 - health: 1262900 | experience: 112624 | damage: 84125


Comment
Add comment · Show 1
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
avatar image andrew-lukasik · Jul 19, 2021 at 08:24 PM 0
Share

opinion:

Port it to Unity mate.

0 Replies

· Add your reply
  • Sort: 

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

122 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

Related Questions

Leveling up in RPG 1 Answer

Where do I put PlayerPrefs.SetInt? 1 Answer

frustrating building problem 0 Answers

Help implementing player dodge or enemy miss rate 2 Answers

Tile-Based 2D Isometric RPG. Building a map? 3 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