Xevious — Prototype & Backgrounds

Paul Marsh
4 min readApr 29, 2021

--

In this series I shall be explaining some of the approaches, techniques and choices I used to help implement Xevious in Unity.

Prototyping & Isolation

There are a number of challenges to implementing Xevious. To stop it being too daunting it is a good idea to break down all the potential problems into smaller more manageable chunks and prototype them.

Prototype

What is a prototype? For me a prototype is about trying out a quick implementation of an idea to see if fundamentally it works or not. It is important to concentrate on the core problem you are trying to solve rather than get caught up in implementing too many surrounding features. For example, I wanted to prototype how to implement scrolling backgrounds. I do not need to know how enemies are going to work with it, or bullets are going to fly, I just need to concentrate on how a background will appear to move. In Unity this means I will create a new isolated scene that will focus on just this task.

Collider Scene — just testing colliders

Isolation

The ‘Isolation’ aspect has a longer tail to its value than just prototyping. When you isolate a feature you prevent other variables affecting the feature. Whilst the advantage seems obvious for the initial prototype it is really helpful for on-going maintenance and development. In the case of Xevious, if one enemy is not working properly, then is it because it is conflicting with another enemy, the background, the bullets, etc, etc,? Keeping your prototypes around as isolated test scenes allows you to focus solely on the problem without any distractions. Proving it works in the test scene allows you to rapidly narrow down the problem if it still occurs in the main game.

In my case I have Colliders, MovePerformance, Sprites and ScrollingBackground.

Isolated scenes

Speaking of which, Scrolling Backgrounds…

Movement & Scrolling Backgrounds

Xevious was the original vertical scrolling shoot-em-up. The player’s ship has the illusion of traveling over land (and sea) but how to achieve that?

Full map next to starts of level 1 & 2

It is interesting that Xevious has one large map but it does not move through it sequentially. E.g. consider level 1 and level 2 you can see that Xevious starts almost at the end of the map. That is useful but how do we move the map? I considered three main choices;

1. Move the camera up and down the large map

2. Keep the camera still and move the large map around it

3. Keep the camera still and move strips of the large map through it

Planning toward the horizon

When faced with such choices I like to use the idea of ‘planning toward the horizon’. What this really means is that I look for a solution for the immediate problem but also with an eye to the features I might need soon — but not too far away (not over the horizon). In this case if I wanted to extend the levels, say by streaming/addressables, then it will be easy to keep loading strips of levels as needed. For me I suspect that it will be easier to do that by keeping the camera still.

Background Manager

I chose to implement the background scrolling in a separate component called the ‘Background Manager’. It has the sole responsibility of dealing with the movement and loading of the backgrounds as the levels change. You can learn more about the specific of the implementation by watching my quick tutorial.

Take Aways

  • Isolate your problems — narrow it down as much as possible
  • Plan toward the horizon — concentrating on delivering for the now, but with an on eye on what is coming soon

Where next?

Next up, Positions & Waypoints.

If you have any questions or would like to know more, then please let me know.

--

--

Paul Marsh
Paul Marsh

Written by Paul Marsh

Unity, VR, Enterprise and .Net Developer

No responses yet