Galactoids 2002 (PlayBASIC port) Free Game

Started by kevin, April 25, 2014, 01:52:53 AM

Previous topic - Next topic

kevin

  Galactoids 2002 (PlayBASIC port) Free Game

 This is a really old galaga / galaxians styled shooter that was originally written in DB classic way back in 2002,  the project was originally released as public domain, so here's a quick PlayBASIC port of the source code (Made back 2010 apparently ).   It's not the most elegant of ports, but it seems to work..



ATLUS


Big C.

very nice... I love this style of game because I am a child of the 80th... ty 4 the code  :D

kevin

#3
 PlayBASIC Live -  Galactoids Port - DarkBASIC Abstraction Layer (2020-11-11  )

  Let's cast our minds back almost 20 years to a public domain game written in DarkBASIC by Steve Spondon call Galactoids.   The game then sat on my hard disc for a decade before one day porting it to PlayBASIC.  

  The game is similar in Galaxians / Galaga / Space Invaders but you fight against a group of marauding aliens.  In actual fact, it's cool little game and a real shame more people didn't see, play or expand upon it.    In Today's video, we'll take a rambling look at the source and the quick technique I used to port the source code from DarkBASIC to PlayBASIC.



Video:







Credits:


   Original Source By:
   Steve Spondon


  Video & Conversion By:
  Kevin Picone
  http://playbasic.com  
  https://underwaredesign.com

  Music:
 Spirit of Fire by  Jesse Gallagher




PlayBASIC LIVE PLAYLIST
https://www.youtube.com/playlist?list=PL_dvm0gvzzIVGlAhx34N6z2ce0ffMMOZ8

PlayBASIC BLOG PLAYLIST
https://www.youtube.com/playlist?list=PL_dvm0gvzzIU0Hnr6veV5UvwkSapHCo1J

PlayBASIC on FACEBOOK
http://www.facebook.com/pages/PlayBasic/127905400584274   (Facebook Page)

PlayBASIC on TWITTER
https://twitter.com/PlayBasic



#PlayBASIC #DarkBASIC #coding #basic #programming #sourcecode #64bit #floatingpoint



Script (English Captions)




welcome back to another quick play basic live

videos

was looking around the forum before and

ran into this very old example now

this is a game called galactoid

galactoids i guess it was uh it's

written by steve spondu it's written

written originally in dark basic classic

uh way back in 2002 today's 2020

so around 18 years old

yeah the game's actually pretty good

it's a cool little game um db classic

wasn't that great for doing 2d

stuff it was more of a 3d language so

that so the support for

getting it to do anything in two days

was kind of a miracle really

but what i noticed about this code that

i ported across

from the db version to play basic

is that i've written a little wrapper

for it

so i built sort of pv versions

of what the db commands are doing

the dark based commands are doing

there's not many of them because this

program doesn't use many

it doesn't use a lot of the command set

budget would show it to you as a way

as one pathway that you could port that

old code across

this is on the forum by the way it's

it's over on the forum it's the thread

itself is called galactoids

2002 playbasic support free game

when was this posted 2010 no 2014

so i don't know okay so here i'm saying

the port was made in 2010 a lot of these

things are probably sitting on my old

as i've talked about before i've got

these old collections of

downloads as you've probably got

yourself as everyone's probably got

these days

um bits and pieces of old bits of code

they've had for years and

i've been around a long time so things

just clutter up in hard drives

i found this one here and obviously made

a port of it

let's have a look at the game itself i

haven't really changed the logic of it

i've sort of just

recreated the commands and the ones i

couldn't directly

translate i've made wrappers for that

emulate how db worked

that's right

it's kind of a galaga type thing

[Applause]

whoops

[Music]

our health is right at the bottom of the

screen i couldn't see it before

so when we when we're touching a bullet

we are dying

three falcons like if you've ever seen

that guy

there you go

[Music]

as you can see i suck at that game

that's all fine but let's have a bit of

a page through it

um as i was saying before i didn't

didn't change the logic i've left it the

way it was so

dark basic doesn't have to types in it

natively there's a few extensions that

people wrote

pre-processes that implement something

similar

that do they'll let you do those things

but this is problems written in straight

straight dv classic

so if you were to change them you would

you know you would make i think that's

probably the aliens things here

probably s sx is probably screen x

one screen y one

um a sprite i don't know if they

actually are

but you kind of make a prefix for it and

put them all in the one space

this is you end up with the same print

same sort of structure though

so the program's laid out the same way

but the data is laid out in uh

in a pattern where all of the

information about each particular

character on screen

is held together if you have parallel

arrays which is what we're doing here

this kind of approach here then

we've got an array with in this case 100

different slots so we can have 100

aliens on screen at one time

and each array stores the x coordinate

of uh all of the possible 100.

the other one saws the y coordinate and

this stores whatever this is

representing and so on i don't know what

bs would be

you have to look through the code really

to fight to work out what these ones are

actually doing

um you could convert it to types but you

wouldn't you would

you're not going to gain anything really

from it so if you're more comfortable

writing code like this that's fair

enough you know

there are some benefits to doing stuff

like that which

can be discussed elsewhere i guess but

um so we're writing in some sounds

i have no idea what this is doing here

drawing something apparently

well look at what that does

go to main so filled circle

okay so i've probably emulated

well this might have been a function in

the original code

the program sort of only has one one uh

one function here and we've got very

small labels as well so it's kind of

hard to read if you're not if you're not

familiar with how the code is written

and i'm not

if i put some time in you you better

pick it out but

so look at the labels

it's got a bunch of labels so obviously

you just kind of you like to use the

label to

look up to to navigate the code which is

fair enough

it's got a new block there there's a

subroutine it's pretty much so

somewhere else is there's a go sub to

this particular piece here

and setting these properties these

global variables

he's probably using why have a look i

don't know what this one particularly

does

so however just search for this thing

here

in the code see what we find so new

block is that

function or that

power-ups

uh you might notice here is his go to a

new block

and newplug was a subroutine

uh he's kind of using

a common trick that if you're familiar

with basic

um that people will do

because this power up here is a

subroutine

and we know it's called as a subroutine

at some point

by some other part of our code

here if i want to use any kind of

subroutine i can rather than actually

go sub to that subroutine from within

this power up subroutine

i can go to it now it just saves putting

one extra breadcrumb on the stack

it's kind of a thing that pops up and a

lot in a lot into the classic basic

optimization you know there's all these

little

little tricks people use these days

they're not

they're not very useful those kind of

optimizations anyway

[Music]

that's our return statement if we fall

through this this logic here

so it turns out the new block is used uh

right directly after our function here

that's calling we'll see if there's any

other calls to it

no so

you probably could have just used that

on one line to be honest

since nothing else is calling it you

couldn't just use those on there but

i'm not even sure what that code is

doing since these variables here

are unknown to us uh the code will

behave

differently see here when we're using

random

because pb's round

number function in particular

will produce a different set of numbers

given the same

seed as the dark basic random numbers

then they would the programs would act

differently so if you have like a

rendering function that draws

say a classic one is like these um

like using sort of generating height

maps or

you know doing sort of during textures

or

this kind of stuff it's kind of

procedural generation thing

you would want to make sure that you you

probably used your own random

table and that table was

transferred between different dialects

if you're going to move

code around between different languages

to make sure that

the way that the sequence of random

numbers that you're getting

are consistent across all different

different ones

this wouldn't be so so this version

would run different than the

the same code on in dark basic for

example

because the random function is going to

produce a different sequence

because they'll be they're a different

bit of code

they're seated differently etc

uh what else we've got here so look at

the stars routine

so i'm assuming the straws the stars in

the back of the back of the game

or the classic sort of um space invaders

or galaxies and

there's another one i was thinking of

before or galaga

oh i think it's called gallagher and

some perhaps

you know in other places around the

world us australians and we're so

uncultured

it's just like galaga you know what i

mean

we just have no concept of pronunciation

of anything

and we don't care

let's check it out so what's happening

here we've got a

fixed number of stars we've got 30 of

these stars in the background

i think in the original coin ops these

are probably done with palette

tricks um

it would be hard to know like

some of these coins you can actually

have hardware scrolling

of the background for example in four

rounds of sprites are overlaid

on these top and top of these things

they're really bitmap-based

in fact i don't know any classic

hardware that's bitmap-based they

probably there probably

are some of course there's probably you

know

a lot of them really but um the ones i'm

sort of thinking of would just be they

have a play field and a bunch of

hardware sprites

and probably some limitations on how

many sprites can appear on certain lines

[Music]

anyway so this bit of logic here draws

the stars in the background

i've cut out a few bits and pieces over

here

to save us

[Music]

a bit of code i'm quite sure we're

drawing boxes

i don't know

so we've got stars f which is the

current star

we're going

randomizing its position

[Music]

if a is not lower than 20 then what are

we doing

now x coordinates the same we're

adding something to the y coordinate

we're checking if we're within the

screen bounds

and then yeah drawing it as a dot to the

screen if we're not

above that we're drawing this as a

probably like a particle effect for

something else

hmm that's kind of interesting

if we just do a search for stars

[Music]

well we need something more useful than

that

what about go substance

i'm pretty sure there's probably only

one occurrence of this

no there's not

[Music]

hmm i think

the way this code structure is there's

probably different

different loops of the game for like

when we're

in a menu when we're playing the game

maybe game over screens that kind of

stuff it's kind of

like a common way of laying these things

out

hmm ship one label

okay this is handling the docking of the

ship

which is kind of like in galaga where

you're you're trying to recapture your

your uh a fighter so you can have

multiple fighters

and there's a i'm not i don't know if

it's a an official

release or a hacked version but there's

a version of galaga that

saw the melbourne show about i was about

14 or 15

that let you collect as many ships as

you possibly could so you can actually

have like

five of these things or 10 of these

things on either side of your ship

it's where i got the idea from spec

attack from

yeah long time ago now

hmm it's pretty compact program we've

got 700 lines

uh no comments of course which will make

it

a bit hard for for new people to go

through this and decipher what's going

on

some pretty cryptic labeling but

overall it's a nice little game and

and fantastic work to the guy who wrote

it

steve spondu very good

but it's i remember at some point having

this idea about

making a layer

like a translation layer which am

kind of done with amos as well and a few

other little languages

but often i i tend to write these things

to the point where i need them to work

and then beyond that i don't care

so they don't get very far i

need to port some some piece of code i

want to behave the same

i write i wrote a layer and beyond that

if you need

functions i don't use then that's up to

you

to add those things

anyway if you need to port some old

darpa actually classic

2d code across across to play basic

there's a

bit of a library here it might be a

start for you

i'd say it's gonna change your world

change um

yeah i mean be fantastic but

uh it's gonna give you something

uh you find a lot of differences between

pb and

the dark basic in general in in the 2d

realm

um one that comes to mind is that pb has

clipping of functions and

and and db didn't which is very odd you

know

even classic classic 90s languages you

know from the

because there is kind of a spiritual

successor i guess

in some ways was considered that to be

from amos

[Music]

it's more really it's not meant to be a

clone of amos but has

some similarities to it but it really

took the idea of that of making a 3d

product into that and

they weren't the first they were just

the ones who who

managed to get to a point where people

actually identify this is this is

fun you know

and the the crazy thing about that is a

guy called uh

called andrew muller he uh

he wrote a 3d

basic uh for the amiga back in 1988.

took most of that school year off to do

it

and at the time no one really understood

what

what this could be you know it was

probably

a bridge too far for most people it was

like wow

because 3d was you know so difficult to

wrap your head around

if you're in a 2d mindset and

the computers you're using just don't

have the grunt the horsepower to push

you know enough polygons to make it fun

for people

but he did it more power to him i mean

he

he solved problems that other people

were struggling with you know

today back in good old pure assembly

so i think in many ways he was actually

the reason why i wanted to

to start writing my own uh phrases

in the mid-90s i got sick of using

i used amos a bit i used blitz basic a

bit and

was trying to make these macro languages

with other people as well

and they were they worked to a point

but at some point it's probably best to

have your own your own preprocessor

phrase

or translator depends on what your back

end is

and just do it yourself you know

anyway got off track there a little bit

um

just a reminder this code's on the forum

you can find it on the forums

at if you look by searching galactoids

2002 the video will be on youtube etc

and have a bit of fun with it you know

if you want to make a sequel be my guest

go for it

that's all for now we'll see you next

time bye