OpenXcom Forum

Modding => Work In Progress => Topic started by: Shoes on July 07, 2013, 05:58:59 am

Title: Achievements mod
Post by: Shoes on July 07, 2013, 05:58:59 am
The purpose of this thread is really more for me to ask general questions in one thread, instead of many. Also, I will outline the mod so people can feel free to recommend more elegant ways of proceding!

Purpose

The purpose of this mod is to award soldiers medals for their valor in combat. These medals would grant stat bonuses. In the future, they could be required before a soldier can equip a certain weapon or something. Or provide bonuses in specfiic conditions, like long range accuracy or vs alien accuracy.

Outline

This mod will act a lot like how promotions are done.

In the SoldierInfoState, there will be a new button that leads to SoldierMedalState that lists all the medals (and their effect) for the current soldier.

After a mission, the DebriefingState will check to see if a medal has been awarded. If one has, it will show which soldier got what (This is different from Promotions and Ranks, because there is only ever one new rank, but many possible new medals...).

In Soldier.cpp, I am adding the actual medal code. Perhaps I will make Soldier.cpp call Medal.cpp to keep things clean. I will be asking questions about how to do what I want to do at a later point.

Here is a link to my git repo branch : https://github.com/Shoes01/OpenXcom/compare/master...MEDALS

My first question is this : Where are all the strings located? :x I know they are all centralized for easier translation, I just can't find where!
Title: Re: Achievements mod
Post by: xracer on July 08, 2013, 06:11:12 pm
*********WARNING TEXT WALL AHEAD*************

i like your ideas, i t would be great if you could do it :)
also if you don't mind it will be nice to do multiple awards of the same medals just like in RL, here is what i have suggested somewhere else

The leveling of the medals is based on a pin system (similar to that of real military units). This pin is placed on top of the ribbon once a second or subsequent award is received. Each medal can have its own specific threshold for receiving said subsequent awards.
As such this will be a template:
1st award    Medal/Ribbon
2nd Award    1st silver pin on ribbon
3rd Award    2nd silver pin
4th Award    3rd silver pin
5th Award    1st gold pin on ribbon which replaces the 3 silver pins
6th Award    2nd gold pin
7th Award    3rd gold pin
8th Award    1st Platinum pin on ribbon which replaces the 3 gold pins
9th Award    2nd Plat pin
10th Award     3rd Plat pin


Also this was a list of medals we had come up with ;)



