HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

vjAssistSYS

02-27-2009, 09:02 PM#1
akolyt0r
Background:
I was in need of an Assistance System which could handle multiple Heros/Units per player.
Since i havent found any good system which achieves that, i made this.

Requirements:
Details:
  • This System can handle multiple heros/units per player
  • Highly customizable
  • Uses one Timer per Hero/Unit supervised by this System
  • This does not handle any bounty stuff, but that can easily be achieved with the provided functions.
  • Easy to import, since it uses vJass


ChangeLog

v1.0 - System submitted for critique and suggestions
v1.0 - TestMap and Screenshot added
v1.1 - uses UnitIndexingUtils now, however can be easily changed to use some other Indexing/Attachment-System
v1.2 - added AssistUnit.UnRegister method, and fixed a possibly critical bug.
v1.25 - restructured some code, renamed library to "jAssyst" (shorter), now uses one death event for all units (damn forgot to change this in v1.1)
v1.3 - added a version which uses a DamageDetectionSystem (LLDD), exchanged ARGB with GetPlayerColored, some minor code optimizations
v1.31 - added a "SpellBonus Module", for registering assists for spells which dont deal damage aswell.
v1.32 - added functionality to automatically unregister registered units upon death (for non hero units only, new requirement: TimerUtils)
v1.40 - added support for IDDS and ADamage, users can now choose which DDS they want to use.
v1.41 - moved the DamageDetection Support to an extra optional Module.
v1.42 - changed implementation to 1 timer per AssistUnit and fixed a minor bug, and fixed some constants of the configuration, which were set to really bad values.
v1.50 - improved performance (by using a much higher timer timout, without _any_ loss of accuracy), made the automatic unregister function less error prone.

Expand jAssyst 1.5:
Expand jAssyst SpellBonus Module:
Expand jAssystModule DamageDetect for LLDD:
Expand jAssystModule DamageDetect for IDDS:
Expand jAssystModule DamageDetect for ADamage:



INFO:
Map contains libraries (TimerUtils,Table,IDDS*,GetPlayerNameColored*) for WC3 versions below 1.23b and 1.23b and above.
If you use 1.23 or below, you have to disable the newer libraries and enable the ones in the 1.23 folder.

*: 1.23b versions of IDDS and GetPlayerNameColored are no official releases, yet.
Attached Images
File type: pngvjAssistSYS..png (215.7 KB)
Attached Files
File type: w3xjAssyst_v1.5.w3x (109.8 KB)
03-01-2009, 11:34 PM#2
akolyt0r
Updated (v1.1)
Quote:
v1.1 - uses UnitIndexingUtils now, however can be easily changed to use some other Indexing/Attachment-System

will update Testmap later..

EDIT: Do you think i should add a UnRegister method ? ..i cant think of a map which would need it ...
03-03-2009, 05:02 AM#3
DioD
ofc you MUST unregister gone units...
03-03-2009, 09:09 AM#4
Tyrande_ma3x
Wouldn't this count assists from dummy units as well?
03-03-2009, 10:29 AM#5
akolyt0r
Quote:
Originally Posted by Tyrande_ma3x
Wouldn't this count assists from dummy units as well?

when you register them with call AssistUnit.Register(youdDummy) ...of course ...but why would you do that ...

Quote:
Originally Posted by DioD
ofc you MUST unregister gone units...

Hmm maybe you are right ...even though you would only need that functionality when you use this system for normal units aswell ...and not just heroes ...and that would be the most common application for this.
Well ..i will add a UnRegister method .... since i use UnitIndexingUtils now ..i dont even need a O(n) operation ...Good Thing.
03-03-2009, 12:43 PM#6
akolyt0r
OK added the call AssistUnit.UnRegister(youdDummy)-method ...

