On the Verge of Verging

Making Games is Easy!

Whoever said making games was hard? A jerk, that's who.


Okay, let's cut straight to the crap. No theories or any boring, confusing stuff in the way. Learn as you go, as opposed to learning then going because you'll never get anywhere the latter approach.

First off, you need to download Verge³, and if you've had difficulty finding where to download, inspect the following image.

Once you've received it, extract the zip to a brand new folder and run it. We'll soon be making Pirate Adventure Plus, the greatest pirate game known to all mankind.

What is this crap? I just want to make my pirate game! I feel like ripping lungs out, or I would, except I know exactly the problem! I read my readme.txt over:

SYSTEM.VC is a required vergeC file.  vergeC (pronounced VURJ-SEE) is the scripting language
	of VERGE.  You can (and should) have many, many .VC files in a game, but SYSTEM.VC is
	the only required one.

You learn that you just have to program Verge to get it work. It seems a system.vc already exists! Let's open it up somehow. You could get Textpad and some useful stuff for it. If you don't care though, just open with Notepad. Whatever, we don't care. Just select all the text in system.vc, delete it, and then paste the below:

void Autoexec()
{
	SetAppName("Pirate Adventure Plus");	// Sets the title of our awesome game.
	Map("cool.map");			// Switch maps.
}

If you wonder what the hell I mean, these are commands you'll find in the verge 3 manual, and are even used in Rysen's Tutorial if you bothered to read it. Nevertheless, it shouldn't be too difficult to figure out. We'll see how it compiles:

Oh yeah, that's right... I never made a cool.map yet. That's okay though, because we'll make one and it'll be the coolest map ever. Open up Maped3. If it won't work, grab a copy of the .NET Runtime 1.1, install it and open Maped3 afterwards. When Maped3 opens, we're ready for action. We shall create a map in our own image.

Fill in the stuff, click okay, and then you'll get a window asking about creation of commonly used obstruction tiles that looks something like the follow:

Just say yes to that dialogue. Then save the map as cool.map and the VSP as whatever you want to call it, cool.vsp possibly. Will it work in Verge?

...Success! It will indeed run. But it's not cool in even the least of ways. It needs some art, because nobody plays a game that's just a black screen (I hope). So, let's get some tiles drawn. I whipped this up in MS Paint:

Right-click and Save As... that baby. If it makes your retinas vomit white blood cells, don't worry, it had the same effect on me. There's a lesson to be learned from this. That is, do not use MS-Paint's default palette to draw tiles. If at all possible use GIMP, Paint Shop Pro, or Photoshop. We'll continue anyway though, and import it with Maped3:

Note the settings in the picture. Destination is tiles, insertion method is replace and the source is an image file with source padding off. Then find where you saved my eyesore.

It'll ask if you want to replace all tiles, just say yes since the previous tiles are just blank and consume extra space in the vsp file. Then draw out your map.

Yar har har. Let's try running this baby.

It... sort of works, but we need a map vc file in order to interact with this properly. Let's make a new Text Document, and name it cool.vc since it correlates with cool.map. Make sure it isn't actually cool.vc.txt, since that's bad.

Now before we edit cool.vc, let's open system.vc. Change the code to:

int player;		// Remembers who the player sprite is.
void Autoexec()
{
	SetAppName("Pirate Adventure Plus");	// Sets the title of our awesome game.
	Map("cool.map");			// Switch maps.
}

...Then we'll put this in cool.vc:

void Start()
{
	// Spawn at the spot the player specifies in map properties.
	player = EntitySpawn(curmap.startx, curmap.starty, "darin.chr");
	// Set the player to the guy we just made.
	SetPlayer(player);
}

Then before we run, let's change some map settings.

We gave our map a title, and a player spawn point and the startup script is now Start. Now let's run it.

Oh right, there's no darin.chr. Crap. Now we'll pretend for a minute you can't get darin.chr from anywhere else... Download VOpenCHR if you haven't done so already:

Let's use it. We'll import the darin.pcx that came in our folder. Each frame is 16x32. There are 5 columns per row and 30 frames total.

Now voila, it's Darin!

