FreeBASIC Community produced game

For other topics related to the FreeBASIC project or its community.
BasicCoder2
Posts: 3393
Joined: Jan 01, 2009 7:03

Re: FreeBASIC Community produced game

Postby BasicCoder2 » Aug 28, 2018 20:40

Surely the first step is to describe core game play of the game?
From what I could see nano45 was just another shoot up game. There was nothing there to capture my interest.
For example explaining pacman,
"The goal of the game is to accumulate points by eating all the Pac-Dots in the maze, completing that 'stage' of the game and starting the next stage and maze of Pac-dots. Between some stages, one of three intermission animations plays. The four ghosts roam the maze, trying to kill Pac-Man."
And so on elaborating the details of what behaviors it is you intend programming.
In other words a complete description of the game so you are all on the same page as to what is to be coded.
paul doe
Posts: 916
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBASIC Community produced game

Postby paul doe » Aug 28, 2018 21:22

BasicCoder2 wrote:Surely the first step is to describe core game play of the game?

I'm about to propose something. Do you have something in mind? Speak! =D
BasicCoder2 wrote:From what I could see nano45 was just another shoot up game. There was nothing there to capture my interest.

What would capture your interest then, concretely? Flashy/stylized graphics? Fast gameplay? It would be nice to know what everyone thinks about this, so we can evolve a design.
BasicCoder2 wrote:For example explaining pacman,
"The goal of the game is to accumulate points by eating all the Pac-Dots in the maze, completing that 'stage' of the game and starting the next stage and maze of Pac-dots. Between some stages, one of three intermission animations plays. The four ghosts roam the maze, trying to kill Pac-Man."

This could be the premise of the game:
"The premise of the game is to build a NanoShip, and then program it's AI to battle other NanoShips for control of the known Universe"
That's the original premise, in a nutshell. The italics are 'blank spots' that we need to fill. That's the purpose of this thread =D
BasicCoder2 wrote:And so on elaborating the details of what behaviors it is you intend programming.
In other words a complete description of the game so you are all on the same page as to what is to be coded.

The design document is not yet written, if that's what you ask. We are simply dumping ideas here =D
BasicCoder2
Posts: 3393
Joined: Jan 01, 2009 7:03

Re: FreeBASIC Community produced game

Postby BasicCoder2 » Aug 28, 2018 21:42

paul doe wrote:"The premise of the game is to build a NanoShip, and then program it's AI to battle other NanoShips for control of the known Universe"

Ok. Now some of the other posts make more sense.
https://store.steampowered.com/app/6921 ... simulator/
badidea
Posts: 1417
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: FreeBASIC Community produced game

Postby badidea » Aug 28, 2018 21:49

paul doe wrote:Fast gameplay? It would be nice to know what everyone thinks about this, so we can evolve a design.

If it isn't tanks we start with, then yeah, I want super-fast spaceships with lasers and photon-rockets and power draining shields. A big light-show!
Maybe even a whole battalion of spaceships control by the AI. Or multiple AI's working in teams trying to invade the enemies home planet to prevent them from re-spawning. Just throwing in some ideas :-)
paul doe
Posts: 916
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBASIC Community produced game

Postby paul doe » Aug 28, 2018 22:20

badidea wrote:If it isn't tanks we start with, then yeah, I want super-fast spaceships with lasers and photon-rockets and power draining shields. A big light-show!

Oooh, then you'll love what I'm working in =D
An appropriate name for such a game, using the generator above: NanoShips Galaxy Chaos Unlimited =D
badidea wrote:Just throwing in some ideas :-)

Keep them coming! =D
paul doe
Posts: 916
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBASIC Community produced game

Postby paul doe » Aug 28, 2018 22:28

BasicCoder2 wrote:Ok. Now some of the other posts make more sense.
https://store.steampowered.com/app/6921 ... simulator/

Something like that, yes. Only with little ships and with a top-down view =D
Roland Chastain
Posts: 851
Joined: Nov 24, 2011 19:49
Location: Dakar, Senegal
Contact:

Re: FreeBASIC Community produced game

Postby Roland Chastain » Aug 28, 2018 22:54

Hello!

BasicCoder2 wrote:
paul doe wrote:"The premise of the game is to build a NanoShip, and then program it's AI to battle other NanoShips for control of the known Universe"


The idea sounds great. I am in. ;)

paul doe wrote:
badidea wrote:An appropriate name for such a game, using the generator above: NanoShips Galaxy Chaos Unlimited =D


I like it, I vote for that one. :)
badidea
Posts: 1417
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: FreeBASIC Community produced game

Postby badidea » Aug 28, 2018 22:57

paul doe wrote:
badidea wrote:Keep them coming! =D

Did I mention that these photon-rockets create shockwaves that send your ship 'out of control', depending on where the rocket hits your ship?
Obviously, we also need a red flashing screen on hit and a yellow pulsing screen when heavily damaged. And some anoying warning sounds and messages, and smoke comming from the control desk (if we would have one). A self destruct option as a final attempt to take the enemy down with you, ending in a draw.
paul doe
Posts: 916
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBASIC Community produced game

Postby paul doe » Aug 28, 2018 23:15

Roland Chastain wrote:Hello!

Hi! =D
Roland Chastain wrote:The idea sounds great. I am in. ;)

Cool. The more the merrier =D
Roland Chastain wrote:I like it, I vote for that one. :)

Be sure that you check out other ones, too (see the little snippet in the page before). Some are silly (NanoShips Universal Universe Redux hahaha!), but most are pretty cool =D
badidea wrote:Did I mention that these photon-rockets create shockwaves that send your ship 'out of control', depending on where the rocket hits your ship?
Obviously, we also need a red flashing screen on hit and a yellow pulsing screen when heavily damaged. And some anoying warning sounds and messages, and smoke comming from the control desk (if we would have one). A self destruct option as a final attempt to take the enemy down with you, ending in a draw.

I love your over-the-top, epileptic action style! =D

Be absolutely sure that you document all these ideas (outside of the forum, that is). They'll get lost here on the forum eventually, and they can prove invaluable later. The model I have in mind can accomodate all this and more. Just a little longer... ;)
BasicCoder2
Posts: 3393
Joined: Jan 01, 2009 7:03

Re: FreeBASIC Community produced game

Postby BasicCoder2 » Aug 29, 2018 0:55

So everyone programs their ship with some AI and then releases them?
Like you might program a robot vacuum cleaner and then press run to see how much dirt it can pick up

Programming the virtual robotic ships might appeal to programmers but the general gamer just wants to grab hold of the steering wheel and make all the decisions themselves. (mechanic vs driver).

Wouldn't a "Drone Wars" be a more contemporary game instead of using a '50s notion of space ships?
Instead of empty space they would have to fly through canyons, between mountains and so on.
Program the drones to attack and defend.
paul doe
Posts: 916
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBASIC Community produced game

Postby paul doe » Aug 29, 2018 1:38

BasicCoder2 wrote:So everyone programs their ship with some AI and then releases them?
Like you might program a robot vacuum cleaner and then press run to see how much dirt it can pick up

More or less, yes. See the first post, it contains a link to the original idea.
BasicCoder2 wrote:Programming the virtual robotic ships might appeal to programmers but the general gamer just wants to grab hold of the steering wheel and make all the decisions themselves. (mechanic vs driver).

You can do both. You can either grab a ship you like (or you designed) and pit it against any number of bots, or you can control said ship and do the battles yourself. The architecture contemplates both.
BasicCoder2 wrote:Wouldn't a "Drone Wars" be a more contemporary game instead of using a '50s notion of space ships?

Mmm, good point. Perhaps 'NanoDrones'? What do you guys think?
BasicCoder2 wrote:Instead of empty space they would have to fly through canyons, between mountains and so on.
Program the drones to attack and defend.

The original idea was a space battle between two ships, one-on-one. I like the concept: it's simple, you can easily program the AI (since, as you stated, the map is basically empty), and you don't need sophisticated algorithms to get a decent bot up and running. But we shall see where this takes us =D
coderJeff
Site Admin
Posts: 2949
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: FreeBASIC Community produced game

