The Forums Are Now Closed!

The content will remain as a historical reference, thank you.

[Mod] Favormod - Revision - V2.3.3

By on December 23, 2009 7:54:59 AM from Demigod Forums Demigod Forums

 

 

Favormod offers over 60 new items (including 15 new summon-ables - Towers and Units), both achievement and standard shop items. All achievement( favor) items are each only 1 point to make it accessible to all. And all new units have been re-skinned. Several set items with unique effects have also been added. All items have their own unique icon and several new casting, buff and spell effects have been added.

Favormod also offers a wide range of abilities that are not available in vanilla Demigod. For more information pls watch the video at the bottom of this Post. 


For instructions on how to install mods see here:

https://forums.demigodthegame.com/369780

 

[Mod] Favormod - Revision - V2.3.3 - Yet More Bugfixes

http://www.mediafire.com/?zab21obvwkdj2ct

 

NOTE: it it highly RECOMMENDED that you use FAVORMOD with both Uberfix AND Enhanced AI -- these are all packaged in the auto installer below.


Or you can install Pacovs Community Mod Pack (includes this version of favormod) here - Self Installer:

RECOMMENDED DOWNLOAD - UPDATED daily, pls make sure version numbers match though.


http://www.box.net/shared/qf7lhj1zjl

 

 

 

Note:

_____________________________________________________________________________________________

EDIT: This video does not accurately reflect the current version of favormod, it is missing most of the skins, new effects and spells as well as about 15 items.

 

WATCH in 720p

 

FavorMod 2.0D Video:

+47 Karma | 632 Replies
December 12, 2010 7:29:42 PM from Demigod Forums Demigod Forums

Ok started making my new critical hit kit.

 

Question: 

 

Do criticals currently stack:

 

ie if i have ashkendor and mageslayer and they both proc at the same time, how the resultant damage calculated?

is it:

 

1. Damage X4 X2 ( for a total of x8 Damage)

or 

2. Damage X4 + Damage X2 (for a total of x6 Damage)

 

Just need to know for my ability critical stuff.

 

Exx

December 12, 2010 7:56:50 PM from Demigod Forums Demigod Forums

Quoting Exxcentric,
Ok started making my new critical hit kit.

 

Question: 

 

Do criticals currently stack:

 

ie if i have ashkendor and mageslayer and they both proc at the same time, how the resultant damage calculated?

is it:

 

1. Damage X4 X2 ( for a total of x8 Damage)

or 

2. Damage X4 + Damage X2 (for a total of x6 Damage)

 

Just need to know for my ability critical stuff.

 

Exx

mageslayer doesn't have a critical, yes critical stacks. so if you have 1 point in critical strike with da and slayers wraps you are looking at 3.5 times normal damage

December 12, 2010 9:32:23 PM from Demigod Forums Demigod Forums

