1.13d Hardcoded /Players X ( Solved )

This forum is for discussions on how to edit what can not be edited through the txt files, needless to say this isn't about battle net hacking.

Moderators: Nefarius, Havvoric

JayBrainDead
Posts: 58
Joined: Fri Mar 09, 2018 10:43 pm

1.13d Hardcoded /Players X ( Solved )

Post by JayBrainDead » Wed Mar 14, 2018 12:12 am

I've read many topics about this subjet but most of them seem seem to have many extra steps to affect each value individually ( Monster HP, XP, DMG and drops ). I'm sorry if has already been posted and it probably has.

What I'm looking for is fairly simple, hardcoding the full effects of /Players 8 in the game at all times regardless of the actual numbers of players in-game, which would also make the /players x command 100% useless (No p*ssying out on my mods).

I know plugy can execute a command everytime you start a game but that is not what i want because 1) You can later change the /players setting 2)*In my case*, The command seems to be incorrectly entered from time to time.

I might be wrong but I think this can be achieved by changing the variable of players x to a static 8. I'm fairly new to code editing so please dont be too harsh on me, i just dont know where to start. :) Thanks to anyone who is willing to take some time of their own to answer my question
Last edited by JayBrainDead on Mon Mar 19, 2018 12:53 am, edited 1 time in total.

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: 1.13d Hardcoded /Players X

Post by devurandom » Wed Mar 14, 2018 1:27 am

You can force /players 8 this way. ;)

Code: Select all


[1.13d] D2Game.0x992D0


6FCB92D0  /$  85C9          TEST ECX,ECX
6FCB92D2  |.  7C 0B         JL SHORT 6FCB92DF
6FCB92D4  |.  83F9 08       CMP ECX,8
6FCB92D7  |.  7F 06         JG SHORT 6FCB92DF
6FCB92D9  |.  890D 441CD36F MOV DWORD PTR DS:[6FD31C44],ECX
6FCB92DF  \>  C3            RETN


Change To:


6FCB92D0      B9 08000000    MOV ECX,8
6FCB92D5      EB 02          JMP SHORT 6FCB92D9
6FCB92D7  |.  7F 06          JG SHORT 6FCB92DF
6FCB92D9  |.  890D 441CD36F  MOV DWORD PTR DS:[6FD31C44],ECX
6FCB92DF  \>  C3             RETN

Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

JayBrainDead
Posts: 58
Joined: Fri Mar 09, 2018 10:43 pm

Re: 1.13d Hardcoded /Players X

Post by JayBrainDead » Wed Mar 14, 2018 1:58 am

Thanks a lot for the fast reply, after applying those changes I noticed that the CE didn't affect monster HP or Experience gained at all. A fallen in the blood moor killed at level1 on normal grants me 18(which is the default for /p 1) instead of the expected 81(18+350%).

Which leads me to believe that this offset alone isnt enough to launch a game on /p 8 on its own or a mistake wasmade at some point (and I tripled checked to make sure it was not on my part). Any other ideas ?

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: 1.13d Hardcoded /Players X

Post by devurandom » Wed Mar 14, 2018 3:12 am

To change experience to players 8 and loot drops to players 8 follow the information in this post.
viewtopic.php?t=62595
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

JayBrainDead
Posts: 58
Joined: Fri Mar 09, 2018 10:43 pm

Re: 1.13d Hardcoded /Players X

Post by JayBrainDead » Wed Mar 14, 2018 3:39 am

Yup... That's what I was trying to avoid haha ! Hoping there was an easier way around this to do all of those changes at once instead of one by one, but if there's not easy way around it then I guess i have no choice. Depending on how much time it takes me, I might try to make a easier guide for this because from what I've seen,this thread is kinda all over the place. Is it cool if I do this ? Just making sure I don't break any rules over here :)

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: 1.13d Hardcoded /Players X

Post by devurandom » Wed Mar 14, 2018 7:16 am

Yes its ok to do that., i think is a good idea to reference the original post and give credits.
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

JayBrainDead
Posts: 58
Joined: Fri Mar 09, 2018 10:43 pm

Re: 1.13d Hardcoded /Players X

Post by JayBrainDead » Sun Mar 18, 2018 6:41 am

FearedBliss had a good thread about the subject, the only thing he doesnt really cover is the /player x Damage/Attack rating increased. I searched a lot using offsets from 1.13c and 1.14d and I believe i might have found the section for Dmg increased. The thing is I cant make it behave like I want it to.

