A new Experience.txt Generator

This would be the forum for questions about how to work with mod making tools which can be a problem of its own.

Moderator: Paul Siramy

Post Reply
User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

A new Experience.txt Generator

Post by Nefarius » Sat Jun 03, 2006 7:46 pm

I've just uploaded a new Experience.txt Generator I've initially coded for myself, it can output an experience.txt file that will always remain valid within the games limits, and being an EXE, doesn't need any scripting host or whatever to run (and it outputs the file without any wait time :)).

You can grab it here: dload.php?action=file&file_id=1394

Readme" wrote:Experience.txt Generator 1.0
by Nefarius



About:
This is just a simple program that will generate an experience.txt file for you.

Can I have the source/what this made in?
If you want to see my horrible code, be my guest, just drop a PM.
This thing was written in c++ and compiled with Bloodshed Dev-C++.

How to use?
Simple, run the program, it will first ask for the maximum cLvl that can be achieved, enter a value of choice.
Next it will ask for the level at which exp starts to decay (at which expratio is no longer 100 percent), from this level on it will decay to 1 (so if decay starts at 100 and max cLvl is 150 then at lvl 150 it will have decayed to 1/1024 etc). If you don't want EXP to decay enter -1.

Bugs?
It doesn't check what you pass on to it, so if you do something stupid the outcome is your fault ;P




---

If you'd like the formula that the app uses to generate the file.

Experience = (FFFFFFFF-256*Lvl)*(Lvl/MaxLvl)^4+256*Lvl
Decay = Max(1024-1024/(MaxLvl-DecayStart)*Max(0,Level-DecayStart),1)
Last edited by Nefarius on Sat Jun 03, 2006 7:50 pm, edited 1 time in total.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12100
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U
United States of America

Hand-picked

Re: A new Experience.txt Generator

Post by Myhrginoc » Sat Jun 03, 2006 8:05 pm

Did you limit the number of levels to 65,535? Many level data are limited to 16 bits. (For that matter, it is probably a good idea to avoid any value that could be coded as CMP {location},-1, so 65,500 might be a safer cap.)
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

Re: A new Experience.txt Generator

Post by Nefarius » Sat Jun 03, 2006 8:23 pm

Nope, it doesn't check for this, but I can add a check.

This is strange however, since I have a character at cLvl 2^31-1 that doesn't crash the game, the only problem
I noticed is the tohit calculation, which will always roll to 0, no matter what amount of AR you have.


EDIT: Recompiled and uploaded the version with Myhrginoc's suggestion. Same link. (wait a few secs)

I also added two example Experience.txt files one with 50 clvls and one with 150 clvls.
Last edited by Nefarius on Sat Jun 03, 2006 8:32 pm, edited 2 times in total.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
Dra1970kstaar_MSD
Junior Member
Paladin
Posts: 109
Joined: Tue May 09, 2006 4:46 am

Re: A new Experience.txt Generator

Post by Dra1970kstaar_MSD » Sun Aug 06, 2006 12:16 am