ty zex need that info, thats what i thought (it was additive not multiplicative . cheers exx

 

Done significantly more testing with abilities crits and ironed out a heap of bugs.

Critical heals will now display a small ("Critical Heal!" green) on effect and Critical ability strikes will display a small ("Critical!" yellow) --> created new floating text for these abilities .

December 13, 2010 2:34:16 AM from Demigod Forums Demigod Forums

Ok finished set, and bug tested it.

 

All ability crits have been bug tested together and individually. Removal of item from set leads to proper removal of buffs. Just need to price it right now . It looks like a fun set, esp with tb.

 

Moving onto blood soaked wand.

 

Also pacov, did you still want golem buffed?

 

I think i will change aura from lifesteal 8 --> lifesteal 12% because you only get one of them. It seems fair and it is a bit of a buff for him.

 

Also might do some more icons tonight, 

 

 

EDIT:

Blood Soaked Wand Fix : Been playtesting with this, having 1000 mana radius is very strong early on. 

 

 

Exx

December 13, 2010 3:13:03 AM from Demigod Forums Demigod Forums

Look at the code for crits/procs in either ForgeUnit.lua or Ability.lua/AbilityTask.lua.  I can't remember which.

If memory serves, Zex is right about the damage - crits stack additively, e.g. both the chance and the 'extra' damage for each crit is calculated separately, and then applied to the target.  So if you have a 1.5x crit and a 2x crit and they both proc on the same hit (again, their chances are calculated separately, so this is fairly rare but does happen), the unit takes 1x damage from the hit + 1x damage from the 2x crit + .5x damage from the 1.5x crit, for a total of 2.5x damage.

If you wanted to merge the separate crit chances/damages from your set into one chance or make the set bonus use one increasing-chance/damage crit instead of multiple smaller crits, you could use an OnAbilityAdded function within each item's main ability to manually add and remove different unique crit abilities (each defined outside of any item blueprint) based on how many items are equipped.  Wouldn't be too hard.

 

Edit: It's ForgeUnit line 701 - paraphrasing:

Code: c++
  1. local damage = data.Amount
  2. if CalculateCritChance(critChance) then
  3.     data.Amount = data.Amount + ((CalculateCritDamage(damage, critData.CritMult)) - damage)
  4. end
CalculateCritDamage in game.lua just returns the two parameters multiplied (don't know why they needed an external function for that?).

Edit 2: Welp, I'm tired.  It is just adding extra crit damage together, like I said above: 2x + 1.5x crits = 2.5x.

December 13, 2010 4:20:22 AM from Demigod Forums Demigod Forums

 

Ok here is what i have done.

For each of the weapon crits--> these are calculated normally by adding a weapon proc ability

The Ability Crits are calulated in Globals.lua -- >DealDamage function (this sits at the top of the function)

Further down the function i assign a float text and i reset the data.amount for the next pass.

Note -  the buffs are mostly Dummy buffs provided by the items that have a permanent duration (or until removed from inventory)

 

 

 

Code: c++
  1.   if Buff.HasBuff(data.Instigator, 'AchievementArcaneMastery') then
  2.   if data.Type == 'Spell' or data.Type == 'SpellFire' then     
  3.  local rand = Random(1, 100)  
  4.    if rand > 79 then    data.Amount = originaldamage *2
  5.     #LOG("GOT DAMAGE BONUS ACHIEVEMENT")  
  6.  damagebuff = 2  
  7.  end      
  8. end    
  9. end     
  10.      if Buff.HasBuff(data.Instigator, 'Ring_DuelistsPendant') then
  11.   if data.Type == 'Spell' or data.Type == 'SpellFire' then 
  12.        local rand = Random(1, 100)      if rand > 84 then  
  13.  data.Amount = data.Amount + originaldamage *0.5  
  14.  #LOG("GOT DAMAGE BONUS Pendant")
  15.      damagebuff = 2
  16.      end    
  17.  end  
  18.  end       
  19.     if Buff.HasBuff(data.Instigator, 'Duelist_Set_Aura') then  
  20.  local currenthealth = target:GetHealth()   
  21.  local maxhealth = target:GetMaxHealth()   
  22.  local maxhealthmult = currenthealth/maxhealth  
  23.  #LOG("current unit health", repr(currenthealth), repr(maxhealthmult))
  24. if maxhealthmult < 0.15 then
  25.  data.Amount = data.Amount + originaldamage *2
  26. #LOG("GOT DAMAGE BONUS Duelist Set Aura Heal Multiplyer")
  27. damagebuff = 2
  28. healthdetector = 2
  29. end  
  30. if data.Type == 'Spell' or data.Type == 'SpellFire' then 
  31.      local rand = Random(1, 100)    
  32.  if rand > 84 then    
  33. data.Amount = data.Amount + originaldamage *0.5  
  34.  #LOG("GOT DAMAGE BONUS Duelist Set Aura")
  35.    damagebuff = 2  
  36.  end    
  37. end  
  38.  end

 

What do you think?  (BTW that took me FOREVER to get that post up, 3x forums go boom

December 13, 2010 5:13:27 AM from Demigod Forums Demigod Forums

Where is this code?  DealDamage?  There are a few problems with that.

1) If the instigator unit is dead or dying, you can't check for those buffs.  I hope you're making sure data.Instigator exists first, otherwise a dead/dying unit that damages something else post-mortem will actually cause DealDamage to error out and do no damage.

2) DealDamage runs hundreds of times per second in a big game, and 99.9% of the time, units are not going to have those buffs.  That's a lot of buff checks (which are iterations of the unit's entire buffs table) happening that don't need to be, when there are simpler checks that can be done.

 