1ST CATEGORY
Honor Cross Given to all units upon arrival as recognition for fighting the Alien threat, and for being part of the force to save humanity. This Medal does not have multiple awards it will only be given once.
Service Medal Given in recognition for serving for a specific number of months. The first award is received on the 6th month of service and all subsequent awards will also be received on the 6th month thereafter.
Military Cross Given to soldiers for been in a specific number of missions. The unit must meet a certain criteria such as having perform at least a certain number of action or using a certain number of time units.
Merit Star Given when a unit kills a certain number of Aliens
Star of GallantryGiven when a unit captures a certain number of live aliens, in any manner such as stun weapons/grenades; stun baton or simply knocking them out with an explosion, a melee attack or your bare fist!!!
Bolt's Cross This medal is given when a unit stuns a certain number of aliens with a stun baton (commander/leader).
Specialists Medal This medal is given when a unit stuns a certain number of aliens with one stun grenade/rocket.
Campaign Medal This medal is given when a unit serves “X” months in the specific area to receive that area campaign ribbon (e.g. North America, Central America, South America, Europe, Africa, etc.)
2ND CATEGORY
Grenadiers Medal Given when a unit kills 3 or more aliens with one grenade.
Marksman Medal Given when a unit kills an alien at over *** m with a weapon (this can then apply for all other weapons).
Proficiency Medal This medal is given when a unit reaches a certain number of kills with a specific weapon (replace weapon with pistol, rifle, heavy grenades, etc.) as such you can have a badge for each weapon.
Star of Valor This medal is given when a unit kills a certain number of alien in close quarters combat or hand-to-hand or stun-baton-to-hand, you get what i mean, and you must be a bad ass if you get close enough to try and capture or kill an alien like that.
Star of Courage This medal is given to a unit for not panicking, after 3-4 squad deaths, each with higher or equal rank.
Star of Sol This medal is given when a unit is the first trooper into X amount (where X is a large amount) of UFOs and alien bases.
Hell-raiser Medal   This medal is given when a unit kills a certain number of enemies with incendiary weapons.
Defender Medal This medal is given for being part of a successful base defense.
Longest Night This medal is given for participating “X” amounts night terror mission.
Black Cross Given to soldiers that survive friendly fire after being hit
3RD CATEGORY
Crimson Heart This medal is given when a unit survives a mission with health (25% or less).
Heart of Terra This medal is given to soldiers that survive the mission after falling unconscious from fatal wounds.
Order of Glory This medal is given when a unit kills 7 aliens in a single mission
Loneliest Number This medal is given when a unit is the sole survivor in a mission, this is given only when attacking a medium or above size UFO with at least 7 soldiers in a mission.
Order of Earth This medal is given when a unit clears a UFO of medium/large size
Nike Cross This medal is given when a unit kills all aliens in a mission
Medal of Heroism
Distinguished Service
Sedgwick's Cross This medal is given when the highest ranking soldier kills enemy commander before any of his men
Eagled Eyes This medal is given to a unit for sighting the first of a new Alien species
Star of Asclepius   This medal is given when a unit survives a battle after being shot (at) more than 10 times by enemy units.
Prowler Cross This medal is given to a unit for being the first to capturing a live alien, for each alien race
Man of Steel This medal is given when a units survives a battle after being hit 5 times or more by enemy units
Dying Kill Medal    This medal is given when a unit kills an Alien with a grenade, after the unit has died. (Aliens turn)(if game allows to track your fallen units)
Demolition-Man    This medal is given to a unit for blowing up a whole UFO (if possible) 
Ace in the Hole    This medal is given when a unit kills an enemy with last round in his inventory
Senile Medal This medal is given when a unit kills an enemy with projectile weapon while enemy is in Fog of War
Terran Cross This medal is given for achieving mission objectives as the highest rank left standing after your squad has taken fatalities (only if you weren't the highest rank at the start)
Meritorious Citation This medal is given for leading the team that recovers a specific piece of alien tech (highest rank soldier in the mission only)
Order of the fallen This medal is given to any soldier fallen in combat (if the system allows tracking and displaying your fallen units)(Medal does not have multiple awards)
Valiant Crux   This medal is given to a unit for completing a terror mission without a single civilian casualty



The categories are just based on rarity, meaning category one basically every single soldier could achieve them sooner or later however category 3 not many will achieve them if any ;) it is simply to tie you to your soldiers so they are not simple cannon fodder :)
Title: Re: Achievements mod
Post by: Shoes on July 09, 2013, 06:09:49 am
This is great! I am not too creative or informed about RL military stuff, so this is great. I will be referring to this when I eventually get this mod working.
Title: Re: Achievements mod
Post by: xracer on July 09, 2013, 07:12:55 am
hey before you start or rather complete it, i would like to see if can get together to talk a little bit :P i have been on IRC hunting you down, and i just missed you by 5 min :(

check this album, https://plus.google.com/u/1/photos/117436529281832067974/albums/5894756605877745809 is what i would like to do and since you can code :)

Let me know
Title: Re: Achievements mod
Post by: Shoes on July 10, 2013, 05:38:59 pm
Oh my, I think you over estimate my ability to code! Wayboy is holding my hand throughout this a lot. You're looking at increasing the resolution of the game so you can display more stats and info, is that it?
Title: Re: Achievements mod
Post by: xracer on July 10, 2013, 06:06:50 pm
well you are much farther ahead than I am :) and my coding skills are zero, what i am trying to do is merge the inventory screen with the stats screen, i gave it a try but the compiler spit out in my face :)

Warboy was looking at the code also i don't think he got it to work either is truly a mess (your welcome) i will keep on modifying it and maybe a code magician (read warboy) will decide to help me :)

