• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[System] Custom Projectiles

Level 18
Joined
Jan 21, 2006
Messages
2,552
Well as a general rule it would actually function smoother if you did use another timer, since the projectiles timer (in both our systems) is dedicated specifically for projectiles. No reason to clump up the timer with user actions.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Well, no, if you were to extend the projectile and add another instance timer you would use that timer to execute your loop actions. Have you actually bench-marked this? It's actually faster than calling the virtual method.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
What do you mean, the added z-distance?

Anachron said:
but it's not really useful for most of the users, since you have to do everything on your own.

Well you haven't really given any examples of this, there is no code or any real description of the problem you're having.
 
Well, no, if you were to extend the projectile and add another instance timer you would use that timer to execute your loop actions. Have you actually bench-marked this? It's actually faster than calling the virtual method.

I didn't say it wouldn't be faster, I just said it wouldn't be smoother. An onLoop function is a good thing, even if it makes it slightly slower.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Anachron said:
I checked the map again and it did not reset the added z distance.

Anachron said:
For example: Curved missile movement.

Okay, first you're saying something about resetting z distance and then you're saying curved missile movement. Arc works fine in my system, and without showing me any code you can't really say anything doesn't work you need to provide examples and show it not working.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I have made a significant update to the system, as well as having fixed up the test-map a little.

Library Updates
  • Improved the functionality of projectile time-scale. It now works perfectly and giving a time-scale of 0.00 will properly pause the projectile as if it were frozen.
  • Added an interface method isValidTargetUnit for filtering units that trigger unit-collision.
  • Added destructable collision as well as necessary constants, using a single rect that is moved/adjusted.
  • Added an interface method isValidTargetDest which functions similar to isValidTargetUnit.
  • Added method operators for retrieving the x/y/z coordinates of a given projectile.
  • Added a hash-table for projectile-groups to quicker reference to certain values. This may become more useful as projectile group implementation is updated.
  • Added the .toRemove option which functions like .toKill except it removes the projectile-unit.
  • Read header documentation for full change-log.
Test Map Updates
  • Improved the Time Slow ability (I believe it was named Slow before) such that projectiles within the invisible (no model/effect yet) "bubble" are slowed to 10% time-scale but retain their full speed once the bubble expires, or the projectile leaves the bubble-area.
  • Fixed certain implementation of projectile creation (before it was bugged, right?) so that it works properly now. In order to create a projectile that goes from point A to point B simply right-click when a unit is selected. One projectile is created per unit selected, so have fun.
  • Added the RangedAttack library which provides an example demonstration of how the projectile can be applied to mimic an in-game WarCraft III missile. The result is almost identical to a missile that would be launched by a ranged attack in-game.
 
Added an interface method isValidTargetDest which functions similar to isValidTargetUnit .
Excuse me, but what is the purpose of this? Isn't it enough to just give the user every unit/dest the missile collides with and he can pick whether to use them or not? This is useless.

The testmap updates are good.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Well you could argue what the point of triggers having both conditions and actions is too, but really there is no absolute necessity. It would be enough just to give the users the unit/destructible but I figured why not separate the conditions from the actions. It would make the resulting code easier to read/follow, and differentiates between the conditions (valid targets) and the actions, something that I think is common enough to be included.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
It's not slower than interfacing the onLoop method. I would think that projectiles specifically would benefit from having an interface method that clarifies, specifically, the conditions by which a target would be considered valid.

Anachron said:
Correct me but I don't think you really know the features you want/need in a projectile engine.

What do you want me to say? You're wrong? Or that no, you're right, and in fact I am not capable of fathoming what people may want in a projectiles system. How come you are so objective towards this library, is it because you are also trying to make a custom projectiles library?
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Fairly important update, I have corrected a mindless mistake that was made when implementing target following capabilities on projectiles. Once a projectile's target moved, the projectile move directly towards the target rather than maintaining its arc trajectory. I doubt anybody noticed this, but it's fixed now :p

Fixed a time-scale problem that would cause projectiles to be destroyed prematurely when their time-scale was adjusted for a projectile who's target is moving. Again, nobody probably noticed this, but necessary nonetheless!