I don't know how to solve 1.  It would probably require way more work than is worthwhile.  Probably one of the reasons GPG didn't do anything that modified ability damage, because they have so many instances of post-death ability damage.

With 2, I'd suggest doing two things at least - move it to a ForgeUnit.DoTakeDamage hook, and modify your buff checks into class table checks.

December 13, 2010 5:29:25 AM from Demigod Forums Demigod Forums

Instead of using dummy buffs, I'd have these items/abilities use OnAbilityAdded/OnRemoveAbility functions to set up a table on the affected unit.  Then you can just query table entries directly-- which is much faster-- instead of having to go through the buff system.  Example:

Code: c++
  1. OnAbilityAdded = function(self, unit)
  2.     if not unit.FavorModData then
  3.         unit.FavorModData = {}
  4.     end
  5.     unit.FavorModData[self.Name] = true
  6. end,
  7. RemoveAbility = function(self, unit)
  8.     unit.FavorModData[self.Name] = false
  9. end,

So to find out whether or not a unit has this item/ability, we first check 'if unit.FavorModData then', and then check 'if unit.FavorModData.AbilityName then' and run appropriate code.  'AbilityName' is obviously the name of the ability, which these functions dynamically set by referring to self.Name (self being the ability blueprint in this case).  You should be able to pretty much copy-paste this set of functions right into any item ability that you want to do external stuff with.

 

DoTakeDamage is the place you want to do this, for damage abilities.  I dunno if you know how to hook a unit class, so I'll run through that real quickly - this would go in hook\lua\sim\ForgeUnit.lua:

Code: c++
  1. local prevClass = ForgeUnit
  2. ForgeUnit = Class(prevClass) {
  3.     DoTakeDamage = function(self, data)
  4.         --Do our new damage stuff here
  5.         prevClass.DoTakeDamage(self, data)
  6.     end,
  7. }

 

Now, for example, if you want to add the Arcane Mastery damage, you can do that non-destructively here.  Lemme see if I can just quickly translate that into this hook:

Code: c++
  1.     DoTakeDamage = function(self, data)
  2.         --Check for FavorMod ability data on instigator
  3.         if data.Instigator and IsUnit(data.Instigator) and not data.Instigator:IsDead() and data.Instigator.FavorModData then
  4.             --Create a local ref to instigator's FavorModData
  5.             local FavorModData = data.Instigator.FavorModData
  6.             local originaldamage = data.Amount
  7.             --Arcane Mastery
  8.             if FavorModData.AchievementArcaneMastery and data.Type == 'Spell' or data.Type == 'SpellFire' then
  9.                 if Random(1, 100) > 79 then
  10.                     data.Amount = data.Amount + ((originaldamage * 2) - originaldamage))
  11.                     #LOG("GOT DAMAGE BONUS ACHIEVEMENT")
  12.                     --What does this do?
  13.                     damagebuff = 2
  14.                 end
  15.             end
  16.         end
  17.         prevClass.DoTakeDamage(self, data)
  18.     end,

I don't know what 'damagebuff' does, since that part of your code wasn't included, but hopefully you should understand where I'm going with this.  Ability crits can be done here too - just look for the crit ability's flag, calculate and add your extra damage, and set data.IsCrit = true.  The latter will turn the float text yellow, and fire the instigator's OnCriticalHit callbacks.

Also notice how I changed the way it calculates damage, to copy the way crits do it.  This way it will add each of the extra damage amounts together, and you can change the multiplier of each without breaking anything.

December 13, 2010 6:41:06 AM from Demigod Forums Demigod Forums

