Elite / Frontier The Innocence Project

The Innocence Project

Before you read any further and waste your time. This is NOT an Elite remake project. Heck, this isn't even a game. It's designed as a programming tutorial. One that I'm in the process of writing.

The goal of this programming tutorial, which will be video'd and uploaded to youtube when it's finished. Is to teach programmers how to create a basic space flight engine, with basic yaw, pitch and roll controls. A sun, a planet and an orbiting space station. So before anyone gets too excited. This is what the tutorial will NOT teach you how to do.

  • Fight other ships
  • Blow up stuff
  • Annoy the police into attacking by firing at a station
  • Use any kind of weapon
  • Land on planets
  • Get attacked by pirates
  • Pick up space cargo
  • Mine
  • And alot of other cool elite stuff.

What the tutorial WILL teach you to do is create a:

  • basic flight engine
  • basic Jump Drive routine
  • simple star system with 1 sun, 1 planet, 1 station
  • simple Two star system you can hyperjump between
  • simple ship purchasing and sales system (basically increases cargo capacity)
  • ship upgrade system (increase speed, cargobay size, and fuel capacity, passenger cabins)
  • simple stockmarket to sell and buy from
  • simple message board populated with people wanting to goto the other system based on your reputation
  • simple reputation system. Higher your rep, the better you get paid.
  • banking system
  • invantory system
  • smuggling system
  • simple Collision system
  • simple Docking system

So there will be quite alot to learn from this tutorial.

Things to know:

The language I'm using is a variation of BASIC. Elite was originally programmed in BBC Basic of course. So you can relive a little of the development process Brabel and Bell may have gone through. Though I don't pretend my work will be anything like as good as theirs! The language is DarkBASIC Professional, it's free to download from www.darkbasicpro.com so you can take my source code and compile it yourselves. Or play with it. It won't cost you a penny to do so, so have fun.

I will host my latest project build and source code on filefront which is free to download from http://www.filefront.com/15433137/Innocence-Build-001.exe/

This is the very first build version 0.0.1 bear in mind I've been coding for all of 15 minutes! But in there is a basic Freeflight engine, jump drive, and speed control. I've also included a simple sun object and some labels. You can fly up the

`Types
Type 3D
x as Float
y as Float
z as Float
ax as Float
ay as Float
az as Float
ID as Integer
Speed as Float
Endtype

`Variables
Global Planet as Integer
Global Sun as Integer
Global Player as 3D
Global Station as Integer

Sync On
Sync Rate 60
Backdrop On
Color Backdrop 0
Autocam Off
Set Camera Range 1, 9999999999

Setup_System()
Point Camera 0, Object Position x(Sun), Object Position y(Sun), Object Position z(Sun)

Do

if Inkey$() = "w" then Pitch Camera Down 0, 1
if Inkey$() = "s" then Pitch Camera Up 0, 1
if Inkey$() = "a" then Turn Camera Left 0, 1
if Inkey$() = "d" then Turn Camera Right 0, 1
if Inkey$() = "q" then Roll Camera Left 0, 1
if Inkey$() = "e" then Roll Camera Right 0, 1
if Inkey$() = "," then Dec Player.Speed, 0.1 : If Player.Speed < -25 then Player.Speed = -25
if Inkey$() = "." then Inc Player.Speed, 0.1 : If Player.Speed > 100 then Player.Speed = 100
if Inkey$() = "j" and Player.Speed > 90 then Move Camera 0, 5000 : Text 0, 10, "Jump Drive Active" : else Move Camera 0, Player.Speed

If Object In screen(Sun) then Text Object Screen x(Sun), Object Screen y(Sun), "Sun"
If Object In screen(Planet) then Text Object Screen x(Planet), Object Screen y(Planet), "Planet"

Text 0, 0, "Speed: " + str$(Player.Speed)

Sync
Loop

Function Obj_id()
Do
Inc Output
If Object Exist(Output) = 0 then Exit
Loop
EndFunction Output

Function Setup_System()

` Make the planet object
Planet = Obj_id()
Make Object Sphere Planet, 1000000
Color Object Planet, rgb(0, 255, 64)

` Make the planet object
Sun = Obj_id()
Make Object Sphere Sun, 100000
Position Object Sun, 10000000, 0, 10000000
Color Object Sun, rgb(255, 128, 0)

EndFunction

This is the first lot of code. The next lot will be commented and more organised. But this should give you an idea of what to expect.

Something to note about DarkBASIC Professional, if you want to work on this in C++ you can install DarkGDK which is hosted on the Microsoft Visual C++ Express 2008 website. The functions are the same as the DarkBASIC Profesional code, the only difference is you have to put db in front of commands and remove the spacing. For example

text would be dbText() and Make Object Cube would be dbMakeobjectcube() so it's pretty easy to port across.

I however prefer using DBPro myself, because it's a great prototyping language. Quick, easy to read, fast to compile and debug.

I hope you enjoy!
 
Last edited:
Back
Top Bottom