Currently still leaks the 2 triggerevents (death/damaged)...is it safe to remove them ?!
03-03-2009, 12:48 PM#7
Anitarf
You should use a damage detection system and a generic unit dies event. In fact, players should be able to define themselves what counts as an assist, it shouldn't be hardcoded to only count damage. What constitutes an assist should be up to the users to decide and as such, damage detection shouldn't even be required, it should be an optional module like any other assist condition (although it likely will be used the most).
03-03-2009, 01:25 PM#8
akolyt0r
yeah generic death event is no problem ... in a earlier version (not released) ..it was a problem though ( would have needed a O(n) operation)...

Hmm you mean i just create a "RegisterAssist(assistingplayer, unit)" method... and then the user can call it whenever he wants to ?...
+ a additional module which does that automatically for damage events ?!

As a matter of fact i dont want to use a damage detection engine ...(i dont need register damage for all units ..only for the ones monitored by this system) ..
What i could do however is to make it easy to make the registerdamage-module use a damage-detection engine ...

EDIT: Damn ..if i dont want ugly code, AND a external registerdamage-module ...i HAVE to use a damage detection engine ..

EDIT2: v1.25 now uses generic death event. I dont think i will do change the damage stuff ... since nearly everybody who wants to use such an Assistance System wants register damage as Assist ....
Maybe i will add a basic spell-assist-module ..to register spells which deal no damge (e.g. hex ...) as assists aswell..
BTW: added 2 functions:
Expand JASS:
03-16-2009, 09:03 PM#9
Anitarf
What happens if I register a unit, then unregister it and after some time register it again? Specifically, what happens with the damage detection?

It's because of shit like this that I'm saying you should use a damage detection system.
03-16-2009, 09:07 PM#10
akolyt0r
Quote:
Originally Posted by Anitarf
What happens if I register a unit, then unregister it and after some time register it again? Specifically, what happens with the damage detection?

It's because of shit like this that I'm saying you should use a damage detection system.

Ok i will make another version using a DDS ...
But for most uses uses (heroes) this should already be sufficient

Also i would need a simple color library (something like GetPlayerColorString(player) ..blabla).... ARGB is really overkill for this, but i havent found any fitting thing in the ressource section ..

EDIT: Damn ..just found http://www.wc3c.net/showthread.php?t=101692
03-16-2009, 09:32 PM#11
Anitarf
Quote:
Originally Posted by akolyt0r
Ok i will make another version using a DDS ...
But for most uses uses (heroes) this should already be sufficient
Sufficient or not it is too error-prone for our resource section.

Quote:
Also i would need a simple color library (something like GetPlayerColorString(player) ..blabla).... ARGB is really overkill for this, but i havent found any fitting thing in the ressource section ..
I think the system could benefit from more modularization. The user interface code that handles game messages and bounties could easily be a separate library from the assistance tracking code.
03-16-2009, 10:11 PM#12
akolyt0r
Updated...i use a DDS now ... i chose LLDD, since it minimalism suits my needs perfectly...

Quote:
Originally Posted by Anitarf
I think the system could benefit from more modularization. The user interface code that handles game messages and bounties could easily be a separate library from the assistance tracking code.

i dont like to do anything like this without a "friend" keyword ....would get pretty ugly.

EDIT: btw could you change the thread title please... i changed the name of this system a while ago to "jAssyst" ..(yeah ...even shorter ...assist is a fun word to play around with ;)
03-16-2009, 11:01 PM#13
Anitarf
Quote:
Originally Posted by akolyt0r
i dont like to do anything like this without a "friend" keyword ....would get pretty ugly.
What are you talking about?
03-17-2009, 07:00 AM#14
akolyt0r
Quote:
Originally Posted by Anitarf
What are you talking about?
well since you cant use private functions of other libraries without a friend keyword... or something like that.
Well whatever i actually think that an additional library for the messages would not improve this system ...
03-29-2009, 05:20 PM#15
akolyt0r
Quote:
Originally Posted by CHANGELOG
v1.31 - added a "SpellBonus Module", for registering assists for spells which dont deal damage aswell.
v1.32 - added functionality to automatically unregister registered units upon death (for non hero units only, new requirement: TimerUtils)
updated, see first post.