wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 10-16-2009, 12:15 AM   #1
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default GetProc

GetProc is based on ChanceToProc by Ammorth. It takes the same concept and gives it a much more usable interface as well as some functional improvements.

GetProc allows you to smooth out the streakiness of random procs. GetRandomReal() often produces long strings of high or low values, which may result in a relatively rare random proc occuring many times in a row. While using GetProc, each time a proc occurs it becomes less likely, and each time a proc fails to occur it becomes more likely. The overall chance of the proc occuring remains the same, but long streaks of the same result become far less likely.

The strength of the steak dampening is configurable using the Weight variable. Many people find it difficult to intuitively grasp the effects of this technique, so here are some hard numbers, based on using GetProc on a 50% chance 1000 times per test and analyzing the results:

Format: <streak length>*<number of occurrences>
Code:
Weight: 0.0; Streaks: 2*157, 3*54, 4*23, 5*12, 6*13, 7*2, 8*1, 12*1, 13*1
Weight: 0.1; Streaks: 2*143, 3*51, 4*44, 5*12, 6*3 , 7*1, 8*1
Weight: 0.2; Streaks: 2*156, 3*70, 4*31, 5*11
Weight: 0.3; Streaks: 2*158, 3*63, 4*31, 5*8
Weight: 0.4; Streaks: 2*198, 3*64, 4*15
Weight: 0.5; Streaks: 2*203, 3*78, 4*9
Weight: 0.6; Streaks: 2*219, 3*55, 4*9
Weight: 0.7; Streaks: 2*212, 3*51, 4*6
Weight: 0.8; Streaks: 2*253, 3*28
Weight: 0.9; Streaks: 2*236, 3*24
Weight: 1.0; Streaks: 2*256
As you can see, increasing weight gradually decreases the number and average length of streaks.

In addition to looking at the way the weight value prevents streaks, we can analyze the effect it has on gameplay moment-to-moment. Let's say we're using 0.5 weight (default) with a hero who has a 20% critical chance:
Code:
Let W = Weight * 0.5 * Min(chance, 1 - chance)
Chance lost on true:    W / chance
Chance gained on false: W / (1 - chance)
therefore:              W = 0.5 * 0.5 * 0.2 = 0.05
Chance lost on true:    0.05 / 0.2 = 25%
Chance gained on false: 0.05 / 0.8 = 6.25%

Attack 1: 20.00% chance, false, gain 6.25%
Attack 2: 26.25% chance, false, gain 6.25%
Attack 3: 32.50% chance, false, gain 6.25%
Attack 4: 38.75% chance, true,  lose 25% (now very unlikely to crit back-to-back...)
Attack 5: 13.75% chance, false, gain 6.25%
Attack 6: 20.00% chance, back to start

Excessive randomness is disruptive to game balance. Unchecked, the random number generator can determine the outcome of an entire fight, regardless of the skill of players involved. Random skills are more balancable when they behave the way you expect them to behave in the short term as well as the long term. A hero whose DPS is highly affected by critical hits should give a fair fight to every opponent it encounters, rather than obliterating one opponent with 8 critical hits, and being obliterated by the next with 0 critical hits. Using GetProc makes randomness a much more controllable game mechanic. And using static ifs and optional library requirements, it is easy to make GetProc optional for any scripts/systems that involve random events.

Expand JASS:

Last edited by grim001 : 10-19-2009 at 09:54 PM.
grim001 is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 10-16-2009, 12:34 AM   #2
Bobo_The_Kodo
oO
 
Bobo_The_Kodo's Avatar
 
Join Date: Jul 2008
Posts: 580

Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)

Default

Would be useful for DotA && Rikter ..

But really, I don't like random in spells anyway .. Could be useful for other game mechanics.

Whats max stored in a hashtable btw? I doubt this could ever run out even if you tried -> even dota only uses 1 hashtable for all spells in map (is like lhv ...)
Bobo_The_Kodo is offline   Reply With Quote
Old 10-16-2009, 02:46 AM   #3
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,726

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

I've seen this in use elsewhere and is even already approved, but I've honestly never liked it. Honest to God, as a player, the weight of 0 is the most awesome of the lot. I love having the chance to get 20 crits in a row out of raw randomness. The randomness is part of what makes it crazy fun in the first place.

