| 10-11-2010, 01:11 PM | #1 | ||
Simple Knockback System
In this case a Knockback describes the translation of a unit over a several range, within a specific time, towards a given direction. The Simple Knockback System exactly supports this functionality plus the possibilty to add multiple KBs to the same target.What is that? Why simple?
Because it is a very tiny and simple system without any bonusfeatures like other KB-systems do support( f.e. destruction of destructables or KB-callback functions ).This system _ONLY_ supports the functionality mentioned before. Why doesn't it support all these bonusfeatures?
I thought about that quite a time and came to the final decision that i for myself don't need all that stuff. The mentioned features are imo special cases that are not needed in each map. And those who need them can easily include them to fit their own desires.Additionaly it keeps the code small and fast, since it doesn't need checks for deactivated features or unused features. Why should i use this system?
Since i couldn't find any KB system that fits my desires, i could motivate myself to write my own.I had used Rising_Dusk's system before but imo it hadn't intuitive parameters. As a user i want to define the range and the time need for a KB and not a startspeed and deceleration per second. I couldn't find out how to define f.e. a KB for range 500 within 1.25 seconds. Then i found a recently new system on inwarcraft.de which was written by kricz. This system had a lot of bonusfeatures, like callback functions, the possibilty of chaning the angle of the KB during the KB etc.. Since i didn't need all that functionality it would've been dumb imo to use it if i am not even using 50% of the possible features. Additionaly it needed an external library called Listmodule, that i haven't seen before and that i haven't used anywhere. I am no fan of importing libraries to my map that i'm not using myself, so this system didn't fit my purposes either. I checked out wc3c for other KB systems, but all of them had "mistakes" or were not supported with the "new" wc3 patch. So if you are searching for a simple to use system and are looking for a system like i did, use SKBS :) How to use it?
It only works if you have the JNGP. If you don't have it, you are screwed!It should be a standard by now for each mapper that tries to make "good" maps and i don't see any point in not having it. If you have the JNGP you'll need one more library, that is included in the map:
You may ask yourself, why i use an external library, when i blamed kricz's system before for the listmodule library. There is no real good alternative to TerrainPathability as far as i know. TerrainPathability doesn't create any objecteditor data and so it shouldn't be a problem for anybody to include/use it. KB needs accurate tile pathability checks and TerrainPathability does that for us. So why don't use it? Credits
And finally the code:
The testmap contains an example in GUI, to demonstrate, how easy it is to use it even in GUI. |
| 10-12-2010, 07:45 PM | #2 |
Wait, did you intend this to be a resource submission? If that is the case, the thread is posted in the wrong forum, however if you did not intend to submit the code to our resource section then there's nothing wrong with it being posted where it is, so I'll leave it here unless you request otherwise. |
| 10-12-2010, 09:30 PM | #3 |
hm thought i post it here first to get some feedback, suggestions, etc.. and if anyone thinks its good enough or worthy to become an "approved system" i m going to post it in the system forum(?). however if this is the wrong place for that, move it pls :) i m not familiar with the wc3c "forum structure". |
| 10-12-2010, 10:47 PM | #4 | |||
Like I said, there's nothing wrong with it being posted here, it's just the content of the post made me think you might have intended to post it as a resource submission. If you didn't, then everything is fine. Anyway, here are my comments: You should update your description along with the code. Right now, the description says knockback stacking is not supported, but the code does support it. The IsUnitKnocked function doesn't seem essential to the system. In a larger system, it would make sense to include it anyway along with other non-essential features, but in this simple system it seems unnecessary, especially because it adds the AutoIndex requirement (speaking of which, it wasn't really needed back when you had a limit of one knockback per unit, a global unit group could get the job done. Not that I'm suggesting you go back to that needless limit.) Quote:
Quote:
Quote:
|
| 10-13-2010, 06:29 AM | #5 | |||
Quote:
1) thx for the math 2) the disadvantage is imo, that the user has to calculate that by himself. "my" approach is more intuitive 3) afaik a comment in dusk's system says, that the deceleration must be higher then the startspeed, so your calculation may be correct, but it isn't correct for the system? i also know, that some people told me, that some of my knockbacks sometimes last forever/to long. that was maybe the problem of deceleration<startspeed that sometimes appeared. edit: i was using dusk's system in my maps Quote:
"// If a unit is already knockbacked, the new KB will be added to the current KB // so yes, KB stacking is possible. " but you are still right. there is still a part talking about timerutils that was already removed. fixing doko soon, and i remove the isunittype dead check during the KB, so if a unit dies during the kb its corpse will still be affected. Quote:
and since it is a simple counter inside the system and an inlined(?) return value for one function, i will keep it. |
| 10-13-2010, 11:28 AM | #6 | |
Quote:
I wouldn't make such a big deal out of this normally but since this is supposed to be a simple knockback system, I have to point out what I see as needless complications. |
| 10-14-2010, 07:23 AM | #7 |
*Update* changelog in first post |
| 10-15-2010, 03:40 PM | #8 | |
Quote:
[ljass]library ... requires optional AutoIndex ... [l/jass] static if LIBRARY_AutoIndex then ?? |
