wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 08-08-2008, 12:49 AM   #16
d07.RiV
User
 
d07.RiV's Avatar
 
Join Date: May 2008
Posts: 239

Submissions (1)

d07.RiV is on a distinguished road (10)

Default

It works 5-6 times slower than SetUnitVertexColor (u, red[i], green[i], blue[i], alpha[i])

Expand JASS:
__________________

Last edited by d07.RiV : 08-08-2008 at 09:51 AM.
d07.RiV is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 08-08-2008, 09:28 AM   #17
Toadcop
BuranX
 
Toadcop's Avatar
 
Join Date: Jul 2006
Posts: 1,887

Submissions (4)

Toadcop is just really nice (295)Toadcop is just really nice (295)

Approved Map: TcXSpell Making Session 10 Winner

Send a message via ICQ to Toadcop
Default

Quote:
even though you still haven't made any benchmark (have you ever done a benchmark?)
i know how much some operation takes time in different conditions and add them to have the needed result ? kind a intuitive calculation which was approved most times when i was benchmarking that stuff via StopWatch ? ...

Quote:
is barely 3 times
lol it's not 3 times =) i wrote AT LEAST 300% (4 times btw). don't use it as "official benchmark result".

Quote:
It works 5-6 times slower than SetUnitVertexColor (u, red[i], green[i], blue[i], alpha[i])
^ @ Vex see i knew that. btw i wrote my msg above before i read that post.

// intuition > all.

this system is almost the same as my TRSII item parser. is handly but do to much operations... but in my case only 1 time at intialization. but it's also somekind a fail... =\

"if you don't debug systems in real game conditions so it's theory" ehhh it's not about current script =)

btw there is a possibility to add plugins for JassHelper parser ? someting what could be done before your proccesings ? to add such support would be awesome.
__________________
Toadcop is offline   Reply With Quote
Old 08-08-2008, 11:41 AM   #18
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,080

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

That's a very theoretical benchmark. Here's something more practical for you to test, the two results should be much closer:
Expand JASS:
__________________
Anitarf is offline   Reply With Quote
Old 08-08-2008, 12:47 PM   #19
Toadcop
BuranX
 
Toadcop's Avatar
 
Join Date: Jul 2006
Posts: 1,887

Submissions (4)

Toadcop is just really nice (295)Toadcop is just really nice (295)

Approved Map: TcXSpell Making Session 10 Winner

Send a message via ICQ to Toadcop
Default

why should this func a new element ? could it not use a temp one ?
and why does it require 2 R2I to mix colors ?!
Collapse JASS:
    set a = ARGB.mix(clr21, clr22, factor) // typo... should be clr1 clr2
yeah reasembling 2 colors and do exact the same as the struct version should be really very close... T_T
lol shit coders...
__________________
Toadcop is offline   Reply With Quote
Old 08-08-2008, 11:55 PM   #20
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,080

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

There, I fixed the code. I'm still interested what the difference will be.
__________________
Anitarf is offline   Reply With Quote
Old 08-11-2008, 07:27 PM   #21
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

I still don't understand, can some one explain me why I should use this over SetUnitVertexColor() ??
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition

Last edited by Flame_Phoenix : 08-11-2008 at 07:27 PM.
Flame_Phoenix is offline   Reply With Quote
Old 08-11-2008, 07:31 PM   #22
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,080

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

The point here isn't in SetUnitVertexColour, but in the fact that you need 4 separate values to use that, which inflates your calibration functions a lot. Spells just look really ugly when half of their calibration section are just red/green/blue values for a colour. With ARGB, all those values are stored in a single integer, which is incredibly cleaner and results in better looking code.
__________________
Anitarf is offline   Reply With Quote
Old 08-11-2008, 08:57 PM   #23
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,905

Submissions (37)

Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)

Hero Contest #3 - 2nd Place

Default

Quote:
It works 5-6 times slower than SetUnitVertexColor (u, red[i], green[i], blue[i], alpha[i])
For all the things this does then I still think that's a very small factor. I'd say the most goes to the function call, since you'd still need a recolor function if used by-ref structs, then you probably have to test against


Collapse JASS:
function recolor takes integer x, unit u returns nothing
    call SetUnitVertexColor(u, RED[x], GREEN[x], BLUE[x],ALPHA[x] )
endfunction
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 08-11-2008, 09:37 PM   #24
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,269

Submissions (17)

moyack is a splendid one to behold (661)moyack is a splendid one to behold (661)moyack is a splendid one to behold (661)moyack is a splendid one to behold (661)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Ups!!!
moyack is offline   Reply With Quote
Old 08-12-2008, 09:56 PM   #25
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,080

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

The recolorUnit method doesn't really work, you should have tested this before approving it, moyack.

If I replaced it with this method, however, it did work:
Collapse JASS:
    method recolourUnit takes unit u returns nothing
       call SetUnitVertexColor(u,.red,.green,.blue,.alpha)
    endmethod
So some silly error must have been made when those functions were inlined.
__________________
Anitarf is offline   Reply With Quote
Old 08-13-2008, 02:23 PM   #26
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,905

Submissions (37)

Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)

Hero Contest #3 - 2nd Place

Default

It is odd, I reused some code from the thing I used in the Ancestral Guardian. Edit: One character errors FTL.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 08-13-2008, 02:52 PM   #27
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is a jewel in the rough (246)cohadar is a jewel in the rough (246)cohadar is a jewel in the rough (246)cohadar is a jewel in the rough (246)cohadar is a jewel in the rough (246)

Default

useless:
Collapse JASS:
    method str takes string s returns string
       return "|c"+i2cc[.alpha]+i2cc[.red]+i2cc[.green]+i2cc[.blue]+s+"|r"
    endmethod

useful:
Collapse JASS:
    method toString takes nothing returns string
       return "|c"+i2cc[.alpha]+i2cc[.red]+i2cc[.green]+i2cc[.blue]
    endmethod
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.
cohadar is offline   Reply With Quote
Old 08-13-2008, 02:59 PM   #28
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,905

Submissions (37)

Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)Vexorian has a reputation beyond repute (1060)

Hero Contest #3 - 2nd Place

Default

If you are going to use that |c you'll have to color some text anyway. toString would be more useful than that without the |c ,
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 08-13-2008, 03:49 PM   #29
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is a jewel in the rough (246)cohadar is a jewel in the rough (246)cohadar is a jewel in the rough (246)cohadar is a jewel in the rough (246)cohadar is a jewel in the rough (246)

Thumbs up

Actually no:

Collapse JASS:
call BJDebugMsg(red.toString + "ERROR: blah blah blah")

call DisplayTextToAll(gold.toString + "Player " + GetPlayerColor(GetKillingPLayer()).toString + GetPlayerName(GetKillingPlayer()) + gold.toString + "just pwned " + ... )
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.
cohadar is offline   Reply With Quote
Old 08-17-2008, 01:12 AM   #30
Szythe
User
 
Join Date: Sep 2006
Posts: 320

Submissions (3)

Szythe has a spectacular aura about (143)

Spell Making Session 11 WinnerSmiley contest 4th and 5th place.Mapping Contest Third PlaceSpell making session 08

Default

Please add some functionality for ease of coloring Lightnings. They use some weird 0. <= color <= 1. scale for coloring. And I think the alpha might be reversed.
btw, I love this script.
Szythe is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 12:11 AM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2014, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services