OpenXcom Forum

OpenXcom => Open Feedback => Topic started by: BBHood217 on August 11, 2014, 07:24:50 pm

Title: Aliens throwing grenades for less TUs than humans?
Post by: BBHood217 on August 11, 2014, 07:24:50 pm
I've had a few games where an alien can throw a grenade and afterwards still have time left to fire off a snap shot.  And a few times where an alien exits from a UFO and throws a grenade when I know it shouldn't have had enough time to do all that.

I'm not imagining things, am I?  Is it because Instant Grenades are on?
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: pmprog on August 11, 2014, 07:27:02 pm
You can prime a grenade in one turn and throw it in the next (or any subsequent turn), I'm assuming aliens also do this
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: Hobbes on August 11, 2014, 09:31:21 pm
I've remembered a situation where a Floater seemed both to fire its weapon and throw a grenade at a scouting HWP on the same turn. That looked odd but at the time I simply thought that there was a second alien nearby. However, afterwards I found no 2nd alien on that location. I remember that my thought was that the alien must have already a primed grenade (I've never seen them doing this on the original but it might be something added by OXC).

At the end I ignored the incident since it could just have been a misperception on my part. Now, after reading the OP I'm more inclined think there might be something there. I'll keep an eye to see if this happens again.
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: BBHood217 on August 12, 2014, 01:45:09 pm
Every time I saw an alien throw a grenade, it always exploded after their turn was done (or instantly exploded with Instant Grenades on).  So I don't think aliens know how to prime grenades above 0.
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: Hobbes on August 12, 2014, 03:03:12 pm
Every time I saw an alien throw a grenade, it always exploded after their turn was done (or instantly exploded with Instant Grenades on).  So I don't think aliens know how to prime grenades above 0.

It could prime the grenade with a 0 timer and keep it on its hand until the next turn. 
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: Warboy1982 on August 12, 2014, 04:14:17 pm
they prime the grenades as they throw them, and they are charged accordingly. they weren't getting charged for moving it from their belt to their hand, but it IS all properly accounted for
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: Hobbes on August 12, 2014, 07:21:38 pm
they prime the grenades as they throw them, and they are charged accordingly. they weren't getting charged for moving it from their belt to their hand, but it IS all properly accounted for

The oracle has spoken! ;)
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: BBHood217 on August 19, 2014, 04:31:43 pm
Okay, I just saw a muton walk several tiles and then afterwards throw a grenade primed at 0.  He definitely only had enough time to just throw it, there should've been no time for him to have primed it first.
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: moriarty on August 20, 2014, 07:26:54 pm
well, yeah, he could have primed it in a previous turn. as long as he carries it, it won't explode... just like it does for your own soldiers.
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: Sharp on August 21, 2014, 01:04:37 am
well, yeah, he could have primed it in a previous turn. as long as he carries it, it won't explode... just like it does for your own soldiers.

That is pretty doubtful though. I have never killed an alien and had it explode next turn as if they have dropped a primed grenade.
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: moriarty on August 21, 2014, 04:03:29 am
True. Hm. Maybe there is really something going on. Maybe the computer is cheating... when it shouldn't be able to.
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: RSSwizard on August 27, 2014, 04:41:07 am
in vanilla Xcom TFTD (which I played the most) I often noticed aliens throwing a grenade then taking a snap shot, and those weapons have higher TU costs . . . and then walk around a little

So they are not getting charged for Priming the grenade, only throwing it.

Maybe they have this little implant in their arm that auto-primes their grenades when they throw them eh? Too bad the xcom researchers never found it or the electronic receiver in their grenades that allowed them to be remotely activated in flight.

>>> reasoning ,the aliens never prime their grenades in advance, otherwise there would have been cases where you shoot one and the grenades he drops explode. Nevar happened in the history of gameplay.

(in other news, one can throw a grenade underwater up to a hundred yards, but in doom flynn taggart can carry every weapon in his arsenal too. thats games man)
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: BBHood217 on August 27, 2014, 07:43:25 am
Who's Flynn Taggart?

Surely you're referring to Doomguy ;)
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: Solarius Scorch on August 27, 2014, 07:49:41 am
Who's Flynn Taggart?

Surely you're referring to Doomguy ;)

Who's totally Blazkowicz's grandson BTW :)
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: Dioxine on August 27, 2014, 07:29:42 pm
Well in XCom you can carry up to about 7 weapons too, it's not Call of Duty either :)
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: Hobbes on August 27, 2014, 08:04:06 pm
Well in XCom you can carry up to about 7 weapons too, it's not Call of Duty either :)

"No, you don't need an additional shotgun to go with your 2 pistols, Assault Rifle, AutoCannon, Stun Rod and Uzi. Now board that Skyranger trooper!" :)
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: BBHood217 on November 14, 2014, 11:01:22 am
After suffering another instance of an alien moving and afterwards only having enough TUs to throw a grenade without priming it only for the grenade to explode anyway, I have to ask:

Is this fair?
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: TaxxiDriver on November 14, 2014, 12:43:09 pm
Very interesting. So it seems to be that the aliens SHOULD spend the corresponding time units for priming a grenade but it seems not, right? And also quite many players seem to have experienced this problem. I myself also sometimes felt there's something strange about the aliens' throwing a grenade for some reason, but since they don't throw grenades that much frequently, I think I have neglected it so far. It would be great if there's a technical explanation for this problem.

Or is it just my misunderstanding? Honestly, I don't know ??? since I cannot remember exactly a single case when aliens had thrown a grenade and had yet enough time to do some other stuff: they usually just ran away IIRC. But also I doubt if it was just caused by mod conflictions...

Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: Warboy1982 on November 14, 2014, 05:28:34 pm
finally found it... it's subtle

https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/AlienBAIState.cpp#L1791 (https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/AlienBAIState.cpp#L1791)
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: TaxxiDriver on November 15, 2014, 01:57:40 am
finally found it... it's subtle

https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/AlienBAIState.cpp#L1791 (https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/AlienBAIState.cpp#L1791)

So the problem is fixed now, right? Splendid! 8)
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: Warboy1982 on November 15, 2014, 12:49:59 pm
not yet, but soon.
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: BBHood217 on November 15, 2014, 02:00:24 pm
Wait... this was a bug all along? :o
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: yrizoud on November 15, 2014, 04:02:00 pm
For the curious, in the linked function, we see the TU cost computed and checked, but it's never actually substracted from the unit's TU.
Title: Re: Aliens throwing grenades for less TUs than humans?
Post by: Warboy1982 on November 16, 2014, 03:59:47 am
not quite... it IS subtracted, that's handled elsewhere.

the problem is:

"if (tu <= _unit->getStats()->tu)"

looks correct at first glance, right?
but if i rename the function slightly:

"if (tu <= _unit->getBaseStats()->tu)"

then the problem is MUCH more apparent.

like i said... subtle.