In any case that is what i have planned, as well a fixing my control panel and adding a little higher resolution artwork. but that is down the road and if this works.
Title: Re: Achievements mod
Post by: Shoes on July 11, 2013, 12:25:42 am
(https://i.imgur.com/KzxBrLY.png)

It is taking shape!

More pictures : https://imgur.com/a/ByD9T#0

More still : https://i.imgur.com/hjJKYLl.png

Added the ability to cycle through your soldiers. Attempted to add descriptions, but as expected, it gets cut off by the columns : https://imgur.com/a/hrYSN
Title: Re: Achievements mod
Post by: cort on July 11, 2013, 06:54:44 pm
Regarding the descriptions, maybe you can find some inspiration from the "Advanced options".

(https://openxcom.org/wp-content/gallery/v0-9/08_advanced.png)
Title: Re: Achievements mod
Post by: xracer on July 11, 2013, 08:08:08 pm
that is not a bad idea show the medals above and the description at the bottom once selected. to keep it all in one screen, good thinking cort
Title: Re: Achievements mod
Post by: Shoes on July 11, 2013, 10:01:13 pm
Thanks cort! I am looking into it now.

Got the pop up working : https://i.imgur.com/VErg1VC.png

I will change to hover text anyway because that is more user friendly.

Now I got the mouse over working as well! https://imgur.com/a/cNROj ; I haven't removed the pop up yet ... because why not, right?

A behin the scenes change : I have moved all the code inside Soldier into a new file, SoldierMedals, because these medal checks are gonna take up some space!

More stuff : some medals are handed out at the end of the month, and kills per race are now being tracked, albeit incorrectly! I have to work on that part...
Title: Re: Achievements mod
Post by: Shoes on October 21, 2013, 12:21:15 am
So I have restarted work on this mod, and here is the latest update:

https://i.imgur.com/y6f2Q6P.png

Mission regions and mission types are tracked, and medals are awarded accordingly. The same is already done with race kills, but I will be able to display them soon. After that, I will work on tracking which guns a soldier used to get kills or stuns, and then award more medals based on that.
Title: Re: Achievements mod
Post by: Hobbit Lord on October 21, 2013, 05:27:07 am
1ST CATEGORY
Service Medal Given in recognition for serving for a specific number of months. The first award is received on the 6th month of service and all subsequent awards will also be received on the 6th month thereafter.
Does anyone actually have soldiers surviving more than 6 months? I suppose if you don't send them on any missions they'd get a medal for babysitting the base?[/td][/tr][/table]
Title: Re: Achievements mod
Post by: Shoes on October 23, 2013, 11:46:45 pm
Here are some more pictures of the kind of details that could be found in the missions and kills stats.

https://imgur.com/a/H8MT2#0

Weapons are now tracked. Oddly enough, it's the weapon's ammo that is awarded the kill. I will look see if I can fetch the parent weapon.

https://i.imgur.com/qQWiHhH.png
Title: Re: Achievements mod
Post by: Shoes on October 28, 2013, 02:04:09 am
In order for medals to move forward, I need to properly track statistics. This mod is slowly turning into a stat tracking mod, with medals as an aside ;p Here is my latest work

old : https://i.imgur.com/3XG3UAc.png

(https://i.imgur.com/82XG7CU.png)

Each soldier will have their own diary listing their missions. I will also be adding more details as I keep working. I will also make the thing look ... not ugly. Maybe.

edit : things are looking better.
Title: Re: Achievements mod
Post by: Sharp on October 28, 2013, 10:40:57 am
Looks pretty cool
Title: Re: Achievements mod
Post by: Shoes on October 30, 2013, 10:57:36 pm
Working out kinks, but kills are getting tracked.

edit: most kinks worked out, now I gotta make this pretty.

edit again : gotta figure out how to lay out all this information...

(https://i.imgur.com/hntMkqK.png)
Title: Re: Achievements mod
Post by: Shoes on November 02, 2013, 07:06:23 pm
Moving right along!

(https://i.imgur.com/Cn6sLvZ.png)
Title: Re: Achievements mod
Post by: Gifty on November 02, 2013, 10:12:16 pm
It's... it's so beautiful!
Title: Re: Achievements mod
Post by: Shoes on November 03, 2013, 06:58:58 am
So I think that's all I wanted to do for diaries. I remembered that I want to add global stats to the diary, so a way to view totals of things.

(https://i.imgur.com/Zupf9sl.png)
Title: Re: Achievements mod
Post by: Mr. Quiet on November 07, 2013, 03:13:59 am
So I think that's all I wanted to do for diaries. I remembered that I want to add global stats to the diary, so a way to view totals of things.

(https://i.imgur.com/Zupf9sl.png)

I don't think Karin and the rookie who killed him wants to be remembered for that XD
Title: Re: Achievements mod
Post by: Sharp on November 07, 2013, 03:48:26 am
I think it's the other way round and Karin is still alive :P

Just want to say, awesome work Shoes, if it didn't make me feel like a parrot I would be saying that after every post of yours in this thread.
Title: Re: Achievements mod
Post by: Shoes on November 07, 2013, 12:39:48 pm
Thanks Sharp :) I wish I had space to show the soldiers name instead, but some are as long as the entire window!
Title: Re: Achievements mod
Post by: Shoes on November 08, 2013, 12:58:15 am
My diary mod is now feature complete, all that is left is UI stuff!


Per mission stats :
(https://i.imgur.com/hUWEAPu.png)

Career wide stats :
(https://i.imgur.com/7iT61xt.png)
Title: Re: Achievements mod
Post by: starwindz on November 08, 2013, 03:26:09 am
Splendid job, Shoes! :)
I think your mod could be new and powerful motivation for playing OpenXcom.

I also think that your mod could be included into next version of vanilla OpenXcom. What do you think of my idea? And when are you going to release this mod officially?
Title: Re: Achievements mod
Post by: Shoes on November 08, 2013, 01:03:39 pm
I would actually like for someone to play with this mod so that I can if there are some strings that are too long or some corner cases that I didn't think about. Terror missions not having a UFO, killing terror units, base defense missions.

How would I "release" this mod? I have the branch on github, and I modified some source, so I am not sure how else I am supposed to distribute this.
Title: Re: Achievements mod
Post by: Sharp on November 08, 2013, 01:51:35 pm
well for ease you could compile and put a link, or just at least link the github :P
Title: Re: Achievements mod
Post by: Shoes on November 08, 2013, 02:09:02 pm
I will do that this evening when I update my branch with code that doesn't CTD. Also I might clean up the git history... it's a lot of "WIP Idon'teven" ;p
Title: Re: Achievements mod
Post by: michal on November 09, 2013, 09:07:49 am
Great work. I hope it will be included into base OpenXcom.
Title: Re: Achievements mod
Post by: Shoes on November 09, 2013, 04:34:30 pm
Thanks for the encouragement! I posted links in the completed mod section for people to try out :)
Title: Re: Achievements mod
Post by: xracer on November 09, 2013, 08:45:54 pm
Looks incredible shoes!!!!

Glad to see you are working on it
Title: Re: Achievements mod
Post by: Shoes on November 09, 2013, 10:05:30 pm
I know you're on hiatus, but I am glad you're still around to see it take shape! It will be incredibly easy to slip my medals mod back into the game with all these tracked statistics.
Title: Re: Achievements mod
Post by: xracer on November 22, 2013, 09:27:09 am
Lol more like computer repair hell :P

Actually things turn to the worse :( and as computer savvy person i feel like a moron, that little virus seems to have made my BIOS its permanent home :S

Now i am hoping to flash the BIOS but somehow it won't allow me to access that feature. anyway if i can't do something in the next week or so i think it will be time to buy a new mobo :(

Back on topic, your mod looks awesome and it will look even better in HD :) once i get on track :)  And yes with all the tracked statistics the types of mod that can be added would be amazing of course keeping all organized and clean :)
Title: Re: Achievements mod
Post by: Shoes on January 05, 2014, 06:05:45 pm
Now with the diary implemented, I've written up the code necessary to define medals via ruleset! I just need to write the code for more diverse criteria. I am getting there :) with a lot of help, I am getting there.

(https://i.imgur.com/m9967fR.png)
Title: Re: Achievements mod
Post by: xracer on January 06, 2014, 08:57:08 pm
Hey,
Looking awesome, and leaving the description vague so that is a guessing game for players :)
When will we have the first beta :) or alpha or anything :)
Title: Re: Achievements mod
Post by: Shoes on January 07, 2014, 04:05:38 am
All I have left is writing up some stat fetching functions, but I suppose I could try and put out what I have so far.

Also, you like the vagueness? I was thinking of adding a progress bar or something to see how many more "whatevers" was needed for the medal.
Title: Re: Achievements mod
Post by: xracer on January 07, 2014, 05:53:50 am
yes i prefer vagueness, i know players will figure out the values really and post them all over the place, but to be on the edge thinking "will i get it this time or this time or this time" it gives it a little tension :)

but it is all a matter of taste :)
Title: Re: Achievements mod
Post by: Shoes on January 07, 2014, 12:48:54 pm
not to mention it will be defined in the ruleset, so they can easily go and look at it if they really need to know ;p
Title: Re: Achievements mod
Post by: Shoes on January 17, 2014, 04:19:05 am
Took me way too long to figure out how palettes work (helps when you're looking at the correct palette).

Colors are sort of ugly. Having a hard time finding a color that fits for what I want to do.

(https://i.imgur.com/CX5rxGO.png)
Title: Re: Achievements mod
Post by: xracer on January 17, 2014, 04:34:11 am
Looking really nice, will this be part of the debriefing screen?
Title: Re: Achievements mod
Post by: Shoes on January 17, 2014, 12:49:11 pm
That's right :) After promotions, this screen pops up.
Title: Re: Achievements mod
Post by: Solarius Scorch on January 17, 2014, 06:17:57 pm
It looks so cool. Please, let us have this mod ASAP :)
Title: Re: Achievements mod
Post by: Shoes on January 18, 2014, 01:27:19 am
It looks so cool. Please, let us have this mod ASAP :)

I updated my thread here https://openxcom.org/forum/index.php/topic,1718.msg16811.html#new (https://openxcom.org/forum/index.php/topic,1718.msg16811.html#new) ; the diary mod will also contain the first hints of my achievement mods too.
Title: Re: Achievements mod
Post by: Shoes on January 20, 2014, 01:10:40 pm
I am starting to add little sprites :)

