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 > Samples
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 10-02-2006, 08:44 PM   #1
Waldbaer
Dragonblood Creator
 
Waldbaer's Avatar
 
Join Date: Nov 2003
Posts: 73

Submissions (3)

Waldbaer will become famous soon enough (37)Waldbaer will become famous soon enough (37)

Default Jump System

Hello!
This System is not very complicated or very big, but I think it's nevertheless quite useful. It offers the following features:
- Makes units jump with a single line of code
- Realistic flying curve in all situations (also if you jump e.g. over a canyon)
- Full multiinstanceability
- English and German Tutorials, also for people new to JASS

Have fun and post your comments either here or in the according forum on my site.

EDIT8: Update 12/22/07 Version 2.0.1: Performance improvements; for more information read the included Version History
EDIT7: Update 01/21/07 Version 2.0: Added the function DCJS_Bounce; the Jump functions now also work correctly with a unit starting the jump in the air; major performance improvements; bugfix; detailed Version History included from now on
EDIT6: Update 11/23/06 Version 1.1: Added the functions DCJS_JumpSpeed, IsLocPathable and GetNearestPathableLoc
EDIT5: Update 10/16/06 Version 1.05: Removed a minor configuration possibility that did not work as described
EDIT4: Update 10/14/06 Version 1.04: Again some technical advancements
EDIT3: Update 10/10/06 Version 1.03: Memory leaks fixed, finally I hope.
EDIT2: Update 10/7/06 Version 1.02: Additional performance advancements
EDIT: Update 10/5/06 Version 1.01: Memory leaks fixed.

Note: The old version 1.1 is still available for download because its code is easier to read and to understand
Attached Images
File Type: jpg JumpSystem.jpg (12.8 KB, 2054 views)
Attached Files
File Type: w3x DCJumpSystem11.w3x (98.8 KB, 858 views)
File Type: w3x DCJumpSystem201.w3x (109.6 KB, 1450 views)
__________________

Last edited by Waldbaer : 12-22-2007 at 12:33 AM. Reason: Update
Waldbaer is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 10-02-2006, 08:58 PM   #2
The)TideHunter(
SpeakerGames.com
 
The)TideHunter('s Avatar
 
Join Date: Mar 2006
Posts: 1,328

Submissions (1)

The)TideHunter( is a jewel in the rough (160)The)TideHunter( is a jewel in the rough (160)

Send a message via MSN to The)TideHunter(
Default

Dosent look to bad atall, goodjob on it :).
__________________
Big plans...
The)TideHunter( is offline   Reply With Quote
Old 10-02-2006, 10:33 PM   #3
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Well, as neat as it is..

We have this testmap and this test map for jumps in jass and gui.
I don't think it does any good to have 3 of the same things in our database.
__________________

Last edited by Rising_Dusk : 10-02-2006 at 10:33 PM.
Rising_Dusk is offline   Reply With Quote
Old 10-03-2006, 12:17 AM   #4
Waldbaer
Dragonblood Creator
 
Waldbaer's Avatar
 
Join Date: Nov 2003
Posts: 73

Submissions (3)

Waldbaer will become famous soon enough (37)Waldbaer will become famous soon enough (37)

Default

This is something quite different to the two maps you mentioned:
1. This is not a spell. It's intention is completely different, it's a rough jump you can base spells on or you can use in cinematics. You don't have to edit anything to kill special effects you don't need.
2. Neither the first nor the second map has the feature of parabolic jumping ignoring the terrain between start and finish of the jump. It's impossible to get a parabolic jump over a canyon with one of these spells. My system has this feature implemented, you don't have to care for anything anymore, just write call DCJS_Jump(....) and the unit will jump in a realistic way to whereever you want. I'd suggest the makers of these two spells to implement my system!
__________________
Waldbaer is offline   Reply With Quote
Old 10-03-2006, 07:48 AM   #5
Jazradel
Superuser
 
Jazradel's Avatar
 
Join Date: Dec 2005
Posts: 651

Submissions (1)

Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)

