Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Leveling using Binary countoffs?
Leveling using Binary countoffs?
Feb 14 2009, 6:06 pm
By: New-Guy  

Feb 14 2009, 6:06 pm New-Guy Post #1



I want to know if this is possible. I'm pretty sure it is, because Vrael mentions it in his Tenebrous RPG topic in the Production forum.
Since I'm pretty sure it is possible (although, I could be wrong) I want to know how it's done, because I want to implement the idea for an RPG I'm making for the Last Stand contest.
If anyone can help me out, thanks!



None.

Feb 14 2009, 6:12 pm JaFF Post #2



You mean storing the 'current experience' and 'required experience' in deathcounters and applying some formula (x2, for example) that increases the 'required experience' deathcounter each time you level up?

Explain in more detail please.



None.

Feb 14 2009, 6:14 pm Pyro682 Post #3



Here is where you can find a short story on how to do a binary count-off.



None.

Feb 14 2009, 6:14 pm New-Guy Post #4



That's the problem. I have absolutely no idea how a system like this would work. I think that sounds like a good idea, but how would you trigger it?



None.

Feb 14 2009, 6:16 pm Pyro682 Post #5



I'm having a hard time with understanding what you want, here...
Can you show us what you're implementing it into?




-----------EDIT--------------------
I can make a small test map to explain the process, if you'd like???



None.

Feb 14 2009, 6:19 pm New-Guy Post #6



Here's a really base version of the map I'm working on (attached).

What I want to do is make a system that can control the experience needed for each level, and can control the amount of experience that each player has.
I found this idea in Vrael's Tenebrous RPG topic in the Map Production forums, if it helps, but he used a really complicated formula to determine EXP.

Attachments:
SEN RPG.scx
Hits: 8 Size: 146.97kb



None.

Feb 14 2009, 6:33 pm Pyro682 Post #7



[/collapse]I'm Sorry, I'm not understanding how you want to fit a binary-count-off system into this.
I can make a test map for you, if you'd like, but as for the fitting into the map... I don't know, maybe its me... I'm tired.
Btw, Great Terrain in the bottom right hand corner, Fantastic Manipulation.


Here is an Example of a simple Common Number Binary system.

Collapsable Box



Here, I think I know what youre getting at now, so Here it is, (bare with me)

Post has been edited 2 time(s), last time on Feb 14 2009, 6:40 pm by Pyro682.



None.

Feb 14 2009, 6:37 pm JaFF Post #8



OK, now you're clear about what you want. I can't open the map, so bare with me if I'm straying off a bit.

To make the most basic system work, you need atleast three deathcounters; let's call them 'ReqExp' (required experience), 'CurrExp' (current experience of player) and 'Multi' (multi-use). Obviously, when a player kills an enemy, you detect it and for each enemy type, award the player with experience. In other words, you need a system that detects when a player kills an eenmy and what type of enemy is it. For the sake of explaining, let's assume you already have such a system.

You will need two basic deathcounter-related functions: 'COMPARE' and 'LEVELUP'. The first compares the 'CurExp' and the 'ReqExp' values EACH TIME YOU KILL AN ENEMY. The second function calculates the new required experience when you level-up.

COMPARE:

While CurExp>0 and ReqExp>0, subtract value N from both deathcounters and add N to 'Multi'.
When atleast one of those two deathcounters hits 0, you check their values:
-if CurExp=>0 then levelup, else return the values to CurExp and ReqExp from Multi.

This function will ensure that when you reach the required experience level, you execute the 'LEVELUP' function.




LEVELUP:

When this runs, Multi=0, CurExp=>0 and ReqExp=old value. I will give an example of the simplest thing - multiplying by 2. This function does this:

While ReqExp>0, transfer its value into Multi with a x2 coefficient.
When ReqExp=0, transfer the value of Multi back into ReqExp, thus increasing the old value by 100%.

I explained the vbasic theory (atleast how I would do it). If you have any specific questions about transferring values between deathcounters using binary countoffs, read the tutorials about those. However, I wrote this assuming you understand the basic concepts behind Binary Countoffs.

ADD:
Quote from Pyro682
Btw, Great Terrain in the bottom right hand corner, Fantastic Manipulation.
Post screenshots please. :) Or, if you would prefer not to go off-topic, send them to me via PM.

ADD2:

I realized Pyro edited his above post, adding some bad information to it:
Quote
Code
Conditions:
Countdown Timer(At most, 0);
Accumulate("Current Player", At least, 10000, gas);

Actions:
Set Resources("Current Player", Subtract, 10000, gas);
Set Resources("Current Player", Add, 10000, ore);
Set Deaths("Current Player", "Khalis Crystal", Add, 10000);
Preserve Trigger();
Comment("Gas for money (10000)");
}

//-----------------------------------------------------------------//

Conditions:
Countdown Timer(At most, 0);
Accumulate("Current Player", At least, 1000, gas);

Actions:
Set Resources("Current Player", Subtract, 1000, gas);
Set Resources("Current Player", Add, 1000, ore);
Set Deaths("Current Player", "Khalis Crystal", Add, 1000);
Preserve Trigger();
Comment("Gas for money (1000)");
}

//-----------------------------------------------------------------//


Conditions:
Countdown Timer(At most, 0);
Accumulate("Current Player", At least, 100, gas);

