[FIXED] No stamina loss for players when overloaded

Here we stuff all the bugs we've managed to squash/squish/squelch.
Post Reply
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

No stamina loss for players when overloaded

Post by Xuri »

Normal player characters are not hindered by being overloaded. They should be losing stamina fast when carrying too much, but no such thing occurs - so they can carry virtually an unlimited amount of weight with no problems.
Last edited by Xuri on Sun Jan 18, 2009 11:29 pm, edited 4 times in total.
-= Ho Eyo He Hum =-
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

There is some stamina loss code there, but not entirely sure how well it works (it's not very straightforward). My question, then, is any idea how OSI calculates stamina loss? I just recall something like -2 stamina with every step when overloaded.
Scott
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Just checked on OSI servers, there it seems to be -5 for every step (or even turning around) while on foot, and -2 for every step if you're mounted.

You also get a system message in white text saying you're overloaded, the instant you do get overloaded. No spamming of such text while walking afterwards though.
-= Ho Eyo He Hum =-
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

So this is fixed now, right?
Scott
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Looks like the stamina loss part works fine - but there are still missing "You're overloaded!" or whatever/messages when you try to move while holding too much.

Also, I noticed that my normal character is able to hold a total of 1999 stones in his backpack/on the cursor. Perhaps a bit excessive, that :P At 1000 stones, the number in the status gump fails to display in it's entirety, and it looks like you're only holding 100. But when you get above 1100 it displays normally again heh.

Not sure what the total max weight a character on the official servers can carry, but if I remember correctly, characters are unable to pick up items (at all) weighing 255 stones or more.

Ahh! Found a nice overview:
http://uo.stratics.com/content/misc/weight.shtml

There's also a sublink there showing the maximum capacity of various containers. Secure containers, bankboxes and strongboxes seems to be excepted from the weight limits though.
-= Ho Eyo He Hum =-
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Hm. If a character tries to pick up a pile of items that would make his total weight surpass the total theoretical maxweight of the character (currently hardcoded to 2,000), he'll normally not be allowed to do so, and the character will drop the pile back on the ground with a stern message from the server telling him that he wouldn't be able to carry that much.

However, if the character attempts to pick up the pile, then very rapidly after clicking the "OK" button to confirm the amount of items to pickup from the pile then clicks on a different location on the ground nearby, the pile of items will be moved there - and the total weight of the pile will be subtracted from the character, essentially reducing the total weight he's carrying since the weight of the pile never got added in the first place (which is correct).
-= Ho Eyo He Hum =-
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Also, the total weight your character can carry as displayed in the status gump seems to be wrong. Is it hardcoded in the client (depending on your str or whatever), or is it something we can fix?

I notice that in CSocket::statwindow() we only send the following related to weight, which is the character's current weight:

Code: Select all

	toSend.Weight( static_cast<UI16>(i->GetWeight() / 100) );
-= Ho Eyo He Hum =-
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Hmm. Seems the status window is calculating with STR * 3.5 + 40, while we've been using STR * 5 + 30. Tried setting WeightPerStr to 3.5, but UOX3 refuses to read it as a decimal number and overwrites it with the value "3".

I'm changing the default value for WeightPerStr from 5 to 3.5 in the code commit I'm making shortly (tweaked some math for calculating max carrying capacity, added a new system message for overloaded characters), but I'm not sure what changes need to be done for UOX3 to use the decimal value instead of rounding it down to 3.

If someone else could fix that, it would be appreciated.
-= Ho Eyo He Hum =-
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

I'll be out of town for the 4th, but when I get back will look into this. Should be just a matter of changing the variable in CServerData to a float rather than a short int.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Looks like I managed to hack it in, by following Maarc's guidelines in the changelog-thread :)
-= Ho Eyo He Hum =-
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Ok, the updated WeightPerStr stuff is on the CVS. However, this issue still remains:
Xuri wrote:Hm. If a character tries to pick up a pile of items that would make his total weight surpass the total theoretical maxweight of the character (currently hardcoded to 2,000), he'll normally not be allowed to do so, and the character will drop the pile back on the ground with a stern message from the server telling him that he wouldn't be able to carry that much.

However, if the character attempts to pick up the pile, then very rapidly after clicking the "OK" button to confirm the amount of items to pickup from the pile then clicks on a different location on the ground nearby, the pile of items will be moved there - and the total weight of the pile will be subtracted from the character, essentially reducing the total weight he's carrying since the weight of the pile never got added in the first place (which is correct).
-= Ho Eyo He Hum =-
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

EDIT: Original issue fixed, so created a new thread for the other issue found:
Players can reduce the total weight they carry to 0.

This thread is "fixed".
-= Ho Eyo He Hum =-
Post Reply