Send a message via AIM to Jazradel Send a message via MSN to Jazradel
Default

Adding basic support for terrain is a great idea. I would add it when I get home, but I can't be screwed.

Nice cinematic by the way, and a clever idea using a repeating trigger and a group.
__________________


Table:
Jump Map
Point System
Warcraft III Model Archive

W3 Model Archive should be available from https://www.mediafire.com/folder/cd5..._III_Resources, PM me if it doesn't work.

Last edited by Jazradel : 10-04-2006 at 05:03 AM.
Jazradel is offline   Reply With Quote
Old 10-10-2006, 07:15 PM   #6
blu_da_noob
Nonchalant
 
blu_da_noob's Avatar


Respected User
 
Join Date: Mar 2006
Posts: 1,933

Submissions (2)

blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)

[Quicksilver #2] - 2nd Place[Quicksilver#1] 1st place

Send a message via MSN to blu_da_noob
Default

You should still be setting DCJS_GC() to a local gamecache variable instead of calling it so many times in each function (function calls are slow in jass).

Quote:
I read about a gamecache limit of 256 some time ago and feared that it was not possible to store more than 256 values and wanted to save gamecache space, so I computed it new every time. But with a simple test (34 units jumping at once) I figured out that this works as well so I'll compute it only once now and then save it in game cache, too. What is this limit about, actually?
That 256 limit is not relevant here. You are still computing Sin/Cos each iteration which is unnecessary and very process expensive. Save the Sin/Cos values.

Quote:
Thanks also for the tip with destroying the unitialized variable - I didn't know this, too and it did not seem to have any effect. Well, now I initialize it with Location(0,0) and the problem should be solved.

You don't need to create a location for it, just assign it a value of null (it just mustn't be left undeclared).

call FlushStoredMission( DCJS_GC(), I2S(H2I(u))) Could just be:
call FlushStoredMission( DCJS_GC(), s)//you already have the string declared to that value
That should be the last I think.
__________________
blu_da_noob is offline   Reply With Quote
Old 10-10-2006, 07:22 PM   #7
Captain Griffen
Dread Lord of the Cookies
 
Captain Griffen's Avatar


Content Director
 
Join Date: Sep 2003
Posts: 5,375

Submissions (2)

Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)

Approved Map: Warlords[Quicksilver #2] - 1st Place

Default

Blu - I doubt a GC call will be any more efficient than getting Cos/Sin. Pipe says Cos/Sin are inexpensive (presume it has a list already worked out).
__________________
Quote:
Originally Posted by Earth-Fury
Griffen is correct, you are not.
Quote:
[13:32] <Akolyt0r> hmm.. stil i want to have some unused women
Captain Griffen is offline   Reply With Quote
Old 10-10-2006, 08:08 PM   #8
blu_da_noob
Nonchalant
 
blu_da_noob's Avatar


Respected User
 
Join Date: Mar 2006
Posts: 1,933

Submissions (2)

blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)

[Quicksilver #2] - 2nd Place[Quicksilver#1] 1st place

Send a message via MSN to blu_da_noob
Default

It's still 3 vs 2 (GC for angle then cos/sin, versus getting cos/sin from GC). *shrug*
__________________
blu_da_noob is offline   Reply With Quote
Old 10-10-2006, 09:02 PM   #9
Captain Griffen
Dread Lord of the Cookies
 
Captain Griffen's Avatar


Content Director
 
Join Date: Sep 2003
Posts: 5,375

Submissions (2)

Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)

