Co2 Redux v2 Bow Proficiency problem

03/20/2020 16:07 youssef911#1
Hello all, it has been a while since i last visited the forum. I have been trying for hours to solve this problem but it seems i have not had any luck.

Expected behavior:
when i hit monsters single arrow with bow or at TG the proficiency percentage increases till it reaches 100% then the skill levels. this should happen for all levels until it is maxed out.

Actual Behavior:
when i hit monsters or TG stake with single arrow the proficiency behaves normally until level 2. when the bow proficiency reaches level 3, the percentage resets each time it reaches 10%. however the actual experience gained is still recorded. So if i keep on hitting and i let it reset for 10 times it actually levels up but the problem is i do not know how much percent is left this way. i started debugging the addProficiencyExperience() function but it seems to be working exactly fine. in fact the bow is the only weapon that has this problem, all single handed or two handed weapons at least the mostly used ones i tried work fine i did not notice any behavior like this from any other proficiency.

I am hoping someone can tell me where i can find the code to debug that is specific for showing the percentage left for proficiency level up for bow.

If that is a client sided issue can it be solved?

Thank you all.
03/20/2020 18:33 Spirited#2
Weird. Was it fixed in the 3.0 version by any chance? Can you post the function to here so we can take a look at what you currently have?
03/21/2020 08:47 Super Aids#3
I would debug the handler for bow attacks, it's most likely an issue with not updating the client properly. So step through the whole handler and not just that function, as you said it actually works, it just doesn't show properly. So I would throw my 2 cents at it happening a step further back than that function.
03/21/2020 13:10 youssef911#4
here are the proficiency functions
And here is the launch attack handler
03/29/2020 03:09 luizinhofox#5
check the weapon.dat on the client if it is changed, it can solve your problem.
03/29/2020 11:17 youssef911#6
Quote:
Originally Posted by luizinhofox View Post
check the weapon.dat on the client if it is changed, it can solve your problem.
Inside the client folder there are 2 files called WeaponSkilllLevelExp.ini but i change them nothing happens. and i found no weapon.dat on the client (5065) however i can say all the files are last modified between 2003 and 2005. i tried to follow the function till the [1025] WeaponProficiency packet. but every thing seems to be going fine. i dont know if i missed something but all it does is check for wep id , and skill experience then add id to the id of the player after calculating the exp based on dmg and all. so i am still lost here on where does the code make the percentage of gained vs needed exp then send it to display to user. For example when i made the team member mini-map search i had to send the member id and locX and locY and so it updates on case 106. but with this one i dont see any change to percentage or anything of that sort. maybe it is handled by the client. but if so then the values passed from the server may be messed up. but then again how does the skill normally lvl when it reaches maximum experience needed for that level?
i am a bit lost here i would really apreciate some help xD
04/03/2020 19:47 Ultimation#7
LOL
04/06/2020 21:12 Ism33lawy#8
Quote:
Originally Posted by Ultimation View Post
LOL
Glad to see you, I am proud of you.
04/06/2020 22:42 pintinho12#9
Community is getting interesting
04/07/2020 12:28 KraHen#10
Keep it to the thread pls.
04/28/2020 16:49 Latyos#11
I have the same problem currently. I'm pretty sure it's a client-side problem as experience/level values update properly on server-side.

For me, it's not only bow but any weapon. What happens is that, when you get to 25% of experience on proficiency, on client-side, it reverts back to 0% and starts counting again. On server-side, experience is up-to-date though. After it reverts back from 25% to 0% 3 times (75% in total), on 4th 25%, it suddenly levels up.

WeaponSkillLevelExp.ini values in client are same with the ones in server.
02/10/2021 13:58 denominator#12
Did you figure out what the issue was?
10/04/2023 12:19 youssef911#13
I did not figure the issue out yet actually. It has been about 2 years since I last coded in CO2 and I am back now, This bug is really killing my mind still cant figure out the root cause.

Also you are correct it is not only limited to the Bow proficiency, this issue is a global one on all weapon types

guys I think I found out the issue. The issue was in this line var buffer = new byte[24];
it was defined initially as new byte[22]. And we are passing 4 + 8 + 22 = 24;
so we were skipping 2 bytes on each send which I think was the reason for messing up the exp calculation on the client.

This is the fixed file if you are using Redux

[1025] WeaponProficiency.cs
10/04/2023 14:46 ~Crystaline#14
Update the weapon/spell proficiency using the packet type 1104 (MsgFlushExp). Try to look on other sources here for implementation.
10/05/2023 05:22 youssef911#15
Actually I am not sure if this is the correct way or not but this server was originally made by Pro4Never and the way its currently structured for the packet handling is that 1025 (WeaponProficiencyPacket) & the skill packet is 1103 (ConquerSkill). and actually [1104] is not used at all. I might try to use it and see what gets affected. But anyway the main issue is now fixed because all proficiencies now reach 100% then level up compared to only reaching 10% or under due to the limit on the buffer size.