Skip to main content

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password
Register
  • Home
  • Browse
    • 2D Art
    • 3D Art
    • Concept Art
    • Textures
    • Music
    • Sound Effects
    • Documents
    • Featured Tutorials
  • Submit Art
  • Collect
    • My Collections
    • Art Collections
  • Forums
  • FAQ
  • Leaderboards
    • All Time
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
    • Weekly
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
  • ❤ Donate
Programming

I need some math to spread my values apart

FacadeGaikan
Monday, July 31, 2017 - 10:06
FacadeGaikan's picture

Have you ever played Banjo-Kazooie, Super Mario 64, or similar games? Notice how the amounts of notes/jiggies/stars needed keep increasing across worlds? Good. I need a formulae that allows me to input the total number of world-opening pickups, worlds, and allows the first world to start at one or two. It should spread the amount needed for each world, increasing in a semi-linear fashion. I know I could use something similar to how Pokemon Exp. is caclulated and add from all the levels, but I'd have to try several different formulas. If ther is a better way, I'd like to hear it. This formulae will be either enterd into python or GDScript.

  • Log in or register to post comments
Boom Shaka
joined 10 years 4 months ago
Tuesday, August 1, 2017 - 07:31
Boom Shaka's picture

Goal = the amount of "currency" you need to unlock the next work

Base = total "currency" in each given world

N = World/Goal number

World = each game map

Adjustment = penalties and/or bonuses (can be linear, geometric, random, or unlocked via game play)

 

For each World(N)

Goal(N) = Base(N) + Goal(N-1) + Adjustment

 

Set your menu/login screen to World(0) and hardcode Goal(0) = 0.   That means you automatically "unlock" the first world.  Subsequent worlds are "unlocked" as follows

Goal(1) = Base(1) + Goal(0) + Adjustment

Goal(2) = Base(2) + Gaol(1) + Adjustment

 

And so on

 

Hope that helps!

  • Log in or register to post comments