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



Reply
 
Thread Tools Search this Thread
Old 01-21-2006, 05:59 PM   #1
Anitarf
Procrastination Incarnate


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

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 Cinematic System

A Jass system designed for cinematic composing and playback.

It grants the mapmaker more control and precision in manipulating units, special effects and cameras than is possible with regular GUI triggers.

The system was first used in the Blizzard's cinematic contest winner, The Spirit of Vengeance made by me and iNfraNe.

Version History

Version 1.5b
- Made the system compatible with Warcraft patch 1.24

Version 1.5
- Added subtitle display function for movie-like subtitles
- Added unshaded fade filters, see the "other engines" chapter for more detail
- Added a lock-camera-on-unit feature for camera position and camera facing
- Added a function to the script system for changing individual camera properties
- Tweaked the camera movement to be more precise over uneven terrain
- Did some more optimisation on the particle system

Version 1.4
- Added a fog engine for gradual changes of fog distance and colour
- Redid the particle and camera systems so they should run faster
- - the particle system can now only work with units that are actors
- - you mustn't change the unit custom value of actors for the system to work
- Added unit scaling support to the particle and scripting systems
- The camera trigger can now be turned on or off, for use in playable maps
- Did some more optimisation to the script system functions

Version 1.3
- Did some performance optimisation; thanks to Vexorian for pointing some things out.

Version 1.2
- First public release

Attached Images
File Type: jpg CinySystem_Thumbnail.jpg (140.9 KB, 1838 views)
Attached Files
File Type: w3x Cinematic_System_1.5.w3x (84.4 KB, 731 views)
File Type: w3x Cinematic_System_1.5b.w3x (84.5 KB, 255 views)
__________________

Last edited by Anitarf : 06-24-2010 at 06:50 PM.
Anitarf is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 01-21-2006, 06:19 PM   #2
Elthanor
User
 
Elthanor's Avatar
 
Join Date: Jan 2004
Posts: 132

Elthanor has little to show at this moment (0)

Send a message via MSN to Elthanor
Default

This might come in handy, but i might need to learn some JAss first.

Any BTW, I LOVED your movie, its soo awesome. Great job!
__________________
Zoom
Signature was too big, recomended size: 25% of current one
Elthanor is offline   Reply With Quote
Old 01-21-2006, 06:29 PM   #3
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

GC is a horribly generic name and needs to be more specific to the system but the problem is that you call it everytime
Collapse BAD:

function CameraMainLoop takes nothing returns nothing
    local real array a
    local real array v
    local real array s
    local real array time
    local integer i = 0

    loop
        exitwhen i == 9
        set i = i + 1
        set time[i] = GetStoredReal( GC(), "camera", "time" + I2S(i) ) + CameraPeriod()

        if time[i] > GetStoredReal( GC(), "camera", "endtime" + I2S(i) ) then
            if GetStoredReal( GC(), "camera", "acc2" + I2S(i) ) != 0 then
                call StoreReal( GC(), "camera", "acc" + I2S(i), GetStoredReal( GC(), "camera", "acc2" + I2S(i) ) )
                call StoreReal( GC(), "camera", "startvel" + I2S(i), GetStoredReal( GC(), "camera", "vel" + I2S(i) ) )
                call StoreReal( GC(), "camera", "startdis" + I2S(i), GetStoredReal( GC(), "camera", "dis" + I2S(i) ) )
                call StoreReal( GC(), "camera", "time" + I2S(i), 0.00 )
                call StoreReal( GC(), "camera", "acc2" + I2S(i), 0.00 )
                set time[i] = 0.00
            else
            endif
        endif

        set a[i] = GetStoredReal( GC(), "camera", "acc" + I2S(i) )
        set v[i] = GetStoredReal( GC(), "camera", "startvel" + I2S(i) )
        set s[i] = GetStoredReal( GC(), "camera", "startdis" + I2S(i) )

        call StoreReal( GC(), "camera", "time" + I2S(i), (time[i]) )

        set s[i] = s[i] + ( v[i] * time[i] ) + ( a[i] * time[i] * time[i] / 2 )
        set v[i] = v[i] + ( a[i] * time[i] )
        if i > 3 and i < 7 then
            if s[i] > 360 then
                set s[i] = s[i] - 360
            elseif s[i] < 0 then
                set s[i] = s[i] + 360
            endif
        endif

        call StoreReal( GC(), "camera", "vel" + I2S(i), v[i] )
        call StoreReal( GC(), "camera", "dis" + I2S(i), s[i] )


    endloop

    call PanCameraToTimed( s[1], s[2], 0.00 )
    call SetCameraField( CAMERA_FIELD_ZOFFSET, s[3], 0.00 )
    call SetCameraField( CAMERA_FIELD_ROTATION, s[4], 0.00 )
    call SetCameraField( CAMERA_FIELD_ANGLE_OF_ATTACK, s[5], 0.00 )
    call SetCameraField( CAMERA_FIELD_ROLL, s[6], 0.00 )
    call SetCameraField( CAMERA_FIELD_FIELD_OF_VIEW, s[7], 0.00 )
    call SetCameraField( CAMERA_FIELD_FARZ, s[8], 0.00 )
    call SetCameraField( CAMERA_FIELD_TARGET_DISTANCE, s[9], 0.00 ) 
