Gw Temp

Menu

Tutorial - 'FPS System IV: Distancing' by Dimensionwyrm

An item about RPGMaker 2000 posted on

Blurb

In the fourth installment of Dimensionwyrm/lunchman's FPS system series you'll see how to make it semi-3-D with enemy distances.

Body

Welcome to the fourth and second-to-last(possibly third) installment of my FPS System tutorials, this time on enemy distancing. What I mean is the enemies that you fight in this is system are so far merely in one dimension, not moving closer or further back. It’s virtually impossible to make this seamless and clearly understandable at the same time, so it’s best to make 3 or so layers, using zoom to show distance (unless you want to spend time making 100+ copies of the same picture with slight differences). It is also impossible to let the player himself move forward/backward due to 3-dimensional limits. For example, it’s impossible to do camera viewing if you are in the same layer as the enemy, if you collide with the enemy, or if the enemy is behind you. For these reasons, it is virtually impossible to do this (unless of course you want to spend hours coding). Distancing in itself is rather simple, so let’s begin.


Step 1:

With distancing, before we being coding we need to make pictures. To stop it from getting pixilated with zoom, open Photoshop (if you have it, otherwise just use regular zoom on rm2k, just 150% or 50%) and ctrl+click the layer on your enemy picture. Following this open image>canvas size and set it to 150%. Now hit ctrl+t. This will open free transform. If you look at the top, it will show various values. Set length and width to 150%, then switch to the movement tool then hit apply when a window comes up. Now move the picture into the center. Now go to image>save for web, select png-128 as the type, and save the picture. Then hit ctrl+alt+z repeatedly until it is back to normal. Then ctrl+click the layer again, and hit ctrl+t again. Now you want to set it to 50% size, then use save for web again and save it. Once this is done use save for web on the original as well so it’s compatible for rm2k (if it already isn’t of course). Now you’re ready to do coding.


Step 2:

Coding is actually rather simple. You first want to create a variable. Name this variable ‘enemy distance’. Now, go to the page of the event where you move your enemy. Within the event, anywhere you want, have it increase/decrease the variable picture. Before it does so, obviously, use a fork to check if it is equal to either 2 or 0, depending if you want it to go closer or further. Have it increase the variable if it gets closer, and decrease it if it gets further. Then have it call a common event named ‘enemy distancing’ (so you make the event beforehand now). We will configure the event next.


Step 3:

Now open the common event ‘enemy distancing’. You want to just put a series of forks that say (basically):

If the variable is 0 show the closest

If it’s 1 show the middle one

If it’s 2 show the furthest one



That was rather simple. Now, in the next step you have to change the timing of attacks (for realism, and to add a point to distancing).



Step 4:

We will do the enemy attacking first. The enemy should reach you in a shorter time if it was in 0 range than in 2 range right? So make a series of forks, each containing a copy of the entire enemy attacking code. In each of the forks base it off variable distance(obviously). So once you do this simply change the timing in between picture changing on the attack sequence, and maybe increase the power based off distance. This part should be rather easy. Now for player attacking:

You should be using a gun, since that is the point of an FPS system. You also want the gun to deal less damage and take more time to reach the enemy if it is further away, giving the enemy incentive to back off if in danger (you might want to make changes in AI here). So, do forks similar to enemy attacking changing speed and damage based off distance.


Congratulations! You’ve just completed the fourth installment in the FPS System series!