Why do you keep remaking everything everyone else has already made? The only differences between yours and Ammorth's is the API, and honestly, what you're doing is 100% against all movement towards standards.

But whatever.
__________________
Home Page
DoE v1.14c Download
AotZ v2.03d Download
OD v0.10x Download

Coming soon eventually...

Personal To-Do List:
ICARUS
Aot3

WC3C Chat
Chat IP: 66.103.20.109
Earthbound 2 in English
vJass Manual

"DAMAGE_TYPE_POISON motherfucker!" ~Anitarf
Rising_Dusk is offline   Reply With Quote
Old 10-16-2009, 03:22 AM   #4
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

Quote:
Originally Posted by Rising_Dusk
Why do you keep remaking everything everyone else has already made?
I don't. Do you have any examples of that? If you're referring to SortUtils, it's absolutely nothing like PruneGroup. PruneGroup is not even capable of sorting things.

Quote:
Originally Posted by Rising_Dusk
Honest to God, as a player, the weight of 0 is the most awesome of the lot... 20 crits in a row out of raw randomness.
The only reason you're getting 20 crits in a row is due to WC3's faulty random number generator, not out of sheer chance. If it were based on true random values, you'd wind up with results that are similar to using GetProc with a low weight. But if you prefer a streaky randomness, that's fine, which is why I pointed out how easy it is to make it optional.

Quote:
Originally Posted by Rising_Dusk
The only differences between yours and Ammorth's is the API
The reason I even created this is because of how unnecessary ChanceToProc's entire API is. Do you want to manage 50 Chance struct instances, attach them to units, and call various methods on them, or do you want the same functionality in one simple function call? Being unable to specify a new chance value without calling a method is clunky, too.

Quote:
Originally Posted by Rising_Dusk
and honestly, what you're doing is 100% against all movement towards standards.
A script being approved does not automatically make it a standard. Almost no one uses ChanceToProc, and part of that is because of its API, which adds a great deal of complexity for a relatively subtle benefit.

Furthermore, if a major improvement can be made, a new script can and should be created to replace an old one.

Last edited by grim001 : 10-16-2009 at 03:32 AM.
grim001 is offline   Reply With Quote
Old 10-16-2009, 04:21 AM   #5
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,726

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

No, no one uses ChanceToProc because no one cares about weighted percent chances. I am not going to suddenly jump on this idea just because you now use a hashtable.
Quote:
Originally Posted by grim001
A script being approved does not automatically make it a standard.
No shit, but two or three scripts that achieve the same thing being approved does make all of them further from a standard.
Quote:
Originally Posted by grim001
I don't. Do you have any examples of that? If you're referring to SortUtils, it's absolutely nothing like PruneGroup. PruneGroup is not even capable of sorting things.
I do, but I don't care enough to argue with you over it.
Quote:
Originally Posted by grim001
Furthermore, if a major improvement can be made, a new script can and should be created to replace an old one.
You still have to manage a unique key for every chance instance in your map, so I see little to no improvement at all as far as I'm concerned. You're going to retort with some crap about hashtable being awesome and that the user doesn't have to manage a struct, but honestly, the user does anyways. I'd rather the struct approach with hooking to units by userdata than having to manage keys.
__________________
Home Page
DoE v1.14c Download
AotZ v2.03d Download
OD v0.10x Download

Coming soon eventually...

Personal To-Do List:
ICARUS
Aot3

WC3C Chat
Chat IP: 66.103.20.109
Earthbound 2 in English
vJass Manual

"DAMAGE_TYPE_POISON motherfucker!" ~Anitarf
Rising_Dusk is offline   Reply With Quote
Old 10-16-2009, 05:31 AM   #6
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

Quote:
Originally Posted by Rising_Dusk
No, no one uses ChanceToProc because no one cares about weighted percent chances.
That probably stems from 99% of everyone not making actual maps, especially ones that are finely balanced enough that weighted procs would make any difference. Nonetheless, Blizzard thinks it's a great idea, considering it exists in most of their games, invisible to the player. Honestly, it doesn't matter whether you personally like them or not.

