Author Topic: [STAT TRACKING] Soldier Diaries 1.0  (Read 536692 times)

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1020 on: November 18, 2015, 07:28:24 pm »
But then can you get an assist if nobody gets the kill? If fire gets the kill, shouldn't the soldier with the incendiary ammo get the credit? If the target dies of fatal wounds, then the soldier who inflicted the most damage (thus did the most to bring the alien close to death by fatal wound) should get credit. That would add a few things to track:

- Latest Incendiary Hit: SoldierID (if alien dies by fire, this guy gets credit)
- Damaged by: [SoldierID, total damage] pairs (if alien dies by fatal wound, the soldier with the highest total damage gets credit)

In general, I think it would be nice to track assists, since it would recognize the contribution of some soldiers better, and hopefully it isn't much more work/data. But if the above can be implemented, then I don't think assists would be necessary, just a nice addition.

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1021 on: November 18, 2015, 09:01:28 pm »
But then can you get an assist if nobody gets the kill? If fire gets the kill, shouldn't the soldier with the incendiary ammo get the credit? If the target dies of fatal wounds, then the soldier who inflicted the most damage (thus did the most to bring the alien close to death by fatal wound) should get credit. That would add a few things to track:

- Latest Incendiary Hit: SoldierID (if alien dies by fire, this guy gets credit)
- Damaged by: [SoldierID, total damage] pairs (if alien dies by fatal wound, the soldier with the highest total damage gets credit)

In general, I think it would be nice to track assists, since it would recognize the contribution of some soldiers better, and hopefully it isn't much more work/data. But if the above can be implemented, then I don't think assists would be necessary, just a nice addition.

Fire is a tough one, because if one soldier hits one alien and lights the entire map on fire killing everyone, he still only hit one alien and would get one credit. To assign an "owner" to fire is complicated and breaks saves, and also fire does very little actual damage... so the amount of energy required to do this properly outweighs the benefits.

Fatal wounds, I could add more information to track who inflicts what and how much.

My hesitation with tracking these things more faithfully is that I don't want to introduce so much bloat to the source. I feel like players would never notice that the alien who died from fatal wounds had actually died from wounds inflicted by the 3rd soldier who shot him, whereas soldiers 4 and 5 only hit armor. I also don't think fire will ever actually kill an alien ;p and if it gets buffed to the point where it could kill an alien, well we fall back into the situation from above. Beyond breaking the saves and trying to assign an owner to fire, there's no absolutely faithful way of tracking who lit who on fire.

(Also, come to think of it, an alien could theoretically die from walking on someone else's fire, thus having never been shot. At the present moment, that would probably cause my mod to crash ;p)

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1022 on: November 18, 2015, 09:41:18 pm »
I wasn't meaning that fire should get an owner, or that who did how many fatal wounds.

What I meant is that during a battle, the game could keep track of the last soldier who set it on fire. So in a battle save, I think it is in the unit section, where you save the position and other things, it would look like:

Code: [Select]
Alien1:
- lastSetOnFireBy: Soldier3
- fatalWoundsInflicted:
  - Soldier5
    3
  - Soldier6
    2
- fatalWounds: 2
Then if an alien dies from wounds, Soldier5 gets the credit (he did the most fatalWounds). If the alien dies from fire, Soldier3 gets credit. This is in keeping with the idea of whoever scores the killing hit getting credit as it is currently in the mod, as opposed to who did the most damage.

So it adds a bit of bookkeeping for aliens during a battle, but 0 bookkeeping outside battles as it is still only assigning kills to units.

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1023 on: November 18, 2015, 11:31:15 pm »
At the moment, I am not explicitly tracking how a unit dies. There is a function that does that, but all it really does is check unit hp; damage/death by fire is done elsewhere. For me to know that an alien has died from fire _might_ be difficult, I will have to check.

Hopefully, I can set a flag "has died by fire", and have a variable "was shot by a soldier using DT_IN" ; put those two together, and you have yourself a pyromaniac.

Same thing with fatal wounds though; I don't think those are set at the same time that shots are landed. I will have to look to see if I can credit fatal wounds to certain soldiers and whatnot. Hopefully I can do something similar to my above approach: "has died by wounds", and has a variable "was wounded x times by y soldiers".

Do you have thoughts on what to do with the hypothetical situation where an alien dies but was not shot by anyone? I think the only way for that to happen is death by fire. Death by bleed out if there's a way to wound an alien without hitting him...

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1024 on: November 19, 2015, 12:13:10 am »
hum.. do you have death by psi for modded psi? (If ever this gets merged the main branch, it will merge with Extended, which has potential for psi-like attacks).

Otherwise.. You already have death by alien? (ie alien panics/goes crazy and blows himself or his friend up)

Those are the only ways I can think of that could kill an alien without the player hitting it. Death by stepping in fire, and the infamous gumba stomps (especially by civilians) are the only other cases.

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1025 on: November 19, 2015, 01:13:20 am »
The other way enemies die without getting shot, is Cyberdisk explosions, etc.  Some elements in the terrain are explosive too, ie. exploding barrels.

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1026 on: November 19, 2015, 09:17:21 pm »
The other way enemies die without getting shot, is Cyberdisk explosions, etc.  Some elements in the terrain are explosive too, ie. exploding barrels.

Terrain explosives pass by the same logic as getting shot, so I do have those covered. And the code I am using to track who shot who was originally implemented for crediting soldiers with killing people via cyberdisk kills :)