Update (Version 1.6)
  • Fixed motion arc not being maintained when projectile target adjustments are made.
  • Fixed timescale issue on target-tracking projectiles.
  • Added a feature to the test-map (Projectiles1.6) to demonstrate target-tracking. Point orders will not have this feature, while unit targets will.
  • Added some tweaks to slow-time so the caster's projectiles are not slowed like other incoming projectiles.
  • Added a bubble model to slow-time that shows the area of effect a little more clearly.
  • Changed missile effect to Wind Rider so that the demo is more concise.
 
Last edited:
It looks cool. I was surprised how it doesn't run into the cliff when I shoot it from a cliff level. Nice job. =)

I don't have much comments on the code, but just letting you know that you still have the //! import in your map. (It should be replaced with the actual library, but you'd probably know that) Just a minor fix.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Bribe said:
Why don't you combine doLoopDestFilter with doLoopDestEnum?

I was not sure how well this would work, because the native that enumerates destructibles takes both a boolean expression and a code func; so if I were to combine one of them the other would be left blank. This actually has already been changed, I put null in the code and executed everything in the filter.

About the //! import thing. In the next update, 1.6b, I'll get rid of this so you don't have to track down the libraries yourself. I find it so neat that you can import code, though for some reason it never replaces the external call with the actual code in the map file. Even after closing/reopening it stays the same.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,467
So in your un-uploaded version you have this:

JASS:
call EnumDestructablesInRect(rct, Filter(function thistype.doLoopDestFilter), function thistype.doLoopDestEnum)

as this?:

JASS:
call EnumDestructablesInRect(rct,Filter(function thistype.doLoopDest),null)

I just think it's more efficient this way, I mean, not that it really matters the nanosecond difference or anything, but you really never need an isolated code to run some behaviours that could just be included in the filter itself.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Yea that's how I have it, and you're right it probably is more efficient in some way. I don't know exactly how destructible enumerations are done (since there are no destructible groups) but I can imagine that it would save a few steps if none of the destructibles were "actually" enumerated.

Also, by the way, it's been updated with 1.6b. I also included a manual in the first post for those who may need it.
 
JASS:
call SaveBoolean(table, this, p, true)
call RemoveSavedBoolean(table, this, p)
return HaveSavedBoolean(table, this, p)
Have you tested this? This will not work properly, I had the same issues before.

This will fix the bugs though.
JASS:
call SaveBoolean(table, this, integer(p), true)
call RemoveSavedBoolean(table, this, integer(p))
return HaveSavedBoolean(table, this, integer(p))

About the missing onLoop:
Makes this system pretty much useless.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,467
I have 150 units on my map all using time travel, and there are two seperate sub-structs receiving two seperate virtual "onLoop" methods from a 0.04 second loop (so 150*2 function calls per 0.04 loop plus the occasional requirements of the other struct) -- there no FPS drop even in the slightest. I think incorporating an "onLoop" is more than fine.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
It does it's job. That's the point. There is no reason the user needs to reference the projectile-timer, if a periodic is required then a timer can be added to the struct that will execute separately. I have experienced better performance excluding the control timer from the user interface and instead using a separately declared timer in a child-struct.

This is irrelevant though, this resource has been queued for submission for months without much feedback from azlier, it's mostly been you arguing with me over why your methods are better than mine. Pretty well every aspect that you consider a "feature" is just luggage that your system carries around with it. I have the sheer basics required to simulate an in-game projectile and enough control features to make it easy to use while still powerful; it doesn't need to include every possible feature known to man just to make it easier for the user. I doubt you even understand the concept behind modular coding.

Also, about the projectile group. The only time that is ever referenced is if you are using the inGroup method, that won't actually affect the enumeration of the projectiles into the group in any way. It's just an added table to eliminate having to loop through each element in the group to determine whether or not it contains a specific value.

About the hash-table thing. I am not having any problems with it, so I don't really know what you're talking about. When I put a debug-message out that tells me whether or not the projectile is in the group it returns the correct value, in the scenario that you stated and also before the boolean has been removed. In other words the cast to an integer is not necessary. Perhaps you have an out-dated version of JassHelper.
 
But have you noticed something?
Nobody would use this system as-it-is, everybody makes a second timed struct-based loop to do some more actions.

Why is that?
Because nobody uses a standard missile.

I know that you are having a fast and very neat system, however, it's not really useful since the users don't want a basic system where you have to do all of the stuff.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Anachron said:
however, it's not really useful since the users don't want a basic system where you have to do all of the stuff.

Anachron said:
Why is that?
Because nobody uses a standard missile.