Postby coderJeff » Aug 29, 2018 2:12

paul doe wrote:This generates a random game title in the over-the-top, kind of nonsensical japanese-style ... effective brainstorming =D

Clever. With 18225 possible names out of the box, I couldn't decide. So added a selector, like a tournament. Each match chooses 1 of 4 with the winners moving on to the next round.

Code: Select all

/'
  Very simple random game title generator and selector
 
  Useful for brainstorming =D
'/
dim as string prefixStrings( ... ) = { _
  "Perfect", "Infinite", "Armed", "Omega", "Zero", "Astro", _
  "Stellar", "Last", "Final", "Red", "Blue", "Dangerous", _
  "Sol", "Shattered", "Mega", "Forgotten", "Alpha", "Giga", _
  "Fighting", "Black", "Hyper", "Star", "G", "Super", "Luna", _
  "Galaxy", "Sun", "Universal" _
}

dim as string nounStrings( ... ) = { _
  "Lancer", "Planet", "Justice", "Battle", "Weapon", _
  "Thunder", "Infinity", "Chaos", "Zone", "Breaker", _
  "Titanium", "Steel", "Vapor", "Hell", "Heaven", "Seeker", _
  "Gun", "Gemini", "Divide", "Fire", "Sol", "Luna", "Galaxy", _
  "Sun", "Moon", "Universe" _
}

dim as string suffixStrings( ... ) = { _
  "Gaiden", "Z", "X", "R", "EX", "Again", "Redux", "Plus", "Duel", _
  "Special", "Trail", "Turbo", "War", "Blaze", "Stream", "Blade", _
  "Unlimited", "Metal", "Divide", "Light", "Storm", "Laser", "Spirit", _
  "Extra", "Super", "Nova", "Taisen", "Warrior" _
}

? ubound( prefixStrings ) * ubound( nounStrings ) * ubound( suffixStrings )

type ListOfStrings
  public:
    declare constructor( _
      aStringArray() as string )
    declare destructor()
   
    declare function at( _
      byval as integer ) as string
    declare function atRandom() as string
    declare sub appendString( aString as string )
    declare constructor()
    declare property count() as integer
    declare sub erase()
   
  private:
    m_stringArray( any ) as string
end type

constructor ListOfStrings()
end constructor

constructor ListOfStrings( _
  aStringArray() as string )
 
  redim m_stringArray( _
    0 to ubound( aStringArray ) - lbound( aStringArray ) )
 
  for i as integer = 0 to ubound( m_stringArray )
    m_stringArray( i ) = aStringArray( lbound( aStringArray ) + i )
  next
end constructor

destructor ListOfStrings()
end destructor

function ListOfStrings.at( _
  byval anIndex as integer ) as string
 
  return( m_stringArray( anIndex ) )
end function

function ListOfStrings.atRandom() as string
  return( m_stringArray( cint( _
    rnd() * ubound( m_stringArray ) ) ) )
end function

sub ListOfStrings.appendString( aString as string )
   redim preserve m_stringArray( 0 to ubound( m_stringArray ) + 1 )
   m_stringArray( ubound( m_stringArray ) ) = aString
end sub

property ListOfStrings.count as integer
   return ubound( m_stringArray ) + 1
end property

sub ListOfStrings.erase()
   ..erase m_stringArray
end sub

type RandomName
  public:
    declare constructor( _
      byref as ListOfStrings, _
      byref as ListOfStrings, _
      byref as ListOfStrings )
    declare destructor()
   
    declare function make() as string
 
  private:
    declare constructor()
   
    m_prefixes as ListOfStrings ptr
    m_nouns as ListOfStrings ptr
    m_suffixes as ListOfStrings ptr
end type

constructor RandomName()
end constructor

constructor RandomName( _
  byref aPrefixList as ListOfStrings, _
  byref aNounList as ListOfStrings, _
  byref aSuffixList as ListOfStrings )
 
  m_prefixes = @aPrefixList
  m_nouns = @aNounList
  m_suffixes = @aSuffixList