https://i.imgur.com/23wNXXi.png
Title: Re: Achievements mod
Post by: xracer on January 20, 2014, 06:49:41 pm
Those are looking amazing, and they will work perfectly for my fork :) if you click on them can you get a few stats and the medal sprite?

something like this
Title: Re: Achievements mod
Post by: Shoes on January 20, 2014, 07:39:39 pm
Clicking on a medal can bring up a window showing various stats, including a larger picture. It could be something as simple as what you have: a list of dates with a larger sprite, or a progress bar if I wanted to.

Dates of commendations are currently not tracked at the moment, so that will take some tinkering.

Also, do you have a list/album of medals like the one you pictured? That would make creating a full medal + ribbon easier than what I am doing now. I only have an album of ribbons and I would need to create the medal from scratch.
Title: Re: Achievements mod
Post by: xracer on January 20, 2014, 09:34:44 pm
To tell you the truth i was going to re-use a bunch of art that i found on line that someone had made a mod for modern warfare and battlefield. I had them somewhere saved, they were user created so i think copyright is not a problem since it was posted on a forum. but i do not remember where, I will have to look at them again


Or we can take actual medals from many countries and use them, i can take pictures of mines if necessary. If you want i can compile the nicest looking medal from multiple armed forces around the world.
Title: Re: Achievements mod
Post by: moriarty on January 20, 2014, 11:01:06 pm
I think those service-ribbons are just about perfect... not too complicated, therefore very in-style with xcom; small enough to be easily displayed on screen in low resolutions; definitely no copyright problems (I doubt there's a copyright for colored stripes, as it's too generic)