hum.. do you have death by psi for modded psi? (If ever this gets merged the main branch, it will merge with Extended, which has potential for psi-like attacks).

Otherwise.. You already have death by alien? (ie alien panics/goes crazy and blows himself or his friend up)

Those are the only ways I can think of that could kill an alien without the player hitting it. Death by stepping in fire, and the infamous gumba stomps (especially by civilians) are the only other cases.

Death by alien is covered because the source treats everyone as "battle units". Death by psi however... do any mods do that without modifying source code? I am worried that there might be a crash when my stats mod tries to figure out which gun, using what ammo, killed the unit.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1027 on: November 19, 2015, 11:01:11 pm »
As far as I know, it is impossible to kill with psi without modifying the code, but that's exactly what Yankes did in Extended ;) I was just thinking ahead: If commendations gets merged in the main branch, when Extended is updated to the main branch, they will have to work together (but one could say that's Yankes' problem..).

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1028 on: November 19, 2015, 11:12:17 pm »
Nah, I should make sure that if anything "impossible" happens in the game, that the stats simply don't get added rather than crashing. Sanitization. That'll be the last step ;p

Offline xracer

  • Commander
  • *****
  • Posts: 564
  • X-COM lover, we've gone at it everywhere
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1029 on: November 20, 2015, 02:07:42 am »
have you made any updates lately, if you have i do not see GIT reflecting it, last update was 10 days or so ago. I am about to start continuing my LP (TFTD) so i want to update to the latest nightly and bring in the diaries .exe into play ;)

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1030 on: November 20, 2015, 12:38:47 pm »
I just pushed the changes I mentioned earlier. Hopefully they work :D

I did not make any changes to the metadata or pallettes to allow proper TFTD support ;p

Offline xracer

  • Commander
  • *****
  • Posts: 564
  • X-COM lover, we've gone at it everywhere
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1031 on: November 22, 2015, 03:57:42 am »
OK for people that would like to test the mod

This is the current release it is working with the latest nightly openxcom_git_master_2015_11_17_1628.zip

I can't upload the file, so this is the link to it

https://www.dropbox.com/s/zwgi206pw2vqaut/Shoes-Diaries_2015_11_21_1340.rar?dl=0

UFO is functional with no error except some bugs when awarding some medals, Shoes will get to them eventually

TFTD is partially working. the medal section in UFOpedia is present but object do not appear, press ESC to get back to the previous window.
There are also some palette work that needs to be done.
Please remember TFTD is a WIP

***NOTE***
I have tried to follow the right folder structure just be mindful it should be a straight paste.

Offline DracoGriffin

  • Colonel
  • ****
  • Posts: 302
    • View Profile
    • Steam: DracoGriffin
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1032 on: November 22, 2015, 05:58:41 am »
If only this was compiled together with OXCE to run X-Piratez!

One day Gadget!

Offline xracer

  • Commander
  • *****
  • Posts: 564
  • X-COM lover, we've gone at it everywhere
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1033 on: November 22, 2015, 08:12:52 am »
If only this was compiled together with OXCE to run X-Piratez!

One day Gadget!
Sorry for.that you should contact your local dealer :P
« Last Edit: November 22, 2015, 04:22:57 pm by xracer »

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: [STAT TRACKING] Soldier Diaries 1.0
« Reply #1034 on: November 22, 2015, 05:53:22 pm »
shoes, for anything that gets too complicated simply don't award anything.

like figuring out how the unit dies by what weapon  etc place it in a try catch type code block. ie check for sucess or failure then if any of the functions fail to give any meaningful bock back simply break/return and award nothing . ie easy way out. this would avoid any issues like fire, explosives, PSI damage that can't be taken in consideration by your checking routines.

one funny thing is what happend when you PSI an enemy unit then make it kill itself. who gets that kill? in that case it should be the person that used PSI on that unit. you would check this by first checking if the unit is being controlled then skip the regular check routine and award a medal.


there should be a PSI control suicide kill medal .


:)