I tried the generator and it created the xp table nicely however, the total xp at the max level is 4294967295 my characters end up with next level = -383700000 (can't remember exact number).

Is there something I have to change to make this work properly?

What I've been doing is just add a few levels higher than what I need and can get the xp I need. Great little program though makes thing so much easier.

User avatar
Myhrginoc
Retired Admin
Cherub
Posts: 12100
Joined: Sat May 25, 2002 7:28 am
Location: Percussion U
United States of America

Hand-picked

Re: A new Experience.txt Generator

Post by Myhrginoc » Sun Aug 06, 2006 2:09 pm

Since the game has a forward-looking level-up routine, I believe you need to set the maximum achievable level to tot more than the maximum possible experience less one plus the largest experience award you can get from a kill. Example, if your largest kill nets 100,000 exp, then you set that maximum achievable level to no more than 4,294,867,294. Then you add one more line with an unattainable experience and a level equal to your maximum in experience.txt (recognizing the game adds one to any listed level).
Last edited by Myhrginoc on Sun Aug 06, 2006 2:12 pm, edited 1 time in total.
Do the right thing. It will gratify some people and astonish the rest.
~ Mark Twain
Run Diablo II in any version for mods: tutorial
The Terms of Service!! Know them, abide by them, and enjoy the forums at peace.
The Beginner's Guide v1.4: (MS Word | PDF) || Mod Running Scripts || TFW: Awakening

User avatar
Dra1970kstaar_MSD
Junior Member
Paladin
Posts: 109
Joined: Tue May 09, 2006 4:46 am

Re: A new Experience.txt Generator

Post by Dra1970kstaar_MSD » Wed Aug 09, 2006 8:24 am

What I don't understand is why i get a negative value in my character's xp for next level when i let the generator generate the table for me.

I did notice that the generator gives a max xp of 4294967295.

Bliz's max xp on thier table is 3837739017. I remember reading somewhere though that this isn't the true maximum that you could use.

Sorry if I'm a bit newbish about this. I'm just trying to understand where maybe I might have gone wrong.

User avatar
Ulf.d2
Posts: 73
Joined: Sun Jul 06, 2008 1:42 am
Location: Washington

Post by Ulf.d2 » Thu Aug 21, 2008 11:42 pm

I downloaded it again and it works fine except for 1 thing. I think I am just doing something wrong, but expratio is always set to 1.

My expgen.bat appears as follows...

expgen.exe experience2.txt 99 45 100

To my knowledge, the first number means max clvl, 2nd means the level where exp starts to decay, but I have no idea what the third number means.

On the forum about this generator, it sounds like it is supposed to prompt you these options, but it doesn't. Nor does it download along with 2 example text files as it said it does. May I suggest that you include a readme.txt downloaded with it?

EDIT:

I messed around with the numbers I put in and found something bizarre. Here are some examples of Level 1 experience bars...

Code: Select all

MaxLvl	99	99	99	99	99	99	99	30
0	0	0	0	0	0	0	0	1073741824
1	300	300	300	300	300	300	300	1073741824
The only 1 that has worked for me so far...

Code: Select all

MaxLvl	99	99	99	99	99	99	99	10
0	0	0	0	0	0	0	0	1024
1	300	300	300	300	300	300	300	1024

Code: Select all

MaxLvl	99	99	99	99	99	99	99	5
0	0	0	0	0	0	0	0	32
1	300	300	300	300	300	300	300	32
This one is the most common one. For this specific one, I chose 50 for the decay point, but the last number in the maxlvl row doesn't show up as 50, but 0...

Code: Select all

MaxLvl	99	99	99	99	99	99	99	0
0	0	0	0	0	0	0	0	1
1	300	300	300	300	300	300	300	1
Any ideas of what is happening?
Last edited by Ulf.d2 on Thu Aug 21, 2008 11:57 pm, edited 1 time in total.
Gem Activated
Gem Deactivated

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

Post by Nefarius » Fri Aug 22, 2008 12:18 am

[quote=Ulf.d2";p="400031"]I downloaded it again and it works fine except for 1 thing. I think I am just doing something wrong, but expratio is always set to 1.

My expgen.bat appears as follows...

expgen.exe experience2.txt 99 45 100

To my knowledge, the first number means max clvl, 2nd means the level where exp starts to decay, but I have no idea what the third number means.

On the forum about this generator, it sounds like it is supposed to prompt you these options, but it doesn't. Nor does it download along with 2 example text files as it said it does. May I suggest that you include a readme.txt downloaded with it?

EDIT:

I messed around with the numbers I put in and found something bizarre. Here are some examples of Level 1 experience bars...

Code: Select all

MaxLvl	99	99	99	99	99	99	99	30
0	0	0	0	0	0	0	0	1073741824
1	300	300	300	300	300	300	300	1073741824
The only 1 that has worked for me so far...

Code: Select all

MaxLvl	99	99	99	99	99	99	99	10
0	0	0	0	0	0	0	0	1024
1	300	300	300	300	300	300	300	1024

Code: Select all

MaxLvl	99	99	99	99	99	99	99	5
0	0	0	0	0	0	0	0	32
1	300	300	300	300	300	300	300	32
This one is the most common one. For this specific one, I chose 50 for the decay point, but the last number in the maxlvl row doesn't show up as 50, but 0...

Code: Select all

MaxLvl	99	99	99	99	99	99	99	0
0	0	0	0	0	0	0	0	1
1	300	300	300	300	300	300	300	1
Any ideas of what is happening?[/quote]


You are setting a expratio of 45, which means 2^45 ;) impossible in a 32bit game.

set it to a value between 0 and 32 (keep it lower then 16 though, as D2 is known to be very bugged with higher precision, but it has support for it anyway).

If you load the tool from the command prompt instead of the batch file, you can see this message: "error: decay rate must be between 0 and 32, defaulting to 0" (1<<0 = 1).

The ExpRatio is softcoded (its not in 1024ths), it depends on the value of the first ExpRatio field (the one next to maxlevel), and indicates the precision (10 being 1<<10 = 1024). If Expratio field (the first one), is left as 0, the game doesn't use the ExpDecay at all and gives you full exp all the time (no matter what the individual fields contain).

You can also add "pause" to the end of the batch file (w/o the quotes)

It is using simple bit precision

1 = 2
2 = 4
3 = 8
4 = 16
5 = 32
6 = 64
7 = 128
8 = 256
9 = 512
10 = 1024

etc

The arguments are: <FILENAME> <MAX LEVEL> <DECAY> <DECAY START>

filename=obvious
maxlvl=max clvl
decay=precision of decay
decaystart=level at which the decay begins (vanilla has this at 70 IIRC)
Last edited by Nefarius on Fri Aug 22, 2008 12:54 am, edited 4 times in total.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

User avatar
Ulf.d2
Posts: 73
Joined: Sun Jul 06, 2008 1:42 am
Location: Washington

Post by Ulf.d2 » Fri Aug 22, 2008 11:34 pm

Okay, so it was just my lack of knowledge on the bat command parameters ;) However, when I click on the expgen application, It just closes immediately, does not prompt me or change the experience.txt at all.

I dont't know if this is something wrong with my computer or what, but I made myself a new batch file the prompts me. Works nicely. However, if someone else has this same problem, they won't have it, so may I suggest including either a batch file such as mine or a readme?
Gem Activated
Gem Deactivated

User avatar
Nefarius
Retired Admin
Cherub
Posts: 11607
Joined: Sat Jun 15, 2002 8:13 pm
Location: Where the blood forever rains
Contact:

Hand-picked

Post by Nefarius » Fri Aug 22, 2008 11:45 pm

[quote=Ulf.d2";p="400199"]Okay, so it was just my lack of knowledge on the bat command parameters ;) However, when I click on the expgen application, It just closes immediately, does not prompt me or change the experience.txt at all.

I dont't know if this is something wrong with my computer or what, but I made myself a new batch file the prompts me. Works nicely. However, if someone else has this same problem, they won't have it, so may I suggest including either a batch file such as mine or a readme?[/quote]

It is a command line app (like most any program w/o an icon), so if you click it, it doesn't pass any parameters for it to play with. So you either invoke it from the command line (in NT+ start > run > cmd, or in 9x start > run > command). You can also create a shortcut to invoke it, and pass the parameters there (like on D2 for -direct -txt), but thats the weirdest option.

This was a 3 minute project to solve the issue people had with the old one (which was a pile of trash, still don't know where the spaces on it came from...).

I'll write a read me later, but I think if someone has a problem, they can find this thread here anyway.
''(...) The game can basically be considered unhackable. '' - Blizzard Entertainment (30th May 2000)
Black Omen Productions | MetalStorm: Progress Report | Screenshots

ZepherZaper
Posts: 6
Joined: Thu Jun 18, 2015 12:26 am

Re: A new Experience.txt Generator

Post by ZepherZaper » Fri Feb 19, 2021 7:26 pm

The download link is not working does anyone have a new download link for this?

User avatar
ChaosMarc
Dark Alliance Beta Test
Champion of the Light
Posts: 256
Joined: Fri May 28, 2004 2:00 pm
Germany

Re: A new Experience.txt Generator

Post by ChaosMarc » Mon Feb 22, 2021 10:15 am

It's still there in the File Center: https://www.d2mods.info/forum/viewtopic ... or#p492172

Post Reply

Return to “Tools”