D2Game.dll Offset 9C9F0 to 9CA13 I might be wrong but it looks to me like this section of code is looking for game difficulty, the number of players and an array which more or less corresponds with Dmg increased then returns the value

Code: Select all

Address   Hex dump             Command                                  Comments
0009C9F0    8A51 6D            MOV DL,BYTE PTR DS:[ECX+6D]
0009C9F3    84D2               TEST DL,DL
0009C9F5    76 05              JBE SHORT 0009C9FC
0009C9F7    83F8 02            CMP EAX,2
0009C9FA    7D 03              JGE SHORT 0009C9FF
0009C9FC    33C0               XOR EAX,EAX
0009C9FE    C3                 RETN
0009C9FF    83F8 09            CMP EAX,9
0009CA02    7D 08              JGE SHORT 0009CA0C
0009CA04    8B0485 78B7D16F    MOV EAX,DWORD PTR DS:[EAX*4+6FD1B778]
0009CA0B    C3                 RETN
0009CA0C    8D04C5 F0FFFFFF    LEA EAX,[EAX*8-10]
0009CA13    C3                 RETN
I tried many changes and at the end I pretty much NOP'd everything and return a flat 32 ( Decimal for 50 ) B8 32000000 then returned it and still no noticeable changes. I really hope that I am not looking at the wrong place and this is just a stupid mistake on my part that would be easy to fix. Anyways, if somebody smarter than me could point my mistakes that'd be great!

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: 1.13d Hardcoded /Players X

Post by devurandom » Sun Mar 18, 2018 12:54 pm

In your situation, you don't need to change the experience table.

I walked through the code..

As soon as the player leaves town and the first monster is drawn the game looks up the playersX value stored in table... then it does 2 table lookup functions... one is the experience calc and the other is damage calc I assume.

The game does this whole routine every time before a new monster is drawn. so maybe you need to go back and double check your patch and see if it applied correctly.

Also in testing be aware that monsters drawn before changing /players x command will have the old values for experience and damage. So make sure you start a new game before testing, if your applying the patch when in game.
;)
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

JayBrainDead
Posts: 58
Joined: Fri Mar 09, 2018 10:43 pm

Re: 1.13d Hardcoded /Players X

Post by JayBrainDead » Sun Mar 18, 2018 6:49 pm

Edit : Im sorry to anyone who reads my posts, english is not my first language so please bear with me ^^
Also long post ahead you've been warned :P
I dont mean to look like im arguing with Devu ( sorry if thats the case ) I've only been doing this type of stuff for a little over a week and know his knows a lot more, I just feel like he was wrong about this case in particular and I really want to get this to work like i intend it to, Happy reading !

devurandom wrote:
Sun Mar 18, 2018 12:54 pm
In your situation, you don't need to change the experience table.
You are right about this, we dont need to change the table directly, we can work around it.
devurandom wrote:
Sun Mar 18, 2018 12:54 pm
As soon as the player leaves town and the first monster is drawn the game looks up the playersX value stored in table
You are also right about this but the small change you made in your first reply maybe doesnt change the /px value but as soon as you leave town and encounter a monster he his drawn with /p1 stats.
devurandom wrote:
Sun Mar 18, 2018 12:54 pm
then it does 2 table lookup functions... one is the experience calc and the other is damage calc I assume.
This is where you are only partially right because it definetly does multiple table lookups for every monster BUT its definetly more than 2.

1. The first table lookup ?( Im sorry idk how to call i just use your words but i hope we can understand each other ) happens at offset 7dcd0 and is linked to Experience Gained from mosters, here what it looks like

Code: Select all

6FC9DCD0  /$  83F8 09       CMP EAX,9
6FC9DCD3  |.  7D 08         JGE SHORT D2Game.6FC9DCDD
6FC9DCD5  |.  8B0485 2CBCD1>MOV EAX,DWORD PTR DS:[EAX*4+6FD1BC2C]
6FC9DCDC  |.  C3            RETN
6FC9DCDD  |>  8D8480 820000>LEA EAX,DWORD PTR DS:[EAX+EAX*4+82]
6FC9DCE4  |.  D1E0          SHL EAX,1
6FC9DCE6  \.  C3            RETN
It compares the number of players stored in EAX to 9 because spagetthi coding(Jk) and the number of players is 0-8, then looks up the table for experience returns the value. I assume the second bit looks up monster base exp granted and applies the /px multiplication.