end constructor

destructor RandomName()
end destructor

function RandomName.make() as string
  dim as string theName
 
  theName = m_prefixes->atRandom() & " " & _
    m_nouns->atRandom() & " " & _
    m_suffixes->atRandom()
   
  return( theName )
end function

randomize()

var prefixes = ListOfStrings( prefixStrings() )
var nouns = ListOfStrings( nounStrings() )
var suffixes = ListOfStrings( suffixStrings() )

var rndName = RandomName( prefixes, nouns, suffixes )

'' Seed the first round
var winners = ListOfStrings()
for i as integer = 1 to 4 * 4 * 4 * 4
  winners.appendString( "NanoShips " & rndName.make() )
next

'' each round
var round = 0
while( winners.count > 4 )
   round += 1
   
   print
   print "ROUND " & round
   
   var competitors = winners
   winners.erase()

   var match = 0
   for i as integer = 0 to (((competitors.count \ 4) * 4) - 1) step 4
      match += 1
      print
      print "ROUND " & round & ", Match " & match
      for j as integer = 0 to 3
         print "    " & (j+1) & ". " & competitors.at( i + j )
      next
      print "  1, 2, 3 or 4?: ";
      do
         var k = inkey
         select case k
         case "1" to "4"
            print k
            var j = asc(k) - asc("1")
            winners.appendString( competitors.at( i + j ) )
            exit do
         end select
      loop
   next
wend

print
print "FINALISTS:"
for i as integer = 0 to winners.count-1
   print "    " & (i+1) & ". " & winners.at( i )
next


Here are my 4 finalists:
FINALISTS:
1. NanoShips Mega Sol Duel
2. NanoShips Luna Infinity Duel
3. NanoShips Shattered Hell Special
4. NanoShips Forgotten Thunder Duel <--- my favourite.


I like the decorations. And if not NanoShips, I have no ideas.
dafhi
Posts: 1241
Joined: Jun 04, 2005 9:51

Re: FreeBASIC Community produced game

Postby dafhi » Aug 29, 2018 3:52

Very nice. I'll help out in whatever fashion I can
paul doe
Posts: 916
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FreeBASIC Community produced game

Postby paul doe » Aug 29, 2018 4:42

coderJeff wrote:...I couldn't decide. So added a selector, like a tournament. Each match chooses 1 of 4 with the winners moving on to the next round.

Nice improvement! I corrected a fatal flaw (which happened when you created a ListOfStrings with an empty or unininitialized one), so you may want to update the code to reflect the change and prevent mishaps ;)

coderJeff wrote: 4. NanoShips Forgotten Thunder Duel <--- my favourite.

My favorite would be "XXX Forgotten Universe Gaiden". The 'Forgotten Universe' part comes from the fact that I missed that thread back in the day, and was a very cool project that was eventually forgotten. And the japanese term 'Gaiden' means literally 'a history within a history' and can be translated as 'alternate universe', much like this project is =D
coderJeff wrote:And if not NanoShips, I have no ideas.

That's easy to tacke:

Code: Select all

/'
  Very simple random game title generator
 
  Useful for brainstorming =D
 
  Cool names I've seen:
  NanoShips Star Battle Trail
  NanoShips Armed Breaker Divide
  NanoShips Star Chaos Taisen ('taisen' is japanese for 'war')
  NanoShips Mega Infinity Special
  NanoShips Last Hell Unlimited
  NanoShips Blue Gemini Z
  NanoShips Star Chaos Divide
  NanoShips Black Heaven Duel
  NanoShips Giga Gemini Light
  NanoShips Infinite Battle Again
  NanoShips Shattered Heaven Blaze
  NanoShips Last Divide X
  NanoShips Fighting Zone X
  NanoShips Omega Battle Z
  NanoShips Sol Breaker Taisen ('sol' is spanish for 'sun', 'taisen' see above)
  NanoShips Infinite Battle Unlimited
  NanoShips Giga Chaos Plus
  NanoShips Last Galaxy Taisen
  NanoShips Infinite Titanium Unlimited
  NanoShips Stellar Divide EX
  NanoShips Universal Divide Unlimited
  NanoShips Stellar Chaos Redux
  NanoShips Forgotten Galaxy Taisen
  NanoShips Galaxy Hell Nova
  NanoShips Star Gun Blaze
  NanoShips Star Weapon Storm
  NanoShips Last Universe Nova
  NanoShips Galaxy Battle Gaiden
  NanoShips Final Heaven Blaze
  NanoShips Final Sol Storm
  NanoShips Infinite Infinity X (LOL!)
  NanoShips Hyper Battle Unlimited
  NanoShips Fighting Universe R
  NanoShips G Chaos Nova
 
  My favorite:
  XXX Forgotten Universe Gaiden