endfunction

Collapse Good:
function CameraMainLoop takes nothing returns nothing
 local real array a
 local real array v
 local real array s
 local real array time
 local integer i = 0
 local gamecache g=g

    loop
        exitwhen i == 9
        set i = i + 1
        set time[i] = GetStoredReal( g, "camera", "time" + I2S(i) ) + CameraPeriod()

        if time[i] > GetStoredReal( g, "camera", "endtime" + I2S(i) ) then
            if GetStoredReal( g, "camera", "acc2" + I2S(i) ) != 0 then
                call StoreReal( g, "camera", "acc" + I2S(i), GetStoredReal( g, "camera", "acc2" + I2S(i) ) )
                call StoreReal( g, "camera", "startvel" + I2S(i), GetStoredReal( g, "camera", "vel" + I2S(i) ) )
                call StoreReal( g, "camera", "startdis" + I2S(i), GetStoredReal( g, "camera", "dis" + I2S(i) ) )
                call StoreReal( g, "camera", "time" + I2S(i), 0.00 )
                call StoreReal( g, "camera", "acc2" + I2S(i), 0.00 )
                set time[i] = 0.00
            else
            endif
        endif

        set a[i] = GetStoredReal( g, "camera", "acc" + I2S(i) )
        set v[i] = GetStoredReal( g, "camera", "startvel" + I2S(i) )
        set s[i] = GetStoredReal( g, "camera", "startdis" + I2S(i) )

        call StoreReal( g, "camera", "time" + I2S(i), (time[i]) )

        set s[i] = s[i] + ( v[i] * time[i] ) + ( a[i] * time[i] * time[i] / 2 )
        set v[i] = v[i] + ( a[i] * time[i] )
        if i > 3 and i < 7 then
            if s[i] > 360 then
                set s[i] = s[i] - 360
            elseif s[i] < 0 then
                set s[i] = s[i] + 360
            endif
        endif

        call StoreReal( g, "camera", "vel" + I2S(i), v[i] )
        call StoreReal( g, "camera", "dis" + I2S(i), s[i] )


    endloop

    call PanCameraToTimed( s[1], s[2], 0.00 )
    call SetCameraField( CAMERA_FIELD_ZOFFSET, s[3], 0.00 )
    call SetCameraField( CAMERA_FIELD_ROTATION, s[4], 0.00 )
    call SetCameraField( CAMERA_FIELD_ANGLE_OF_ATTACK, s[5], 0.00 )
    call SetCameraField( CAMERA_FIELD_ROLL, s[6], 0.00 )
    call SetCameraField( CAMERA_FIELD_FIELD_OF_VIEW, s[7], 0.00 )
    call SetCameraField( CAMERA_FIELD_FARZ, s[8], 0.00 )
    call SetCameraField( CAMERA_FIELD_TARGET_DISTANCE, s[9], 0.00 ) 
 set g=null
endfunction

Why? Because the GC function has a comparission and a return and many other things that charge the performance - As bad as using BJ functions. In functions like this one it is getting called way too much times and using a local will make the charge lighter,

Any logical explanation for doing this:

Collapse BAD:

    call StoreReal( GC(), "camera", "startdis" + I2S(1), CameraSetupGetDestPositionX( whichSetup ) )
    call StoreReal( GC(), "camera", "startdis" + I2S(2), CameraSetupGetDestPositionY( whichSetup ) )
    call StoreReal( GC(), "camera", "startdis" + I2S(3), CameraSetupGetField( whichSetup, CAMERA_FIELD_ZOFFSET ) )
    call StoreReal( GC(), "camera", "startdis" + I2S(4), CameraSetupGetField( whichSetup, CAMERA_FIELD_ROTATION ) )
    call StoreReal( GC(), "camera", "startdis" + I2S(5), CameraSetupGetField( whichSetup, CAMERA_FIELD_ANGLE_OF_ATTACK ) )
    call StoreReal( GC(), "camera", "startdis" + I2S(6), CameraSetupGetField( whichSetup, CAMERA_FIELD_ROLL ) )
    call StoreReal( GC(), "camera", "startdis" + I2S(7), CameraSetupGetField( whichSetup, CAMERA_FIELD_FIELD_OF_VIEW ) )
    call StoreReal( GC(), "camera", "startdis" + I2S(8), CameraSetupGetField( whichSetup, CAMERA_FIELD_FARZ ) )
    call StoreReal( GC(), "camera", "startdis" + I2S(9), CameraSetupGetField( whichSetup, CAMERA_FIELD_TARGET_DISTANCE ) )

instead of this?

Collapse Good:
    call StoreReal( GC(), "camera", "startdis1", CameraSetupGetDestPositionX( whichSetup ) )
    call StoreReal( GC(), "camera", "startdis2", CameraSetupGetDestPositionY( whichSetup ) )
    call StoreReal( GC(), "camera", "startdis3", CameraSetupGetField( whichSetup, CAMERA_FIELD_ZOFFSET ) )
    call StoreReal( GC(), "camera", "startdis4", CameraSetupGetField( whichSetup, CAMERA_FIELD_ROTATION ) )
    call StoreReal( GC(), "camera", "startdis5", CameraSetupGetField( whichSetup, CAMERA_FIELD_ANGLE_OF_ATTACK ) )
    call StoreReal( GC(), "camera", "startdis6", CameraSetupGetField( whichSetup, CAMERA_FIELD_ROLL ) )
    call StoreReal( GC(), "camera", "startdis7", CameraSetupGetField( whichSetup, CAMERA_FIELD_FIELD_OF_VIEW ) )
    call StoreReal( GC(), "camera", "startdis8", CameraSetupGetField( whichSetup, CAMERA_FIELD_FARZ ) )
    call StoreReal( GC(), "camera", "startdis9", CameraSetupGetField( whichSetup, CAMERA_FIELD_TARGET_DISTANCE ) )

Edit: you also have an ==true in the B2I function which is btw useless
__________________
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 01-21-2006, 06:30 PM   #4
iNfraNe
MSc
 
iNfraNe's Avatar


Cinematics Moderator
 
Join Date: Dec 2003
Posts: 2,174

Submissions (7)

iNfraNe is just really nice (261)iNfraNe is just really nice (261)iNfraNe is just really nice (261)iNfraNe is just really nice (261)iNfraNe is just really nice (261)

Approved Map: Mortar Ball

Send a message via MSN to iNfraNe
Default

Well the good thing about this is, you dont REALLY have to know jass, just some common sense, since all the functions are prebuild and you just need to write some lines (almost all functions are showed in the example cinematic it holds, to make it even easier)
__________________
Inactive.
Table:
Past Projects:
The Spirit of Vengeance (Cinematic, Blizzard contest winner)
Elimination Tournament
Mortar Ball
iNfraNe is offline   Reply With Quote
Old 01-21-2006, 07:00 PM   #5
Anitarf
Procrastination Incarnate


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

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

Quote:
Originally Posted by Vexorian
GC is a horribly generic name and needs to be more specific to the system but the problem is that you call it everytime
Well, the advantage is I can type it quickly, and when using game cache natives instead of handle vars, that's a big factor. :)

