Posted: Sun Nov 29, 2015 3:12 pm Post subject:
Unofficial Bounty Logic applied to ares 0.8
Hi , i try to recreate old bounty logic to lates 0.8 branch
and some feature are removed due my limited C knowledge
and i will try to cover some later
tag :
[Techno]
Bounty.Enabled=bool (enabling bounty logic)
Bounty.UseCustomValue=bool(use custom value instand than unit cost)
Bounty.CustomValue=int(Custom value )
Bounty.Pillager=bool(enabling pillager logic)
Bounty.PillageMultiplier=double(Victim pillage mod)
Bounty.CostMultiplier=double(Victim modifier)
Bounty.Modifier=int(bounty mod for killer )
Bounty.Message=bool(to show flying strings)
//General hackers
[Weapon]
GiveMoney.DamageMultiplier=double(work same as bounty mod ,but this for damage on Give money)
GiveMoney.Amount=double(money given per damage)
GiveMoney.Message=bool(show message)
GiveMoney.AddExperience=bool(give money and experience ?)
Still missing :
Veteran support tag
Veteran ability immune bounty
Country support tag
Global tag for bounty
Formula:
For General Hacker or Give Money , the formula still same as old branch.
Pillager Damage is always positive and respect Verses.
Bounty : (Victim Cost/KillerMod)*Victim Mod (for custom value just change unit cost to cust value ) .
Pillager :(Damage/Victim STR)*Pillage mod *victim cost(for custom value same as above ).
Some vormula applied to pillager , if damage is much more than victim strenght or killer is more than 1, the bounty will split for killer .
and for pillager also work on structures.
Please give suggestion and please report bug realated to bounty and post here.
Note:
Old issue of FlyingStrings graphic bug is still here ,so this won't fix be me *maybe.
This branch also included custom theater feature , not fully work but , check at RMG XD , for documentation , open the custom theater branch on Ares Sourcode regarding custom theater.
Credit : sorry
Graion Dilach & joshy for base bounty source
AlexB & joshy for flyingstrings header code
And ares DEV who have the officila Ares 0.8 & YRpp source
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Thu Dec 03, 2015 1:11 pm Post subject:
Heh, nice, although I think you overcredit me there. The FlyingStrings header and class was Alex's and the basic Bounty code was Joshy's - I only did Pillage and the maintenance in those times. _________________ "If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more... QUICK_EDIT
So, why isn't this added on top of 0.9's code? That is because I didn't upload the 0.9 code yet. I don't want to upload WIP code for two reasons: It's not finished and uploading it is a promise that it's working. To me, that is. There are pieces of debug code and starting points for new features that never materialized, but I won't publish incomplete features. I'll finish them (some of them are available in Ares 0.A already), and I'll release them when I'm satisfied with them. If 0.9 would have went better, you'd all have them already, even the ones showcased in preview releases. So this is my fault.
Most importantly, I'm happy that this logic, which has been asked for by numerous modders multiple times, is being worked on. It's an important logic, not only because NPatch had it for years already, but also because it offers many opportunities for play styles and game modes.
The code might be aged, considering I heavily changed the foundations of Ares, so there are a few things that could need some work. I can't look at the code right now, but from the tag descriptions I would change a few things:
Why is a Bounty.Enabled tag needed? Couldn't there bei either a global tag activating this for all units? UseCustomValue and CustomValue should be unified into a single Nullable<int>, which uses the custom value if set, otherwise the default value. Also, the hardcoded division by 2 seems odd. I think this can be condensed down a bit.
A cost multiplier could better react to Industrial Plants, but it makes the logic a bit more complicated. Using a tag used as alternative to Cost alone is easier to describe and thus easier to use, but it all really depends on what you modders want. So I can only encourage you to test this build! There will be nothing from me within the next two weeks, and it would be great if otamaa gets the feedback he needs to make Bounty and Pillager work.
Depending on how this works out, I think the next version after 0.A could include it then. 0.A is kinda feature-laden already, and when I can get back to work, I rather want to release it as-is, most likely even removing some features again (at least the untested ones). That is because I need about two weeks RC phase again, in which I also have to write up the documentation, and adding yet more would shift my schedule too much. Hopefully, work on hypothetical 0.B can start mid-January '16, including Bounty. _________________ QUICK_EDIT
Why is a Bounty.Enabled tag needed? Couldn't there bei either a global tag activating this for all units?
Yeah , i have no no idea where i must place the global value tag
and for test purpose , i use 1 tag to enabled the bounty logic per techno.
AlexB wrote:
UseCustomValue and CustomValue should be unified into a single Nullable<int>, which uses the custom value if set, otherwise the default value.
Yes , i know
But i Try to make some condition for it , last i plan to change it but i think not need , because i just use it for some test purpose.
AlexB wrote:
Also, the hardcoded division by 2 seems odd. I think this can be condensed down a bit
Ah ,just for decreasing output value of bounty , because sometime i test , the value just too bigger to get i think , and sometime i forgot that i use custom value with legit value , so the output still bigger (know it after check again the rulesMD ).
AlexB wrote:
I think the next version after 0.A could include it then.
Thanks
but , the FlyingStrings old bug , still there , i have no idea how to fix it btw , hehe QUICK_EDIT
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Tue Dec 08, 2015 10:30 am Post subject:
It was a while ago since I last used Nullable<int> - and IIRC it's even a bad idea, because that does not allow to restore the cost-based value in a later stage (map/gamemode inis) - use -1 as the default and the fallback value instead.
Bounty.Immune is unneeded - CostMultiplier=0 and PillageMultiplier=0 does the same.
Also remove your magic numbers, such divisions are BAD idea if you intend to use this for beyond testing.
I thought I had country tags working in the last build though.
Now that I relook at it, my Hackers freebie implementation also disappeared... what revision your code is actually based on?
EDIT2: Regarding the cost-based-value (now that I looked at my old code and remembered all the issues with it), yes, -1 or being nulled as fallback would work the best.
Regarding the FlyingStrings bug I was thinking about somehow deducing the exact position of the string on the monitor and hiding it if it's overlapping in the UI but I never got there. The UI doesn't gett redrawn all the time causing that bug and I thought my idea would've been easier than messing with the UI code at all.
EDIT4: Try comparing it with TacticalClass::Instance.VisibleArea.Height (or Height-minus UI bar), might work. _________________ "If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more... QUICK_EDIT
If the issue is that the FlyingStrings drawn overlap with the UI and other elements while it should be just in the viewport: Usually the drawing functions take a rectangle (other than the drawing bounds) as clipping bounds. I can't check right now, but passing the bounds of the viewport surface could do the right thing here already.
Regarding Nullable: the template has changed a lot since 0.3. There is no support for re-setting it to empty state right now, though for NullableVector there is already (the unused and afaik undocumented <default> special value). Would be a small change to support that also for Nullable and NullableIdx. Otherwise, the approach using negative values to use the actual cost value would work best.
Multipliers or modifiers that are set to 0 are kinda self-explanatory already. Generally, the fewer special cases there are, the simpler the logic is: It can be described with fewer words, and is easier to grasp. Compare Malicious= on warheads with like ImmuneToEMP=. The first can be summarized in a single sentence, the latter needs several paragraphs and a list of special tags that define whether some object of a certain type is immune. I would like to correct this error from the past, but it's how it is now. _________________ QUICK_EDIT
My notebook is broken, so nobody has seen me on Skype for the last few days. I hope I'll be back soon (in around 10 days), and when I have access to my data again (VS, Ares souce code, game to test, and all my notes), I'll try to resolve the FlyingStrings issue. And all the other stuff. Also, I know who!
What's the compiler error? If Valueable works, Nullable should work, too.
One comment on radiation though: The Ares code has some code fragments for it already, but it's just a shell: Not working, not even close. I wouldn't touch that for now. Efforts on that feature should be coordinated, otherwise, work is done twice. _________________ QUICK_EDIT
I already list all Address on YrPP to IDA , on 3 days , so i going to look at Radiation , and compare some with NPP , the difference is too much , so i decide to research until I know far enought
Some error if i compile it , "This->GetXt, check declaration of TechnoClass" , i already forgot , but maybe like that ,some value contain on Nullable value is not declarable , i think
And i need some help for cust theater XD QUICK_EDIT
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Tue Dec 08, 2015 10:53 pm Post subject:
otamaa, you still didn't answered my question regarding the base revision though. Sorry but at this point I have a bad feeling you undone a lot of working things as part of your catchup.
[EDIT] Forget it I didn't noticed you updated the first post.[/EDIT]
Yes, Alex, it must be the viewport - there isn't any validity checks in the 2011 code after the coords-to-pixel transformation.
I prolly could find time to restore my Ares setup on Saturday - if you want to freely wander, I guess I can take this back actually. It sounds a bit shameful that apparently the thing I couldn't solve 4 years ago would be a simple 2 line fix. _________________ "If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more... QUICK_EDIT
Okay , thanks Graion , Anything suggestion for Give money
i not have idea for that , and seems on lauchpad , no one report bug or some suggestion XD
If you want the bounty src , just PM me , i will send to you XD
about the template thats is my fault not check all code related XD
That happen on flying string also , but after checking anything , finally found that XD QUICK_EDIT
Joined: 22 Nov 2010 Location: Iszkaszentgyorgy, Hungary
Posted: Wed Dec 09, 2015 11:06 am Post subject:
GiveMoney doesn't need anything beyond what it has atm. I specifically checked that one out. I don't remember if anyone ever cared about that, I did it as a freebie.
So really imo just default Bounty.CustomValue to -1 on the country constructor and SetDefault it to 0 or -1 on the unit (thereby the template will skip it unless the modder explicitly specifies a value, the bug regarding it was that Nullable constructor sets the HasValue flag to true even if that's just a constructor default, which in Bounty's case would have meant "try fallback", thereby TechnoTypeExt Bounty class must use SetDefault for all it's defaults to allow falling back at all) then read -1 as use Cost instead of the UseCustomValue boolean.
IMO you don't need global tags, country and techno-level values should be enough for all. I'd also request that you should restore my default values in the long run because those were
The Viewport related things - I'm kinda unsure about where is the origin of the viewport but I'd guess testing such out would be a really simple task.
EDIT: Although yay, because that shows I forgot to commit a change some years ago: the hook at https://github.com/Ares-Developers/Ares/blob/ft-bounty/src/Misc/Bugfixes.cpp#L85 has to be removed, because I shifted that one into Bounty.cpp for the Pillage_Temporal hook at https://github.com/Ares-Developers/Ares/blob/ft-bounty/src/Misc/Bounty.cpp#L136. _________________ "If you didn't get angry and mad and frustrated, that means you don't care about the end result, and are doing something wrong." - Greg Kroah-Hartman
=======================
Past C&C projects: Attacque Supérior (2010-2019); Valiant Shades (2019-2021)
=======================
WeiDU mods: Random Graion Tweaks | Graion's Soundsets
Maintainance: Extra Expanded Enhanced Encounters! | BGEESpawn
Contributions: EE Fixpack | Enhanced Edition Trilogy | DSotSC (Trilogy) | UB_IWD | SotSC & a lot more... QUICK_EDIT
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum