Epic Space Game

User projects written in or related to FreeBASIC.
TESLACOIL
Posts: 1769
Joined: Jun 20, 2010 16:04
Location: UK
Contact:

Epic Space Game

Postby TESLACOIL » Aug 01, 2012 7:33

Epic Space Game Turn based space game similar to Master of Orion, with some real-time elements added, think Starflight

Wing Commander, Homeworld & Elite are other influences. The game arena is the Milkyway and its neighboring satellite galaxies. Im big on open worlds & player freedoms. The play area is pretty large, plenty big enough to keep you occupied regardless of playing style whether it be explorer, conqueror or empire builder. I will be including numerous game tools to make life easier and give you more choices as a player. As you gain experience and acquire new technologies you will find additional help in the form of Senators, Commanders & a HAL n'000 computer which helps automate some of the less illustrious tasks.

Im having a lot of fun building this universe and hope you pick it up and give it a go. The first few posts are just bare bones stuff but as the galaxies start to fill up & the details crystallize you will find its quite good fun just kicking back and exploring whats being built....if your lucky you might spot a sludge pool slowly bubbling into life, don't forget your test tube ! or perhaps stumble across some ancient relic or ruin belonging to a lost civilization...who knows whats really out there, beyond the squawk and static of a million suns.


Epic Space Game ?

Epic = approx 1 million star systems , 10 million planets , 100 million moons , comets, asteroids, trojans, centaurs etc etc

Epic = true to life stars and planets + a little artistic spice , never heard of a Wolf–Rayet star ? apply within

Epic = plausible & realistic technology for the most part

Epic = AI that will have your mouse bouncing off the walls :-p

Epic = Multiplayer LAN fun ( internet play later on down the road )

Epic = designed to make use of your of extra pc's if you have them for that startrek bridge feel





Installment 1 the core game files [this very short prog generates key files and folders & over a gig of data ]

Instructions
> create a new folder
> enter the path of that folder by editing the chdir command below , see the ****
> and now run this code in that folder


Code: Select all


'core game files

dim as ulongint i,ii,x,y,c,num

screenres 1280,720,8

'makes directories
for i =0 to 720-1
mkdir i & "ygmap"
next i
? " game directories created"
?""
?" core game data files take a minute or so to install "
sleep 3000
'sleep:end


for i =0 to 720-1
chdir i & "ygmap"
? i & "ygmap"          ' : sleep

for ii = 0  to 1280-1
OPEN ii & "x" & i & "y" & ".txt"  FOR OUTPUT AS #1
write #1, ii,i,"system name"
close #1
next ii


' **** IMPORTANT substitute your games root folder here
chdir "C:\Documents and Settings\a\Desktop\solospacegame\universe" 




next i
sleep:end


*note the database x,y coords = HD screen resolution 1280x720

As its too much data & code to paste all at once this is just the first installment. Ill post code more as i go along. Once im happy and got feedback/tweak the game ill create a proper installer. The game design is quite modular and transparent so you will be able to create custom scenarios, gfx , sound etc very easily....thats part of the fun with these games




ADDED for clarity, showing the modular layout of the independent game components and their associated root folders. The game can be played on single machine vs the AI but as its designed to be multiplayer over lan or MMORG via internet the modular file structure reflects this.
Image




Further reading & References

Star Size Comparison HD http://www.youtube.com/watch?v=HEheh1BH34Q

Local group http://en.wikipedia.org/wiki/Local_group

Milky Way http://en.wikipedia.org/wiki/Milky_Way

Solar system http://en.wikipedia.org/wiki/Solar_system

List of Moons http://en.wikipedia.org/wiki/List_of_natural_satellites
Last edited by TESLACOIL on Aug 23, 2012 4:04, edited 26 times in total.
Destructosoft
Posts: 88
Joined: Apr 03, 2011 3:44
Location: Inside the bomb
Contact:

Re: Epic Space Game

Postby Destructosoft » Aug 02, 2012 3:05

I will be astonished if/when you accomplish what you have set out to create here.

<--Has worked on a turn-based space game for the last four years and may never get around to finishing it. (Hence why it was not announced in FB forums.)

As your game sounds more vast and elaborate than mine, you have quite a road to pave. I wish you great success.
TESLACOIL
Posts: 1769
Joined: Jun 20, 2010 16:04
Location: UK
Contact:

Re: Epic Space Game

Postby TESLACOIL » Aug 09, 2012 12:43

its a long term project for sure, i spent 6 months just researching

Turn/click based space games are very simple. Most dont even have sound, small still images or outline blueprints suffice for graphics. I enjoy playing them and apart from the server side of things required for online play they are pretty to simple to code. The key trick is to hide what is effectively an excel spreadsheet from the user. That and make navigation of that database a steller experience, scuse the pun.

With space games, due to the inherent simplicity of the main interface/exe players often code up custom tools, battle sim, eco sim, galaxy explorer etc. This splits up the code into manageable sized exes. Such bolt ons /gaming aids have become part and parcel of that game culture. As the games are often browser based the UI and other aspects tend to be very simple so when attacking it with formal code methods its that much easier. My AI, the only other project im working on is also composed of numerous separate exes which communicate via simpel txt.log files....the jump to turn based space games not so large for me. 3d gfx, gl etc bit out of my league and much harder to get up to a cultural exceptable standards from a gamers point of view.

It would be very easy to write a galaxy viewer for the code above, each startype a pixel of a different color. ( if mouse = x,y then open file x,y )

I have been experimenting with importing pictures of real galaxies, bload bmp, and scanning that picture pixel by pixel to create data for my game galaxy. If the bmp is HD resolution 1280x720 then it has a 1:1 ratio with the database above. (if pixel on real galaxy picture = black then starname = nothing but dust here )
TESLACOIL
Posts: 1769
Joined: Jun 20, 2010 16:04
Location: UK
Contact:

Re: Epic Space Game

Postby TESLACOIL » Aug 09, 2012 14:08

WYSIWYG galaxy viewer data integrity checker version 1



Code: Select all

'galaxy viewer data intergity checker version 1


dim as ulongint i,ii,x,y,c,num,starcol



dim as string galviewpath,universepath,q,startype

open "galviewpaths.txt" FOR input AS #1 ' a text file which sits in the galaxyvie.exe folder
input #1,universepath                   'universepath , the path where the main universe data is kept
close #1



?
?"galaxy viewer v1"
?
?" universepath = ";universepath

'sleep:end

screenres 1280,720,8


chdir universepath

for i =0 to 720-1
   
chdir i & "ygmap" '? i & "ygmap" ' : sleep
   
for ii = 0  to 1280-1

OPEN ii & "x" & i & "y" & ".txt"  FOR INPUT AS #1
INPUT #1, x,y,startype,starcol 'NOTE added a 4th field to database for starcolor 0 to 255 just add manually to check this prog
close #1

if starcol = 0 then line (x,y)-(x,y),13 ''? x;y;"system name";ii,i
if starcol > 0 then line (x,y)-(x,y),starcol


'sleep:end
next ii

chdir universepath

next i

chdir curdir
bsave "galaxymap1.bmp",0
cls
bload "galaxymap1.bmp"
?" bloaded galaxy map"

sleep:end



The galaxy viewer UI (user interface) will prolly look something like this and zoomable. As the image and database have a 1:1 ratio as you scoot the mouse across in fully zoomed out mode as seen below you still pull up that star data via mouse x,y coords, fiddly :-p but great fun nonetheless, of course zooming in means you dont need have to posses nano precision mouse fingers !

Feel free to make your own galaxy viewer or galaxy map. Becuase of the the 1:1 ratio of the database (first post) you can just upload a picture of your-galactic creation, indeed any picture can be turned into a galaxy. * best just post a normal hyper link to your HD res picture file rather than try embed it here.

Image






This program takes a few mins to read in all the data, it than saves that data as a bitmap, the bitmap can then be loaded at any time by any other exe and the x,y coords and colour of the pixel at those co ords will give you the x,y coords of the star in the galaxy, and its star type (linked to colour of the star )....so once you have you galaxy built and populated with stars etc you only really have to run this galaxy viewer/data integrity once

explanation

for manual editing its nice to have the data spread out in nice easy to read text files written in long hand, loading and reading all these files at once takes a long time so saving the database visually allows you to load sections of the database near instantly and in a visual WYSIWYG format which can be operated on by using basic inbuilt gfx functions

galaxies are not rectangular , the intention is to have an ovalish shaped starmap wich sits comfortably in the middle of a wide screen display set at HD 1280x720. The main Galaxy will lie at the centre but will have mini satellite galaxies, stray star clusters sprinkled around. The ovalish star map leaves the 4 corners vacant for text display/ data box /gfx box and perhaps a line or two at the very top or bottom of the screen for additional text

Many space games are kind of boring, highly repetitive algorithm based data. Real galaxies are much more interesting so i hope you all wade in and come up with groovy custom systems or or clusters of star systems for everyone else to have fun exploring. Thus far there are only 4 fields x,y starname, starcolour but more will be added. Each star will eventually have fields for size, surface temperature rotation speed what have you. Ill have to come up with a standardized full format, open to suggestions. There is must have data, must have for game data and some misc interesting data. One also has to avoid too much data clutter but this too could added later and perhaps just used with an advanced hyper detailed galaxy viewer. In game culture terms this is sometimes called 'fluff'....There are almost a million warp to locations but this will be reduced to about half a million simply by leaving the data blank. Thats still leaves half a million stars that have to be named !, feel free to have one named after you or your pet rock


Note i added a 4th field to database for starcolor 0 to 255 just add to manually one of the files to check this prog works

eg if starsytem 10,20 has ',10 added' then you should see a green dot at that location on the screen



If you have more than one computer to hand then say running the the main game on one screen and the galaxy viewer / battle calc and other game tools on additional screens for a full on Captain Kirk / Darth Vader experience.

example of game tools used with these types of games
http://www.si-master.com/

detailed breakdown of the Starcontrol database
http://wiki.uqm.stack.nl/Star_Control_Universe
Last edited by TESLACOIL on Aug 23, 2012 0:18, edited 1 time in total.
TESLACOIL
Posts: 1769
Joined: Jun 20, 2010 16:04
Location: UK
Contact:

Re: Epic Space Game

Postby TESLACOIL » Aug 17, 2012 23:34

Solar System viewer mark 1 ( A Game Tool , Reader Class )


Code: Select all

' solar system viewer

dim as string homepath,galdatpath

dim as string starname

dim as integer x,y,col



OPEN "ssvpaths.txt" FOR input AS #1
INPUT #1, galdatpath
CLOSE #1

chdir galdatpath
chdir "0ygmap"

OPEN "0x0y.txt" FOR input AS #1
INPUT #1, x,y,starname,col
CLOSE #1


?
?" solar system viewer "
?
?" galdatpath = ";galdatpath
?
?" test star system = ";x,y,starname,col
?
if starname ="" then beep: ? "  ERROR file not found " : sleep: end

sleep 999




screenres 1280,720,8
width 1280\8, 720\16


?
?" solar system viewer "







sleep : end





the first entry in ssvpaths.txt is the path to the galaxy data folder ( mines @ C:\Documents and Settings\a\Desktop\solospacegame\universe )

just create the ssvpaths.txt file by hand and copy and paste the correct path to your galaxydata folder...where ever you have decided to put it


My setup
im using a 3 computer setup to play this game ( you only need 1 computer), if you have file sharing on your network you can have the solar system viewer run on a separate computer. It should be able to retrieve the date across the network if you paste the correct path into ssvpaths.txt ...the game exe runs on the middle computer, i have dumb viewer terminals left and right running game tools like this 'solar system viewer.' It all looks pretty dossy and drossy right now but it will 'epic up' over time :-D

It is an EPIC game (once completed) , i have in mind inviting friends round for a weekend beerfest, sat there like the crew on the bridge of the starship. Spock trawling through the galaxy viewer searching for subspace anomalies or juicy planets to colonise, another freind , ahem crew member upgrading the technology or designing new ships on another screen. With 100million+ destinations you are going to need a little help....did i mention the n million baddies and NPC's :-p
TESLACOIL
Posts: 1769
Joined: Jun 20, 2010 16:04
Location: UK
Contact:

Re: Epic Space Game

Postby TESLACOIL » Aug 18, 2012 3:56

added some data fields to the starsystem files

Code: Select all

'skeleton code , so you can have fun making your own solar system viewer

dim as string starname,startype,starspec
dim as string starf1,starf2,starf3,starf4,starf5,starf6,starf7,starf8
dim as ulongint x,y,col,starsize,starage,startemp


chdir ????
OPEN "????" FOR INPUT AS #1
INPUT #1, x,y,starname,col,startype,starsize,startemp,starage
INPUT #1, starf1,starf2,starf3,starf4,starf5,starf6,starf7,starf8
INPUT #1, starspec
CLOSE #1



?" x=                          ";x
?" y=                          ";y
?" star name                   ";starname
?" star colour                 ";col
?" star type                   ";startype
?" star size diam miles        ";starsize
?" startemp                    ";startemp
?" star age million years      ";starage
?" ><"
?" starf1                      ";starf1 
?" atarf2                      ";starf2
?" starf3                      ";starf3
?" starf4                      ";starf4
?" starf5                      ";starf5
?" starf6                      ";starf6
?" starf7                      ";starf7
?" starf8                      ";starf8
?" ><"
?" star spec(ial)              ";starspec

sleep:end







example starsystem folder/file format, folder = 3ygmap file = 17x3y.txt

Code: Select all

1
2
Tauri
10
M-type red supergiant
197500000
6300
4500
fact 1
fact 2
fact 3
fact 4
fact 5
fact 6
fact 7
fact 8
star_spec_none


starsystem file 0x0y.txt sit in the folder named 0ygmap , this being the top left most star system

starsystem file 1279x719y.txt sits in the folder named 719ygmap , this being the bottom right most star system
TESLACOIL
Posts: 1769
Joined: Jun 20, 2010 16:04
Location: UK
Contact:

Re: Epic Space Game

Postby TESLACOIL » Aug 22, 2012 9:37

Just spent most of today working out an installer and beefing up the game editors. It should be fairly easy to start adding content to the game once ive included some readme's and a couple of diagrams to get you going.

Viewer class tools

Editor class tools

Code Patcher class tools

its all very WYSIWYG so the data files are easy to edit by hand if that's your preferred style
TESLACOIL
Posts: 1769
Joined: Jun 20, 2010 16:04
Location: UK
Contact:

Re: Epic Space Game

Postby TESLACOIL » Aug 23, 2012 4:08

@ Destructosoft

My true ambition is to get 1 billion human beings all logged on at once to an exaflop supercomputer running a true to life simulation of the Milkyway and the local group...as trudge steadily towards a type 1 kardashev civilization the day that things are possible draws closer....so this is just tiddly winks by comparison.*ps , i already have a teraflop computer...just working on the exa bit , scuse the pun perhaps the greatest mistake of my life was never playing elite, lets call this mid life compensation.

im just another frustrated Captain Kirk, somewhat short of a warp drive and a teleporter





I have 3 computer ambitions

Build the wolds first sentient machine mind (almost there) started when i was 8 and @ 1 terflop things start to get interesting !
Create an Epic space game for the whole world to play ( wip ) I blame it on that mile long queue outside the cinema for star wars
Posses the worlds most powerful chess computer ( wip ) another human being i know taunts me with his, and it must die :-p

Why ? quite simply, when you have a room full of computers it would be rude not to :-p
Destructosoft
Posts: 88
Joined: Apr 03, 2011 3:44
Location: Inside the bomb
Contact:

Re: Epic Space Game

Postby Destructosoft » Aug 26, 2012 5:41

TESLACOIL wrote:im just another frustrated Captain Kirk, somewhat short of a warp drive and a teleporter
Which seems to be where most dreams of an epic space game begin.

Your project is impressive. I advise you run with it.
TESLACOIL
Posts: 1769
Joined: Jun 20, 2010 16:04
Location: UK
Contact:

Re: Epic Space Game

Postby TESLACOIL » Aug 26, 2012 23:10

My current focus is on building a 'data set' which represents the playing area, aka 2d galaxy map

this is a bit like creating a giant chess board. The idea being you can have a game engine which uses say 8x8 square to play chess or checkers on and perhaps another engine which plays games using a bigger sized board

Some parts are universal, ie Stars, Planets moons etc but it is not essential that a game engine utilizes the moons or the entire board. eg Any_coders_space game.exe can use my data set, my galaxy viewer and other tools

Im writing an epic space game engine, but i im starting first with a universal playing board. I just need to detail all the data fields so they can encompass a wide range of games/game engines, including future features i wish to include. Hence the highly modular WYSIWYG approach.



The big design win for me was setting the physical file structure to = HD screen resolution of 1280x720 , few people will need a bigger data set than this 1280 files in 720 folders = 921,600 data files. This enables a take it or leave it approach to the data, data fields within those files can be skipped.

Each players view is restricted. as in you cannot read the stats of a particular star system if you haven't probed it first. Eg player x doesn't have permission to read the contents of a particular section of a particular file.
anarky
Posts: 80
Joined: Jun 02, 2005 14:54
Location: Australia
Contact:

Re: Epic Space Game

Postby anarky » Sep 08, 2012 7:07

I completely forgot about my helping you Tesla, I got so tied up with closing the store and helping friends and job hunting arggh!

I hope tonight I can get my drink on and get back into some brainstorming...

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 5 guests