Quote:
Originally Posted by Rising_Dusk
No shit, but two or three scripts that achieve the same thing being approved does make all of them further from a standard.
The kind of standard you are looking for doesn't exist unless you want to prevent all progress from being made. If it bothers you, get rid of the outdated scripts when new ones supersede them.

Quote:
Originally Posted by Rising_Dusk
You still have to manage a unique key for every chance instance in your map
Keys can't even be used that way, they are generated at compile time. You need one key per proc type, not one key per struct instance. That would require hundreds or thousands of keys.

Seriously, compare them side by side:
Collapse JASS:
globals
    key CriticalHit
endglobals

function OnDamage takes nothing returns nothing
    if GetHandleProc(CriticalHit, GetEventDamageSource(), CritChance) then
        call DoCriticalHit()
    endif
endfunction

Collapse JASS:
globals
    Chance array CriticalHitChances
endglobals

function OnDamage takes nothing returns nothing
    local integer id = GetUnitId(GetEventDamageSource())
    local Chance c = CriticalHitChances[id]
        if c == 0 then
            set c = Chance.create(Weight, 0)
            set CriticalHitChances[id] = c
        endif
        if c.getPercent() != CritChance
            call c.setPercentage(Weight, CritChance) //Calling this resets the streak dampening, so it must be
        endif                                        //avoided when possible by comparing to previous chance
        if c.isProc() then
            call DoCriticalHit()
        endif
endfunction

You have to recode my entire GetHandleProc function inside every place a handle-related proc is used to duplicate the same functionality. This is why I said ChanceToProc's API sucks.

Last edited by grim001 : 10-16-2009 at 06:08 AM.
grim001 is offline   Reply With Quote
Old 10-16-2009, 07:37 AM   #7
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Quote:
That probably stems from 99% of everyone not making actual maps, especially ones that are finely balanced enough that weighted procs would make any difference. Nonetheless, Blizzard thinks it's a great idea, considering it exists in most of their games, invisible to the player. Honestly, it doesn't matter whether you personally like them or not.
Well, for me as a (noob/average/pro/awesome (just put in how you feel here) map maker I prefer making things repeating, not random. For example: DotAs Storm Panda also has the ability to deal bonus damage, not random, but every x attacks. And thats how I do things. Randomness sucks, because its never balanced, you never know if you can belie on abilities or not.

By giving them an actual number, no matter how much action has to be done before, it is calculateable and the player gets a know about how good it really is and when its next time casted.

To get to an end, I wouldn't use this or the other library, just because randomness isn't a good things at all for players, and even if, I wouldn't want to make it that complicated as you have. GetRandomReal(0., 1.) for example is just enough for randomness, you don't need to weight it.

This library is really fine, but I guess, like the Colored Teleports, its nothing I need to have.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 10-16-2009, 08:18 AM   #8
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

Every game ever made that includes random elements is going to disagree with you. There are tons of things that don't work well except as random chances.

Thousands of games have % chance to crit. Bonus damage on every Xth attack is an almost unheard of mechanic because of how conceptually unintuitive it is. Besides, it is abusable; you can just use X-1 attacks on random critters to ensure you start the next fight with a crit.

Quote:
Originally Posted by Anachron
Randomness sucks, because its never balanced, you never know if you can belie on abilities or not.

So clearly, GetRandomReal() is not good enough for you, because the results are too unreliable. Incidentally, using a weighted system solves exactly this problem. Your reasoning is completely self-defeating.
grim001 is offline   Reply With Quote
Old 10-16-2009, 08:24 AM   #9
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Quote:
Every game ever made that includes random elements is going to disagree with you. There are tons of things that don't work well except as random chances.
Which would be? I don't know anything that couldn't be done with repeated counting until releasing the effect.

Quote:
Thousands of games have % chance to crit. Bonus damage on every Xth attack is an almost unheard of mechanic because of how conceptually unintuitive it is. Besides, it is abusable; you can just use X-1 attacks on random critters to ensure you start the next fight with a critical.
Yes, but why should you care? I mean you have to "waste" attacks for creeps first, just to make sure you start the next attack of you with a critical. Also for me, this is REALLY good, because it brings more tactic and fun into play.

Quote:
So clearly, GetRandomReal() is not good enough for you, because the results are too unreliable. Incidentally, using a weighted system solves exactly this problem. Your reasoning is completely self-defeating.
Well, I mostly don't use random numbers, that is exactly what I said in the above post, and even if, I would just stick to GetRandomReal(), because it is in fact, all what I need.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 10-16-2009, 08:29 AM   #10
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

Right. You don't have a problem with weighted procs, you have a problem with the entire concept of percentage chances being used in video games. I don't think you're the target audience for this script.
grim001 is offline   Reply With Quote
Old 10-16-2009, 08:36 AM   #11
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Quote:
Originally Posted by grim001
Right. You don't have a problem with weighted procs, you have a problem with the entire concept of percentage chances being used in video games. I don't think you're the target audience for this script.
Basically the whole concept of randomness in maps is unbalanced, and you can never balance it, because as its name suggests, its random.

If I have to stick to an advanced random engine I would maybe need your library, but I think for me it has no use, until now.

But maybe its only a matter of time.

Maybe you ask why I discuss that much, even if I won't use it, its probably because I like to discuss scripts and to get whats behind that, and to reveal such stuff as bugs and its usefulness.
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]
Anachron is offline   Reply With Quote
Old 10-16-2009, 09:24 AM   #12
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