Actions:
Set Resources("Current Player", Subtract, 100, gas);
Set Resources("Current Player", Add, 100, ore);
Set Deaths("Current Player", "Khalis Crystal", Add, 100);
Preserve Trigger();
Comment("Gas for money (100)");
}

//-----------------------------------------------------------------//

Conditions:
Countdown Timer(At most, 0);
Accumulate("Current Player", At least, 10, gas);

Actions:
Set Resources("Current Player", Subtract, 10, gas);
Set Resources("Current Player", Add, 10, ore);
Set Deaths("Current Player", "Khalis Crystal", Add, 10);
Preserve Trigger();
Comment("Gas for money (10)");
}

//-----------------------------------------------------------------//


Conditions:
Countdown Timer(At most, 0);
Accumulate("Current Player", At least, 1, gas);

Actions:
Set Resources("Current Player", Subtract, 1, gas);
Set Resources("Current Player", Add, 1, ore);
Set Deaths("Current Player", "Khalis Crystal", Add, 1);
Preserve Trigger();
Comment("Gas for money (1)");
}

//-----------------------------------------------------------------//

Conditions:
Countdown Timer(At least, 1);
Deaths("Current Player", "Khalis Crystal", At least, 10000);

Actions:
Set Deaths("Current Player", "Khalis Crystal", Subtract, 10000);
Set Resources("Current Player", Add, 10000, gas);
Preserve Trigger();
Comment("Give Gas Back (10000)");
}

//-----------------------------------------------------------------//


Conditions:
Countdown Timer(At least, 1);
Deaths("Current Player", "Khalis Crystal", At least, 1000);

Actions:
Set Deaths("Current Player", "Khalis Crystal", Subtract, 1000);
Set Resources("Current Player", Add, 1000, gas);
Preserve Trigger();
Comment("Give Gas Back (1000)");
}

//-----------------------------------------------------------------//

Conditions:
Countdown Timer(At least, 1);
Deaths("Current Player", "Khalis Crystal", At least, 100);

Actions:
Set Deaths("Current Player", "Khalis Crystal", Subtract, 100);
Set Resources("Current Player", Add, 100, gas);
Preserve Trigger();
Comment("Give Gas Back (100)");
}

//-----------------------------------------------------------------//


Conditions:
Countdown Timer(At least, 1);
Deaths("Current Player", "Khalis Crystal", At least, 10);

Actions:
Set Deaths("Current Player", "Khalis Crystal", Subtract, 10);
Set Resources("Current Player", Add, 10, gas);
Preserve Trigger();
Comment("Give Gas Back (10)");
}

//-----------------------------------------------------------------//


Conditions:
Countdown Timer(At least, 1);
Deaths("Current Player", "Khalis Crystal", At least, 1);

Actions:
Set Deaths("Current Player", "Khalis Crystal", Subtract, 1);
Set Resources("Current Player", Add, 1, gas);
Preserve Trigger();
Comment("Give Gas Back (1)");
}

//-----------------------------------------------------------------//

This is an awful way of doing Binary Countoffs - it will not cover all the possible values within one trigger cycle (and, in some cases, may take up to 8 trigger cycles to complete). You must use the powers of 2 in reverse order. For example:

128, 64, 32, 16, 8, 4, 2, 1.

That way, any number will be covered within one trigger loop. Other than that, what Pyro said describes the method very well.

Post has been edited 2 time(s), last time on Feb 14 2009, 7:04 pm by JaFF.



None.

Feb 14 2009, 7:00 pm New-Guy Post #9



Sorry to let you guys know, but the terrain in the bottom right isn't mine. I'm just borrowing a bit from Crescent Dyne until I get some terrain worked out by myself.

I think I'm starting to get how it works now... I'll just have to do some tests.



None.

Feb 14 2009, 7:05 pm Pyro682 Post #10



Sorry JaFF, Screen Shot is too big of a file.

Oh, I used 10s. Woops....
Yea, Use 2s, and If the numbers get big enough, use bigger powers of two. Make sure that the biggest ones go first.


-Edit-
Ouch JaFF, Sandbagged. hahahahaha! :lol: :D <3



None.

Feb 14 2009, 7:09 pm JaFF Post #11



Don't worry - I've seen CD terrain. :P



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:05 am]
O)FaRTy1billion[MM] -- the setting exists, it's just hidden in a weird place
[04:04 am]
O)FaRTy1billion[MM] -- instead change "Microtile Overlay" to "Impassable"
[04:04 am]
O)FaRTy1billion[MM] -- er, wait, idk why i was looking for height
[04:03 am]
O)FaRTy1billion[MM] -- below the minimap should be a thing that says "Overlay Settings" with a little + button in the corner, press the + to expand it, uncheck Use Defaults, then change "Tile Overlay" to "Height"
[03:57 am]
Sylph-Of-Space -- Unless I'm dum (possible)
[03:57 am]
Sylph-Of-Space -- It would be so so so nice if SCMDraft had some kind of dedicated "walkability" view for the tilesets.
[03:53 am]
Sylph-Of-Space -- :'( dont cry for me cat-gentina
[09:18 pm]
Ultraviolet -- 🔪🐈
[12:34 pm]
NudeRaider -- curiosity kills the cat!
[2024-5-19. : 6:18 am]
Sylph-Of-Space -- No complaints here, i'm just curious!
Please log in to shout.


Members Online: Zycorax