'/
dim as string prefixStrings( ... ) = { _
  "Perfect", "Infinite", "Armed", "Omega", "Zero", "Astro", _
  "Stellar", "Last", "Final", "Red", "Blue", "Dangerous", _
  "Sol", "Shattered", "Mega", "Forgotten", "Alpha", "Giga", _
  "Fighting", "Black", "Hyper", "Star", "G", "Super", "Luna", _
  "Galaxy", "Sun", "Universal", "Armored", "Mobile", "Central" _
}

dim as string nounStrings( ... ) = { _
  "Lancer", "Planet", "Justice", "Battle", "Weapon", _
  "Thunder", "Infinity", "Chaos", "Zone", "Breaker", _
  "Titanium", "Steel", "Vapor", "Hell", "Heaven", "Seeker", _
  "Gun", "Gemini", "Divide", "Fire", "Sol", "Luna", "Galaxy", _
  "Sun", "Moon", "Universe", "Core" _
}

dim as string suffixStrings( ... ) = { _
  "Gaiden", "Z", "X", "R", "EX", "Again", "Redux", "Plus", "Duel", _
  "Special", "Trail", "Turbo", "War", "Blaze", "Stream", "Blade", _
  "Unlimited", "Metal", "Divide", "Light", "Storm", "Laser", "Spirit", _
  "Extra", "Super", "Nova", "Taisen", "Warrior", "Blast", "Geddon", _
  "Oblivion", "Echelon", "Bananarama" _
}

dim as string namePrefixStrings( ... ) = { _
  "Nano", "Mega", "Turbo", "Hyper", "Dyna", "Robo", "Cyber", _
  "Neuro", "Meta", "Auto", "Armed", "Giga", "Cosmo", "Data", _
  "Flux", "Gyro" _
}

dim as string nameStrings( ... ) = { _
  "Droids", "Ships", "Bots", "Cores", "Drives", "Probes" _
}

? ubound( prefixStrings ) * ubound( nounStrings ) * ubound( suffixStrings )

type ListOfStrings
  public:
    declare constructor( _
      aStringArray() as string )
    declare destructor()
   
    declare property empty() as boolean
    declare function at( _
      byval as integer ) as string
    declare function atRandom() as string
   
  private:
    declare constructor()
    m_stringArray( any ) as string
end type

constructor ListOfStrings()
end constructor

constructor ListOfStrings( _
  aStringArray() as string )
 
  redim m_stringArray( _
    0 to ubound( aStringArray ) - lbound( aStringArray ) )
 
  for i as integer = 0 to ubound( m_stringArray )
    m_stringArray( i ) = aStringArray( lbound( aStringArray ) + i )
  next
end constructor

destructor ListOfStrings()
end destructor

property ListOfStrings.empty() as boolean
  return( cbool( _
    ubound( m_stringArray ) < lbound( m_stringArray ) ) )
end property

function ListOfStrings.at( _
  byval anIndex as integer ) as string
 
  return( iif( _
    empty, "", m_stringArray( anIndex ) ) )
end function

function ListOfStrings.atRandom() as string
  return( iif( _
    empty, "", m_stringArray( cint( _
    rnd() * ubound( m_stringArray ) ) ) ) )