I don't make systems for morons who are lazy and don't know how to do anything themselves. What I've done serves as a concise manner of allowing users control over projectiles that they would not normally have by hard-coding the motion of the projectile. This is what a projectile library is supposed to do.

Besides that, neither you, Anachron or YourNameHere are moderators and if all you're going to suggest is that I dumb it down for the idiots out their then save your suggestions.

YourNameHere said:
it's a pretty neat thing because you can use the basic system and insert some modules to it to add some functionality.

Using modules with inheritance from interfaces/structs can cause problems, and if I were to start plopping modules everywhere then I might as well start coding in cJass and write a whole list of stupid methods that do primitive actions because the dumb-half of my brain considers them useful. Please, I make systems like Knockback Lite for newbie users. If you're a newbie then chances are I don't really care whether or not you can operate the system. Also, Anachron, you tried mimicking my interface for your own system and now you're trying to show me that you know more about what I'm doing. I'm sick of all these fucking newbies here makes me want to go to wc3c.net.

And Anachron let's not forget how everybody at wc3c.net said that your system was a gigantic mess of crap; why on earth do you think I would want to start conforming to how you do things.

Anitarf said:
Anachron, your system is a bloated abomination.

And now you want me to start trying to mimic Anachron's layout like he mimicked my interface? Like for fuck's sakes people need to open up their fuckin' eyes. Anachron I didn't think you'd be posting back here it seems that you forget that my system out-performs yours, not to mention Anitarf refers to yours as a bloated abomination. I just love how you're hanging onto your stupid little arguments.

Neither of you are moderators, and I'm looking for moderator feedback because this has been pending for way too long without reason. Not having all possible user functionality is not something that should be holding this back from being an approved submission and just because Anachron disagrees with what I'm doing doesn't mean that he has any idea what he's talking about. I really don't want to have to get a second opinion from any of the guys over at wc3c.net, but I'm quite certain there is a reason you are ridiculed and scarce on those forums. Stop harassing me with these stupid little dinky module features that you're in love with and give me some real feedback. But oh, wait, nobody can cause nobody can even understand the fucking code. Jesus...
 
Level 11
Joined
Apr 29, 2007
Messages
826
Using modules with inheritance from interfaces/structs can cause problems, and if I were to start plopping modules everywhere then I might as well start coding in cJass and write a whole list of stupid methods that do primitive actions because the dumb-half of my brain considers them useful. Please, I make systems like Knockback Lite for newbie users. If you're a newbie then chances are I don't really care whether or not you can operate the system.

Now seriously, it was just a little suggestion to make all those people who can't handle your system shut up.
I like that you can make optional modules for users to easily add some functions, and I don't really see a problem with that.

Using modules with inheritance from interfaces/structs can cause problems
Didn't have any problems with that.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
YourNameHere said:
Now seriously, it was just a little suggestion to make all those people who can't handle your system shut up.

The only reason I'm pissed is because instead of being approved I'm being harassed by Anachron who constantly tries to one-up this.

YourNameHere said:
I like that you can make optional modules for users to easily add some functions, and I don't really see a problem with that.

Cool, but that isn't necessary for approval. If modules/scripts become available for this projectiles library I can add it but as of now it's been long over-due in the submissions section.

YourNameHere said:
Didn't have any problems with that.

Try having a struct extend an interface, and then implementing modules into the struct. Now extend the struct again with a new struct-type. The modules that were implemented for the parent struct will not always work properly for the child struct. Typically I think they do not work.

Not a huge problem, though most of the scripts I would release probably wouldn't be modules for the system. There are lots of ways of improving the public interface without having to use modules.
 
Level 11
Joined
Apr 29, 2007
Messages
826
The only reason I'm pissed is because instead of being approved I'm being harassed by Anachron who constantly tries to one-up this.
Okay. Or not okay to be exact. D:

Cool, but that isn't necessary for approval. If modules/scripts become available for this projectiles library I can add it but as of now it's been long over-due in the submissions section.
Well it isn't needed for approval, but where's the bad side at adding them anyway? It will just give them more reasons to approve it. (Or more reasons to not approve it..)

Try having a struct extend an interface, and then implementing modules into the struct. Now extend the struct again with a new struct-type. The modules that were implemented for the parent struct will not always work properly for the child struct. Typically I think they do not work.
I've never tried that to be honestly, but it seems more like a problem with a system like this where extending it isn't a bad idea in general.

