Mount Python
============

(C) 2002 Ben Davis unless otherwise indicated. All Rights Reserved.

Permission is granted for anyone to play and distribute this game, provided
this file (readme.txt) is included without any modifications and the game is
not crippled in any way. Permission is NOT granted for anyone to try to make
money from this game in any way, without prior written permission from me,
Ben Davis. I'd appreciate feedback; see the end of this file for contact
details.

This game is a clone of a NES game, Snake Rattle 'n' Roll, by Rare.

Rare's site: http://www.rareware.com/

The levels are exactly the same as in the original version*, and are thus
copyrighted to Rare. Should they wish it, I shall promptly remove them from
the game. Otherwise my plan for the finished game would be to use the
original levels as bonus levels and design some levels of my own, thus making
the game much bigger; I hope I'll be allowed to do this, as I think it would
be a real treat for those who used to own Snake Rattle 'n' Roll. But if not,
so be it.

*One level was changed; see if you can work out which one and why ;)

This game is unfinished. Apologies for the rough edges. I may one day finish
it, but then again I may not.


Configuration
-------------

I started writing this game when DOS support was still commonplace. It uses
the legendary 320x400 mode, an extension of VGA 320x200. A select few may
respect this decision, but my experience shows that most people think I'm
crazy. But that's beside the point. Unfortunately, though most graphics cards
(including my GeForce 2) can still do this mode, DirectX generally can't. The
game runs distorted in a window.

Therefore I insist that users actively choose one of the following modes
before they play:

320x400 - Original intention, and the best option if you can get the game to
          go full screen with it. Much more likely to work with the DOS build
          than with the Windows one, if your system can run DOS programs at
          all.

640x400 - Stretched mode, much more widely supported for Windows programs.
          However, it is nonstandard. Older computers will not run the game
          as smoothly in this mode.

640x480 - Stretched horizontally, but not vertically; you will get a
          widescreen effect with this mode, which may be cool in some ways,
          but it's still distorted. All systems should support this mode if
          they're modern enough not to support DOS and 320x400.

Note that the higher resolutions do not look any better; it is a low-
resolution image stretched to fill the screen, so it looks the same. Don't
choose higher resolutions on the grounds that they might give you a sharper
image, because they won't.

You can make this choice, separately for the DOS and Windows builds, by
editing mtpython.ini. Any other ports will use the same option you choose for
the Windows build.


Object
------

This game is currently nothing more than an engine test. You can't die, and
you can't win. Just run around and enjoy the scenery!

There is a two-player mode. You can select it by editing mtpython.ini. Try it
even if you don't have someone else there with you; there's a nice feature
implemented for the two-player mode, and it'll make you jump when it kicks in
;)


Controls
--------

The keys are currently semi-hardcoded and can't be changed, so get used to
them. They are as follows:

               Player 1   Player 2

Move Left      A          Left Arrow
Move Right     D          Right Arrow
Move Up        W          Up Arrow
Move Down      S          Down Arrow
Jump           Z          Enter
Shoot Tongue   X          Right Control

Since it's an isometric game, the directions are rotated slightly. They
should make sense though.

These keys are listed as for UK and US keyboards. I'm aware they move around
a lot in different countries, and I'm sorry. However, Allegro should do a
pretty good job of keeping the general positioning of the keys the same; try
pressing random keys and see what happens. With a bit of luck the keys will
be arranged in a sensible pattern for you.

Hold Left Shift to cheat. This will stop players from being carried by water
currents or slipping down slopes, and it will also enable them to walk into
cliffs in order to ascend them (instantly). Don't be ashamed of using this
feature; you can't reach some levels without it, since the procedure for
placing the player(s) on the next level isn't implemented yet!

No, you can't kill the draughts piece.


Editing
-------

It is possible to modify the level. Position Player 1 on the square you want
to modify, and then use the following keys:

Page Up   - Raise square
Page Down - Lower square
Home      - Raise square and all squares extending back from it
End       - Lower square and all squares extending back from it
Insert    - Change ground texture
Delete    - Set flow for water, or set slope for ice*
F2        - Load level from mtpython.lvl
F3        - Save level to mtpython.lvl

