BeSly - BeOS, Haiku & Zeta
knowledge base (Haiku only)

Select your language

  • Русский (Россия)
  • Português do Brasil (pt-BR)
  • Polski (PL)
  • Italiano (IT)
  • Deutsch (Deutschland)
  • Français (France)
  • Nederlands (nl-NL)
  • English (United Kingdom)
  • Login
  • Home
  • Books / Magazine
    • BeOS, Haiku and Zeta Magazins
    • Haiku, BeOS and Zeta Books
  • Article
    • BeSly
      • BeSly, BeOS and Zeta knowledge base is 1 year old!
    • BeGeistert
      • BeGeistert 005
      • BeGeistert 008
      • BeGeistert 010
      • BeGeistert 012
      • BeGeistert 017
      • BeGeistert 019
      • BeGeistert 021
      • BeGeistert 022
      • BeGeistert 023
      • BeGeistert 025
      • BeGeistert 026
      • BeGeistert 028
      • BeGeistert 029
    • FOSDEM
      • FOSDEM 2008
      • FOSDEM 2009
      • FOSDEM 2010
      • FOSDEM 2016
    • Haiku
      • Haiku in 2016
    • How to help
    • Haiku Challenge
    • Versionen
  • Backup
    • Backup of the complete system
    • Backup with LBackup
  • Bug report
    • Report system or program error
    • Syslog - save error information after system crash
  • CD/DVD Tools
    • MKBFS
      • How to create a BFS image from terminal
  • Development
    • BuildLOG
      • BuildLOG documentation
    • C / C++
      • Message Commands
      • Programming for Haiku: Hello World
      • Run a shell script or command with C
    • EGSL
      • EGSL Tutorial
      • EGSL Games
      • EGSL Commands
      • Outrun Deluxe in EGSL
    • Love2D
      • Love2D create executeable files
    • Playground Editor documentation
    • yab
      • yab Beginners tutorial
      • How to sort a array in Yab
      • yab-shuffle cards
      • How to calculate the average of many number with yab
      • Using objects in yab
      • yab - Game Tutorial
      • How to test yab programs properly
      • Use a central partition to create your yab programs
      • yab - Lelldorins programming guidelines
      • The yab - What is What?
      • yab FAQ
      • yab - special characters in text
      • Tutorial to adding new commands to yab
      • yab Commands
      • yab and the Layout command
      • yabIDE basics
    • yabasic
    • How to set the App Version and Description long text
  • EMail
    • Beam
      • Tips and tricks
      • Beam Setup Filters - Mail - SPAM
      • BeMail, Beam... Mail addresses
    • Haiku Mail
      • Haiku Mail
  • Emulator
    • DosBox
      • DosBox
      • DOSBox GUI Tutorial
    • eUAE
      • eUAE quick guide
  • Games
    • 2Pow
    • Aleph One - Description
    • Astrorocks
    • Bshisen
      • BShisen - Description
      • BShisen - How to create a Tileset
    • Bubble Chain
    • Click-O-Manie Description
    • ColorBalls - Description
    • Crimson Fields
      • The Tiles-Crimson Fields
      • The Units-Crimson Fields
      • The Buildings-Crimson Fields
      • The Map-Editor-Crimson Fields
      • How to install crimson fields
      • How to compile Crimson Fields
      • How to play Crimson Fields
    • Diamond Girl - Create your own levelsets
    • eDuke - Duke Nukem 3D
    • Exult - Ultima 7 for Haiku
    • FreeSCI - portable interpreter for Sierra games
    • Gaming on Haiku
    • Gem Drop X - Description
    • Hermes - Run A La Carte
    • Hopkins FBI - Description
    • Installing and using GemRB on Haiku
    • Keen Döskopp - Description
    • KIDS
    • Mahjongg - How to create a tileset
    • Still Yet Another Sokoban
    • Wallman
    • Wolfenstein 3D - Description
  • Hardware
    • Haiku - inofficial hardware compatibility list
    • External Monitor from a Laptop
    • BeSly SAT - Hardware List (Complete System)
    • BeSly SAT - Hardware List
  • Internet
    • Beshare
      • BeShare - Tips and Tricks
      • BeShare - Setting and Operation
      • The BeShare Handbook
    • Filesharing with Poorman
    • Freelists
      • FreeLists.org - How to
    • UberTuber - Description
    • Vision
      • Vision - Tips and Tricks
      • Vision Commands
      • Setup Vision (IRC Client)
    • Voptop
      • Voptop Description
  • Installation
    • Bootmanager
    • how to generate a bootable usb stick (under Windows)
    • New installation - secure and insert your data
    • Haiku installation
  • Live-Stick
    • Enlarge haiku usb stick to use it as a live stick
  • Misc programs
    • BeSly-Tutorial Finder
    • Drop2Sort Text Entrys - Sorting Text contents alphabetically
    • Drop2Number+Copy - multiple rename
    • Ghostscript GUI
  • Music
    • TopLIsta
      • TopLIsta Dokumentation
  • Office
    • GoBe Productive
      • GobeProductive 2.0 for Haiku
  • Package Management System
    • Haiku Package - Tips and Tricks
    • Create Haiku package (HPKG) file through Terminal
    • HPKG Creator
    • Setting up a software repository
    • Repomaker
    • Repository Servers
    • Porting a compiled program to Haiku
    • Manually install system files
  • Painting
    • ArtPaint
    • ImageMagick
      • ImageMagick tips and tricks
    • Icon-o-Matic
      • Icon-o-matic - Creating a simple icon
      • How to add a icon to a binary
      • Icon-o-matic Tips and tricks
    • Wonderbrush
      • Change image size
      • Edit pictures in Pixel area
      • Wonderbrush - How to edit screenshots
  • Preferences
    • Patterning the automated Haiku menus
  • Systemstartup
    • Avoid increasingly longer boot times
    • Blacklist - Ignore problematic hardware
  • System tools
    • AttrL
      • AttrLOption - Short description
    • BeSlySAT
      • BeSlySAT - System Analysis Tool
    • Haiku's Screenshot - Description
    • HiQ-Dock
      • HiQDock - A Dock for Haiku
    • KeymapSwitcher
    • Menu Sorter
      • Menu Sorter
    • TAR GUI
      • tar-gui
    • Zip-Gui
      • ZIP GUI Description
  • Terminal / Bash
    • Bash_history Switcher - Description
    • create a people file using the terminal
    • How to create Image of a Floppy Disk
    • Mounting over the Terminal
    • Replicant
      • Create a replicant in the Deskbar Tray
    • Shell Scripts
    • Startscript for Programs who only runs over the Terminal
    • tar
  • System
    • Systemoverview