Ok i have spent an hour trying to get this to work (+1 for the help btw), but i cant seem to get it to activate the damage bonus in this manner. (i hate tables. them, me and demigod never seem to get along --> hence why i have been using buffs). (for the life of me i cannot see why this is not working. it is hooking properly (i fixed 3 small gramar errors) so i dunno.

 

Just a couple of thoughts --> isnt DoTakeDamage going to be called as often as DealDamage? ie instead of when a unit takes damage, it will be when a unit attacks 

 

therefore #attacks = #damage?

 

Confused and tired lol.

 

Exx.

 

 

 

 

 

December 13, 2010 7:16:13 AM from Demigod Forums Demigod Forums

Yes, that's why the majority of the performance change is to move the ability checks to a unit variable/table.

The reason I  suggested doing the hook in DoTakeDamage is because that way you can hook non-destructively without having to duplicate all of the checks that DealDamage does, because you're essentially sliding your code inbetween all the stuff DealDamage does (tons of viability checks) and all the stuff DoTakeDamage does (float text, whether or not to kill, etc).

If you hook DealDamage non-destructively at the end, you miss the DoTakeDamage call and you're modifying 'data' after it's already been passed.  If you hook it at the beginning, you have to do all of those target, damageself, etc checks or you risk running into really big problems.

 

What part of it are you having trouble getting working?  Any log errors?

Pastebin one of your item blueprints that uses this, and whichever damage function you're overriding.

December 13, 2010 7:17:09 AM from Demigod Forums Demigod Forums

Ok another hour of attempting this:

 

So i am going to agree with mithy that this way of doing the crits is not the best, but it is functional for now, and i doubt anyone will notice the resource loss for the moment. Until i can get the above described way working, i am going to keep what i had and throw it on the too do list, (damn theres alot there now . )

 

Ok, now more icons.....

 

December 13, 2010 7:34:19 AM from Demigod Forums Demigod Forums

hmm i am going to upload a copy of what i have, without your changes.

 

Then i am going to have a 4th run through with your stuff.

 

What part of it are you having trouble getting working?  Any log errors?

 

ok so i am first having a problem of getting a functional import. (ForgeUnit.lua fail)

 

I fixed that on my second try (but deleted the file in frustration-- recycle bin turned off so its gone for good ).

At this point i added a LOG("File has been hooked, instigator found"), it checked out. But would not deal bonus damage (with buff code or tables). 

 

third try import problems again

 

Very little of my stuff touches original code in favormod, and enfos can be as destructive as it likes because it HAS to override pretty much the entire of the core game, so i am not very good at non destructive hooking. Do you have any function hooks that i can look at as examples in uberfix? (will have a look now that i think of this)

So if i remove the buff table checks and replace them with new tables, this will be the majority of the performance difference between these 2 methods?

 

 

 

December 13, 2010 7:39:56 AM from Demigod Forums Demigod Forums

Nothing that's more specific than the examples I just gave.  I'm hooking a few things in ForgeUnit in my WIP version, but it's all for the Ooze fix, and all relatively simple.

Next time you post a new version, I'll just grab that and see if I can make the change myself.

So if i remove the buff table checks and replace them with new tables, this will be the majority of the performance difference between these 2 methods?

That, and a non-destructive hook of DealDamage.  I did have a destructive change in DealDamage in the UberFix, but I figured out a non-destructive way to do that in a ForgeUnit function as well.

December 13, 2010 7:41:10 AM from Demigod Forums Demigod Forums
December 13, 2010 7:51:41 AM from Demigod Forums Demigod Forums

Other than DealDamage and BuffAffects, are you doing any other checks for buffs?  The ones in BuffAffects aren't a performance issue since they won't be happening nearly as often, but I just figured I'd ask.

Also, I might have just thought of a way to modify post-mortem ability damage, but I'd probably have to add some support code to the UberFix.  It won't be perfect, because waaaaaay too many of GPG's abilities use direct DealDamage calls, even though plenty of others use -health buffs to do exactly the same thing.  Very irritating and inconsistent.

December 13, 2010 8:19:40 AM from Demigod Forums Demigod Forums

Also, I might have just thought of a way to modify post-mortem ability damage, but I'd probably have to add some support code to the UberFix.  It won't be perfect, because waaaaaay too many of GPG's abilities use direct DealDamage calls, even though plenty of others use -health buffs to do exactly the same thing.  Very irritating and inconsistent.

 

lol agreed, thats how i got to the dealdamage function in the originally, it is the first place both of these two methods converge.

 

 

Other than DealDamage and BuffAffects, are you doing any other checks for buffs?  The ones in BuffAffects aren't a performance issue since they won't be happening nearly as often, but I just figured I'd ask.

 

only on items, since those are the only 2 sims i have editied. 

December 13, 2010 8:27:56 AM from Demigod Forums Demigod Forums

Well dang, I just looked at some of your achievement item code, and have you actually thoroughly tested the buffs and abilities you have that modify absorption?  The absorption system is totally broken, and the method you're using looks like it should be overwriting Groffling, although it looks like you're skipping any unit that has Bramble Shield.

I was on the fence about doing a total rewrite of absorption in the UberFix, but if you're using some absorption stuff, I'll go ahead and do it.  That way all absorption buffs can play nice with each other.

December 13, 2010 8:46:11 AM from Stardock Forums Stardock Forums

Blood Soaked Wand Fix : Been playtesting with this, having 1000 mana radius is very strong early on.

500 then might be a wee bit safer.

Also pacov, did you still want golem buffed?

I was mostly thinking damage.  Might as well tweak the lifesteal buff as well.  And if the golum doesn't have a decent armor rating, might be good to buff that as well. 

December 13, 2010 8:49:55 AM from Demigod Forums Demigod Forums

Yere i have seen your post on that in uber. 

 

I was aware they could overwrite eachother (QOT and my shields) hence why they have cancelling on atm.

 

Before your uberfix post i was completely unaware of groffling absorption buff.

 

I would be more than happy for a fix!

 

December 13, 2010 8:53:51 AM from Demigod Forums Demigod Forums

Ok i have tables now active for my globals Dealdamage code.

 

Will this be a sufficient fix for now you think? -- i can always import it across later but at least this has an easy overriding check - if favormod{} = true.

 

Ok done pacov

 

will increase lifesteal -->10 

increase attack rate by .1

increase armor to 500

December 13, 2010 8:57:06 AM from Demigod Forums Demigod Forums

Pastebin what you've got.  It's still not a great idea to replace DealDamage (like where you're changing the ACTUAL data.Amount instead of copying it) when it's much safer to hook DoTakeDamage and do the same thing with a per-unit copy of data.

Also, like I said, every unit's OnTakeDamage already has code to deal with float text color etc.  All you have to do is set data.IsCrit = true in DoTakeDamage, if it's an ability crit.

December 13, 2010 9:06:41 AM from Demigod Forums Demigod Forums

float text color etc. is on a forkthread so it doesnt take up any time from the dealdamage function

also i want this for my Overkill Effect: when unit gets below 20% health 100% time both ability and weapon damage 2x Crit. This works for all Health effects. (pots and heals as well)

http://pastebin.com/jTbKmadw

 

Cheers for being so helpful this is great!

December 13, 2010 9:29:54 AM from Demigod Forums Demigod Forums

Ok i can now see you logic for this:                

 

   data.Amount = data.Amount + ((originaldamage * 2) - originaldamage))

 

will add that in

 

December 13, 2010 9:39:05 AM from Demigod Forums Demigod Forums

I'm confused about what the Duelist_Set_Aura is supposed to do.  Is it supposed to double damage when the target is below 15% health?  Otherwise do a 15% chance to increase by 50%?

 

And yeah, that method is how GPG's code does criticals, because it adds multiple bonuses together properly.

December 13, 2010 9:48:40 AM from Demigod Forums Demigod Forums

it does both.

 

When you get all 3 items it adds that ability (requires a buff from each item). 

This one does:

15% Ability damage 

100% chance for a 2x crit when target is below 15% health (this can stack with any other crits that go off).

Stardock Forums v1.0.0.0    #108434  walnut1   Server Load Time: 00:00:00.0000406   Page Render Time:

Stardock Magazine | Register | Online Privacy Policy | Terms of Use

Copyright ?? 2012 Stardock Entertainment and Gas Powered Games. Demigod is a trademark of Gas Powered Games. All rights reserved. All other trademarks and copyrights are the properties of their respective owners. Windows, the Windows Vista Start button and Xbox 360 are trademarks of the Microsoft group of companies, and 'Games for Windows' and the Windows Vista Start button logo are used under license from Microsoft. ?? 2012 Advanced Micro Devices, Inc. All rights reserved. AMD, the AMD Arrow logo and combinations thereof are trademarks of Advanced Micro Devices, Inc.