OpenXcom Forum

OpenXcom => Troubleshooting => Topic started by: sender on October 05, 2013, 09:24:08 pm

Title: Without any equipment, weight is 6?
Post by: sender on October 05, 2013, 09:24:08 pm
Previous thread:
https://openxcom.org/forum/index.php/topic,1107.0.html

I'd like to reopen this.

I'm quite certain that this is incorrect. The base weight for an unloaded soldier should be 0.

The source of confusion is that Vanilla X-Com suffers from bugs tracking ammo weight (https://"https://www.ufopaedia.org/index.php?title=Known_Bugs#Ammo_Weight_Bugs"). Scroll down to the section for "displaced ammo weight". Basically whenever you dropped a loaded gun you would still be incorrectly tracked as carrying the ammo for weight purposes. This would make it appear that you had extra weight even when stripping yourself of all inventory items. Unloading the gun before dropping it would update your weight correctly and you would end up with 0 weight for an empty inventory.
Title: Re: Without any equipment, weight is 6?
Post by: redrat9595 on October 06, 2013, 08:10:26 pm
I thought this might be an issue, too, but I assumed there was some decision made that I didn't know about. I can attest to the fact that, in the original, it WAS possible to get down to zero weight. The only things turned on in UFOExtender are inventory stats, D3D, Cursor Clipping, and Cursor Scaling. ALL bugfixes are turned off (as in not fixed).

I unloaded the rifle, then dropped everything down to the ground.
Title: Re: Without any equipment, weight is 6?
Post by: OwenQ on October 08, 2013, 01:40:42 am
I went ahead and reported this on the bug tracker (https://openxcom.org/bugs/openxcom/issues/296). It's a constant source of consternation, especially when I have low-strength rookies who can't handle a rifle, extra clip, and grenade (17 units), leave their spare clip on the floor of the Skyranger, and have the game try to autoequip said clip to a guy who can't handle that loadout plus another clip, then everybody has a TU penalty and I feel as though everything is wrong with the world.
Title: Re: Without any equipment, weight is 6?
Post by: Warboy1982 on October 14, 2013, 12:33:25 pm
according to ufopaedia's notes, getting down to zero weight by unloading your initial weapon and then dropping it is actually exploiting the Weightless Loaded Ammo, listed just above the Displaced Ammo Weight, in fact it says in the description of the bug that this is the case.

i'm going to say there's no right answer on this one, and leave it as it is, but...

THIS (https://github.com/SupSuper/OpenXcom/commit/64c47671604bdc76e613fccbf51e1bc49c6414ed) should settle the issue once and for all. the weight now comes from the armour, and is defaulted to 6, rather than being hard coded. you can very easily remove this by adding "weight: 0" to the armor's entry in the ruleset.

Title: Re: Without any equipment, weight is 6?
Post by: moriarty on October 14, 2013, 02:46:43 pm
that appears to be a very nice solution to this debate :)

...by the way, what does the game do if you give an armor a negative weight?  8)

(it appears to me that it might be logical to give powered armor types a weight bonus, and this might be a way to do just that...)

EDIT: nevermind, I just looked at the new git builds page and realized that you actually implemented "allow armors to modify effective stats". woot!!! so no need for negative weight :P
Title: Re: Without any equipment, weight is 6?
Post by: Align on October 14, 2013, 03:28:00 pm
This seems like it would be very easy to test in vanilla xcom, just send a skyranger with no guns to a mission.
Title: Re: Without any equipment, weight is 6?
Post by: OwenQ on October 14, 2013, 07:29:58 pm
I reinstalled XCOM on Steam, added a Skyranger full of grenades and the first three soldiers I could find that had a strength divisible by 3. 11 grenades with 33 strength = no TU penalty, 12 grenades = TU penalty, ditty for 9/27 and 7/21. That's what I'd expect if the base weight carried is intended to be 0, and I don't think there are any bugs related to grenades and weight.

Either way the armor thing is more than good enough and makes me positively giddy with possibilities.
Title: Re: Without any equipment, weight is 6?
Post by: sender on October 14, 2013, 11:15:36 pm
according to ufopaedia's notes, getting down to zero weight by unloading your initial weapon and then dropping it is actually exploiting the Weightless Loaded Ammo, listed just above the Displaced Ammo Weight, in fact it says in the description of the bug that this is the case.

i'm going to say there's no right answer on this one, and leave it as it is, but...

THIS (https://github.com/SupSuper/OpenXcom/commit/64c47671604bdc76e613fccbf51e1bc49c6414ed) should settle the issue once and for all. the weight now comes from the armour, and is defaulted to 6, rather than being hard coded. you can very easily remove this by adding "weight: 0" to the armor's entry in the ruleset.

That's not how weightless loaded ammo works. The ammo is weightless because it's still thought of by the game as on the ground. Soldiers who unload the weapon are correctly tracked as holding ammo (INCREASING their weight, because the ammo is no longer weightless), and dropping it resets their weight to zero properly. Dropping the weapon as-is without unloading it resets their weight to zero, but then when another soldier picks up the gun they don't gain the correct weight (because the ammo is still "owned" by the ground). But if that soldier unloads it, the ammo is correctly tracked and increases their weight as before.

Load up a vanilla X-Com game and check. If you check the save game (https://www.ufopaedia.org/index.php?title=OBPOS.DAT) you can see that unit weight = the sum of items that they are the "owner" of. The only issue was tracking who owned what item. There was never any hidden encumbrance.
Title: Re: Without any equipment, weight is 6?
Post by: redrat9595 on October 15, 2013, 01:59:33 am
...bugs related to grenades and weight.

Either way the armor thing is more than good enough and makes me positively giddy with possibilities.

Good idea! Completely removes the issue of bug debate.

Also, I am thoroughly excited about the new armor fields. That makes a couple of things I wanted to try ridiculously easy.
Title: Re: Without any equipment, weight is 6?
Post by: sender on October 18, 2013, 07:13:48 pm
This is not a matter for debate. Subtracting 6 weight from all units is provably wrong, and anyone who loads up a vanilla X-Com game can plainly see so. Until it is fixed the game is broken. Forcing players to modding to get the original weight limits is supremely moronic.

Here's a save which makes it abundantly clear what the weight limit is. 3 Rifles (8 weight) with no ammo on a soldier with 24 strength = 0 encumbrance.
Title: Re: Without any equipment, weight is 6?
Post by: redrat9595 on October 18, 2013, 11:42:55 pm
This is not a matter for debate. Subtracting 6 weight from all units is provably wrong... 3 Rifles (8 weight) with no ammo on a soldier with 24 strength = 0 encumbrance.

I agree. I think the issue was pretty obvious from the beginning. I wasn't saying there should be a debate, I was saying that there was one and it is no longer debatable at all because that proved it definatively by removing the subject of said debate (ammo handling bugs).

While I am happy with the new armor handling (which has been fun to play with, by the way), this does need to get fixed. This is now three sources proving the exact same point in three different ways: default X-COM armor has NO weight, at least as far as the code is concerned.

BARELY RELATED SIDE NOTE: As sender said, unloading the gun before dropping it made the weight of the magazine attributed the soldier instead of the ground, which is why I did it.

Thanks for your time, Warboy, as well as anyone else who helps sort this out in the official build.
Title: Re: Without any equipment, weight is 6?
Post by: Warboy1982 on October 19, 2013, 08:30:31 am
This is not a matter for debate. Subtracting 6 weight from all units is provably wrong, and anyone who loads up a vanilla X-Com game can plainly see so. Until it is fixed the game is broken. Forcing players to modding to get the original weight limits is supremely moronic.

well, i've done extensive research into the topic, using the source code as my reference, and i've come up with conclusive and definitive results.

however, i'm not going to share them or make any code adjustments, in case you fall under the misguided impression that this kind of attitude will get you anywhere here or indeed anywhere else in life.
Title: Re: Without any equipment, weight is 6?
Post by: OwenQ on October 19, 2013, 06:51:13 pm
Sender's attitude is completely uncalled for, but he's not the only one following this issue. I, for one, would like to know what's actually going on and be proven wrong if I am. At least a couple of other folks in the thread also bothered to empirically test it so I imagine I'm not alone.

Like redrat, I fully appreciate the time and effort put into this.
Title: Re: Without any equipment, weight is 6?
Post by: redrat9595 on October 19, 2013, 09:14:38 pm
Hey, whoa, wasn't trying to offend anyone here. I frequent much rougher forums than this, so if I did, I apologize. I was agreeing with the data presented, not its presentation.

I'm not sure what source code you're talking about, but if you have numbers that I don't I'd love to see them. I was under the impression that removing ammunition entirely from the experiment (bringing only grenades) removed all confounding variables and created a clear-cut situation (one that I replicated). If I'm missing something obvious here, please let me know.

Thanks,
Red
Title: Re: Without any equipment, weight is 6?
Post by: sender on October 19, 2013, 09:33:46 pm
well, i've done extensive research into the topic, using the source code as my reference, and i've come up with conclusive and definitive results.

however, i'm not going to share them or make any code adjustments, in case you fall under the misguided impression that this kind of attitude will get you anywhere here or indeed anywhere else in life.

I have yet to make any personal attacks. I am not judging you or the (considerably large) amount of work you have put into this project. I am stating the facts as they are available, to which every available research by multiple people points towards 0 base encumbrance.

If you would like to put forth evidence supporting your decision you are free to do so, and if it is compelling I will retract everything I have said. As it is, you are either intentionally withholding evidence to spite both me and the rest of those who are in this thread, or you have no evidence to support your claim and are dismissing our claims entirely out of hubris. Either of these is you acting childish. And that was a personal attack.

Please, just load up the save I posted earlier. It's a single soldier in a skyranger entirely empty other than 4 rifles. You can easily pick them up and compare encumbrance. There are no possible problems I can find with this test.
Title: Re: Without any equipment, weight is 6?
Post by: moriarty on October 19, 2013, 09:53:55 pm
off-topic
Until it is fixed the game is broken. Forcing players to modding to get the original weight limits is supremely moronic.

last time I checked, this qualifies as a personal attack.

/off-topic

seriously, I can't understand the obsession with "100% vanilla" behavior. if we wanted a game that was 100% vanilla, we wouldn't be here today... okay, I'm kind of stretching that, but still, I guess we all agree that there were things in the original that were just plain wrong.

for me, the "weight" always represented "weight of stuff that the soldier carries". I never noticed that it was not zero when they weren't carrying anything, and I don't see why it ever should be more than zero, unless you want the clothes to count into this - but then you'd have to be able to send your troops into battle naked, just to give you the option of having soldiers with weight=0. which is truly ridiculous.

yes, I would also like to see the proof that warboy is talking about, but chances are that even if it is flawless, it won't convince everybody, because there will always be somebody claiming that "if it isn't exactly like the original, it is stupid".

so please, why can't we leave it at this point? I feel that the only good that could ever come out of this discussion is the added possibility of defining a weight for armor. and hey, we have that now :)
Title: Re: Without any equipment, weight is 6?
Post by: OwenQ on October 19, 2013, 10:59:08 pm
I agree that vanilla shouldn't be adhered to slavishly, but downloading the game should be close enough to the original (as intended) as makes sense, sans silly bugs and early 90's technical limitations. I'm using the vanilla behavior since that's supposed to be the projects baseline, and as far as I have seen it also seems to be the more sensical behavior as moriarty said.

Apart from being genuinely curious about what's going on under the hood, the current situation is that the game requires a mod to act 'as expected' (a character in nothing but coveralls being weight = 0). If the coveralls are supposed to weigh 6 units for whatever reason, I'll accept it with grumbling and just mod it. As it stands though that extra 6 weight puts some relatively tight restrictions on what characters can carry (especially the lower-strength ones).
Title: Re: Without any equipment, weight is 6?
Post by: redrat9595 on October 19, 2013, 11:40:27 pm
Not to be rude, but I think most obsession stems from the about page: "OpenXcom is an open-source clone of the original..." I'm not a stickler for an exact copy of the original, but I love tossing auto-cannons on my rookies, and 6 makes the difference between old strategy and revising how I distribute weapons. I'd rather have it behave, by default, like the original and be able to do the other stuff by choice (advanced options, rulesets, config, etc.)

That said, I don't mind changing it in the rulesets to fit my belief (I'm in there all the time anyway), and I think the new armor handling is, again, AWESOME. Having played a multitude of RPGs and TTRPGs, though, I think the reason they would have made it 0 by default is for the same reason every other game does: lack of choice. You have to have the armor. I mean, that flattop hairstyle MUST weigh at least as much as a grenade, and we don't account for that. ;)

But again, I'm fine with how it is now.

Thanks,
Red
Title: Re: Without any equipment, weight is 6?
Post by: sender on October 20, 2013, 03:02:13 am
off-topic
last time I checked, this qualifies as a personal attack.

Wasn't intended. Just saying that "you can mod it back so you can't complain" is not a reasonable response. That's a critique of a doctrine, not a person.

seriously, I can't understand the obsession with "100% vanilla" behavior. if we wanted a game that was 100% vanilla, we wouldn't be here today... okay, I'm kind of stretching that, but still, I guess we all agree that there were things in the original that were just plain wrong.

It's not like there is any especially good reason to change base soldier weight from 0 to 6. If OXC suddenly doubled the cost and construction time of living quarters and said that anyone who has a problem can change it back to vanilla values themselves, wouldn't that be silly?

Anyway, if we wanted to be 100% slavishly devoted to vanilla, we'd be demanding that soldiers get a free no-encumbrance clip every mission. But instead players can see why fixing the pre-loaded ammo weight bug is justifiable. Adding 6 weight to each soldier has no justification based on the vanilla X-Com.
Title: Re: Without any equipment, weight is 6?
Post by: Warboy1982 on October 20, 2013, 08:50:52 am
for the record, i never "forced" anyone to mod anything, i prefer "allowed" or "enabled". that's my doctrine you're calling moronic, and by extension, me that you're calling a moron. i'm open to criticism, but saying "that's dumb, the game is broken" will typically elicit a response along the lines of "please go forcibly insert an umbrella in yourself and push the button"

the argument over weight has been going on for well over a year now, and personally i'm sick to death of it. i attempted to resolve the situation by giving players the option to do as they saw fit, and somehow that resulted in more fuel on the fire. the whole argument only exists because the whole concept of weight is bugged as shit to begin with. rest assured, that for every calculation and test case you propose, there is an equal and opposite one proving things the other way. so yes, the topic IS very much open for debate.

it got to the point where i just threw my hands up in the air and accepted a PR to "fix" it. and now i'm a moron for trying to settle the argument without getting involved or taking sides.

well, now i'm involved, and here's the code that will settle things once and for all

Code: [Select]
int __cdecl sub_413820(__int16 a1)
{
  v1 = 0;
  v2 = a_ObPos_DAT;
  v3 = 170;
  do
  {
    if ( v2->obdata_ref != -1 )
    {
      if ( v2->owner_unitpos_ref == a1)
      {
        v4 = p_ObData_DAT[v2->obdata_ref].0x2B;
        v1 += v4;
      }
    }
    ++v2;
    --v3;
  }
  while ( v3 );
  return v1;
}

you don't even want to know how hard that was to find.

tl;dr: you have a definitive answer. 0 is the correct default. congratulations, you were right. we can all sleep safe in the knowledge that the game isn't completely broken because we got a number wrong.
Title: Re: Without any equipment, weight is 6?
Post by: sender on October 21, 2013, 02:04:15 am
I'm glad that my insistence led to fixing a bug that had remained unresolved and contested for over a year. You can argue about my methods, but not my results  ;D

Sorry if you felt offended or that I went over the line. I'm only here because I enjoy X-Com.