Not a huge problem, though most of the scripts I would release probably wouldn't be modules for the system. There are lots of ways of improving the public interface without having to use modules.
Fine.
 
Also, Anachron, you tried mimicking my interface for your own system and now you're trying to show me that you know more about what I'm doing. I'm sick of all these fucking newbies here makes me want to go to wc3c.net.

And Anachron let's not forget how everybody at wc3c.net said that your system was a gigantic mess of crap; why on earth do you think I would want to start conforming to how you do things.
Honestly, go to wc3c.net where all the arrogant tools are dying in their busyness with their great reallife and let us alone here then. This is not wc3c.net.

Also I am trying to help, which you do not seem to like. To bad, I thought you'd be a good coder.

Seriously, I don't care about the people at wc3c.net, they are all more or less arrogant (with a few exceptions) and they have never checked out how smooth and flawless my systems run. So don't build your resume without even checking what I've done.

And now you want me to start trying to mimic Anachron's layout like he mimicked my interface? Like for fuck's sakes people need to open up their fuckin' eyes. Anachron I didn't think you'd be posting back here it seems that you forget that my system out-performs yours, not to mention Anitarf refers to yours as a bloated abomination. I just love how you're hanging onto your stupid little arguments.
Same as you stick to your stupid arguments.

Neither of you are moderators, and I'm looking for moderator feedback because this has been pending for way too long without reason. Not having all possible user functionality is not something that should be holding this back from being an approved submission and just because Anachron disagrees with what I'm doing doesn't mean that he has any idea what he's talking about. I really don't want to have to get a second opinion from any of the guys over at wc3c.net, but I'm quite certain there is a reason you are ridiculed and scarce on those forums. Stop harassing me with these stupid little dinky module features that you're in love with and give me some real feedback. But oh, wait, nobody can cause nobody can even understand the fucking code. Jesus...
Chill dude, you are totally wrong here. This is not wc3c.net, this is hws.
We don't troll or harass here, we are trying to help.

At wc3c.net you would need even longer to get a resource approved, so why on earth do you think this should be approved so fast?

Besides, wc3 is dying.

And now for the love of god, if you don't like the way we code, just leave this site.
Every site has it's own style (& scripts).
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Anachron said:
Honestly, go to wc3c.net where all the arrogant tools are dying in their busyness with their great reallife and let us alone here then. This is not wc3c.net.

Everybody who has more experience than you tells you you are wrong. What does that tell you? You're wrong.

Anachron said:
Also I am trying to help, which you do not seem to like. To bad, I thought you'd be a good coder.

First of all, trolling me on my coding practices is not trying to help. Second of all, you don't know what good code is. The reason you hate wc3c.net so much is because all of the bull-crap you make up in your head doesn't fly there while on here you can pull things out of your ass without anybody calling it out.

Anachron said:
Seriously, I don't care about the people at wc3c.net, they are all more or less arrogant (with a few exceptions) and they have never checked out how smooth and flawless my systems run. So don't build your resume without even checking what I've done.

Right, so now you're just being objective and disallowing any disagreement. All your going to do when I present you with evidence that you're wrong is tell me that they don't know what they're talking about. If you seriously believe that you know more about modding WarCraft than Anitarf then you're only proving my point.

Anachron said:
Same as you stick to your stupid arguments.

Except I'm not coming into your thread telling you that you should make everything in your system more like mine.

Anachron said:
Chill dude, you are totally wrong here. This is not wc3c.net, this is hws.
We don't troll or harass here, we are trying to help.

Dude there are pages of your harassment earlier in this very thread, not to mention your little "To bad, I thought you'd be a good coder" comment. At no point did I ever start telling you that you should make your system more like mine because my way of doing things is better, as you have done on numerous accounts here. Not to mention that you copied your user interface from my result.

Also, this isn't wc3c.net but that doesn't mean that nothing from that site is credible information.

Anachron said:
At wc3c.net you would need even longer to get a resource approved, so why on earth do you think this should be approved so fast?

This has been pending for almost 4 months. I've submitted resources to wc3c.net that have been approved in a couple of weeks most.

Anachron said:
Besides, wc3 is dying.

Irrelevant.

Anachron said:
And now for the love of god, if you don't like the way we code, just leave this site.
Every site has it's own style (& scripts).

