1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Snippet] [Needs work] Projectile Utils

Discussion in 'Graveyard' started by Bribe, Aug 24, 2010.

  1. Switch33

    Switch33

    Joined:
    Dec 3, 2006
    Messages:
    334
    Resources:
    0
    Resources:
    0
    Are you working on the bounce type projectile script anytime soon? Cause i tried to create one using this before and kind of failed(Something about not knowing how to launch another missile to figure out bounces).
     
  2. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,121
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    I am working on a script which will include a much better way of doing everything, plan to release it within a few days.
     
  3. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,121
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Moved the initializer to a module and made some touch-ups. This is fully compatible with the new Table library so that didn't need to be updated.

    A bouncing projectile module is yet to come, I'm afraid I just haven't had the time to work on that.
     
  4. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,121
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Updated to fix an initialization bug.
     
  5. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    Well, this is in need of an update.
     
  6. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    The whole idea of bouncing the projectile is quite simple:

    Code (vJASS):
    struct bouncingprojectile extends projectile
        private integer bounces = 0
       
        method onFinish takes nothing returns nothing
            if (bounces > 0) then
                set bounces = bounces-1
                // find new target
                // designate target vector (start vector can use position, I believe)
                call launch(position, newEndVector, speed, arc)
                if (bounces == 0) then
                    set toDestroy = true
                endif
            endif
        endmethod
       
        static method create takes unit u, integer bounces returns thistype
            local thistype p = allocate(u)
            set p.bounces = bounces
            if (bounces > 0) then
                set p.toDestroy = false
            endif
            return p
        endmethod
    endstruct
     
  7. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,121
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    I moved this back to Submissions because I don't have time to work on it and this will help me to remember to work on it when I do have time.

    I might just end up writing my own projectile system anyway, which doesn't run of vector (because it has not reason to, it just adds weight of additional array reads).
     
  8. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    I can't wait for this to get updated :p
    Kenny's Projectile System is quite cumbersome, uses AIDS, has VERY BAD documentation, uses T32, and the rest are libraries that no one uses... (Linked List Module)
    Plus, it uses a group handle when it could use a simple Table...
    Also, there's tons of shitcode..
    Oh and the API is as bad as AIDS' >_>
     
  9. Dirac

    Dirac

    Joined:
    Jun 20, 2011
    Messages:
    249
    Resources:
    3
    JASS:
    3
    Resources:
    3
    Looks like a proper, straight-to-approval resource on the helper.
     
  10. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    haha :p
     
  11. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    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.
     
  12. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,121
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    However I don't see you using any of the vector operations any more ;)

    So this time you can get away with less ;)

    Array reads are quite heavy operations, I have noticed a significant FPS loss just by using delegates instead of normal extended structs.
     
  13. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    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.
     
  14. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,121
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    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?
     
  15. Berb

    Berb

    Joined:
    Jan 21, 2006
    Messages:
    2,539
    Resources:
    2
    JASS:
    2
    Resources:
    2
    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?

    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.

    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.
     
  16. Nestharus

    Nestharus

    Joined:
    Jul 10, 2007
    Messages:
    6,146
    Resources:
    8
    Spells:
    3
    Tutorials:
    4
    JASS:
    1
    Resources:
    8
    graveyarding

    way the heck outdated and last update was almost 2 years ago

    let me know if you plan on updating this, we can move it back into submissions ; )


    this could stand to see a lot of improvements, like using GetUnitCollisionn in order to determine the launch point, etc
     
  17. freesouthkorea

    freesouthkorea

    Joined:
    Jun 23, 2018
    Messages:
    8
    Resources:
    0
    Resources:
    0
    it would be nice if you could edit the max height the projectile reached during flight. You can't already, can you?