OpenXcom Forum

Contributions => Offtopic => Topic started by: Nerva on December 19, 2016, 08:07:19 pm

Title: Do aliens spend TU's to prime grenades?
Post by: Nerva on December 19, 2016, 08:07:19 pm
Since aliens don't throw grenades that are set for a delay, I'm curious if the game requires them to waste TU's to prime grenades?
Title: Re: Do aliens spend TU's to prime grenades?
Post by: Solarius Scorch on December 19, 2016, 09:21:53 pm
Yes, I remember Warboy said that they don't get to use grenades faster than X-Com.
Title: Re: Do aliens spend TU's to prime grenades?
Post by: Nerva on December 19, 2016, 10:28:41 pm
A related question would be, do aliens ever prime grenades on one turn, run out of time to throw, and then throw them the next turn, or does the AI never prime if it can't immediately throw?
Title: Re: Do aliens spend TU's to prime grenades?
Post by: Meridian on December 19, 2016, 10:43:20 pm
A related question would be, do aliens ever prime grenades on one turn, run out of time to throw, and then throw them the next turn, or does the AI never prime if it can't immediately throw?

I have only peeked into the AI code, so not 100% sure, but looks to me they throw grenade only if they can prime + throw + have 4 more TUs to move the grenade from belt to hand.

https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/AIModule.cpp#L1814
Title: Re: Do aliens spend TU's to prime grenades?
Post by: Nerva on December 19, 2016, 10:53:48 pm
You're saying that's how OpenXcom works?   Any idea if anyone knows how the original game's AI worked?   Did OpenXcom recreate the AI from observing the original game, or did they somehow decompile the original code and find the actual algorithms?
Title: Re: Do aliens spend TU's to prime grenades?
Post by: Meridian on December 19, 2016, 10:58:41 pm
You're saying that's how OpenXcom works?   Any idea if anyone knows how the original game's AI worked?   Did OpenXcom recreate the AI from observing the original game, or did they somehow decompile the original code and find the actual algorithms?

Yes, this is OpenXcom forum. Unless stated otherwise, we talk about OpenXcom.

I don't know how original worked... maybe Volutar or Warboy could say.

AI was (intentionally) not re-created 1:1, but it is quite similar to original. There was reverse-engineering involved, but not everything.
Title: Re: Do aliens spend TU's to prime grenades?
Post by: Hobbes on December 20, 2016, 12:01:00 am
Any idea if anyone knows how the original game's AI worked?   Did OpenXcom recreate the AI from observing the original game, or did they somehow decompile the original code and find the actual algorithms?

Warboy recreated the original AI from the original code, made a few improvements upon it but nothing too different.

The AI itself isn't too complicated: each alien can have 4 states, Patrol/Attack/Flee/Ambush