Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Fri Apr 19, 2024 4:30 am
All times are UTC + 0
Unofficial Bounty Logic applied to ares 0.8
Moderators: Ares Support Team at PPM, Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [19 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
otamaa
Vehicle Driver


Joined: 14 Nov 2014
Location: Indonesia

PostPosted: Sun Nov 29, 2015 3:12 pm    Post subject:  Unofficial Bounty Logic applied to ares 0.8 Reply with quote  Mark this post and the followings unread

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 #Tongue
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



asdasdas.png
 Description:
 Filesize:  179.21 KB
 Viewed:  3860 Time(s)

asdasdas.png



ares 0.8 ft bounty.rar
 Description:

Download
 Filename:  ares 0.8 ft bounty.rar
 Filesize:  326.66 KB
 Downloaded:  11 Time(s)


Last edited by otamaa on Tue Dec 08, 2015 2:04 pm; edited 3 times in total

Back to top
View user's profile Send private message
Graion Dilach
Defense Minister


Joined: 22 Nov 2010
Location: Iszkaszentgyorgy, Hungary

PostPosted: Thu Dec 03, 2015 1:11 pm    Post subject: Reply with quote  Mark this post and the followings unread

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...

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID
Krow
Commander


Joined: 30 Jan 2010
Location: Malaysia

PostPosted: Thu Dec 03, 2015 3:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

Why is not included in the latest build? Missed a lot of the action for quite some time.

_________________
Team Black wrote:
interesting seeing your voxel work. They're still better than Aro's!

Back to top
View user's profile Send private message
OmegaBolt
President


Joined: 21 Mar 2005
Location: York, England

PostPosted: Thu Dec 03, 2015 5:44 pm    Post subject: Reply with quote  Mark this post and the followings unread

Or as a separate DLL that can be thrown in alongside Ares. Afterall, Syringe was originally intended for just that purpose.

Back to top
View user's profile Send private message Send e-mail
otamaa
Vehicle Driver


Joined: 14 Nov 2014
Location: Indonesia

PostPosted: Fri Dec 04, 2015 3:00 pm    Post subject: Reply with quote  Mark this post and the followings unread

i only have 0.8 source ,and 09 source isn't published yet
and i already confirm to alex maybe bounty will be add to next version *maybe

and sorry for the credit btw Very Happy

Back to top
View user's profile Send private message
Allied General
General


Joined: 19 Mar 2004
Location: United Kingdom

PostPosted: Fri Dec 04, 2015 5:33 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks for the contribution towards the Ares project.

I think this was the only feature I missed from NPatch  (well this and unit transformation)

_________________

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID Facebook Profile URL Twitter Channel URL
Ich-Henker
Flamethrower


Joined: 06 Aug 2015
Location: Germany

PostPosted: Fri Dec 04, 2015 5:36 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yeah, great stuff, how can we implement it to ares 0.9/1.0?

Back to top
View user's profile Send private message
otamaa
Vehicle Driver


Joined: 14 Nov 2014
Location: Indonesia

PostPosted: Fri Dec 04, 2015 5:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

this maybe will add on 1.1 ver , but it depend on alex , i can't say much about it Smile

_________________
Conv ASM -> C++ is suck XD

Back to top
View user's profile Send private message
AlexB
Commander


Joined: 31 May 2010
Location: Germany

PostPosted: Mon Dec 07, 2015 10:26 pm    Post subject: Reply with quote  Mark this post and the followings unread

First, thanks for your work on the Ares code!

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.

_________________

Back to top
View user's profile Send private message
otamaa
Vehicle Driver


Joined: 14 Nov 2014
Location: Indonesia

PostPosted: Tue Dec 08, 2015 2:21 am    Post subject: Reply with quote  Mark this post and the followings unread

Thanks !
AlexB wrote:
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 #Tongue).

AlexB wrote:
I think the next version after 0.A could include it then.


Thanks Smile

but , the FlyingStrings old bug , still there , i have no idea how to fix it btw , hehe Smile

Back to top
View user's profile Send private message
Graion Dilach
Defense Minister


Joined: 22 Nov 2010
Location: Iszkaszentgyorgy, Hungary

PostPosted: Tue Dec 08, 2015 10:30 am    Post subject: Reply with quote  Mark this post and the followings unread

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.

EDIT: Ahyeah, if you kept the functions at https://github.com/Ares-Developers/Ares/blob/b75770ce06ca2e6126f75876eb9b527f2ece75c1/src/Ext/Techno/Body.cpp#L359, the Getters, the separate class in the code which si still included in the country data as well then you should have country defaults which should work as globals as well.

Now that I relook at it, my Hackers freebie implementation also disappeared... what revision your code is actually based on? #Tongue

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.

EDIT3: https://github.com/Ares-Developers/Ares/blob/ft-bounty/src/Misc/FlyingStrings.h#L59 You have to check if point.Y falls into the UI range and if yes just skip the drawing. Notsure where to get the screen resolution from though, can't find the Video segment demapped in YR++.

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...

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID
AlexB
Commander


Joined: 31 May 2010
Location: Germany

PostPosted: Tue Dec 08, 2015 12:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

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.

_________________

Back to top
View user's profile Send private message
otamaa
Vehicle Driver


Joined: 14 Nov 2014
Location: Indonesia

PostPosted: Tue Dec 08, 2015 1:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks Graion Alex for advice

Noted Smile

about flying string , i will do it later , cause now i working on Custom theater and New Radiation type , and for bounty , i will look on it later XD

ANd about Nullable<T> , that always give error on compile , i dunno how to make it work , so i use TecnoTypeExt instand , i will look on it later XD


Btw , Alex , not see you on skype on few days XD
Miss for shake btw :p
Guess who #Tongue[/quote]

Back to top
View user's profile Send private message
AlexB
Commander


Joined: 31 May 2010
Location: Germany

PostPosted: Tue Dec 08, 2015 2:58 pm    Post subject: Reply with quote  Mark this post and the followings unread

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! Very Happy

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.

_________________

Back to top
View user's profile Send private message
otamaa
Vehicle Driver


Joined: 14 Nov 2014
Location: Indonesia

PostPosted: Tue Dec 08, 2015 5:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yeah Very Happy
Hope you can access your notebook again Very Happy

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 Smile

And i need some help for cust theater XD

Back to top
View user's profile Send private message
Graion Dilach
Defense Minister


Joined: 22 Nov 2010
Location: Iszkaszentgyorgy, Hungary

PostPosted: Tue Dec 08, 2015 10:53 pm    Post subject: Reply with quote  Mark this post and the followings unread

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]