What do you mean, the way we code? You're only one person, Anachron, you do not speak for the entire community of The Hive Workshop. Also, you're the only one I am having a problem with, and you're the only one who requires me to quote members of wc3c.net because otherwise you'll just come around my thread posting irrelevant or untrue garbage in this thread.

Anachron said:
Every site has it's own style (& scripts).

Funny because I see a whole crap-ton of systems that are originally hosted at wc3c.net that are now hosted here on The Hive Workshop.

Post #1

http://www.hiveworkshop.com/forums/1518640-post3.html
========================================================================

"And still, why do you also work on a missle engine now? You are free to help me with mine"

This pretty much sums up the rest of what I am about to say, because this comment pretty much shows how obvious it is that your comments are nothing more than an attempt to try and de-moralize me in trying to create a projectile library.

"Way too complicated"

Absolutely no information given. Real helpful Anachron.

"Private variables shouldn't have a pre with 'priv_'"

Again, irrelevant and useless, not to mention it's just bullshit you pulled from your ass.

"Due to the above points, your engine is not really able to handle a lot missles."

It does and always has handled more projectiles than your system, not to mention none of the points you mentioned above would affect the performance most of them are features and interface suggestions.

"You should use stub methods to allow the user to run defined actions on collide, touch, etc."

Funny how you ended up copying MY interface after saying this.

"You have tons of variable settings & gettings in the loop method, which isn't necessary be used."

Funny because at the time you said this I had the bare minimum and you had a bloated amount. This entire post was trolling/harassment.

Post #2

http://www.hiveworkshop.com/forums/1518997-post6.html
========================================================================

"No it's not and honestly, you shouldn't do that. Just because you can doesn't say you should."

This was in response to me saying that I can name my variables whatever I want. Enough said.

"That's nothing compared to the hell of variables you set ever and every again. Check my Loc struct which does a lot of great stuff for me."

I love how you tell me that I have too many sets/gets and then you go ahead and tell me that you use a library which only slows down your sets/gets since it requires function calls. Clearly you had no idea what you were talking about then.

Post #3

http://www.hiveworkshop.com/forums/1519841-post16.html
========================================================================

"Berbanog, this is maybe offtopic, but why does your eventHandler work and mine not? I have it exactly like yours now, but I get a parse error. (JassHelper wants to have the methods that take something in the parent struct). Why? "

And then you go ahead and ask me for help after all your dumb, unfound criticism. I don't think I have to continue.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I've asked you to leave me alone before and you accused me of trolling. For fuck's sakes just unsubscribe I would prefer it, you've done nothing but present irrelevant information that you've pulled out of your ass to try and show how your system is superior in some way. I've supplied an ample list of quotes that are examples of just how stupid your presence in this thread has been ever since it was started.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,467
About the noobies wanting to use the system, Berbanog, I think that's not a bad idea, because most people here are total noobies.

Anachron, really, stop generalizing "everyone" follows a certain method. That is a total made-up excuse, one that is completely unfounded. I don't want a fucking onLoop method for a missile, but I do want the missile so that I can tell it to damage the target when it reaches its mark.

I use Berbanog's missile system because I've learned a ton from it because it's so rich with content. I've tried reading your codes for many spells and you use the most obscure methods of doing things. It's a pain to try to read that kind of coding. Your codes are not noobie-friendly.

Berbanog, just ignore him and he hopefully won't keep making snide quips at your system.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Bribe said:
About the noobies wanting to use the system, Berbanog, I think that's not a bad idea, because most people here are total noobies.

But it doesn't mean everything should be dumbed way down for them. Nothing quality is produced with morons in mind.
 
Level 15
Joined
Jul 6, 2009
Messages
889
I don't want missiles go underground. I wanted in the testmap the Footman have height of about 500 and then shoot their spears directly below them. But that is an instant missile.

I am probably wrong but anyways

In the doLaunch method;
set d = SquareRoot((finish.x-start.x)*(finish.x-start.x) + (finish.y-start.y)*(finish.y-start.y))

That factors ground distance only. :( The following line will than set the time left to 0.00 = instant. :(
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
No two units are ever going to be directly on top of each other. Either way, I only set it this way because I thought that's how WarCraft III missiles work. If you have two units that are directly on-top of each other, I'm pretty sure you won't be able to see their missiles.
 
Top