PyCaster Documentation

Installation Instructions

To use this program, you will need to install pygame (gaming/drawing engine), which can be found in the lib folder of this project (32/64-bit files were both included).

If you're not using Python 3.5, you will probably need to download the correct version of it yourself here.

Move the .whl file to C:\Wherever\Python35\Scripts.

Then, open a CMD line under that directory and run the command pip3 install filename, where filename is probably pygame-1.9.2a0-cp35-none-win32.whl or something similar (remember to install 32/64-bit based on what Python you're running).

As far as this tech demo goes, you can download as zip through GitHub (over on the right-hand side) and run main.py with Python 3.5 or honestly whatever Python 3 version you installed pygame under. Shouldn't matter too much.

Usage

Level Editing

PyCaster reads in an image (by default, res/world.png, this is configurable) to use for its 2D map.

The image is parsed at runtime and finds a player tile (where the player starts) and a boss tile (where the boss of the level is located) based on a configurable color of pixel.

Configuration

Editable config files are located in /configs.

gameconfig.txt

This file controls various game-related settings.

Elements are added using the format element=value.

The following elements currently support direction Python code evaluation (so that the user may input special values such as math.pi, colors, etc.):

angle, FOV, text_color

Developer Tools
devtools: Whether or not developer tools display in the top left
World/Rendering
worldname: This is the image file that the program reads in as the game map
block_lines: Whether or not the blocks are outlined vertically
light: Lighting level surrounding the player
text_color: The color of the battle and developer tool text
locked_res: Whether resizing the window keeps the fixed resolution or fits to the window
screen_x: Starting width of the window
screen_y: Starting height of the window
Controls
forwards: Key to move forwards
backwards: Key to move backwards
left: Key to turn to the left
right: Key to turn to the right
strafe_left: Key to strafe left
strafe_right: Key to strafe right
Music
battle_music: Music played during normal random encounters
boss_music: Music played during boss encounter
hit_sound: Sound effect played when the player attacks
Player
angle: Starting angle of the player in radians
FOV: Starting field of view of the player in radians
HP: Player hitpoints
hand_sprite: Sprite displayed in front of, or in the hand of, the player over the terrain
Battles
min_encounter_steps: Minimum amount of steps to a random encounter
max_encounter_steps: Maximum amount of steps to a random encounter
action1: The name of the first battle action
action2: The name of the second battle action
action1Message: The message that displays when using the first battle action. This supports using two '{}', where the first is replaced with the enemy name and the second with damage.
bossFleeMessage: The message displayed when the player tries and fails to flee a boss battle

monsterconfig.txt

This file controls the possible monsters and bosses that are encounterable in PyCaster

Monsters are added using the format "filename.png", ["monster_name", hp, attack], "monster_type"

There currently exist 2 types of monsters, "normal" and "boss". Normal monsters are automatically added to the random encounter system and may be fought anywhere on the map. Boss monsters are automatically added to be encountered when the player hits the boss tile.

Sources/More Information

Permadi Raycasting - Somewhat outdated, but still solid to understand the concept behind raycasting. (To give you an idea, the article was published in 1996)

Open Game Art - Source for the enemy sprites and battle music

BFXR Sound Effect Generator - Source for player hit sound effect