One of my commits regarding this branch was to add Nullable<T>.SetDefault. If you forgot to copy that out then there lies your compiling problem. That template extension looks compatible with 0.8 even.

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...

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID
otamaa
Vehicle Driver


Joined: 14 Nov 2014
Location: Indonesia

PostPosted: Wed Dec 09, 2015 10:31 am    Post subject: Reply with quote  Mark this post and the followings unread

Okay , thanks Graion , Anything suggestion for Give money Smile
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

Back to top
View user's profile Send private message
Graion Dilach
Defense Minister


Joined: 22 Nov 2010
Location: Iszkaszentgyorgy, Hungary

PostPosted: Wed Dec 09, 2015 11:06 am    Post subject: Reply with quote  Mark this post and the followings unread

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.

And otamaa, just a fyi: GitHub has a really nice diff view for an entire branch to see what's missing: https://github.com/Ares-Developers/Ares/compare/ft-bounty #Tongue

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...

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID
otamaa
Vehicle Driver


Joined: 14 Nov 2014
Location: Indonesia

PostPosted: Wed Dec 09, 2015 12:09 pm    Post subject: Reply with quote  Mark this post and the followings unread

Okay , noted Smile
How if player who get damage by give money also lost they money ?
look silly but nice i think Smile

ah ,i didn't know that Github feature  :p

About the hook ,i already manage that , some multiple hook already removed Smile

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [19 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
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


Powered by phpBB © phpBB Group

[ Time: 0.2392s ][ Queries: 14 (0.0109s) ][ Debug on ]