• 🏆 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!

[Snippet] [Needs work] Projectile Utils

Level 18
Joined
Jan 21, 2006
Messages
2,552
(because it has not reason to, it just adds weight of additional array reads)

You might as well just inject the machine code directly into Warcraft and then get everybody to download your client. That is the most efficient way, and if you're worried about array look-ups I cannot see why this wouldn't be your only course of action. The reason for using vectors is purely mathematical potential.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I have used them in the past, frequently. There is a lot of neat things you can do with projectiles using vector mathematics that are no where near as intuitive when only using Cartesian coordinates. I've actually got a few spells that I was going to put into the test-map for the projectiles library that use some of these operations. When you actually use the projectile library to make things like spell projectile effects the use of the vector library becomes more common. Simple projectiles obviously only require simple math.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Then the user can use vectors for their own operations, but you don't have to make your system use them internally because arrays add a lot of weight. You have just been testing on the wrong computer to notice this.

Your argument "only bums spend <$500 on a computer" is incredibly flawed and malignant. Money is an amount relative to the person who is wielding it, many people are working on a budget and that $500 is put to better use paying rent for the apartment or for 1-2 months worth of food. Not to mention any other expenses like electricity, phone/Internet, clothes, etc.

$500 goes a very long way. And to spend that kind of money you have to have a need for spending it. We found a computer that was within budget and it was what we needed. Why pay lots more money only for the benefit of running your projectile system as well as you can?
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Your argument "only bums spend <$500 on a computer" is incredibly flawed and malignant

That's not an argument, it's just a statement. If you disagree that's fine, I was not really being serious when I said that. I would not have feelings either way. If you're going to take it literally though, a bum doesn't really buy a computer now does he? The amount of $500 is obviously something which a bum does not have as disposable cash. How could you take this seriously?

You have just been testing on the wrong computer to notice this.

Well it's not the wrong computer. It's a computer with slightly better than average specs. There are people out there who consider my computer below average. Though this is not the first computer I've tested this on. When I made the projectiles system, I was using my MacBook Pro from 2006. I did not notice a few array look-ups being any more problematic on either computer.

Then the user can use vectors for their own operations, but you don't have to make your system use them internally because arrays add a lot of weight. You have just been testing on the wrong computer to notice this.

Yea that's true they could do their own vector operations and pass real variables to the function/method. I just like the interface of using 2 vectors instead of 6 real variables. If you look at the system, there really isn't any use of the vector library other than the type itself; I included it because I liked the idea of correlating projectiles and vectors.

What I should do is have projectile settings where more complicated projectile patterns are used, rather than simply the standard speed/arc. It makes more sense to do this kind of thing with a physics system though. I suppose as a simple projectiles library there isn't really any need to delve into vectors whatsoever.

Perhaps I will try removing the vector requirement and replacing the vectors with an onslaught of real members. If you insist that doing a FirstOfGroup loop is faster, perhaps I will also give that a shot and see if it aids projectile/unit collision at all. If not then I would rather utilize the creation of the extra threads as a surefire way of preventing operation limits (being hit).

Haha you have got me confused about these threads now, Projectile Utilities and Custom Projectiles.
 
Top