and there's lots of them, just look at https://www.google.com/search?q=service+ribbons&tbm=isch (https://www.google.com/search?q=service+ribbons&tbm=isch)
Title: Re: Achievements mod
Post by: xracer on January 21, 2014, 09:05:40 am
I found some thing that i did a while back, i did it based on a few things but i did it on my own, so maybe your mod can use it.

i have a couple of them done. But i didn't finish them because i didn't have the actual medals and i didn't think the mod will ever be implemented :)

Title: Re: Achievements mod
Post by: Shoes on January 21, 2014, 01:54:58 pm
That's cool ;p the "more info" window for medals will take a bit of a back seat either until I start/finish the battle log, or until your mod makes enough progress to really benefit from it. For now I will stick to just the 30x8 ribbons, and unless you have suggestions, I will probably use this for reference : https://www.wiz-worx.com/366th/medal000-1.gif

Or this one, from BF2142 : https://i.imgur.com/3CV1Y.png

That one includes little stars so that I can further decorate the ribbons when soldiers get multiple awards.
Title: Re: Achievements mod
Post by: xracer on January 21, 2014, 07:45:59 pm
Ahhhh good old Marine Corps medals

"Give me that good ol' Marine Corp spirit
Give me that double time and rhythm
Give me..."

Brings back a lot of good memories :)

