Creating a leveling system using preset stats

For questions about using Classic.

Post » Fri Feb 26, 2010 8:57 am

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:

[code:1ms0op86]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 :mrgreen:
B
2
S
2
G
3
Posts: 143
Reputation: 1,536

Post » Fri Feb 26, 2010 9:03 am

The Array object can save and load a file.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Fri Feb 26, 2010 9:07 am

[quote="Mipey":1hus3dfg]The Array object can save and load a file.[/quote:1hus3dfg]
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.
B
2
S
2
G
3
Posts: 143
Reputation: 1,536

Post » Fri Feb 26, 2010 9:30 am

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!
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Fri Feb 26, 2010 9:38 am

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.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Fri Feb 26, 2010 9:55 am

Thanks for the quick reply guys!

[quote="Mipey":75l2zuky]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![/quote:75l2zuky]
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 ;)
[quote="Somebody":75l2zuky]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.[/quote:75l2zuky]
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.
B
2
S
2
G
3
Posts: 143
Reputation: 1,536

Post » Fri Feb 26, 2010 11:20 am

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?

[code:4uziiekv]
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...

EDIT: 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...
B
2
S
2
G
3
Posts: 143
Reputation: 1,536

Post » Fri Feb 26, 2010 1:27 pm

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.
B
2
S
2
G
3
Posts: 143
Reputation: 1,536

Post » Fri Feb 26, 2010 2:10 pm

Hehe, you answered yourself before I got around to answering. Glad it works out for you :)
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Fri Feb 26, 2010 3:16 pm

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 :lol: 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
B
2
S
2
G
3
Posts: 143
Reputation: 1,536

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests