Creating a leveling system using preset stats

This forum is currently in read-only mode.
  • I'm having a second go at creating a leveling system and am contemplating including it in my game. I can manage everything from being able to modify the defense of the character and the amount of HP he removes from an enemy and also experience gain as I've done it with my old system, but I can't figure out how I'm going to modify the experience of the player without having to create an event like this:

    If player equal level 2

    • Set Def 3
    • Set Str 2
    • etc.

    If player equal level 3

    • Set Def 4
    • Set Str 4
    • etc.

    and on and on and on...

    I'm using a level system which reaches ten, so it's pretty simple. The old system used an equation to calculate level gain and stats increase, but I created a file which has preset values of the levels as follows:

    Level________EXP____Strength____Endurance____Health______Defence__
    Lvl. 1 		 0 			1				1		20				1
    Lvl. 2 		 25			3				2		32				2
    Lvl. 3 ....[/code:1ms0op86]
    
    Now, I don't want to use an ini file, since anyone playing the game can simply edit the experience needed to level up and max out all the stats! Instead, is there a way to do this, for example, with a timeline or something which isn't as tedious as creating events for every level?
    
    Thanks in advance
  • The Array object can save and load a file.

  • The Array object can save and load a file.

    But will the file created be editable by the user? That's what I'm trying to avoid since it defeats the purpose of a leveling system.

  • Any file that you save is editable, even the game exe itself. But if you mean if it is readable by human, then no, Array saves in binary format.

    Don't worry about players modifying the game to cheat - if they want to cheat, they WILL find a way. There are programs that allow them to search the memory and adjust values, such as health, current experience etc.

    Focus on your game first!

  • Also - perhaps there's a way to find formulas for the levels - will take a little time, will save some time later if you decide to change the level structure.

    Like,

    Strength adds 3 each level? Strength = Level*3

    Agility adds 1 every 3 levels? Agility = Floor(level/3)

    If you want exponential growth just have something like: Health = Level*30*1.25

    Etc.

  • Thanks for the quick reply guys!

    Any file that you save is editable, even the game exe itself. But if you mean if it is readable by human, then no, Array saves in binary format.

    Don't worry about players modifying the game to cheat - if they want to cheat, they WILL find a way. There are programs that allow them to search the memory and adjust values, such as health, current experience etc.

    Focus on your game first!

    Thanks. I've never used the array object before, so it should be interesting. I can't stop the dedicated cheaters, but I can always stop the average Joe from modifying it

    Also - perhaps there's a way to find formulas for the levels - will take a little time, will save some time later if you decide to change the level structure.

    Like,

    Strength adds 3 each level? Strength = Level*3

    Agility adds 1 every 3 levels? Agility = Floor(level/3)

    If you want exponential growth just have something like: Health = Level*30*1.25

    Etc.

    If I can't get it working well with the array object, I'll probably just do it this way. Though the reason why I opted for a preset system is to have more control over my stats.

  • Okay... Array, how do I use it? I've search the forum and read the Wiki but have no idea what's going on.

    And this just hit me: If it saves and loads in a binary format, how am I going edit my values in? Ah well, the equation option sure is looking more realistic at this point... seems very confusing at the moment.

    Googling a bit showed me that it creates something like a matrix, so I'm going to set to have to set it out like this?

    Lv.(X)    Str.(Y)   Def.(Z)
    {1            1            1}
    {2            2            3}
    {3            4            5}
    [/code:4uziiekv]
    
    So, the value of X in (1,1,1) is 1? And the Value of Y in (3,3,3) is 4?
    
    I'm pretty sure I have this is not how it works...
    
    [b]EDIT:[/b] Okay, I think now I understand it.
    
    For an array of Width (X) = 2 and Height (Y) = 2, it'll appear like this right?
    
    [code:4uziiekv]
    { a1            a2 }
    { b1            b2 }
    [/code:4uziiekv]
    So Array(1,1,1) will be a1, Array (1,2,1) will be b1, Array (2,1,1) will be a2 and Array (2,2,1) will be b2?
    
    So this means I can create something like this
    [code:4uziiekv]
    Lv.		{1	2	3	4	5  }
    Str.		{1	1	2	4	6  }
    Health	{20	25	40	60	90}
    
    [/code:4uziiekv]
    To retrieve the Strength when at level five, I simply do Array(5,2,1) which is 6?
    
    Okay, now all I need to know is how I create a file with these values in them to be read by the Array object...
  • Too impatient for a reply, I created my own array editor in Construct! Works wonderfully, with a load and save function

    If anyone is interested, I can try to expand it where the user enters how many rows and columns are available.

  • Hehe, you answered yourself before I got around to answering. Glad it works out for you

  • Okay, my Construct Array editor is complete and I just realized I basically created a program which cheaters can use to edit both my Array file (which I wanted to avoid) and any other Construct Array file for that matter I'm not sure if it works only with an Array file generated by Construct as I don't have an Array file generated by another program...

    Maybe I won't release it... don't really think the mods or users would be too happy with this tool.

    What it can do:

    • Load/save Array file
    • Display Array file allowing one to edit
    • Generate Array file by inputting number of rows and columns (max 8*8 for now)
    • Clear Array sheet
  • I'm working on a leveling system myself. Just wondering, but, where were you going to put your save file anyway? (Unless you don't need one.) Saves have to be locked up tight too.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I'm working on a leveling system myself. Just wondering, but, where were you going to put your save file anyway? (Unless you don't need one.) Saves have to be locked up tight too.

    I wouldn't worry so much about people cheating. In single player games, if someone cheats. They're only cheating themselves. If they've paid for a game, then moreso. (Though it's fine to cheat once you've played through it).

  • I'm working on a leveling system myself. Just wondering, but, where were you going to put your save file anyway? (Unless you don't need one.) Saves have to be locked up tight too.

    I was thinking about that earlier. An ini file would be stupid for a save file, so naturally the next choice is an array. The problem is I just created a program which can read and modify any Construct array file and if I can make such a program, so can anyone else. That's why I'll probably not release it since if a developer chooses to use an array to store save data, it can be easily edited...

    After thinking of this I had another idea. Maybe one of the talented plugin developers could created a text file plugin, where it acts just like a text file, but it's saved into the actual game file. Then when the player chooses to save, the array can save to that file... but I guess to do that, the array file would have to be modified too... but it'll surely add an extra layer of security.

    So, right now I'll likely go down the array route for my save file and hope no one else has created an Array Editor since I have no other choice. And I'll probably make an event saying 'If Str is greater then X, set text to "YOUR A FILTHY CHEATER" and "set Health to 1" '

  • Isn't there some kind of hash thing you can use to add security? I haven't tried it myself so I'm not sure.

  • Isn't there some kind of hash thing you can use to add security? I haven't tried it myself so I'm not sure.

    You can use Lucid's 's' plugin (Python stuff) which has encryption options, as far as I know.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)