Approved Map: Warlords[Quicksilver #2] - 1st Place

Default

Ahh. That's possible different then. Have to benchmark it to be sure.
__________________
Quote:
Originally Posted by Earth-Fury
Griffen is correct, you are not.
Quote:
[13:32] <Akolyt0r> hmm.. stil i want to have some unused women
Captain Griffen is offline   Reply With Quote
Old 10-14-2006, 03:22 AM   #10
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


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

Submissions (37)

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

Hero Contest #3 - 2nd Place

Default

Quote:
Originally Posted by blu_da_noob
It's still 3 vs 2 (GC for angle then cos/sin, versus getting cos/sin from GC). *shrug*
sin/cos can't be that slow
__________________
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 10-14-2006, 11:49 AM   #11
Waldbaer
Dragonblood Creator
 
Waldbaer's Avatar
 
Join Date: Nov 2003
Posts: 73

Submissions (3)

Waldbaer will become famous soon enough (37)Waldbaer will become famous soon enough (37)

Default

Quote:
Originally Posted by Vexorian
sin/cos can't be that slow
OK, I have corrected it the way blu_da_noob told me. What's faster now, calculating sin/cos every time or reading once more a gamecache value?

I did not update it until now, because I'm still unsure what is better and I don't want to update it more often than necessary - that's annoying especially for those people who already downloaded it - I think you know that.

If I get an answer today I'll update it finally today, too.
__________________

Last edited by Waldbaer : 10-14-2006 at 11:49 AM.
Waldbaer is offline   Reply With Quote
Old 10-14-2006, 12:29 PM   #12
blu_da_noob
Nonchalant
 
blu_da_noob's Avatar


Respected User
 
Join Date: Mar 2006
Posts: 1,933

Submissions (2)

blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)

[Quicksilver #2] - 2nd Place[Quicksilver#1] 1st place

Send a message via MSN to blu_da_noob
Default

Meh, the difference should be neglible anyway. Just do whichever you feel comfortable with.
__________________
blu_da_noob is offline   Reply With Quote
Old 10-14-2006, 08:21 PM   #13
Waldbaer
Dragonblood Creator
 
Waldbaer's Avatar
 
Join Date: Nov 2003
Posts: 73

Submissions (3)

Waldbaer will become famous soon enough (37)Waldbaer will become famous soon enough (37)

Default

OK, again updated. I did it again as it was in the first version concerning the sin/cos thingy. I tested with many units at the same time and there is really no noticeable difference between the two possibilities, but calculating everytime again makes the code easier to read, I think. That's the only advantage!

Update 10/14/06 Version 1.04: Additional technical advancements
__________________

Last edited by Waldbaer : 10-16-2006 at 08:36 PM.
Waldbaer is offline   Reply With Quote
Old 10-16-2006, 08:34 PM   #14
Waldbaer
Dragonblood Creator
 
Waldbaer's Avatar
 
Join Date: Nov 2003
Posts: 73

Submissions (3)

Waldbaer will become famous soon enough (37)Waldbaer will become famous soon enough (37)

Default

Searching for a reason why this still has not been approved, I found the constant function DCJS_GC(), which returned the global gamecache variable. Since this function did not work as it should anyways (more than one edit required to change the variable's name because of the Init_DCJumpSystem function), I removed it completely and replaced it with the direct name of the variable.
This doesn't make a noticeable difference in speed (I don't know why function calls, even constant function calls should be slow - if they are, that's also negligible, I think), but it's one possibility fewer to confuse a user.

Update 10/16/06 Version 1.05: Removed a minor configuration possibility that did not work as described
__________________

Last edited by Waldbaer : 10-16-2006 at 08:35 PM.
Waldbaer is offline   Reply With Quote
Old 10-16-2006, 09:37 PM   #15
Captain Griffen
Dread Lord of the Cookies
 
Captain Griffen's Avatar


Content Director
 
Join Date: Sep 2003
Posts: 5,375

Submissions (2)

Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)

Approved Map: Warlords[Quicksilver #2] - 1st Place

Default

Quote:
Originally Posted by Waldbaer
(I don't know why function calls, even constant function calls should be slow - if they are, that's also negligible, I think)

Because function calls require a few micro-ops. Constant function calls are exactly the same once compiled as non-constant function calls.
__________________
Quote:
Originally Posted by Earth-Fury
Griffen is correct, you are not.
Quote:
[13:32] <Akolyt0r> hmm.. stil i want to have some unused women
Captain Griffen 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 06:56 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

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