<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Super Intergalactic Tinchi 🐠</title>
    <description>The latest articles on DEV Community by Super Intergalactic Tinchi 🐠 (@martin_cerdeira).</description>
    <link>https://dev.to/martin_cerdeira</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F197664%2F7fe65bb4-dcfd-4c41-b6cf-b60020189e5e.jpg</url>
      <title>DEV Community: Super Intergalactic Tinchi 🐠</title>
      <link>https://dev.to/martin_cerdeira</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/martin_cerdeira"/>
    <language>en</language>
    <item>
      <title>Time Distort in Super Intergalactic Gang (and in video games in general?)</title>
      <dc:creator>Super Intergalactic Tinchi 🐠</dc:creator>
      <pubDate>Fri, 19 Jul 2019 14:08:56 +0000</pubDate>
      <link>https://dev.to/martin_cerdeira/time-distort-in-super-intergalactic-gang-and-in-video-games-in-general-1hgb</link>
      <guid>https://dev.to/martin_cerdeira/time-distort-in-super-intergalactic-gang-and-in-video-games-in-general-1hgb</guid>
      <description>&lt;p&gt;When I started to develop SIG  I had only a couple of things clear: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It was going to be a Shoot em' up.&lt;/li&gt;
&lt;li&gt;It was going to have a slow motion mechanics, as if it were Neo and the famous "bullet time".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Video demo&lt;/em&gt;&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=4zkn1-7K1c0" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimg.youtube.com%2Fvi%2F4zkn1-7K1c0%2F0.jpg" alt="IMAGE ALT TEXT HERE"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are usually used to seeing things in slow motion as a way of repeat an event that happens at a high speed and be able to see it clear. &lt;br&gt;
In fast actions such as in a sport, a fight or a car accident, seeing things at a slower speed than normal helps to appreciate what happens best.&lt;/p&gt;

&lt;p&gt;It is very attractive, for example, to see Messi in a slow motion play, and to notice how he seems to be affected less than his rivals by this time distortion, I.E: he moves relatively faster then rivals.&lt;br&gt;&lt;br&gt;
Of course, this is not so, only his greater speed and skill in real time are the ones that achieve this effect.&lt;/p&gt;

&lt;p&gt;So, since the mechanics of time distort was the main thing in my game, it had to feel good and be gratifying, make the player feel like a great skillful who can dodge bullets and slip between enemies and shoot them in the face.&lt;/p&gt;

&lt;p&gt;That's why it was clear to me that I couldn't just implement it as a time slowdown, and that it had to affect different objects in particular ways in order to maximize the effect.&lt;/p&gt;

&lt;p&gt;The first thing I did was to define a global variable in my game that would represent the speed of time:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;globlal TIME_SPEED = 1;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F0ax8vp5yl3js3i9ly7v8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F0ax8vp5yl3js3i9ly7v8.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That is, it is used as a multiplier, being 1 the normal value and, for example, if I wanted to make everything go at half speed the value should be 0.5.&lt;/p&gt;

&lt;p&gt;Then, I use that multiplier in every place where there was some process that had something to do with time. &lt;/p&gt;

&lt;p&gt;For Example: Enemies advance and move at a given speed that is linked to time because, to travel a given distance, less time means greater speed.&lt;br&gt;
Also, for the most part, they have attacks based on a timer that dictates the frequency of the shot or attack. In the case of bosses, the timers are involved in changing states, for example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;passive &amp;gt;&amp;gt; attack 1 &amp;gt;&amp;gt; passive &amp;gt;&amp;gt; attack 2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Speed of bullets, frames of animations, movement of the character also are linked to time.&lt;/p&gt;

&lt;p&gt;With the global variable multiplying everywhere, the only thing left is to change its value and everything automatically goes slower in "time distort mode".&lt;/p&gt;

&lt;p&gt;What remains is to make the player experience it as a real time distortion and use it to his benefit.&lt;/p&gt;

&lt;p&gt;To slow everything down evenly would be intuitive but, through experimentation and a lot of playtesting what I determined was that it is perceived as a slowness and nothing else. &lt;br&gt;
It doesn't give that feeling of over power, it just moves everything slower and it doesn't even give a major advantage because although. For example: the bullets goes slower, so does the character.&lt;/p&gt;

&lt;p&gt;Here I think there can be thousands of ways to solve this problem and I don't think there's one that's optimal but I think the one I used worked quite well and it was:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enemies:&lt;/strong&gt;&lt;br&gt;
All enemies, bosses and enemies bullets are affected by slow motion equally using a value of 0.3 as multiplier, ie less than half the normal speed. &lt;br&gt;
This affects your moving speed, your animations, your firerate, and any timer that modifies behavior or reaction to an event.&lt;br&gt;
That means that enemies "think" slower than in normal mode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The player:&lt;/strong&gt;&lt;br&gt;
Characters are affected in their movements to a lesser extent than enemies, using a value of 0.5.&lt;br&gt;
The speed of the bullets is also affected but not the firerate which remains the same as normal speed. &lt;br&gt;
The latter sounds a bit strange but with this what is achieved is that the player can continue shooting and the bullets accumulate forming a denser row and when the time distort and accelerate produce a "matrix" effect. &lt;/p&gt;

&lt;p&gt;In short, during a time distort, the player has more time to react, feels more agile and able to literally slip between enemy bullets. Indirectly, it's like having a boost of speed and more firerate but in a slightly more interesting and covert way.&lt;/p&gt;

&lt;p&gt;Then, to accentuate the feeling of time distortion was generated a kind of ghost trail that follows the movements of the players with a delay and changed the pitch of the SFX and music to half.&lt;/p&gt;

&lt;p&gt;I think this method is generic enough to use in any other game or genre, so that's why I consider that sharing this thoughts and techniques could be useful to any game developer trying to achieve something similar to this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fex57u99kedve5gm6jwsm.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fex57u99kedve5gm6jwsm.gif"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gamedevelop</category>
      <category>showdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
