Author Topic: New Camera Shake Feature  (Read 1246 times)

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
New Camera Shake Feature
« on: 2 February 2014, 01:15:37 »
You can let the camera shake now :)

This feature is meant for tanks shooting big rockets, heavy running elephants or exploding buildings.Like this :D
Or if you want  to see it in an RTS here (when the tower dies)
Here is the syntax:
Code: [Select]
<skill>
<type value="move"/>
<name value="move_skill"/>
<ep-cost value="0"/>
<speed value="375"/>
<anim-speed value="240"/>
<animation path="models/warrior_walk.g3d"/>
<sound enabled="false"/>
<shake enabled="true" intensity="10" duration="40" start-time="0.5">
<self enabled="true" visible="true" in-camera-view="true" camera-distance-affected="true"/>
<team enabled="true" visible="true" in-camera-view="true" camera-distance-affected="true"/>
<enemy enabled="true" visible="false" in-camera-view="false" camera-distance-affected="true"/>
</shake>
</skill>
intensity=intensity
duration=duration in update frames (40 per second)
start-time=start time. works like in <sound>

self=options for the player
self=options for your allies (excluding you)
enemy=options for the opponent

visible=If visible is true the camera only shakes if the unit is visible (not hidden in fog-of-war). ( this is nearly useless for team and self but i am not sure what happens if you kill a not completed building or a unit with sight 0 )
in-camera-view=if true the camera only shakes if the unit is in the actual camera view (watch the video if you dont understand)
camera-distance-affected=the distance between the unit and the camera position is taken in consideration (watch the video if you dont understand)

Video showing the feature:
https://www.youtube.com/watch?v=lt7Sci3wYjs

Should this be added to the glest wiki already or should i wait until this is included in a stable release?
(here it is shown for the stop skill, but works for all skills: https://docs.megaglest.org/XML/Skills#Stop)
« Last Edit: 18 June 2016, 16:24:40 by filux »
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
Re: New Camera Shake Feature
« Reply #1 on: 2 February 2014, 15:45:06 »
I'm very excited to try this out!  ;D
Annex: Conquer the World Release 4 For Pc Mac + Linux
https://forum.megaglest.org/index.php?topic=9570.0
Annex is now on Facebook!
https://www.facebook.com/AnnexConquer

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: New Camera Shake Feature
« Reply #2 on: 3 February 2014, 05:27:30 »
Looks cool. I did notice in your video that shadows on the edge of the screen flicker (although I believe this is a long-outstanding camera issue and shaking merely demonstrates this issue -- not cause it).

Can you elaborate on how the intensity value works? I'm assuming it's related in some way to the distance the screen moves? Similarly, how does camera-distance-affected work?

Also, you're welcome to add it to the wiki immediately, but I think you should mention (until it's part of a stable release) which revision this was implemented in.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
Re: New Camera Shake Feature
« Reply #3 on: 3 February 2014, 15:51:43 »
i added it to wiki already, but only for stop skill because i dont have time now to add it to all skills. ( and i think the system that you have to add it to all skills is bad)
and yes the intensity thing is how much the camera shakes (how far its going left,right,up and down)

the camera-distance-affected is maybe better explained in wiki:
Quote from: glest wiki
If camera-distance-affected is true the shake intensity is affected by the distance between the unit and the camera position
bigger distance between the unit and the camera -> smaller intensity

EDIT:
i found this while browsing the glest wiki:
https://docs.megaglest.org/GAE/Earthquake
is that a similar effect? and i thought i had a cool new idea :(
« Last Edit: 18 June 2016, 18:30:32 by filux »
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: New Camera Shake Feature
« Reply #4 on: 3 February 2014, 20:44:13 »
This is a nice effect, good job!
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
Re: New Camera Shake Feature
« Reply #5 on: 4 February 2014, 20:28:34 »
New lua commands to let the camera shake:

Let the Camera Shake (camera-distance-affected=false)
shakeCamera(int Intensity, int Duration)

Let the camera shake but camera-distance-affected=true (you need to give a unitID for that ofcourse)
shakeCameraOnUnit(int Intensity, int Duration, int UnitId)
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
Re: New Camera Shake Feature
« Reply #6 on: 5 February 2014, 17:56:24 »
It would also be useful to have the shake effect on splash particles, eg Nukes exploding, powerful spells, etc.
Annex: Conquer the World Release 4 For Pc Mac + Linux
https://forum.megaglest.org/index.php?topic=9570.0
Annex is now on Facebook!
https://www.facebook.com/AnnexConquer

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
Re: New Camera Shake Feature
« Reply #7 on: 14 February 2014, 18:47:30 »
I tried to implement it but its harder than i tought.This will take a while...
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.