Yes i understand, i am still looking for the ribbons i had some similar to those, but they were a little higher resolution just like the one i had. And yes the one with the stars is exactly what i was going for like when i mentioned this to you a few months ago.

I really like your mod, and it is really shaping up. Keep it up :)


Title: Re: Achievements mod
Post by: xracer on January 22, 2014, 11:04:37 am
hey

something i found :) i know it is not what you are looking for.

as well as the stars, that you mentioned.
Title: Re: Achievements mod
Post by: Aldorn on February 17, 2014, 08:16:38 pm
Nice job !
I like this idea to introduce awards.

Some suggestions I have in mind (sorry but no idea how to model it) :
- amount of x kills in a limited number of missions (e.g 25 kills in 10 first missions) -> kill medal
- x missions in a country -> country medal
- give a retribution depending on kind of medal
   -> kill medal type => stat bonus e.g. +1 Health
   -> country medal type => bonus of +5000/medal to country budget
   -> ...
Title: Re: Achievements mod
Post by: Shoes on February 17, 2014, 10:58:23 pm
Nice job !
I like this idea to introduce awards.

Some suggestions I have in mind (sorry but no idea how to model it) :
- amount of x kills in a limited number of missions (e.g 25 kills in 10 first missions) -> kill medal
- x missions in a country -> country medal
- give a retribution depending on kind of medal
   -> kill medal type => stat bonus e.g. +1 Health
   -> country medal type => bonus of +5000/medal to country budget
   -> ...

Limited number of mission kills can be done easily enough; I already have it's mechanics in mind. It would be slightly different than the rest, but just a few lines of code.

X missions in a country is in :) I am very pleased with that one, as it is modular, so you can have a "Canada Campaign Medal" and a "Egypt Campaign Medal", etc.

Bonuses per medal, however, I haven't looked at. Main reason is because it would be unlikely to be merge into the core game, so it is on the back burner. However, it would not be difficult to add. It could even me doable via the ruleset, once the code gets written. I also like the idea of bonus money and stuff, because I had never thought of bonuses beyond soldier stats.
Title: Re: Achievements mod
Post by: Fox105iwsp on February 17, 2014, 11:24:41 pm
So, this mod is only for github version? >_<
Title: Re: Achievements mod
Post by: Shoes on February 18, 2014, 01:15:39 am
I am new at this "sharing" thing, and since I am modding the source code, it's trickier than just uploading a ruleset.

https://openxcom.org/forum/index.php?topic=1718.msg17633;topicseen#msg17633

That thread has some links in it, but I don't think any of them work! :D

Seeing the influx of interest, I am working on getting something ready that I can share with others.