Add the bounty logic.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ares |
Invalid
|
Wishlist
|
Unassigned |
Bug Description
Receive credits for killing enemy units.
Marshall (m-edward) wrote : | #1 |
reaperrr (reaperrr) wrote : | #2 |
This would be exactly one of the 4 or 5 features I would need for my project...
Also, this would technically allow for an entire additional income system, you could have one faction harvesting collectables (ore, tib), one faction building oil derrick-like stuff and the third relying on bounties for killing stuff. I'm absolutely sure that quite a few mods would benefit from this feature, not just mine.
MRMIdAS (mrmidas) wrote : | #3 |
Massive support, cash bounties is one of my favourite generals additions, hopefully we'll be able to define the bounty animation etc should this be implemented.
Bug Importer (bug-importer) wrote : | #4 |
Code related to this issue has just been checked in!
Author: AlexB
Location: ft-bounty, r1045
Commit contains DLL: Yes
Revision comment:
Bounty logic implementation and first binary. Graion's and Joshy's code.
Related to issue #203, Related to issue #1523.
Documentation:
[TechnoType]
Multiplier of the enemy victim's Cost/Damage which should be granted as bounty.
[TechnoType]
If set to yes, the granted money will be written out above the unit.
[TechnoType]
Multiplier of the friendly victim's Cost/Damage which should be taken as bounty.
[TechnoType]
If set to yes, the taken money will be written out above the unit.
[TechnoType]
If set to yes, the unit will grant money for the Damage it delivered and not when it destroys a unit.
[TechnoType]
If set to yes, the TechnoType can't grant money.
SVN: http://
Graion Dilach (graiondilach) wrote : | #5 |
Shoulda work, but I'll do a cleanup and opimization on Tuesday. Shouldn't affect anything else except performance.
EDIT: OK, I know it DOESN'T work. I think I know the cause. Tuesday.
Marshall (m-edward) wrote : | #6 |
Confused about ImmuneToBounty, doesn't Bounty.Modifier=0 achieve the same thing?
It would make more sense to have a CanReceiveBounty flag on the killing unit instead...
DCoder DCoder (dcoder1337) wrote : | #7 |
The way I see it, the unit doesn't receive bounty, its owner house does... else the unit's victims' bounty would have to be included with the unit's own bounty when it is killed.
Marshall (m-edward) wrote : | #8 |
I was thinking of something like the alchemist from warcraft 3 that transmutes its victims into gold.
So the 'bounty-gathering' unit would be unique, and basic units would not be able to harvest bounty for their owner house.
Graion Dilach (graiondilach) wrote : | #9 |
If a victim have ImmuneToBounty set, then any unit with a positive Bounty.Modifier (regardless of Pillager setting) won't get money.
Bounty.Modifier goes to the attackers.
TBH, I don't remember the exact effect of Transmute, (I never liked Alchemists, Dark Ranger and Beastmster are more better) but the effect of Pillager came from War3's Orc ability.
Marshall (m-edward) wrote : | #10 |
Ah wait I see now. All of the tags are on the attacker, ImmuneToBounty is on the victim. I thought it was the other way round before, now it makes sense to me.
So transmute is what has been implemented after all.
The only thing missing is victim-specific modifiers, however I don't think that is needed (certainly not by me anyway).
Graion Dilach (graiondilach) wrote : | #11 |
Well, I can add a Bounty.
As I said, I'll fix it up the things today or tomorrow. But we can leave this open for a while to see what would be helpful as well. Personally, I'd see a VeteranAbility, but first I'd like to fix this to work in this stance (http://
Marshall (m-edward) wrote : | #12 |
Hmm... applied damage irrespective of unit cost is far too powerful for pillage.
That should be
(damage applied / victim max hp) * bounty.modifier * victim cost
Although, if you want uber-configurable parameters then there should be
Bounty.Modifier ;percent of victim's cost to gain as bounty when killed
Pillage.
Pillage.
then you don't need the Bounty.Pillage boolean.
and then the complementing
Bounty.
Bounty.
Instead of ImmuneToBounty/
Graion Dilach (graiondilach) wrote : | #13 |
Well, I already use Bounty.Modifier 0.0 as turning it off, and that's the default. I don't see a reason why it should be moved to the victim's side.
Also, Pillage.AsCost, Pillage.AsDamage... I'd like to keep the boolean. It's easier to check that one. Pillage and Bounty are in two different hooks after all. However, if I implement Bounty.
The first build will contain 1045's system, then I go implement your suggestions into it.
OTOH. I have added checks for Armory, Hospital and Slave Miner logics. Can anybody mentions another place where the unit kills another unintentionally?
Also, when this is committed, somebody please do a Temporal Pillager. I smell a glorious bug, but I don't want to add a check until I'm not sure.
Krozalid (krozalid) wrote : | #14 |
Does this work Graion? I would love to try it.
Bug Importer (bug-importer) wrote : | #15 |
Code related to this issue has just been checked in!
Author: AlexB
Location: ft-bounty, r1052
Commit contains DLL: Yes
Revision comment:
Refactored to work, also to follow DCoder's review. Added sanity checks for Armory Hospital and Slave Miner. Logics haven't changed yet. Graion's code.
Related to issue #203, related to issue #1523.
SVN: http://
Graion Dilach (graiondilach) wrote : | #16 |
Do me a favour. Break it.
Do me a bigger one. Break it with unordinary. Temporal, DeathWeapons, anything serious.
If this fails again, I won't send a patch until I find an SP3 for VS2010.
Graion Dilach (graiondilach) wrote : | #17 |
OK, I know this one failed as well, but enough of shotting in the dark.
I have VS2010, and I am going to have that Ares builder as well. No more "Compiled, Ship It!"-behaviour. VS2010 already pointed out that a header was wrongly included, so my next patch WILL work.
Especially because I'll do a basic test before I send the patch to commit.
Graion Dilach (graiondilach) wrote : | #18 |
First testing build.
Ignore filesize, I forgot including the debugger part. However this also means that don't post up extcrashes regarding this one. If it was caused by Bounty, a debug.log is enough.
Known bug: The messages are not connected to the map but to the screen. Will be fixed ASAP I figured out a way to do it.
Refactoring wasn't done, it's just a working version of the code.
As a testing build, take note the following: Pillager and Messages are enabled and Modifiers are defaults to 1. This means all unit uses Bounty from the box. These are just defaults right now and will be reverted when it's merged into trunk.
http://
Check DeathWeapons,. Temporals, DeathAnims, railguns, Animation Damage, Paralyze, Slave Miners, rmory, Hospital and other haywire effects. Where it gives/takes money for nothing, REPORT!
Marshall's points will be developed into the system, since I see they're valid and needed. I think I'll do that tomorrow.
FS-21 (jagarni1983) wrote : | #19 |
Of what I observed (thanks for the default values of that DLL, I saved a lot of time that I used to test things):
- Temporals not work.
- If you use repair weapons (negative damage) it show in red as "-$-50" but in reality the money is increased by 50.
- Rail gun weapons works.
- Sonic weapons with ambient damage works but is impossible to read the "almost" infinite chain of strings when the wave is damaging the unit.
- Money strings from V3 launchers vehicles are indicated in V3 rockets & not in the V3 launchers (is this behaviour what you wanted?).
- Chaos drone gas produce negative damage in your units when they attack friendly units (by logic I imagine that it works).
- By "Animation Damage" do you mean the damage made by virus clouds? If "yes" then it not works.
- By "Slave Miners" what do you wanted exactly to test with those units? I don't see any problem if I attack them or if I kill the slaves or they attack enemies...
- "DeathWeapons": Works as planned.
- Drain weapon from the Yuri Flying Disk does nothing.
- Crushing infantry with vehicles does nothing.
- Flying vehicles like the Yuri Disk killed by EMP weapons does nothing (EMP.Threshold).
- "Paralyze" (from squids against ships?) works.
- Hospital & Armory "massive heal" effect that you wanted to test does nothing.
One idea I thought about the heavy overload of strings due to a very low ROF of the weapons: do a counter of 1 sec. between strings (or less time, the min. necessary to not overlap strings) & during that time not to show nothing and when the counter ends then show the full sum of that unit since the last count (if sum != 0), reset count of the unit & repeat again the count...
Krozalid (krozalid) wrote : | #20 |
Confirming FS-21's founding.
Graion Dilach (graiondilach) wrote : | #21 |
Thanks!
Temporals, Armory, Slave Miner Crushing and Threshold should been retested with Bounty.Pillage=no. AFAIK, Hospital and Armory kills their units before respawning and SM always kills the Slave when it gets in. I've only added checks against these three. Crushes and Threshold should work without Pillage set.
DeathWeapons: OK, so it does Bounty. I can't decide if it should or shouldn't. That's my problem.
Drainweapon and Temporal doesn't cause a damage, so that's not surprising if that doesn't work with pillagers. But I see, Temporal should give bounty at deleting even if the unit is a pillager.
Animation damage doesn't have an owner tbh, so I don't think I can fix that. It goes to the other animation warhead problems.
OK, then todo list:
Add Marshall's proposal
Fix Spawned units' bounty strings Only MissileSpawn is checked, spawn planes will show
Add a check to Sonic
Add a check to ROF
Crushing should give bounty to pillagers
Negative damage shouldn't generate Pillage. (this one is arguable, we can speak about non-free unit repairs with this)
DCoder DCoder (dcoder1337) wrote : | #22 |
Just because an object disappears off the map doesn't necessarily mean it's been killed. Neither Hospital, Armory nor the Slave Miner kill their occupants.
Graion Dilach (graiondilach) wrote : | #23 |
Oh, OK, thanks.
C4 and IvanBombs?
Krozalid (krozalid) wrote : | #24 |
C4 works. IvanBomb works too.
FS-21 (jagarni1983) wrote : | #25 |
I forgot to say that Desolator's deploy weapon does nothing.
Graion Dilach (graiondilach) wrote : | #26 |
Same. YR doesn't keep which weapon generated the radiation (that's why you can't gain veterancy through rad, neither), and without custom radiation, I can't keep that, neither.
Graion Dilach (graiondilach) wrote : | #27 |
DLL is updated, testing defaults haven't changed.
ImmuneToBounty is deprecated, Bounty.
Calculations match Marshall's proposal.
String should spawn on missile spawnees and not on the missiles.
Still waiting on Crush, Temporal and Threshold no-Pillage check.
Black Temple Gaurdian (black-temple-gaurdian) wrote : | #28 |
Just a logicalpoint, does this work on cost or soylent (or whatever it was)? IMO it should be soylent as that's what the similar logic (the Grinder) uses so you don't necessarily get 100% back.
Marshall (m-edward) wrote : | #29 |
Well, it doesn't really matter as you have fine control now. Because of that though, I'd vote cost - simply because I've already manually changed all my soylents to be more suitable for the grinder.
Graion Dilach (graiondilach) wrote : | #30 |
DLL updated, no more IEs when a building want's to message.
Graion Dilach (graiondilach) wrote : | #31 |
DLL updated, Pillage should work with Temporal and the strings should be attached to the map (this one is Alex's code).
Defaults are reverted to proposed trunk defaults, neither one is tested yet. Debug symbols in, so DLL size is correct.
EDIT: Whoops, sorry about ignoring the cost-soylent argument. The calculation is based upon Cost, and Industrial Plant logic kicks in as well.
Graion Dilach (graiondilach) wrote : | #32 |
Another update within the day!
D's Crush hook is also incorporated. Also fixed a bug in Temporal Pillager which caused that money wasn't given.
Testing, please! (somebody please check if buildings IE again, I don't really understand Alex's code but how I see they shouldn't)
FS-21 (jagarni1983) wrote : | #33 |
Can you explain a bit the "buildings IE" to try to reproduce it?
Graion Dilach (graiondilach) wrote : | #34 |
Can building write out a message, or it IEs instead? Two posts above.
Graion Dilach (graiondilach) wrote : | #35 |
OK, guys, updated again, Temporal had a wrong hook before.
So both Crush and Temporal works. What have I missed?
Chanterier (speederyr) wrote : | #36 |
Get a Terror Drone into a vehicle which has bounty logic enabled and has a death weapon.
Terror Drone kills the vehicle and dies in the process. Bounty is given. Does this make sense?
Graion Dilach (graiondilach) wrote : | #37 |
Well if it paid the vehicle, then yes, thank you. However Bounty and Pillage are similar, but not related in game terms. Special cases are handled differently, like Temporal and Crush.
For example, Threshold without Pillager should (read: the code says this, testers say nothing) pay already, on the other hand I don't see a reason why Threshold with Pillager set should pay, since Threshold ignores applied damage.
Chanterier (speederyr) wrote : | #38 |
Death weapon shouldn't provide bounty. The unit died, it can't receive money (pickup remaining parts or however you explain the logic). This should at least be customizable.
YR M0ddEr (yr-m0dder) wrote : | #39 |
Bounty.Modifier= calculating is wrong, but ONLY when killing buildings. Note that Bounty.
DCoder DCoder (dcoder1337) wrote : | #40 |
"Is wrong" is not really a helpful error description.
YR M0ddEr (yr-m0dder) wrote : | #41 |
with "wrong" I mean it gives wrong amount of money, like twice as much as you should get.
Graion Dilach (graiondilach) wrote : | #42 |
@DCoder. he reported this to me over IRC first. I guess ObjectType-
@Speeder, it won't be customizable. I won't add another if-clause. Personally I agree that Deathweapons shouldn't have Bounty, so if anybody doesn't have an opposite point, my next update will have that fixed.
Graion Dilach (graiondilach) wrote : | #43 |
Code related to this issue has just been checked in!
Author: Graion Dilach
Location: external place, r105207
Commit contains DLL: Yes
Revision comment:
Related to issue #207: Changed cost getting to prevent doubling BuildingType money. Pillager isn't set to yes by default from now on.
Fixed issue #1588: Implemented as proposed.
Graion Dilach (graiondilach) wrote : | #44 |
Updated to 1052071, no longer IE during menu load.
Krozalid (krozalid) wrote : | #45 |
It's not working for me.
Graion Dilach (graiondilach) wrote : | #46 |
07 or 071?
I know 07 is broken thatr's why it was updated. 071 should work. But you can upload the dump, I have WinDBG to read it.
Graion Dilach (graiondilach) wrote : | #47 |
OK, guys, Ares's Bounty branch is updated.
If I read the code correctly, CostMultiplier and PillageMultiplier defaults to 0 right now... take steps accordingly.
Krozalid (krozalid) wrote : | #48 |
From what I understand, this could be enabled for the countries too right? And I assume that the tags are the same? I'm not sure whether I did it wrong or not but this really doesn't work for me. And yes I'm using the latest branch revision.
Graion Dilach (graiondilach) wrote : | #49 |
I'll look into it.
You did understand correctly, but in latest branch, Bounty.
Krozalid (krozalid) wrote : | #50 |
So what should I put on the country if I want them to get bounty?
Graion Dilach (graiondilach) wrote : | #51 |
The same tags.
And I'll get talk to our Project Manager to see if we have a Doc Maintainer onboard. I think I'll need him.
Krozalid (krozalid) wrote : | #52 |
What about Bounty.Modifier?
Graion Dilach (graiondilach) wrote : | #53 |
That defaults to 0 as well, yeah. Those tags can go to the country.
OK, all tags which were on the technos bbefore can go to the country, and serve as defaults if the techno doesn't have them.
Black Temple Gaurdian (black-temple-gaurdian) wrote : | #54 |
So what tags are needed to get this to work? Thew documentation is... non-existant.
Graion Dilach (graiondilach) wrote : | #55 |
Thew code is broken also.
On my to-do to get it fixed, actually I postponed it to the first day after 0.2 release.
Graion Dilach (graiondilach) wrote : | #56 |
Graion Dilach (graiondilach) wrote : | #57 |
http://
Buildings again. --'
Renegade (renegade) wrote : | #58 |
Closed in favor of blueprint.
Changed in ares: | |
assignee: | Graion Dilach (graiondilach) → nobody |
status: | In Progress → Invalid |
In addition, please can an option be included to restrict which units can receive Bounty.
Some flag examples:
[AudioVisual]
BountyAnim=PILLAGE
[DYINGUNIT]
GivesBountyMin=1
GivesBountyMax=10
[KILLINGUNIT1] mFriendlies= no
CanGetBounty=yes
CanGetBountyFro
[KILLINGUNIT2]
CanGetBounty=no