Quote:
Originally Posted by Anachron
Basically the whole concept of randomness in maps is unbalanced, and you can never balance it, because as its name suggests, its random.

With weighted procs, each successive event is slightly less random, until it actually becomes impossible for the same thing to happen too many times in a row. A high Weight value (0.75+) actually produces really similar results to "bonus damage every X attacks," except that you don't always know when the Xth attack will come up, so that it's not exploitable and maintains the appearance of being percentage based.
grim001 is offline   Reply With Quote
Old 10-16-2009, 01:42 PM   #13
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,726

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Quote:
Originally Posted by grim001
Keys can't even be used that way, they are generated at compile time. You need one key per proc type, not one key per struct instance. That would require hundreds or thousands of keys.
No, because two different spells with a 15% chance to hit each need their own key. You need to then, as a user, have a unique integer associated for each spell or instance of this that is in your map. For some of my maps, that number would spike well into the hundreds. I, as a user, would just use a struct for that, so inevitably I'd still have to manage structs despite your claim that this system removes the need to manage them. I'd much rather hook it to unituserdata.

And I agree that Ammo's is bloated, but I hate yours even more. If you could do it like his and do all of the logistics internally, then it'd be cool. Seriously, as you were, let's compare them side to side with my suggestion:
Collapse Yours:
globals
    key CriticalHit
endglobals

function OnDamage takes nothing returns nothing
    if GetHandleProc(CriticalHit, GetEventDamageSource(), CritChance) then
        call DoCriticalHit()
    endif
endfunction
Collapse His:
globals
    integer array Chances
endglobals

function OnDamage takes nothing returns nothing
    if GetProc(Chances[GetUnitId(GetEventDamageSource())], CritChance) then
        call DoCriticalHit()
    endif
endfunction
I mean, I'm sold on the second.
Quote:
Originally Posted by grim001
With weighted procs, each successive event is slightly less random, until it actually becomes impossible for the same thing to happen too many times in a row. A high Weight value (0.75+) actually produces really similar results to "bonus damage every X attacks," except that you don't always know when the Xth attack will come up, so that it's not exploitable and maintains the appearance of being percentage based.
I wish I could emphasize enough how hard that sucks as a player. Turning critical strike into an effective "bonus damage every X attacks" is lame! As a player who appreciates randomness, you want the times where you get nothing and are like "Damnit, God hates me!" and then you want those streaks where you hit 5 times in a row with it and flip out at how awesome it was. Oftentimes, even your enemies go "Holy shit you lucky son of a bitch" and laugh about it. I mean, that's the best there is. Killing that is like taking away the fun of randomness altogether.
__________________
Home Page
DoE v1.14c Download
AotZ v2.03d Download
OD v0.10x Download

Coming soon eventually...

Personal To-Do List:
ICARUS
Aot3

WC3C Chat
Chat IP: 66.103.20.109
Earthbound 2 in English
vJass Manual