*When dealing with flow and slope, it may be advantageous to hold Left Shift.

The algorithm used for drawing the level has a lot of oddities. In order for
your level to look right, you should follow these guidelines:

1. A square should never be lower than any square that's in front of it.
   There are two exceptions to this rule, as follows:

   Firstly, a square that's diagonally behind any given square may be lower.
   However, the square directly behind the given square must be at least as
   high as the given square. In this case a half-square will appear. You'll
   be able to see this happen. This will not be displayed properly with all
   textures though. The texture of the half-square itself cannot be changed.

   Secondly, you may create islands in the sea (the water at the lowest
   level). These islands may only extend four units high; any higher and
   sprites will not correctly appear behind the islands when they should.
   Make sure you can see at least one tile's width of water behind and to the
   sides of the island (see the next section for why).

2. Some textures do not work next to each other. In some cases this is
   because my work on the graphics isn't finished (e.g. spikes vs ice); in
   other cases it may be because those textures aren't meant to be used
   together.

3. The game does let you change the texture of the sea, and there are no
   immediate concerns with this provided you take the last paragraph under
   point 1 exactly as it is written ("at least one tile's width of WATER").
   However, the final version will have a shark in the sea, as in the
   original; this would look odd if it weren't water!

There is no way to change the size of the level. The editor would not be part
of the final release, so stop complaining. :P


Technical
---------

Read this section if you're interested in why levels have to be designed as
described in the last section.

Although this game is isometric, it uses rectangular tiles. Each of these
rectangular tiles consists of two triangles, which would each be a quarter of
one isometric tile. This works for a flat level. Surprisingly, it can be
extended to the case where walls are present; as an isometric tile is raised
one unit, it stays aligned with the grid, and the grid can simply be tiled
blindly over the newly exposed wall and extra rectangular tiles created as
appropriate.

I came up with a pattern by which to name all the rectangular tiles I draw.
The tiles are kept in a directory of their own on my computer. I wrote an
auxiliary program to read all these files in, put them into a datafile in any
old order, and output a source file containing a function to choose
rectangular tiles as required.

The code that invokes this function is pretty scary. I did not plan it very
well, and it took quite a few rewrites; as it is, it's badly commented and
uses a lot of questionable hacks. If I ever want to change it or work out
exactly what it does again, it'll give me nightmares. Moral: plan your code!

This technique of using rectangular tiles has obvious advantages. For one
thing there is no overdraw (actually there is, since I made a special case
for spikes and ice slopes whereby another tile can appear behind it).
Secondly it fits in well with the memory addressing model of some systems;
although my version uses 20x15 tiles, the original used 16x8, since that
worked well with the NES hardware.

However, it also has disadvantages. You can't generally have the snake going
behind an isometric tile; he would have to appear on top of half of a
rectangular tile but underneath the other half. This game gets around it for
the special case of islands in water (and the whole level counts as an island
if the snake goes round the back), by using two separate sprite drawing
functions. One of them is Allegro's standard draw_sprite() function, which
draws the sprite on top of everything. The other is one I wrote myself, which
only draws the sprite over pixels of a certain colour, namely that of water.
A complex algorithm which took ages to derive chooses between the two
functions. For the most part this gives the illusion that the snake goes
behind stuff, provided the area behind is water. There are a few oddities;
for example, water on the level will allow the snake to show through when he
falls behind the level.

Given the processing power of today's computers, I could easily have
implemented a more solid method for arranging 'hidden snake removal'. However
I chose to do it this way in order to be true to the original. It's also nice
to revert to obsolescent programming techniques once in a while :)


Other
-----

You may wonder, why did I call this game Mount Python?

Well, all the levels are built into a single structure. So why not call it a
mountain? With a slight stretch of the imagination those funky looking snakes
could be construed as pythons, so I decided to name the mountain after them.

I guess it's a coincidence that Monty Python's Flying Circus and Snake Rattle
'n' Roll both have a big foot in them that crushes things. ^_^


Conclusion
----------

That's it! I hope you enjoy the game.


This game uses Allegro: http://alleg.sf.net/

Ben Davis
entheh@users.sf.net
http://bdavis.strangesoft.net/