Quote:
Why? Because the GC function has a comparission and a return and many other things that charge the performance - As bad as using BJ functions.
It's still one function call less than using handle variables. But I agree, your suggestion means a considerable optimization, I'll implement it in the next version.

Quote:
Any logical explanation for doing this:

*Insert embarrasingly noob-like code here*
No logical explanation, just the result of copy-pasting, and the irrational fear that 1 might not convert exactly to "1". Will fix.

Quote:
Edit: you also have an ==true in the B2I function which is btw useless
Indeed it is. But it was worse before, I was using the return bug before iNfraNe told me this is faster. :)
__________________
Anitarf is offline   Reply With Quote
Old 01-21-2006, 07:11 PM   #6
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

Why have a B2I at all ?

And

Quote:
Well, the advantage is I can type it quickly, and when using game cache natives instead of handle vars, that's a big factor. :)
if you use g it would be even faster
__________________
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 01-21-2006, 07:23 PM   #7
Anitarf
Procrastination Incarnate


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

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

Yeah, well... I had a deadline when I was making this! (excuses, excuses :) )

Anyway, I fixed that now, at least in the most critical functions. It was kinda lame not to use the handle vars because of performance reasons, but then do things like this.
__________________
Anitarf is offline   Reply With Quote
Old 01-21-2006, 10:49 PM   #8
Tim.
Missing You All at Wc3c
 
Tim.'s Avatar


Site Owner
 
Join Date: Jul 2003
Posts: 4,474

Submissions (18)

Tim. is a name known to all (502)Tim. is a name known to all (502)Tim. is a name known to all (502)Tim. is a name known to all (502)Tim. is a name known to all (502)

Approved Map: PiratesSpell making session 3 winner

Default

You know I love this. Awesome beyond a doubt.
__________________
"oO and if anyone called Tim. trys to make an account then kick there butts." -Mavus, moderator of the GTW forums


Avast! Seen Pirates? Get it here!
Tim. is offline   Reply With Quote
Old 01-22-2006, 08:12 AM   #9
Hyarion
User
 
Join Date: Jan 2005
Posts: 497

Hyarion is on a distinguished road (14)

Default

Is it alright if I kiss the very ground you walk on?
__________________
Hyarion is offline   Reply With Quote
Old 01-22-2006, 12:34 PM   #10
Zeal_
User
 
Zeal_'s Avatar
 
Join Date: Apr 2004
Posts: 376

Zeal_ will become famous soon enough (29)

Send a message via AIM to Zeal_
Default

Rename it,

Cinematic Jass for Dummies.
__________________
Older, smarter, and back
Zeal_ is offline   Reply With Quote
Old 01-22-2006, 08:26 PM   #11
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

why would it have such a lame name?
__________________
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 01-23-2006, 11:51 PM   #12
DanL.
Girl+Guns= DanL.
 
DanL.'s Avatar
 
Join Date: Dec 2005
Posts: 47

Submissions (2)

DanL. has a spectacular aura about (82)DanL. has a spectacular aura about (82)DanL. has a spectacular aura about (82)

Send a message via AIM to DanL.
Default

Good cinematic, and also good concept .
DanL. is offline   Reply With Quote
Old 01-30-2006, 12:22 PM   #13
Freakazoid
I love you all.
 
Freakazoid's Avatar
 
Join Date: May 2003
Posts: 1,915

Submissions (14)

Freakazoid is a jewel in the rough (159)Freakazoid is a jewel in the rough (159)

Default

I hate Jass, but guess i have to learn it :/
__________________
Freakazoid is offline   Reply With Quote
Old 02-02-2006, 05:44 PM   #14
Capn_Sniffies
User
 
Capn_Sniffies's Avatar
 
Join Date: Dec 2002
Posts: 305

Capn_Sniffies has little to show at this moment (0)

Default

Does this work on multiplayer maps?
Capn_Sniffies is offline   Reply With Quote
Old 02-02-2006, 06:07 PM   #15
Anitarf
Procrastination Incarnate


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

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

Hmm... cinematic maps are usually single player, no?

But anyway, if you mean to use this in a playable map for an introduction cinematic or anything like that, yes, it should work in multiplayer too. I looked through the code again quickly and I found nothing that would limit it to only one player.
__________________
Anitarf 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 08:30 PM.


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