How to help us?

Who wants to help this project, can do this writing their own tutorials, descriptions or translations. Also ideas or criticisms are welcome.

To make your own tutorials you have some helpful informtions and opportunities. The easiest way is, you write your tutorial and send it to: webmaster(at)besly.de. It is important that this is really an own tutorial, as there could be legal problems to the original authors otherwise.

We have 168743 guests and 4 members online

  1. You are here:  
  2. Home

Welcome

Details
Written by: admin
Category: Willkommenstexte
Also available: Italiano (IT) Deutsch (Deutschland)
Published: 28 September 2022
Created: 28 September 2022
Last Updated: 30 September 2022
Hits: 28816

Welcome on BeSly the Haiku knowledge base.

This site are created to help other users and developers. What to start, has begun in August 2004 with only German translations and little tutorials has now become a comprehensive, informative, multi-lingual knowledge base.

It contains a variety of assistance to install, program descriptions, program and system settings. We always try to make the tutorials easy to understand with a simpe but effect layout. In the years the site is online many ideas are included into the website. Idears from other users, like the system information at the beginning of every tutorial.

The menu structure is designed so that all instructions are displayed sorted by their program type. You can also use the search function to find tutorials.

There is also a small Software that allows you to find BeSly tutorials. Here also all programs listed by there program type, but also by the system type, language or authors. Even the smallest instructions are included, usually found only in collections of "Tips and Tricks".

Due to the similarity between the systems, wich are all have the same basis or be a rebuild, many of the tutorials are applicable on all systems.

Who wants to help this project, can do this writing their own tutorials, descriptions or translations. Also ideas or criticisms are welcome.

With the relaunch of BeSly it is now possible for the user to write the instructions themselves in the web interface. Even uploading pictures should be no problem. The only condition is to log on the BeSly. Your data will not pass from us. 

How to set the App Version and Description long text

Details
Written by: lorglas
Category: Development
Published: 31 March 2023
Created: 31 March 2023
Last Updated: 04 April 2023
Hits: 3944

Sometimes you want to add the Version Info and a description to your program.

In this example you can see that the version and description (Beschreibung) is empty.

setversion1.png

To set this, you can use the command setversion over the terminal. to do that, open the Terminal and type setversion -h and press Enter. 

