Open Racer: The Free Software Tux Racer Derivative

News About Contributing  Multimedia_Hacks  Download Screenshots Mailing List  WorldForge   

~.~.~.~.~.~.~. ~.~.~.~.~.~.~.~.~.~.~.~.~.~. ~.~.~.~.~.~.~.~.~.~.~.~.~.~.
~.~.~.~.~.~.~. ~.~.~.~.~.~.~. ~.~.~.~.~.~.~. ~.~.~.~.~.~.~. ~.~.~.~.~.~.~.
Open Racer Maps... v0.0.0.2
~.~.~.~.~.~.~. ~.~.~.~.~.~.~. ~.~.~.~.~.~.~. ~.~.~.~.~.~.~. ~.~.~.~.~.~.~.
~.~.~.~.~.~.~. ~.~.~.~.~.~.~.~.~.~.~.~.~.~. ~.~.~.~.~.~.~.~.~.~.~.~.~.~.
(based on Tux Racer 0.6.x) (Mandrake 8.0 rpm based intro to TuxRacer/OpenRacer maps)

< Current variation of this file is pre-OpenRacer, for initial OpenRacer release... >

by Gregory W. Brubaker

errors in this file may be dirrected to the Open Racer Mailing List (openracer@worldforge.org)...
This File never claims to be relevant for anything released after what it claims relevancy for...
Get the most current media files (0_0_0 pre 3)


Basics / course.tcl / tree.rgb ("Tree Map")

Maps are found in the /usr/share/tuxracer/courses/ (or appropriate) directory...

The Map "Bumpy Ride", would thus be found under:

/usr/share/tuxracer/courses/bumpy_ride/

It includes the file course.tcl:
#
# Course configuration
#
tux_course_name "Bumpy Ride"
tux_course_dim 60 560 30 550 ;# width, length of course in m
tux_start_pt 30 2.5 ;# start position, measured from left rear corner
tux_angle 30 ;# angle of course
tux_elev_scale 8.0 ;# amount by which to scale elevation data
tux_elev elev.rgb ;# bitmap specifying course elevations
tux_terrain terrain.rgb ;# bitmap specifying terrains type


tux_course_init

As well as RGB images (here included as jpegs/gifs):


Preview Picture of the course

preview.rgb
- an ingame screenshot of the course


Elevation Map

elev.rgb
- an elevation map (grayscale) of the corresponding course


Terrain information

terrain.rgb
- a (grayscale) terrain map of the corresponding course (White, Black, and any Grey)


Placement of trees and other items

trees.rgb
- a relatively cryptic (at first glance) "tree map" of the corresponding course.


Now, you don't have to take my word for it, but those are the very files used by the game, as you see them there (colors and shades may be distorted, as has been file type)... Exactly that size (60x280 pixels)... Basicly those Shades/Colors.

If you are starting a new map, you will need to be able to interpret all of the above; but lets start with the hardest part, the size... Apparently, the length 560 equals the length of the 3 RGB files / 2. Or 280x2 = 560. This makes a little sence, in that the faster you are going, the less you'll notice the lands length, and the more import the lands width, in a sence... 60 is also apparently the maps width, which would then give the maps width a 1:1 proportion of pixels to maps blocks/chuncks. You'll also notice (in the file), that on this map we start in the middle (30), and 2.5 units away from the back of the map, or 1 pixel and a forth forward from the back of the texture maps... This entire map is at an elevation of 30 degrees, regardless of what the elevation map might make you think (elevation maps thus can be done as if the world is flat...) And we see that this map is actualy scaling the elevation map by a factor of 8 (changing this factor would allow you break out of the theoreticaly possible elevations ).

It would be cool if Red equaled the very bottom, Green equaled the ceiling above the very bottom, and Blue equaled a floor above Green... Or, if R, G, and B where each their own floor... This makes some sence in that the individual RGB values are currently being wasted on elevation maps... However, even anything of that type might not be as easy as you think (you could do one layer at a time in the gimp, and then combine them...). But this isn't the case. Elevation maps are in Grey. The brighter the higher, the darker the lower...

Actualy, you will also find that this map has its elevation and terrain maps dynamicaly configured, while the trees.rgb file would apear to be the static name for such a file... ( in course.tcl )

Wait a minute, what are those other variables, 30 and 550??? I would suggest the only possiblity that makes sence is that they are the position of the goal, or end of the map...

Ok, fine, but what about that cryptic trees.rgb file??? I can't be 100% certain, but I would bet the bottom dollar that red dots are flags, white dots are trees, and that cyan dots are fish... Of course, there is also a yello dot, whose origin I have no guess... other than maybe another fish??? Or maybe the goal???



RGB Dot Colors:
General Color Description:
(source)
Actual Color Usage:
? Guess ? Use?
(0,0,0)
black
default
blank

***

(used with and like black)
found on bunny hill, next to brighter blocks...
not apparent on bumpy ride...


bad


(used with and like white)
found on bunny hill

bad