2. The second lookup happens at offset 7dcf0 and is linked to monster HP, heres what it looks like

Code: Select all

6FC9DCF0  /$  83F8 09       CMP EAX,9
6FC9DCF3  |.  7D 08         JGE SHORT D2Game.6FC9DCFD
6FC9DCF5  |.  8B0485 50BCD1>MOV EAX,DWORD PTR DS:[EAX*4+6FD1BC50]
6FC9DCFC  |.  C3            RETN
6FC9DCFD  |>  83C0 FE       ADD EAX,-2
6FC9DD00  |.  6BC0 32       IMUL EAX,EAX,32
6FC9DD03  \.  C3            RETN
Very similar to the first one it compares /px to 9 then looks up the table for monster hp returns the value, then applies it to base monster hp returns the value again.

Every thing is fine up to that point. But these two sections of code do not have any effect on multiple other values linked /px like Monster Dmg, Monster Ar and Items dropped. And it would make no sense that one of these two also applies Damage and/or Attack rating because the values are totally different to monster hp and/or exp gained and they do not apply on all difficulties. IMO there has to be at least two other table look ups assuming that Monster damage and attack rating are linked ( 3 if the are not )

3. FearedBliss Showed in his guide where the bit regarding /px and items dropped is and how change it so i wont repeat it, here but i believe it starts around offset 9982c for 1.13d

4. That still leaves us with a least one more bit that is linked to the number of players which is Damage and Attack rating ( In 1.14d these are linked together since they always have the same value so for all intents and purposes lets assume it also it linked in 1.13d ), and i stronly believe it is at offset 9c9f0.

Code: Select all

Address   Hex dump             Command                                  Comments
0009C9F0    8A51 6D            MOV DL,BYTE PTR DS:[ECX+6D]
0009C9F3    84D2               TEST DL,DL
0009C9F5    76 05              JBE SHORT 0009C9FC
0009C9F7    83F8 02            CMP EAX,2
0009C9FA    7D 03              JGE SHORT 0009C9FF
0009C9FC    33C0               XOR EAX,EAX
0009C9FE    C3                 RETN
0009C9FF    83F8 09            CMP EAX,9
0009CA02    7D 08              JGE SHORT 0009CA0C
0009CA04    8B0485 78B7D16F    MOV EAX,DWORD PTR DS:[EAX*4+6FD1B778]
0009CA0B    C3                 RETN
0009CA0C    8D04C5 F0FFFFFF    LEA EAX,[EAX*8-10]
0009CA13    C3                 RETN
Because this change is only applied on difficulty nightmare and hell and if there is more than 2 players. (ECX+6D) being the difficulty pointer the first section from 9c9f0 to 9c9fe makes a lot of sense, then the game procceeds like in our first 2 situations : compare /px to 9 and look up the table then returns the value then at 9ca0c i can only assume it applies the changes and returns the value again.

I might be wrong about this but you know everything lines up for this to be the /px damage increased it just seems i cant figured out how to apply a flat 50. would going to the Array and changing the 9 values to 32 work at this point ? Im kinda out of ideas Lol.

Edit 2:
Also in testing be aware that monsters drawn before changing /players x command will have the old values for experience and damage. So make sure you start a new game before testing, if your applying the patch when in game.
I was well aware of that when doing my test and accounted for that but that might be the case for everyone.
Also I noticed something else I tought had a strange behavior, if you apply changes to the sections of code regarding /px above in this post it wont work if you are running the game in -direct -txt mode keep that in mind

Edit 3: For those who might have been lost in all this, The initial Goal of this whole excercise was to had a flat 50 % monster damage regardless of both GAME DIFFICULTY and NUMBER OF PLAYERS.
Ive only seen guide on this subject to show how to PREVENT monster damage increased in all case, but I aint no p*ssy, i want this mod to be absolutely savage

JayBrainDead
Posts: 58
Joined: Fri Mar 09, 2018 10:43 pm

Re: 1.13d Hardcoded /Players X

Post by JayBrainDead » Sun Mar 18, 2018 10:20 pm

So after a whole day of testing I figured it out.

