HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

ChainMissile system oppinion and help

08-01-2009, 10:57 PM#1
Flame_Phoenix
Hi guys, recently I develop a Chain Missile system that allows users to make known spells such as Frost Chain and Paralyzing Casks (from Dota) and many other things.
This system allows the user to customize most things such as the effect when hitting a target, the search algorithm and the movement algorithm (the last one, only if he wants).

I am happy with this system by many reasons, basing myself on Chain Lightning I was able to develop a new approach based on past mistakes, thus making a better system. It is also my chance to prove to Anitarf and Pyrogasm that they did the right thing by approving the spell and by helping me. I hope they also get happy with this modest and simple system.

So, now with the help of chobibo and other people, I've (finally) concluded the system. Basically, now I need an opinion from the user.
Also, I have a question:
1 - In my create method I receive a boolean value that tells me if the user has or doesn't have a custom moveMissile method. Is there a way to check if the user has moveMissile method in his code and then if he doesn't have it, to run the system moveMissile code? I just don't like that boolean value on the create method, but it does it's job well =P

Anyway, here is the code:
Expand JASS:

And what is a system without a demo map?
Here is one too =D

Hope you like it and give feedback too.
Attached Files
File type: w3xChainMissileSys 1.1.3.w3x (61.2 KB)
08-01-2009, 11:17 PM#2
chobibo
Quote:
Vodoo Chain
Paralyzing Casks

Collapse JASS:
.collisionSize *.collisionSize
Why not store the product initially instead of multiplying it to itself whenever you need its value?

There's an error on the tooltip of Frost Chain.

Nice system.
08-02-2009, 09:21 AM#3
Flame_Phoenix
Quote:
Why not store the product initially instead of multiplying it to itself whenever you need its value?
You say I should store collisionSize*collisionSize in a member and then use it ?? Well, I could do that, but then if the user changes the collision size of the missile while it is moving then I will have to update the variable and that will bring me more trouble.
Thx for the typo report.

Well, I am submitting it soon too, I just need to know how to fix that fly height thing =P
08-02-2009, 10:33 AM#4
Opossum
Quote:
Originally Posted by Flame_Phoenix
You say I should store collisionSize*collisionSize in a member and then use it ?? Well, I could do that, but then if the user changes the collision size of the missile while it is moving then I will have to update the variable and that will bring me more trouble.

Just overload that member:
Expand JASS:
08-02-2009, 01:08 PM#5
Anitarf
I think you should first try to make a properly working missile system and then try to build a chain missile system on top of that, if it turns out to be even worth it since once you have a missile system making a chain spell would be a piece of cake without the need for a special system.
08-02-2009, 01:42 PM#6
Tot
like your idea

but

1) finish one system, then start a new one

2)
Quote:
Collapse JASS:
//Because SquareRoot is a heavy operation, I avoid it by playing with "*"

*zzz*

nowadays not important

a normal calculator has a ~10kHz processor and takes not even a sec for it

a modern pc-processor has 2*3000000kHz --> takes nearly no time
08-02-2009, 02:20 PM#7
Flame_Phoenix
Quote:
I think you should first try to make a properly working missile system and then try to build a chain missile system on top of that, if it turns out to be even worth it since once you have a missile system making a chain spell would be a piece of cake without the need for a special system.
The system works and it is ended. I am just here to ask for an opinion before submitting it. If you can approve a nova system, I don't see why this can't be approved as well.

Quote:
Just overload that member:
I am aware of the operator syntax, in fact I use it in 2D3S. I just don't get your idea here.
Quote:
1) finish one system, then start a new one
Both systems are independent. Although they can be used together (and they will, which is why I am making them) making one system does not imply the need for the other. Besides Anitarf just spoted another bug on 2D3S with that evil array thing, I have to remake most Xefx and Lightning Modules.

Quote:
nowadays not important
Tell that to Anitarf and Pyro, they take efficiency with great importance when it comes to systems and spells xD
08-02-2009, 02:44 PM#8
Tot
Quote:
Tell that to Anitarf and Pyro, they take efficiency with great importance when it comes to systems and spells xD

efficient :thumb_up:
stupid efficiency :thub_down:

Root operations don't take nowadays not so much res, cause algorithm was improved
08-02-2009, 04:12 PM#9
Flame_Phoenix
Quote:
efficient :thumb_up:
stupid efficiency :thub_down:

Root operations don't take nowadays not so much res, cause algorithm was improved
Well, that is not something I will discuss (lol).
Anyway, any opinions on this before I submit?
08-02-2009, 04:55 PM#10
chobibo
I agree with Opposum with overloading the set method of collision size, saves 1 mul operation. I mean you're not using the collision size for anything else, just for checking distances, so it would be practical to just store the product rather than multiplying it every time you need to compare values.

I agree with F_P for not using Sqrt, the system will be using that function a lot, and that would lower the system's efficiency.

That's just my opinion.
08-02-2009, 05:34 PM#11
Opossum
Quote:
Originally Posted by Flame_Phoenix
I am aware of the operator syntax, in fact I use it in 2D3S. I just don't get your idea here.

That method overloads (replaces) the usual variable setting with a function.
So whenever someone uses set cm.collisionSize (cm being any ChainMissile instance) it will not directly set the member collisionSize but it will instead call the declared method. Not sure if it inlines though... probably not.
08-02-2009, 06:14 PM#12
Flame_Phoenix
Ahhh, now I understand your idea Opossum. I wonder why I didn't think of it before =P
Thx for the opinion chobibo.

before I submit, can anyone help me with the Z fly height formula for the missile ? The default move method doesn't take care of it, so the spell only acts on ground units. I had the formula, but it takes a unit and not an xefx object, so instead I have to set the fly height of the xefx object gradually as he approaches the target. However I am too dumb to find it out =S

EDIT EDIT EDIT


Ok guys, updated first post, keep your suggestions coming !
08-02-2009, 06:48 PM#13
chobibo
3D Math
That could help you.
08-02-2009, 08:27 PM#14
Anitarf
Quote:
Originally Posted by Flame_Phoenix
The system works and it is ended.
Quote:
Originally Posted by Flame_Phoenix
I can't get the formula to move the missile.Z of the project to the air unit gradually. Can you help me?
...
08-02-2009, 09:00 PM#15
Flame_Phoenix
Lol Anitarf .... my second quote is something "optional" (from my point of view) I would like to add. If I can't add it, I will still submit what I have, but until then, I will try to add it by every means necessary.
Quote:
That could help you.
Not really =S
Thx anyway.

EDIT EDIT EDIT

I found this on scrips section:

Collapse JASS:
function ParabolicMovement takes real h, real d, real x returns real
    local real a = -4*h/(d*d)
    local real b = 4*h/d
    return a*x*x + b*x
endfunction

This is sort of what I want, but without the parabolic movement thing and only until it reaches half ... Moyack seems really good with maths (so not like me xD ) maybe I should ask for his help, I bet this is piece of cake for him. What do you guys think?