(255,255,255)
white
courseinit
Tree
***
(255,96,0)
orange
courseinit
Barren Tree (Dead)
***
(194,40,40)
red
courseinit
flag
***

light blue
bunny
bumpy ride




(28,185,204)
light blue
courseinit
fish / herring
***

cyan
bumpy ride (only once)

bad


dark cyan
bumpy ride
Tfine, but what about that cryptic <b>trees.rgb; file??? I can't be 100% certain, but I would bet the bottom dollar that red dots are flags, white dots are trees, and that cyan dots are fish... Of course, there is also a yello dot, whose origin I have no guess... other than maybe another fish??? Or maybe the goal???


;# 3rd entrance
#tux_start_pt 48 60 ;# 4th entrance
#tux_start_pt 45 160 ;# mid ramp
#tux_start_pt 14 160 ;# mid floor
tux_angle 23
tux_elev_scale 25
tux_base_height_value 67
tux_elev elev.rgb
tux_terrain terrain.rgb

tux_course_init

Of course, I picked this map as an example out of simplicity... Its terrain file is actualy 200x400, a 1:1 of what the course.tcl file claims... which compared to the file above, seems to question how much the dimensions of this file matter... But assuming this map works, I would reccomend something of this type...

Its trees.rgb file would appear to be invalid, as its all black, and not the same size as the terain and elev files (its 44x45)... While its preview is 128x128, the same as our other map's preview image... A set and important standard? Also, it appears to be created with multiple start points in mind, however, they appear to be commented out... As well as a "mid ramp" and "mid floor"... Are any of these even supported???

The elev.rgb file also shows a relatively simple elevation map, as well as a terrain.rgb map only showing 2 types of terain (white and black)...

Maybe now its a little late to define the terrain map... Oh well, here it goes:


RGB Dot Colors2:
General Color Description:
(with bad approximations)
Actual Color Usage:
? Guess ?
(0,0,0)
black

ice?
(128,128,128)
any grey (Tux 0.6.x)

rock
(255,255,255)
white

snow

Wow, that s interesting... Does the greys actualy matter? Do they actualy affect speed? Do they actualy effect texture? Nope! Texture is defined by the Shade Black/Grey/White, but friction coefficients are set in ~/courses/common/courseinit.tcl ...

This being a "terrain map", one could assume it will not always stay black and white... Maybe color sets will be added for Snow / Sand / Grass / Rock / et cetra... Or, maybe this will be handled by a map environment variable... But the masses will still want more than 3 textures per map, if they can... I would reccomend at least having every combination of 255 and 0 as being a texture: (0,0,0), (0,0,255), (0,255,0), (0,255,255), (255,0,0), (255,0,255), (255,255,0), (255,255,255)... That would allow 8 textures per environment, or, you could similarly use 255, 128, and 0... Allowing 27? different textures (per environment)... But who really wants to make such maps using so many textures, through such a scheme??? But I guess you could leave the people to use as many or as few textures out of the environment set as they choose...

On with the show...


Cups, Time, Score, Herring...


Here is the course_idx.tcl file... its under courses, and defines some important things, like what maps are in what cup...


#
# Procedure to get course name, author, and par time from course.tcl file.
#
proc get_course_info { } {
if [catch {open course.tcl r} fileId] {
puts stderr "Couldn't open course.tcl in [pwd]"
return {}
}

set name ""
set author ""
set par_time ""

while {[gets $fileId line] >= 0} {
regexp {tux_course_name ([^;])} $line match name
regexp {tux_course_author ([^;])} $line match author
regexp {tux_par_time ([^;])} $line match par_time

if { $author != "" && $name != "" && $par_time != "" } {
break;
}
}

if { $author == "" } {
set author "Unknown"
}

if { $name == "" } {
set name "Unknown"
}

if { $par_time == "" } {
set par_time 120.0
}

# Remove quotes around strings, etc.; e.g. "Jasmin Patry" -> Jasmin Patry
eval "set name $name"
eval "set author $author"
eval "scourse. Muliple paths allow you to take low or high roads, each with their own challenges." \
-par_time 70.0 \
} \
{ \
-course bunny_hill -name "Bunny Hill" \
-description "Use clever turning to conquer the Bunny Hill." \
-par_time 40.0 \
} \
{ \
-course twisty_slope -name "Twisty Slope" \
-description "Tight twists make grabbing herring difficult. Hard turns will lead you to victory." \
-par_time 40.0 \
} \
{ \
-course bumpy_ride -name "Bumpy Ride" \
-description "This hill has a series of ramps tackle. Make sure to line yourself up before getting airborne." \
-par_time 40.0 \
} \
} \
$contrib_course_list \
]

tux_load_texture herring_run_icon common/herringrunicon.rgb 0
tux_load_texture cup_icon common/cupicon.rgb 0