1. The first thing I had to make sure of is that /player x does have an impact on either Monster Damage or Monster Attack Rating. I started by joining a game with my test character, set it to /p1, went to the blood moor, isolated a normal zombie (no elite, no minnion) and let him successfully hit me 10 times in a row pausing the game in between, counting individual damage for the 10 hits adding the total, healed up left game. I repeated this proccess 8 times then averaged out the dmg on hit of a hell zombie. The result was 97.41 average damage on hit on my character and the zombie had 73% hit chance on my character ( I didnt not count missed hits so i can't confirm or deny but it felt about right )

/Players 1
dmg on hit 97.41
chance to hit displayed 73%

2. Using the same test character I loaded up a game, set it to /p8 went to the blood moor isolated .... you get where im going at i did the exact same thing for /p8, 10 normal zombie hit/8 different games. I averaged out the dmg on hit and red hit chance

/Players 8
dmg on hit 136.25
chance to hit displayed 73%

3. At the end of step two I could clearly tell that /Player x did have an effect on Monster Damage but did not seem to affect Attack rating. I did not count the average of hit missed but I did not noticed a really difference like I could with the Damage on hit and the Stats Displayed stayed the same.

All of the step above were done with a clean D2Game.dll, now on to step 4.

4. I went back to the section I thought determined Damage and Attack Rating increased

Code: Select all

Address   Hex dump             Command                                  Comments
0009C9F0    8A51 6D            MOV DL,BYTE PTR DS:[ECX+6D]
0009C9F3    84D2               TEST DL,DL
0009C9F5    76 05              JBE SHORT 0009C9FC
0009C9F7    83F8 02            CMP EAX,2
0009C9FA    7D 03              JGE SHORT 0009C9FF
0009C9FC    33C0               XOR EAX,EAX
0009C9FE    C3                 RETN
0009C9FF    83F8 09            CMP EAX,9
0009CA02    7D 08              JGE SHORT 0009CA0C
0009CA04    8B0485 78B7D16F    MOV EAX,DWORD PTR DS:[EAX*4+6FD1B778]
0009CA0B    C3                 RETN
0009CA0C    8D04C5 F0FFFFFF    LEA EAX,[EAX*8-10]
0009CA13    C3                 RETN
and changed it to something similar to what FearedBliss did in the thread linked above :

Code: Select all

Address   Hex dump          Command                                  Comments
0009C9F0    90              NOP
0009C9F1    90              NOP
0009C9F2    90              NOP
0009C9F3    90              NOP
0009C9F4    90              NOP
0009C9F5    90              NOP
0009C9F6    90              NOP
0009C9F7    90              NOP
0009C9F8    90              NOP
0009C9F9    90              NOP
0009C9FA    90              NOP
0009C9FB    90              NOP
0009C9FC    90              NOP
0009C9FD    90              NOP
0009C9FE    90              NOP
0009C9FF    90              NOP
0009CA00    90              NOP
0009CA01    90              NOP
0009CA02    EB 08           JMP SHORT 0009CA0C
0009CA04    8B0485 78B7D16F MOV EAX,DWORD PTR DS:[EAX*4+6FD1B778]
0009CA0B    C3              RETN
0009CA0C    B8 32000000     MOV EAX,032
0009CA11    90              NOP
0009CA12    90              NOP
0009CA13    C3              RETN
5. I repeated step 1 and 2 all over again with this new change. The results for both step were averaging something very similar to step 2. Effectively I changed it so that regardless of /player x, all monster would gain 50% damage on all difficulty. I could have stopped here, but I like the Mythbusters approach to take it to an extreme just to confirm if the rule still applies, so i did.

6. I changed 0009CA0C B8 32000000 to 0009CA0C B8 FF000000 just for the hell of it (FF=255). At this point I was fairly confident so I loaded up the game with the same test character and went straight to the first zombie i could find, didnt even bother to change /px so it was still set to 1. What happenned ? This zombie hit me for multiple hundreds at a time !! I could not even let him hit me 10 times in a row I would have died long before that.

That was it I knew I did right .. but the steroid zombie still had 73% chance to hit me ( according to my stat sheet ). I could take 2 conclusions from this either :
A. In 1.13D, Attack Rating is not linked to the Damage Increased formula and is also not linked to the number of players because regardless if i set it to 1 or 8 in-game it never changed.
B. Attack Rating is linked to the number of players (possibly Dmg% formula aswell) but the character stat sheet doesnt display it properly, AKA visual bug.
Actually heres a free one
C. Attack rating has a separate formula for 1.13d that isnt affected by the /player x command, who knows ?

7. To make it more exact, I dug into D2Game.dll to find the exact numbers in the array linked to damage increased which can be found at Offset FB778 and Found out that at 8 players the value used is 38(56 Decimal). That is more than I expected but then I looked at the default formula which ends with :

Code: Select all

0009CA04    8B0485 78B7D16F    MOV EAX,DWORD PTR DS:[EAX*4+6FD1B778]
0009CA0B    C3                 RETN
0009CA0C    8D04C5 F0FFFFFF    LEA EAX,[EAX*8-10]
0009CA13    C3              RETN
Am I correct to assume that whatever value is found by the array is then substracted by 10 in the default formula ? I dont know what to make of the last command because if i ignore it and just MOV EAX,38 I'll get a 56% dmg increase but that seems more then what it should AND the values i had in my test ( even not 100% accurate, small sample size )
According to my test it should be about 40% dmg 0% ar
According to : https: diablo2 diablowiki net/Player_Settings it should be 43% for both dmg and ar ( tho 1.13d might be bugged )

What do you guys think ?

JayBrainDead
Posts: 58
Joined: Fri Mar 09, 2018 10:43 pm

Re: 1.13d Hardcoded /Players X ( Solved )

Post by JayBrainDead » Mon Mar 19, 2018 5:28 am

I hope nobody got scared by the long posts :( Finding this took me some time and I cant find anything about this for 1.13d, I like when i can give back ^^

I finally settled on leaving it at 38 (56) like indicated at the end of the array, after even more extensive testing because 32 (50) didnt feel quite right while playing.

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: 1.13d Hardcoded /Players X ( Solved )

Post by devurandom » Mon Mar 19, 2018 3:55 pm

There's other formula's that modify experience gained, damage reduction, etc.

There's an experience gain table that can reduce the experience from the base formula.
Not sure you can draw conclusions that setting players 8, doesn't work because it doesn't return what the base calcs say it should.
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

JayBrainDead
Posts: 58
Joined: Fri Mar 09, 2018 10:43 pm

Re: 1.13d Hardcoded /Players X ( Solved )

Post by JayBrainDead » Mon Mar 19, 2018 6:36 pm

What made me draw the conclusion that :

Code: Select all

[1.13d] D2Game.0x992D0


6FCB92D0  /$  85C9          TEST ECX,ECX
6FCB92D2  |.  7C 0B         JL SHORT 6FCB92DF
6FCB92D4  |.  83F9 08       CMP ECX,8
6FCB92D7  |.  7F 06         JG SHORT 6FCB92DF
6FCB92D9  |.  890D 441CD36F MOV DWORD PTR DS:[6FD31C44],ECX
6FCB92DF  \>  C3            RETN


Change To:


6FCB92D0      B9 08000000    MOV ECX,8
6FCB92D5      EB 02          JMP SHORT 6FCB92D9
6FCB92D7  |.  7F 06          JG SHORT 6FCB92DF
6FCB92D9  |.  890D 441CD36F  MOV DWORD PTR DS:[6FD31C44],ECX
6FCB92DF  \>  C3             RETN
doesnt work as intented is because if you apply this change to a clean 1.13d install and join a game what you expect to happen is :

Situation A : Forced 8 players, so you should get similar results to a clean game with /p8 applied AND since the game is force to 8 players, the /player x command shouldnt have any effect on game difficulty. it should be the same no matter what /px command you use because player should always be 8 right ?

What happened when I tired it was this instead :

Situation B : Joined a game and didnt any /player x command expecting results of a 8 player game. Instead I got results from a /p1 game, then I tried changing the player number to 8 using the command ( this shouldnt have any effect remember we already forced it to 8 ). After using the command I got 8 player difficulty.

What conclusion can you draw from this ?
1. Forcing a static player number is impossible ( which I REALLY doubt )
2. The code edit mentioned above doesnt not work as intented, it might still be possible that is not the way to do it

At the time I started this thread I was hoping there would be an easy fix like you proposed, but I didnt not have much knowledge about assembly ( and I dont claim to have become an expert in the last week ) everybody else who documented on the subject took a different approach by changing every formula instead. That's what I did and Im glad I learned quite a bit along the way cause after all I managed to get what I Initally wanted. Found the formula for damage then changed it to behave like i intended it to in the first place.

It is probably possible to just force 8 players I just havent really looked into it, though I like what I did even more because the base formula doesnt apply Increased damage in Normal difficulty, only Nightmare and Hell but the way it is now it even applies on Normal :twisted: Yes I know, I am evil ^^

Edit: For the sake of argument, I could look into making your approach work since Im sure it could be useful for some people, but that will be after im done doing all the heavy lifting ( code editing ) necessary for my mod. As I said plenty of times I'm sure it is possible and that would a much more simple and clean solution, maybe it's just a minor thing we have overlooked.

Anyways thanks for replying on posts you always give me food for thought and end up pushing to learn just a little bit more about assembly every time. ;)

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: 1.13d Hardcoded /Players X ( Solved )

Post by devurandom » Tue Mar 20, 2018 1:40 am

Your right, code never gets executed by anything but client.. Face Palm.. And its a double whammy to fix from a pure assembly perspective because reloc table. If one of the functions were close enough to make a relative call it might be fixable with more simplistic code.
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

JayBrainDead
Posts: 58
Joined: Fri Mar 09, 2018 10:43 pm

Re: 1.13d Hardcoded /Players X ( Solved )

Post by JayBrainDead » Tue Mar 20, 2018 1:53 am

Not 100% sure what you just said, but it seems that we came to an aggreement ^^

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: 1.13d Hardcoded /Players X ( Solved )

Post by devurandom » Tue Mar 20, 2018 3:37 am

if your up for testing, this might be a simpler edit to force players 8

-somewhat tested :-| may need revision


Description

Code: Select all

6FC9DF7B    E8 90B80100   CALL 6FCB9810                 ; determine game type, TC &
							; return players X for SP & MP or
							; return player count for Bnet.
6FC9DF80    8BC8          MOV ECX,EAX
6FC9DF82    83F9 01       CMP ECX,1
6FC9DF85    7D 05         JGE SHORT 6FC9DF8C
6FC9DF87    B9 01000000   MOV ECX,1
6FC9DF8C    8BC1          MOV EAX,ECX
6FC9DF8E    E8 5DFDFFFF   CALL 6FC9DCF0	                ; [D2Game.6FC9DCF0
                                                        ; HP calc
6FC9DF93    8906          MOV DWORD PTR DS:[ESI],EAX
6FC9DF95    8BC1          MOV EAX,ECX
6FC9DF97    E8 34FDFFFF   CALL 6FC9DCD0	                ; EXP calc

Code: Select all

Force Players 8

[1.13d] - D2Game.0x7DF80

6FC9DF7B      E8 90B80100   CALL 6FCB9810
6FC9DF80      8BC8          MOV ECX,EAX
6FC9DF82      83F9 01       CMP ECX,1
6FC9DF85      7D 05         JGE SHORT 6FC9DF8C
6FC9DF87      B9 01000000   MOV ECX,1


change to:


6FC9DF7B    E8 90B80100   CALL 6FCB9810
6FC9DF80    90            NOP
6FC9DF81    90            NOP
6FC9DF82    90            NOP
6FC9DF83    90            NOP
6FC9DF84    90            NOP
6FC9DF85    90            NOP
6FC9DF86    90            NOP
6FC9DF87    B9 08000000   MOV ECX,8
6FC9DF8C    8BC1          MOV EAX,ECX
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

JayBrainDead
Posts: 58
Joined: Fri Mar 09, 2018 10:43 pm

Re: 1.13d Hardcoded /Players X ( Solved )

Post by JayBrainDead » Tue Mar 20, 2018 4:19 am

Im currently stuck and unable to progress on my own project.

Sure bud I can test this edit, as I already told you theres not much I can do to help ( Newbie over here ) but if I get a chance I'll gladly contribute!

JayBrainDead
Posts: 58
Joined: Fri Mar 09, 2018 10:43 pm

Re: 1.13d Hardcoded /Players X ( Solved )

Post by JayBrainDead » Tue Mar 20, 2018 6:15 am

After a clean install of diablo 2 lod 1.13d I edit the Game.dll as you suggested above and from a few minutes of testing I can this was already somewhat more successful heres what i mean :

1. Experience gained is equal to /p8, confirmed on 2 different characters
2. Monster HP is equal /p8, confirmed on multiple mobs
3. Monster damage, I cant tell anything yet as this is the most tricky to confirm and requires a lot more test and calculations then the first parameters
4. I dont what the {filtered} happenned to items dropped, It is indeed too early to tell because this also requires more extensive testing but look what i got from the very first chest I encountered : https://imgur.com/sot1bnF
I've never seen anything like that, dropped from a chest at level 1 in the blood moor 5 steps away from rogue camp, 8 items all rares
Probably my best start to any character ever Lol, Luck or Broken Drop rates ?

Obviously this is too early to draw any conclusion but i thought it'd be funny enough to share. I'll see if i can repeat anything as crazy as this



Edit : I have to tip my hat to you kind sir. With the random map I got from making this character testing the drop rates was made somewhat easier

After even more testing here are my conclusions :

1. Experience gained, CHECK, tested earlier

2. Monster HP, CHECK, also tested earlier

3. Drop rates, heres where the tricky stuff comes into play, I opened multiple times the chest generated in front of rogue camp and i had anything from 1 to 8 items with an average of 3/4 items per chest
Knowing that on /p1 Chest can only grant up to 4 items and /p8 up to 8 items thing are looking good
I also compared my results with the sample FearedBliss did in this thread : viewtopic.php?f=8&t=62595
He had an average of 1 items on /p1 and about 3 for /p8, still looking good
I was not able to reproduce the result In my very first run, in fact it was the only time a chest granted me 8 items. To me that was VERY unlikely but still possible occurance

Items dropped, CHECK

4. Attack rating, Monster did not receive an increase to AR during this test, but neither did they using the /players 8 command or during any of my previous tests on this patch.
No increase, expected result. CHECK

5. I tried to use the /players 1 command to revert the changes made, without any success, the game stay on 8 player difficulty no matter what, rendering the command useless. CHECK

6. The last thing that would have to be tested is Monster Damage which I have not done yet. I have charts regarding monster damage but to be exact I would need to import the same character to be able to compare the damage dealt. But my girfriend is calling me to bed so ... that will have to wait ^^

For all intents and purposes this worked as intended. Kudos to Devu ;) You are a legend ...

...Or not depends on your personnal criteria of a legend :mrgreen:

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: 1.13d Hardcoded /Players X ( Solved )

Post by devurandom » Tue Mar 20, 2018 7:01 am

Here's a more simplified patch that should do the same thing.. i think.

It was already pointed out by Lolet in the other thread. Though he didn't spell out that it would work this way, it should do the same thing as the patch your testing. Seems to work and gives good drops.

Code: Select all

Force Players 8

[1.13d] - D2Game.0x99810

6FCB9810      51            PUSH ECX
6FCB9811      53            PUSH EBX
6FCB9812      57            PUSH EDI
6FCB9813      8BF8          MOV EDI,EAX
6FCB9815      8D4424 08     LEA EAX,[ESP+8]

change to:

6FCB9810      B8 08000000   MOV EAX,8
6FCB9815      C3            RETN
6FCB9816      90            NOP
6FCB9817      90            NOP
6FCB9818      90            NOP

Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

JayBrainDead
Posts: 58
Joined: Fri Mar 09, 2018 10:43 pm

Re: 1.13d Hardcoded /Players X ( Solved )

Post by JayBrainDead » Tue Mar 20, 2018 5:54 pm

Well now the question is ... should I revert all the changes made previously so I can apply this patch ? Surely this is more accurate than what I did because it doesnt change any base formula used by the game.

Why did you have to go ahead and create me work ? Jk
Here's a more simplified patch that should do the same thing.. i think.

It was already pointed out by Lolet in the other thread. Though he didn't spell out that it would work this way, it should do the same thing as the patch your testing. Seems to work and gives good drops.
If Im not mistaken this is the formula for items dropped only forced to 8, this would not apply any other factor like HP DMG and EXP, and i know this works because its extremely similar to what I did previously

Edit it is exactly the same. MF only

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: 1.13d Hardcoded /Players X ( Solved )

Post by devurandom » Tue Mar 20, 2018 7:51 pm

looks to me that it will do the same as the other patch, just less bytes to patch. just sets players to 8.
Looking to find the minimalist patch to make players 8 work since this question gets asked a lot.

But the question now is: was this patch by lolet correct? for effecting drop rates.
because patching it this way might skip the TC lookups? if I'm reading it correctly.

EDIT: how do the 2 compare for MF? .. drop rates?
new patch vs MOV EAX 8 RETN ?

also if you do one patch you shouldn't need the other patch.
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

JayBrainDead
Posts: 58
Joined: Fri Mar 09, 2018 10:43 pm

Re: 1.13d Hardcoded /Players X ( Solved )

Post by JayBrainDead » Tue Mar 20, 2018 8:23 pm

devurandom wrote:
Tue Mar 20, 2018 7:51 pm
looks to me that it will do the same as the other patch, just less bytes to patch. just sets players to 8.
As I said earlier, FearedBliss already did a lot of testing regarding the patch by lolet and so did I because thats what I had in my mod untill today.
Even tho this was already applied,

Code: Select all

Force Players 8

[1.13d] - D2Game.0x99810

6FCB9810      51            PUSH ECX
6FCB9811      53            PUSH EBX
6FCB9812      57            PUSH EDI
6FCB9813      8BF8          MOV EDI,EAX
6FCB9815      8D4424 08     LEA EAX,[ESP+8]

change to:

6FCB9810      B8 08000000   MOV EAX,8
6FCB9815      C3            RETN
6FCB9816      90            NOP
6FCB9817      90            NOP
6FCB9818      90            NOP
Monsters in my game did not receive any increased damage ( probably why this thread is still going ^^ ), I cant tell for HP and EXP because I had both patched to :

MOV EAX,15E
RETN

But seeing as it did not increase damage which was the only other factor that wasnt patched, it leads me to believe that it would probably not apply Inc HP/EXP, EVEN IF IT DID the patch would still require a second patch regarding Damage which would already make it more bytes to patch.
But the question now is: was this patch by lolet correct? for effecting drop rates.
because patching it this way might skip the TC lookups? if I'm reading it correctly.
It defenitely affected the average and maxnimum possible number of items dropped. I didnt notice anything that would indicate an error regarding TreasureClass, No High Ilvl drops in in low lvl zones or anything like that. It seemed pretty accurate to me.

But this is more likely 100 % accurate

Code: Select all

Force Players 8

[1.13d] - D2Game.0x7DF80

6FC9DF7B      E8 90B80100   CALL 6FCB9810
6FC9DF80      8BC8          MOV ECX,EAX
6FC9DF82      83F9 01       CMP ECX,1
6FC9DF85      7D 05         JGE SHORT 6FC9DF8C
6FC9DF87      B9 01000000   MOV ECX,1


change to:


6FC9DF7B    E8 90B80100   CALL 6FCB9810
6FC9DF80    90            NOP
6FC9DF81    90            NOP
6FC9DF82    90            NOP
6FC9DF83    90            NOP
6FC9DF84    90            NOP
6FC9DF85    90            NOP
6FC9DF86    90            NOP
6FC9DF87    B9 08000000   MOV ECX,8
6FC9DF8C    8BC1          MOV EAX,ECX
Since it does not changed individual formulas

TL:DR It does work but only for Mf and would require at least one, but possibly up to 3 other patches to make it a complete /p8

User avatar
devurandom
Forum Regular
Angel
Posts: 897
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: 1.13d Hardcoded /Players X ( Solved )

Post by devurandom » Wed Mar 21, 2018 12:23 am

stepping through the code with ollydbg with either patch vs an manual players 8 unpatched has the same effect on HP/EXP in my testing. only question is the drop function.

anyway too many patches...
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

JayBrainDead
Posts: 58
Joined: Fri Mar 09, 2018 10:43 pm

Re: 1.13d Hardcoded /Players X ( Solved )

Post by JayBrainDead » Wed Mar 21, 2018 12:40 am

Code: Select all

Force Players 8

[1.13d] - D2Game.0x7DF80

6FC9DF7B      E8 90B80100   CALL 6FCB9810
6FC9DF80      8BC8          MOV ECX,EAX
6FC9DF82      83F9 01       CMP ECX,1
6FC9DF85      7D 05         JGE SHORT 6FC9DF8C
6FC9DF87      B9 01000000   MOV ECX,1


change to:


6FC9DF7B    E8 90B80100   CALL 6FCB9810
6FC9DF80    90            NOP
6FC9DF81    90            NOP
6FC9DF82    90            NOP
6FC9DF83    90            NOP
6FC9DF84    90            NOP
6FC9DF85    90            NOP
6FC9DF86    90            NOP
6FC9DF87    B9 08000000   MOV ECX,8
6FC9DF8C    8BC1          MOV EAX,ECX]

I mean if you wanna go simple, this one is pretty hard to beat and does that effect on everything ^^

FearedBliss
Posts: 82
Joined: Sat Oct 16, 2010 4:29 pm
United States of America

Re: 1.13d Hardcoded /Players X ( Solved )

Post by FearedBliss » Wed Mar 21, 2018 12:51 am

Attack rating and damage code were covered in my offsets pack post:

viewtopic.php?f=8&t=63543

Enjoy.

Post Reply

Return to “Code Editing”