The indigoparadox Web Zone

Raycaster in Visual Basic 4

Back to projects

Web Zone Navigation

Related Web Zones

Other Web Zones

Screenshot of the Raycaster running on a Windows 95 desktop with a

1. Introduction

vbray is an extremely simple raycasting proof-of-concept. It borrows heavily from Lodev's Raycasting tutorial, but it uses GDI lines to draw the walls on a Windows form.

2. Playing

Uses WASD to move. Load the example world "Arcade.csv" from the File menu to start!

We've run it on a 486 DX-2 55 Mhz, but it was very slow. There are lower-resolution options for display if needed. There's also a minimap window which shows the path of the rays used for casting!

3. Data Formats

Below is an annotation of the example starting map, Arcade.csv. The annotations give a general idea of how each line is structured. Values are separated by commas.

Arcade.csv
Determines ground color by hex number.
1ground,&H3000
Determines sky color by hex number.
2sky,&Hffff00
Map width in tiles. map statements must not be longer than this number.
3width,20
Map height in tiles. Must not have more map statements than this number.
4height,20
Version of reader this map is intended for.
5version,1
Starting positin in tiles (X/Y) followed by facing angle.
6start,11,8,-0.5596647,0.8287189,0.5469547,0.3693788
Wall definitions. Each is an index used in the map statements followed by light/dark hex colors and color names.
7wall,1,&H808080,&H404040,gray
8wall,2,&HFF00,&H8000,green
9wall,3,&HFF,&H80,red
10wall,4,&HFF00FF,&H800080,purple
11wall,5,&H00,&H00,black
12wall,6,&HFFFF,&H8080,yellow
13wall,7,&HFFFF00,&H808000,cyan
14wall,8,&H8000,&H4000,darkgreen
15wall,9,&HFF0000,&H800000,blue
Map in rows/columns. Each number is a 0 for free space or a number from the wall table above.
16map,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
17map,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
18map,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
19map,8,0,0,0,0,0,0,0,0,0,0,6,6,6,0,0,0,0,0,1
20map,8,0,0,0,0,0,0,0,0,0,0,6,0,6,0,0,0,0,0,1
21map,8,0,0,0,0,0,0,0,0,0,0,6,5,6,0,0,0,0,0,5
22map,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
23map,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
24map,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
25map,8,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,0,0,1
26map,8,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,6,0,0,1
27map,8,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,0,0,1
28map,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
29map,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
30map,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
31map,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
32map,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
33map,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
34map,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
35map,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,1
Mobile definition: name of the mobile, followed by X/Y position, two walking animation frames (in .ico format), and a string to say on interaction.
36mobile,Maid,2,2,s_maid1.ico,s_maid2.ico,Fine weather- isn't it?
Warp definition: location to warp from on current map (X/Y), followed by name of map to warp to and location to start there (X/Y), followed by angular facing direction.
37warp,5,18,Cave.csv,4,2,7.912095E-02,0.996865,0.657931,-5.221983E-02

Mobile icons are 16 colors Windows 3.x format. In theory, they can be 32x32, but it's only been tested with 16x16.

Table of Contents

  1. Introduction
  2. Playing
  3. Data Formats