tux_events {
{
-name "Herring Run" -icon herring_run_icon -cups {
{
-name "Canadian Cup" -icon cup_icon -races {
{
-course bunny_hill \
-name "Bunny Hill" \
-description "Use clever turning to conquer the Bunny Hill." \
-herring { 23 23 23 23 } \
-time { 37 35 32 30 } \
-score { 0 0 0 0 } \
-mirrored no -conditions sunny \
-windy no -snowing no
}
{
-course twisty_slope \
-name "Twisty Slope" \
-description "Tight twists make grabbing herring difficult. Hard turns will lead you to victory." \
-herring { 24 24 24 24 } \
-time { 43 40 34 31.5 } \
-score { 0 0 0 0 } \
-mirrored no -conditions sunny \
-windy no -snowing no
}
{
-course bumpy_ride \
-name "Bumpy Ride" \
-description "This hill has a series of ramps tackle. Make sure to line yourself up before getting airborne." \
-herring { 18 18 18 18 } \
-time { 35 30 28 27 } \
-score { 0 0 0 0 } \
-mirrored no -conditions sunny \
-windy no -snowing no
}
}
}
}
}
}


cd $cwd


Personaly, I'd reccomend allowing the player to get less herring, because you want the game to be fun, don't you??? Also, you will see that virtualy no maps are actualy part of the main game... apparently... someone will probably want to increase the Cups...


Fog, Light, Environment, Fish, Flags, Trees, Rocks/Ice/Snow, more "Light"

The courseinit.tcl file under ~/courses/common defines all the major things, like colors mentioned above...

#Course initialization script
#sets basic course paramaters before the lighting is set.

set cwd [pwd]
tux_goto_data_dir
cd courses/common

source tree_polyhedron.tcl

tux_load_texture fish herring_standard.rgb 0
tux_item_spec -name herring -diameter 1.0 -height 1.0 \
-texture fish -colour {28 185 204} -above_ground 0.2

tux_load_texture shrub shrub.rgb 0
tux_tree_props -name tree3 -diameter 1.4 -height 1.0 \
-texture shrub -colour {0 255 48} -polyhedron $tree_poly \
-size_varies 0.5

tux_load_texture tree tree.rgb 0
tux_tree_props -name tree1 -diameter 1.4 -height 2.5 \
-texture tree -colour {255 255 255} -polyhedron $tree_poly \
-size_varies 0.5

tux_load_texture tree_barren tree_barren.rgb 0
tux_tree_props -name tree2 -diameter 1.4 -height 2.5 \
-texture tree_barren -colour {255 96 0} -polyhedron $tree_poly \
-size_varies 0.5

#tux_load_texture finish_f f.rgb 0
#tux_tree_props -name tree4 -diameter 2.0 -height 2.0 \
# -texture finish_f -colour {255 0 253} -polyhedron $tree_poly \
# -size_varies 0.0

#tux_load_texture finish_i i.rgb 0
#tux_tree_props -name tree5 -diameter 2.0 -height 2.0 \
# -texture finish_i -colour {255 56 253} -polyhedron $tree_poly \
# -size_varies 0.0

#tux_load_texture finish_n n.rgb 0
#tux_tree_props -name tree6 -diameter 2.0 -height 2.0 \
# -texture finish_n -colour {255 93 252} -polyhedron $tree_poly \
# -size_varies 0.0

#tux_load_texture finish_s s.rgb 0
#tux_tree_props -name tree7 -diameter 2.0 -height 2.0 \
# -texture finish_s -colour {251 125 250} -pocourse. Muliple paths allow you to take low or high roads, each with their own challenges." \
-par_time 70.0 \
} \
{ \
-course bunny_hill -name "Bunny Hill" \
-description "Use clever turning to conquer the Bunny Hill." \
-par_time 40.0 \
} \
{ \
-course twisty_slope -name "Twisty Slope" \
-description "Tight twists make grabbing herring difficult. Hard turns will lead you to victory." \
-par_time 40.0 \
} \
{ \
-course bumpy_ride -name "Bumpy Ride" \
-description "This hill has a series of ramps tackle. Make sure to line yourself up before getting airborne." \
-par_time 40.0 \
} \
} \
$contrib_course_list \
]

tux_load_texture herring_run_icon common/herringrunicon.rgb 0
tux_load_texture cup_icon common/cupicon.rgb 0

tux_events {
{
-name "Herring Run" -icon herring_run_icon -cups {
{
-name "Canadian Cup" -icon cup_icon -races {
{
-course bunny_hill \
-name "Bunny Hill" \
-description "Use clever turning to conquer the Bunny Hill." \
-herring { 23 23 23 23 } \
-time { 37 35 32 30 } \
-score { 0 0 0 0 } \
-mirrored no -conditions sunny \
-windy no -snowing no
}
{
-course twisty_slope \
-name "Twisty Slope" \
-description "Tight twists make grabbing herring difficult. Hard turns will lead you to victory." \
-herring { 24 24 24 24 } \
-time { 43 40 34 31.5 } \
-score { 0 0 0 0 } \
-mirrored no -conditions sunny \
-windy no -snowing no
}
>





 
Layout from Open Source Web Design  |  Contact Me

  Copyleft 2001 by J. Nathan Matias