setversion -h

After this you get this information.

setversion: you did not specify any version

Usage: setversion filename
[ -system <major> <middle> <minor>
[ [ d | a | b | g | gm | f ] [ <internal> ] ]
[ -short <shortVersionString> ]
[ -long <longVersionString> ] ] # system info
[ -app <major> <middle> <minor>
[ [ d | a | b | g | gm | f ] [ <internal> ] ]
[ -short <shortVersionString> ]
[ -long <longVersionString> ] ] # application info

To set the version and the description you can use the example code below.

Example code:

setversion /Share/Projekte/yab_hpkg/repomaker/repomaker_0.4.5 -app 0 0 0 -long "This is a tool to manage your own Repository"

In this example i define the location of the app. After that, i write the version for major middle minor.

Keep in mind, that between the major middle and minor value is a space, not another character. No Minus or dot or somethink else.

 After the minor string it is possible to set the long version info text with

-long "This is a tool to manage your own Repository"

If you set the app version and the long description with the previous example code, you get this result.

setversion2

Here are a list of further option, but i didn't test it right now.

d development
a alpha
b beta
g gamma
gm goldenmaster
f final

 

 

Outrun Deluxe in EGSL

Details
Written by: lorglas
Category: EGSL
Also available: Deutsch (Deutschland)
Published: 27 February 2026
Created: 27 February 2026
Last Updated: 27 February 2026
Hits: 65

1. Introduction

We wanted to create a small Outrun Deluxe in EGSL (Easy Gaming Scripting Language by Markus Mangold). The goal was:

  • A perspective road
  • Player car and enemy cars
  • Curves and drifting
  • HUD (time, speed)
  • Decorative elements such as palms
  • Background music

EGSL is great for simple 2D games using sprites, rectangles, and circles. However, for creating true perspective 3D effects, there are limitations that we will explore throughout this tutorial.


2. Basic Structure

First, we defined the game variables and settings:

  • Window size: Width and height of the game window
  • Track parameters: Road width, segment length, drawing distance, and camera depth
  • Speed settings: Maximum speed, acceleration, braking, deceleration, and drift factor
  • Player state: Current speed, lateral position (playerX), track position (pos), and remaining lap time
  • Colors: Top and bottom sky colors for the gradient
  • Arrays: One for track segments (track) and one for enemy cars (cars)
  • Sprites: Player car, enemy car, and decorative elements like palms

Example initialization in EGSL:


-- Fenstergröße
W = 960
H = 600

-- Strecke
ROAD_W = 2000
SEG_LEN = 5
DRAW_DIST = 150
CAM_DEPTH = 0.84

-- Geschwindigkeit
MAX_SPEED = 400
ACCEL = 2
BRAKE = 4
DECEL = 1
DRIFT_FACTOR = 0.1

-- Spielerzustand
speed = 0
playerX = 0
pos = 0
lapTime = 75.0

-- Farben Himmel
skyTop = {r=255,g=120,b=120}
skyBottom = {r=255,g=200,b=120}

-- Arrays
track = {}
cars = {}

-- Sprites
playerSprite = nil
enemySprite = nil
palmSprite = nil

This foundation sets up all variables we will need for the track, the player, the enemies, and the graphics.

Next, we would implement track generation, player/enemy updates, and rendering, building upon these basic structures.

3. Generating Track and Enemies

We created the road as a table of segments. Each segment contains:

  • curve → The curvature of the segment
  • y → Elevation of the segment
  • color → Road color
  • deco → Random decoration, such as palms

Example in EGSL:


function createTrack()
   for i = 0,799 do
      local s = {}
      s.curve = math.sin(i*0.04)*2 + math.sin(i*0.01)*4
      s.y = math.sin(i*0.02)*50
      s.color = (i % 2 == 0) and {r=70,g=70,b=70} or {r=60,g=60,b=60}
      s.deco = (math.random(0,4) == 0)
      table.insert(track, s)
   end
end

Enemy Cars Placement

The enemy cars are randomly distributed along the track to create a dynamic challenge for the player. Each enemy’s position along the track (z) and lateral offset (x) is chosen randomly:

function spawnCars()
   for i = 1,20 do
      local c = {}
      c.z = math.random() * (#track * SEG_LEN)
      c.x = math.random()*2 - 1
      c.speed = MAX_SPEED*0.6 + math.random()*50
      c.sprite = enemySprite
      table.insert(cars, c)
   end
end

This ensures that:

  • Enemies appear at different distances from the player
  • Lateral positions vary, so the player must steer to avoid collisions
  • Speed differences create overtaking dynamics

By looping through this table each frame, the enemies move forward along the track and loop back to the start when reaching the end. This gives the appearance of continuous traffic.

4. Player Movement

The player’s movement is frame-based and takes into account:

  • Speed, acceleration, and braking
  • Drifting, which depends on speed and track curves
  • Collisions with enemy cars, reducing speed

function update()
   -- Zeit
   lapTime = lapTime - 0.02
   if lapTime <= 0 then

          return true

    end

    -- Geschwindigkeit
    if keystate(k_up) then

         speed = speed + ACCEL
    elseif keystate(k_down) then

         speed = speed - BRAKE
     else

        speed = speed - DECEL

     end
     speed = math.max(0, math.min(speed, MAX_SPEED))

     -- Drift
    if keystate(k_left) then

          playerX = playerX - DRIFT_FACTOR*(speed/MAX_SPEED)

    end
    if keystate(k_right) then

           playerX = playerX + DRIFT_FACTOR*(speed/MAX_SPEED)

    end

     -- Position
    pos = pos + speed
    if pos >= #track*SEG_LEN then
        pos = 0
        lapTime = lapTime + 20
    end

    -- Gegnerbewegung
    for _,c in ipairs(cars) do
         c.z = c.z + c.speed
        if c.z > #track*SEG_LEN then

             c.z = c.z - #track*SEG_LEN

        end
        if math.abs(c.z-pos) < 20 and math.abs(c.x-playerX) < 0.2 then
              speed = speed * 0.6
       end
   end

   return false
end

Key Points:

  • playerX moves left/right, scaled by speed to simulate drift
  • pos increases according to speed, looping when reaching the end of the track
  • Collisions with enemies reduce the player’s speed, creating a risk-reward gameplay

This system is simple but effective for a pseudo-3D racing effect, as long as the rendering correctly reflects the track perspective.

5. Projection

To create a pseudo-3D perspective, we calculate the on-screen position and width of each track segment and object based on its distance from the camera (z). This gives the illusion of depth:

function project(x,y,z)
   local scale = CAM_DEPTH / z
   local sx = (1 + scale*x) * W/2
   local sy = (1 - scale*y) * H/2
   local sw = scale * ROAD_W * W/2
   return sx,sy,sw,scale
end

Explanation:

  • scale decreases with distance, making far objects appear smaller
  • sx determines horizontal position, shifted by player’s lateral offset
  • sy determines vertical position, simulating height/elevation
  • sw determines road width on screen

By projecting each segment and enemy, we can draw them at the correct size and position relative to the player.

Important: If z is 0, this causes a division by zero, so always ensure z > 0.

 Next, we’ll see how to render the road, side stripes, and decorations using this projection.

6. Rendering the Road

This was the most challenging part, because EGSL has limited drawing capabilities:

  • Only rectangles and lines (box() / fillbox()) are available.
  • The road often appeared as narrow vertical strips, and green side areas sometimes overlapped the road.
  • Curves were barely visible, and large sections sometimes looked uniformly gray.
  • EGSL does not have polygon or triangle functions (filltriangle() is unavailable in standard EGSL), which makes proper 3D perspective difficult.
 

 Simplified pseudo-perspective example:

function render()
   cls()
   drawGradient() -- Himmel

   local base = math.floor(pos/SEG_LEN)
   local camH = 100
   local x, dx = 0, 0

   for n = 0,DRAW_DIST do
       local seg = track[(base+n) % #track + 1]
       local z1 = (n*SEG_LEN) - (pos % SEG_LEN)
       if z1 <= 0 then

           z1 = 0.1

       end

       local sx,sy,sw,_ = project((playerX-x)*ROAD_W, camH-seg.y, z1)
       sx, sy, sw = math.floor(sx+0.5), math.floor(sy+0.5), math.floor(sw+0.5)

       -- Straße
       colour(seg.color.r, seg.color.g, seg.color.b)
       box(sx-sw, sy, sx+sw, H) -- untere Hälfte des Bildschirms

       dx = dx + seg.curve
       x = x + dx
    end
end

Observations:

  • Only rectangles are drawn; true trapezoidal perspective is impossible
  • Side areas (green borders) need careful positioning, otherwise they cover the road
  • Curvature (curve) and elevation (y) have minimal effect on the visual result

This demonstrates EGSL’s fundamental limitation for pseudo-3D racing games. Without polygons or triangles, it is almost impossible to render a convincing Outrun-style road.

Next, we’ll discuss decorations, enemy cars, and HUD, which were easier to implement.

7. HUD, Enemies, Player, and Decorations

Once the road is projected, we can overlay the other game elements:

Enemy Cars

  • Drawn with putimage() at the projected position:
for _, c in ipairs(cars) do
  local dz = c.z - pos
   if dz < 0 then
      dz = dz + #track*SEG_LEN
   end
   if dz > 0 and dz < DRAW_DIST*SEG_LEN then
       local sx, sy, sw, scale = project(c.x*ROAD_W, 100, dz)
       putimage(sx, sy-20, enemySprite)
    end
end
  • Enemies move along the track and wrap around when reaching the end

Player Car

  • Always drawn near the bottom center of the screen:
putimage(W/2, H-60, playerSprite)

Decorations (e.g., Palms)

  • Added randomly per segment based on seg.deco:
if seg.deco and n % 10 == 0 then putimage(sx+sw*1.2, sy-50, palmSprite) putimage(sx-sw*1.5, sy-50, palmSprite) end

HUD (Time, Speed)

  • Use bmptext() or equivalent to display player info:
bmptext(20, 20, "TIME: "..math.floor(lapTime), myfont) bmptext(20, 50, "SPEED: "..math.floor(speed), myfont)

Key Takeaways:

  • These elements are 2D overlays, drawn after the road
  • They are relatively straightforward in EGSL
  • The major visual challenge remains the road itself

This allows the game to show moving cars, decorations, and HUD, even though the pseudo-3D road is still very limited.

 

8. Music

function initMusic()
   gamesound = loadsound("Blaster.wav")
   playsound(gamesound,16,2,true)
end

 9. Main-Loop

function main()
   openwindow(W,H,32,"OUTRUN DELUXE")
   math.randomseed(os.time())
   colorkey(0,0,0)
   KeysConst() -- Tasten

   createTrack()
   spawnCars()
   initMusic()

   local gameover = false
   repeat
   key = getkey()
   if key == k_esc then

       break

   end
   gameover = update()
   render()
   sync()
   until key == k_esc or gameover

   closewindow()
end

main()

10. Conclusion: Is EGSL Suitable for Outrun?

Advantages of EGSL:

  • Simple and beginner-friendly
  • Great for 2D sprites, rectangles, and lines
  • Ideal for simple 2D games

Problems with pseudo-3D road:

  • No polygon or triangle functions (filltriangle())
  • Rectangles cannot produce a true perspective road
  • Curves, green borders, and lane stripes overlap incorrectly, making the road look narrow and flat
  • Division by zero errors must be carefully avoided when projecting

Key takeaway:

  • Achieving a realistic Outrun-style pseudo-3D is not feasible in EGSL
  • For a true perspective racing road, you need an engine that supports polygons/triangles, for example:
    • LOVE2D (Lua-based)
    • Unity (C#)
    • Godot (GDScript/C#)

Conclusion:

EGSL is not suitable for a full Outrun Deluxe with a proper pseudo-3D road. It works well for simple 2D gameplay, but the visual fidelity needed for a racing game like Outrun cannot be achieved.

Imprint
Haftung
Die Nutzung von BeSly erfolgt auf eigenes Risiko. Eine Haftung oder Gewährleistung für die Inanspruchnahme unserer Dienste und Inhalte oder deren Verfürgbarkeiteit wird nicht übernommen. Wir übernehmen ferner keine Verantwortung für Inhalte außerhalb von BeSly, auf die wir verweisen.
Die BeSly übernimmt außerdem keine Gewähr für Inhalte in Bereichen, in denen von Besuchern automatische Eintragungen vorgenommen werden können (z.B. Foren). Sollten Sie Inhalte entdecken, die gegen Gesetze verstoßen oder in denen Rechte Dritter verletzt werden, informieren Sie uns bitte sofort per E-Mail an webmaster@besly.de oder webmaster@lelldorin.de, damit wir diese Inhalte bis zur Klärung des Sachverhalts sperren können.

 

Webmaster und Gestaltung:
Name: Lorenz Glaser
Strasse: Stammannstr. 35 
Ort: 22303 Hamburg
EMail: webmaster(at)besly.de
   
Name: Christian Albrecht
Strasse: Stolbergsstrasse
Ort: 22085 Hamburg
EMail: webmaster(at)lelldorin.de