"DAMAGE_TYPE_POISON motherfucker!" ~Anitarf
Rising_Dusk is offline   Reply With Quote
Old 10-16-2009, 02:16 PM   #14
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,153

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

doesnt ammos script need a "chance array" for every proc type aswell ???

whats worse, hundreds of integer arrays, or hundreds of constant integers ?

And if something is already approved, which does the same thing, it shouldnt be necessary, that you argue if this script is useful or not. If you really think something like this is not necessary (My opinion clearly is, that it IS useful for some applications) you shouldnt have approved Ammo's script in the first place, but you didnt even mention your thoughts about weighted procs in Ammos thread.

This really makes you look biased IMO.



One example where i would use a weighted proc is for bosses of RPGs:

it really sucks if your whole party gets killed, only because the boss got 5-10 critical strikes in a row...

When you balance the healer, you would most likely take the average damage of the boss into account, so the healer of the party wouldnt be able to heal these massive ammounts of damage...
Of course you can balance the healer in a way that he CAN heal such crit' streaks, but then he would be too powerful when the boss doesnt crit that often.

For use in PVP applications, i think something like weighted procs arent that necessary. Even when i would use it for some special cases, i would choose a relativly low weight.
__________________

Last edited by akolyt0r : 10-16-2009 at 02:17 PM.
akolyt0r is offline   Reply With Quote
Old 10-16-2009, 02:56 PM   #15
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,726

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Quote:
Originally Posted by akolyt0r
doesnt ammos script need a "chance array" for every proc type aswell ???
Yes, it just requires that you manage the weights and the logistics yourself. If you abstracted that to within the system like Grim's script does, I think the chance array would be hella easier to use than the hashtable keys.
Quote:
Originally Posted by akolyt0r
whats worse, hundreds of integer arrays, or hundreds of constant integers ?
Hundreds of constant integers that can't be constants because you have to make sure you don't accidentally use the same value in different places in your map. If you just use a random constant integer for the key per proc type, you're bound to run into collisions and have no clue wtf is going on. That's why I would use a struct (integer stack) for it, so you'd never get collisions.

I'd much, much rather unituserdata. I mean, okay, I guess you can use unituserdata for grim's method too by just passing GetUnitId(MyUnit) as the key, but when that key recycles it has possibility for collisions as well. Hrm, I mean, I guess my way has the same problems. Lame. It's entirely possible that I didn't think this through and grim's actually right about having to use arbitrary integers. (Fuck)

The whole key business might actually be better since you could just use the spell's raw id for the integer and not have to use a struct. Well, fine, I agree, maybe this is the better way.
Quote:
Originally Posted by akolyt0r
you shouldnt have approved Ammo's script in the first place
I didn't, and were it up to me, it never would have been approved. I believe my only comment on the script was calling it cute and not wanting to pass judgment or some such and maybe some code feedback, since well, that's my job. Anitarf approved that one.

I clearly understand the purpose of this and that script, I just don't like it on a fundamental level.
Quote:
Originally Posted by akolyt0r
it really sucks if your whole party gets killed, only because the boss got 5-10 critical strikes in a row...
It sucks even more if you give the boss critical strike in the first place, since there are thousands of way cooler things he should be doing than getting random red number bonus damage packets on attack. But if you do have a random on-attack effect for a boss, really, if it procs ten times in a row, it's a hilarious way to lose. Furthermore, sounds like the players should put some distance between themselves and the boss, 'cuz he's pissed. :p

Anyways, whatever, I don't like what this does, but some other random mapmaker might think this is cooler than random numbers and want to use it. Great, fine, I still hate the unique key crap. See above.
__________________
Home Page
DoE v1.14c Download
AotZ v2.03d Download
OD v0.10x Download

Coming soon eventually...

Personal To-Do List:
ICARUS
Aot3

WC3C Chat
Chat IP: 66.103.20.109
Earthbound 2 in English
vJass Manual

"DAMAGE_TYPE_POISON motherfucker!" ~Anitarf

Last edited by Rising_Dusk : 10-16-2009 at 03:16 PM.
Rising_Dusk is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 09:14 PM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2014, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services