end function

'' Interface for the Random Name Generator
type RandomNames extends Object
  declare virtual destructor()
  declare abstract function make() as string
end type

destructor RandomNames()
end destructor

'' A concrete implementation
type RandomDecorations extends RandomNames
  public:
    declare constructor( _
      byref as ListOfStrings, _
      byref as ListOfStrings, _
      byref as ListOfStrings )
    declare destructor() override
   
    declare function make() as string override
 
  private:
    declare constructor()
   
    m_prefixes as ListOfStrings ptr
    m_nouns as ListOfStrings ptr
    m_suffixes as ListOfStrings ptr
end type

constructor RandomDecorations()
end constructor

constructor RandomDecorations( _
  byref aPrefixList as ListOfStrings, _
  byref aNounList as ListOfStrings, _
  byref aSuffixList as ListOfStrings )
 
  m_prefixes = @aPrefixList
  m_nouns = @aNounList
  m_suffixes = @aSuffixList
end constructor

destructor RandomDecorations()
end destructor

function RandomDecorations.make() as string
  dim as string theName
 
  theName = m_prefixes->atRandom() & " " & _
    m_nouns->atRandom() & " " & _
    m_suffixes->atRandom()
   
  return( theName )
end function

/'
  And this is an example of the Decorator Pattern.
 
  It works like implementation inheritance, but much more
  flexible, as it can be composed even at run-time. To be
  a 'proper' decorator, it needs to adhere to the interface
  of the object it decorates (among other things) so it
  complies with the Liskov Substitution Principle.
 
  See this entry on Wikipedia for more info:
    https://en.wikipedia.org/wiki/Liskov_substitution_principle
 
  INHERITANCE? We don't need no stinkin' inheritance!
    (implementation inheritance, at least =D)
'/
type RandomGameTitle extends RandomNames '' <-- Derives from interface
  public:
    declare constructor( _
      byref as ListOfStrings, _
      byref as ListOfStrings, _
      byref as RandomNames )
    declare destructor() override
   
    declare function make() as string override
   
  private:
    declare constructor()
   
    m_prefixes as ListOfStrings ptr
    m_nouns as ListOfStrings ptr
    m_decorations as RandomNames ptr
end type

constructor RandomGameTitle()
end constructor

constructor RandomGameTitle( _
  byref aListOfPrefixes as ListOfStrings, _
  byref aListOfNouns as ListOfStrings, _
  byref theNameDecorations as RandomNames )
 
  m_prefixes = @aListOfPrefixes
  m_nouns = @aListOfNouns
  m_decorations = @theNameDecorations
end constructor

destructor RandomGameTitle()
end destructor

function RandomGameTitle.make() as string
  return( m_prefixes->atRandom() & m_nouns->atRandom() & _
    " " & m_decorations->make() )
end function

randomize()

var prefixes = ListOfStrings( prefixStrings() )
var nouns = ListOfStrings( nounStrings() )
var suffixes = ListOfStrings( suffixStrings() )
var namePrefixes = ListOfStrings( namePrefixStrings() )
var names = ListOfStrings( nameStrings() )

var decorations = RandomDecorations( _
  prefixes, nouns, suffixes )

var title = RandomGameTitle( _
  namePrefixes, names, decorations )
 
for i as integer = 1 to 100
  ? title.make()
next

sleep()

=D
dafhi wrote:Very nice. I'll help out in whatever fashion I can

Welcome, then! We are just brainstorming for now. Ideas, concepts, art, code, anything goes =D
Last edited by paul doe on Aug 29, 2018 9:48, edited 2 times in total.
BasicCoder2
Posts: 3393
Joined: Jan 01, 2009 7:03

Re: FreeBASIC Community produced game

Postby BasicCoder2 » Aug 29, 2018 7:00

coderJeff wrote:And if not NanoShips, I have no ideas.

I imagined nanoShips as something small enough to inject into the body. Maybe miniShips :)
The nano45 example code doesn't seem to have a main file to compile and run?

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 21 guests