Before we're finished though, we need to put in the movescripts and animations.

Fill these in the forms if you don't want to have to figure out the animations by yourself:

Idle Down Frame:	0
Idle Up Frame:		5
Idle Left Frame:	10
Idle Right Frame:	15
Move Down Script:	F0W10F1W10F2W10F1W10F0W10F3W10F4W10F3W10
Move Up Script:		F5W10F6W10F7W10F6W10F5W10F8W10F9W10F8W10
Move Left Script:	F10W10F11W10F12W10F11W10F10W10F13W10F14W10F13W10
Move Right Script:	F15W10F16W10F17W10F16W10F15W10F18W10F19W10F18W10

Now, let's save our friend Darin as darin.chr.

High zlib compression makes you cool or something, I guess. Now let's run Verge:

Good. Now it's time to make ourselves a textbox. The finished code product is now in system.vc, and can display a colossal one line of text:

int player;		// Remembers who the player sprite is.
void Autoexec()
{
	SetAppName("Pirate Adventure Plus");	// Sets the title of our awesome game.
	Map("cool.map");			// Switch maps.
}

void TextBox(string t)	// Textbox("Blah blah blah")
{
	int done;	// To tell when we're done.
	while (!done)	// While not done... loops this code.
	{
		// Draw the map.
		Render();
		// Draw a Box.
		RectFill(5, 5, ImageWidth(screen) - 5, 15 + FontHeight(0), 0, screen);
		// Draw the text.
		PrintString(10, 10, screen, 0, t);
		// An essential to any loop. Refreshes the screen.
		// Only do after you draw everything.
		ShowPage();

		if (b1)	// If we press button 1, enter.
		{
			done = 1;	// We're done.
			Unpress(1);	// Make sure they let go of b1.
		}
	}
}

In cool.vc we'll rig the code so that some text is spoken upon the start:

void Start()
{
	// Spawn at the spot the player specifies in map properties.
	player = EntitySpawn(curmap.startx, curmap.starty, "darin.chr");
	// Set the player to the guy we just made.
	SetPlayer(player);
	// Intro text box.
	TextBox("Darin: Ahoy! Yar har har.");
}

We run Verge, and it should come out with what we expect.

We've got that done, but Darin looks pretty lonely. I know if we place his best friend, the captain, it'll cheer that bugger up. We'll open up cool.map and place a new entity.

The captain has an activation script of TalkToCaptain, a speed of 30 px/s, a movement type of Wander Zone and 0 delay. Now let's put him at his proper position by clicking a location on the map.

He'll also need some code to act properly, which we place in cool.vc

void Start()
{
	// Spawn at the spot the player specifies in map properties.
	player = EntitySpawn(curmap.startx, curmap.starty, "darin.chr");
	// Set the player to the guy we just made.
	SetPlayer(player);
	// Intro text box.
	TextBox("Darin: Ahoy! Yar har har.");
}

// Talk to the cap'n.
void TalkToCaptain()
{
	TextBox("Captain: Go away. Go, adventure.");
	TextBox("Darin: Okay.");
	Exit("The End");
}

Now, we run it:

Yay! It's now a game! A game with a 0% rating. It's got a while to go, but we've done it.

We'll add more nice touch to cool.vc so that entities other than the player won't trample over him.

void Start()
{
	// Spawn at the spot the player specifies in map properties.
	player = EntitySpawn(curmap.startx, curmap.starty, "darin.chr");
	// Set the player to the guy we just made.
	SetPlayer(player);
	// Makes sure people on the map won't walk through our player.
	entity.obstruct[player] = 1;
	// Intro text box.
	TextBox("Darin: Ahoy! Yar har har.");
}

// Talk to the cap'n.
void TalkToCaptain()
{
	TextBox("Captain: Go away. Go, adventure.");
	TextBox("Darin: Okay.");
	Exit("The End");
}

Then we're done. El fin. Now we'll want to replace this piece of crap with something that has graphics, music, story, and most importantly gameplay. Pirate Adventure Plus could possibly be made into an remotely fun game with a little work.

Perhaps we'll do just that in the next tutorial...