Game Maker's Garage Forum

Game Creation => Other Languages & Tools => Topic started by: Charlo on February 24, 2008, 07:27:58 PM

Title: RealBasic
Post by: Charlo on February 24, 2008, 07:27:58 PM
Does anybody else here own/use RealBasic?  I got it a while ago and I never use it, but back in the old days it was the preferred program for people looking to get past GameMaker.  I haven't really invested time in learning the syntax so I can't do much, but I think it would be cool to learn.  It's been used to create a few GM clones (such as GameScripter) so it seems pretty powerful...
Title: Re: RealBasic
Post by: GMG Tim on February 24, 2008, 09:26:48 PM
When I used to make games in REALbasic a long time ago, the system was pretty slow for games. I would suggest learning a language such as TNT Basic, PyGame, or PTK game engine (http://www.phelios.com/ptk/). PTK in particular will teach about many of the concepts of programming, while keeping it simple, and it's an excellent stepping stone to C and other lower level languages. PyGame might be a bit hard to setup, but it is very flexible, and definitely worth it.

- Ghost
Title: Re: RealBasic
Post by: Silverwind on October 20, 2008, 11:20:23 AM
Wow, my dad downloaded the RealBasic trail package and I've been trying it out. It's really awesome. The interface builder is easier than Interface Builder and the Quickstart guide is really easy to understand. The syntax of the language isn't nearly as pleasant to look at as GMs, (obviously) but I think I'll be able to grasp it with practice. Best of all, it compiles for all platforms. :)

It's about time I started looking at other languages, and I recommend RealBasic to anyone like myself who doesn't want needless hassle in learning them.
Title: Re: RealBasic
Post by: Tireas Dragon on October 20, 2008, 12:39:32 PM
Ya I downloaded it too a while back (ran out of time on it since then) It is nice has methods, arrays, and all other common basic stuff. I had this CD that taught the basics of basic. So my brother showed me a way to make programs in it. But I ran out of time and didn't want to spend $40. I think I will finish Rokeno then look into other languages.
Title: Re: RealBasic
Post by: Silverwind on October 20, 2008, 12:47:34 PM
Don't get me wrong, I'm not gonna stop using GM or anything, (far from it indeed!) but I wanna expand my knowledge base.

Oh yeah, how's Rokeno coming along?
Title: Re: RealBasic
Post by: Tireas Dragon on October 20, 2008, 02:36:16 PM
Well since work on the battle engine has been halted by Problems in the repeat. I have started programming the areas you walk around in and have started working on the second town.
Title: Re: RealBasic
Post by: Mystor on October 20, 2008, 04:55:58 PM
I don't really like Real Basic's concept as much :-/

but i haven't used it for a while so I might look into it.

It will be hard to beat flash though: animate in the same program, vector graphics, export to online and use AIR to make desktop apps for Mac, Windows and Linux!

I am beginning to look into python now

Mist
Title: Re: RealBasic
Post by: Silverwind on October 20, 2008, 05:09:51 PM
Quote
It will be hard to beat flash though: animate in the same program, vector graphics, export to online and use AIR to make desktop apps for Mac, Windows and Linux!
Yeah, having a game playable from a browser is cool as well. :) You should make an ORPG Mist, you've got all the knowledge and resources for it.
Title: Re: RealBasic
Post by: Gan on October 20, 2008, 05:11:25 PM
An browser orpg would be amazing. I can only build desktop orpgs...


-Gandolf
Title: Re: RealBasic
Post by: Silverwind on October 20, 2008, 05:15:53 PM
Quote
An browser orpg would be amazing. I can only build desktop orpgs...


-Gandolf
You should then. :) Man, if I had enough programming experience to make an ORPG I'd do it right away! I hope RealBasic will be able to help in some way.
Title: Re: RealBasic
Post by: Mystor on October 20, 2008, 05:41:45 PM
If someone feeds me a gm game I may try to make it in flash.

That would be cool.

Mist
Title: Re: RealBasic
Post by: Gan on October 20, 2008, 06:24:01 PM
That's genius. Converting Gm games to browser games. Even better than converting to pc games!


-Gandolf
Title: Re: RealBasic
Post by: Mystor on October 21, 2008, 08:25:36 AM
I am a bit busy atm tho so I will let you know when I have time :)

Mist
Title: Re: RealBasic
Post by: Silverwind on October 24, 2008, 05:03:07 AM
Looks like REALbasic uses the term "Methods" instead of "Functions" as well. :)
Title: Re: RealBasic
Post by: Mystor on October 24, 2008, 09:04:19 AM
Quote
Looks like REALbasic uses the term "Methods" instead of "Functions" as well. :)
LOL

Functions will triumph no matter what.
C uses them :P

Mist
Title: Re: RealBasic
Post by: WarHampster on October 24, 2008, 09:35:38 AM
They're the same thing...
Title: Re: RealBasic
Post by: Gan on October 24, 2008, 10:46:46 AM
Don't functions return a value, and methods don't?


-Gandolf
Title: Re: RealBasic
Post by: WarHampster on October 24, 2008, 03:24:52 PM
Speaking from experience, the methods in silver creator can return values.  
Title: Re: RealBasic
Post by: Silverwind on October 24, 2008, 03:29:57 PM
Well, after reading quite a bit on Methods in the REALbasic User's Guide, I've come to the conclusion that the easiest way to describe them (in GM and REALbasic context) is that they're user invented commands. The extent of Method design in Silver Creator is being able to write the routine that'll be run when the Method is executed, but the extent of Method design in REALbasic is slightly higher. In RB you can actually alter the syntax of the command, adding additional parameters and such stuff.

I now completely understand what an "object orientated" language is. It's a language intertwined with its interface builder. Many of the variables that you reference aren't created by code visible to the user, instead the interface elements handle them for you. Text fields for example have a "built-in" variable called Text which updates every time the user types something into it, and it equals whatever content the text field holds. So a command such as "Var$ = Text$" (this is GM syntax, but the concept is the same for RB) would make Var equal whatever text was in the text field. The user wouldn't have used code to make Text$ equal anything though, the text field handled the value itself. That's basically what object orientated languages are; languages with interface elements to handle vars.

One of the things I don't like about RB's syntax is how you have to create each variable before you use it. That's gonna be sooooo time consuming!
Title: Re: RealBasic
Post by: WarHampster on October 24, 2008, 04:04:10 PM
Quote
The extent of Method design in Silver Creator is being able to write the routine that'll be run when the Method is executed,

Untrue.. methods in SC can take parameters and return values.
Title: Re: RealBasic
Post by: Mystor on October 24, 2008, 04:25:48 PM
Quote
One of the things I don't like about RB's syntax is how you have to create each variable before you use it. That's gonna be sooooo time consuming!
I always declare my variables before I use them, even though I don't have to.
Not declaring them is bad practice.
For example you don't want to accidentally run r++; before you set r=0; or in flash var i:Number = 0;.
It also creates a kind of a variable lookup table:
foobar = 5; //The number of aliens to start with
name = "SuperAwesomeDude"; //Your Name
temp = null; //temporary variable


Anyways, it is good practice.
Most languages require it (GM probally is set up to check if the variable is defined whenever you use a new variable, that slows down execution time)

Mist (PS Sorry for the rant)
Title: Re: RealBasic
Post by: Silverwind on October 24, 2008, 04:36:12 PM
Quote

Untrue.. methods in SC can take parameters and return values.
Oh? Oh yeah, so it says. The documentation's description is incredibly unhelpful though. Could somebody post a code example demonstrating how to reference a parameters value in a useful manner please? It would be most appreciated.

For those interested, here's the documentation's description of method parameter properties:
Quote
- Parameters is where you enter a comma separated list of all the values you want this method to accept. For example, if you enter "var1$, var2, var3$" in the parameters, and your Method Name is "BOB", then you would use this code to invoke your method: "BOB "var1$ value here", someNumberHere, otherNumberHere". When your method script is called, the first value passed ("var1$ value here") is stored in var1$. And so on and so forth.
Title: Re: RealBasic
Post by: Silverwind on October 24, 2008, 04:52:00 PM
Quote
I always declare my variables before I use them, even though I don't have to.
Not declaring them is bad practice.
For example you don't want to accidentally run r++; before you set r=0; or in flash var i:Number = 0;.
It also creates a kind of a variable lookup table:
foobar = 5; //The number of aliens to start with
name = "SuperAwesomeDude"; //Your Name
temp = null; //temporary variable


Anyways, it is good practice.
Most languages require it (GM probally is set up to check if the variable is defined whenever you use a new variable, that slows down execution time)

Mist (PS Sorry for the rant)
True, and for variables referenced frequently I do the same, but for variables used for split second tasks it seems an unnecessary effort. Here's two examples from Tides of Fáden:
Code: [Select]
P1LVL = 1
P1EXP = 500
P1HP = 50
P1maxHP = 50
P1ATK = 0
P1DEF = 0
P1gold = 0
P1weapon$ = ""
P1shield$ = ""
P1boots$ = ""
P1item1$ = ""
P1item2$ = ""
P1item3$ = ""
P1item4$ = ""
P1item5$ = ""
P1item6$ = ""
P1item7$ = ""
P1item8$ = ""
P1item9$ = ""
Code: [Select]
P1name$ = USERASK Name your character.
IF P1name$ = "" THEN GOTOCARD 249
replacecheck = 1
namecheck = FILEEXISTS $P1name$$
IF namecheck = 1 THEN replacecheck = YESNOALERT A character with that name already exists. Do you want to replace that character with a new one?
IF replacecheck = 0 THEN GOTOCARD 249

In the first example I predefined the values of numerous variables even though their values were 0 because they're important elements throughout the entire game. In the second example however, variables such as "replacecheck" and "namecheck" are only useful to this particular routine, (which is small) then they're no longer needed in the game. Having to predefine vars like that seems a waste of time.
Title: Re: RealBasic
Post by: Mystor on October 24, 2008, 06:12:55 PM
You an probally define vars on the spot is you want.

Mist
Title: Re: RealBasic
Post by: Silverwind on October 24, 2008, 06:18:20 PM
Yeah, that'll make it easier.

What will happen if I try to create a var already created though? Will it return an error, reset the var's value to 0, or do nothing?
Title: Re: RealBasic
Post by: WarHampster on October 24, 2008, 06:31:29 PM
Once you get used to programming in C, declaring everything is second nature... I usually just declare variable that I will most likely need to use in the game opening script.

Heres an example of using parameters/ returns in SC... it was developed by Plaza Redd and is extremely useful.

Method Name: ChangeField$
Parameters: source$, separator$, fieldNumber, output$
Return Type: String
 
Code:
Code: [Select]
LET tempstr$ = "" 
 
IF COUNTFIELDS(source$, separator$) < fieldNumber THEN
   STOPALERT "There are not enough fields in that string!"
ELSE
   IF fieldNumber = 1 THEN
 LET tempstr$ = output$
 FOR x = 2 TO COUNTFIELDS(source$, separator$)
    LET tempstr$ = tempstr$ + separator$ + NTHFIELD$(source$, separator$, x)
 NEXT
   ELSE
 IF fieldNumber = COUNTFIELDS(source$, separator$) THEN
    FOR x = 1 TO COUNTFIELDS(source$, separator$)-1
  LET tempstr$ = tempstr$ + NTHFIELD$(source$, separator$, x) + separator$
    NEXT
    LET tempstr$ = tempstr$ + output$
 ELSE
    FOR x = 1 to fieldNumber-1
  LET tempstr$ = NTHFIELD$(source$, separator$, x) + separator$
    NEXT
    LET tempstr$ = tempstr$ + output$
    FOR x = fieldNumber+1 TO COUNTFIELDS(source$, separator$)
  LET tempstr$ = tempstr$ + separator$ + NTHFIELD$(source$, separator$, x)
    NEXT
 END IF
   END IF
END IF
RETURN tempstr$


 

Example Code:
Code: [Select]
 
 
LET string$ = "Apple:Banana:Peach:Tomato"
LET string$ = ChangeField$(string$, ":", 4, "Orange")

Title: Re: RealBasic
Post by: Mystor on October 24, 2008, 09:03:23 PM
If You are good at C, why do you still use GM/SC :-\\

and @silver
It depends on the language and how it works.
I would suggest testing it out and seeing how it reacts.

In Flash, it creates a compiler note but does not create an error.
The only time when trouble might occor would be when you give it a diffrent type (For example INT instead of FLOAT)

Mist
Title: Re: RealBasic
Post by: Gan on October 24, 2008, 10:05:48 PM
Vb.net is just like Rb, though you have functions and subroutines.

Ex Code:
Code: [Select]
'Beginning of code:
Public Class Form1()
Dim GameOver As Boolean = False
Dim YouWin As Boolean
Dim AlianHp As Integer = 40 '40 Hitpoints

'Not going to show all code so...
Private Sub AlianHit()  'This sub is called when Alian is hit by bullet
AlianHp -= 5
Call CheckAlianHp(AlainHp) 'Calls Subroutine at bottom.
If GameOver = true then
If YouWin = false then MessageBox.Show("You Lose!")
If YouWin = false then MessageBox.Show("You WIN!")
Application.Exit
End if
End Sub

Public Sub CheckAlianHp(ByVal Hp As Integer)
If Hp <= 0 then
GameOver = True
YouWin = False
else
GameOver = False
end If
End Sub
End Class

That's just an example of variable and sub/method code. Not actual code because I didn't add in collision checking, writing sprites to screen, or anything else.


-Gandolf
Title: Re: RealBasic
Post by: Mystor on October 24, 2008, 10:28:26 PM
Interesting language.
The only thing that I don't like about it is how it lacks clear structures.

That allows for simple shorthand but I find it a bit hard to read, for example:
Code: [Select]
If GameOver = true then
If YouWin = false then MessageBox.Show("You Lose!")
If YouWin = false then MessageBox.Show("You WIN!")
is in your code

That is a bit hard to understand.
I would always write:
Code: [Select]
If (GameOver == true) {
  if (YouWin == false) {
    MessageBox.Show("You Lose!");
  }
  if (YouWin == true) {
    MessageBox.Show("You WIN!");
  }
}
Just to make it more organized (I doubt that that is proper code :P)

Mist
Title: Re: RealBasic
Post by: Silverwind on October 25, 2008, 07:24:36 AM
Quote
Heres an example of using parameters/ returns in SC... it was developed by Plaza Redd and is extremely useful.
Now I know what it was like for you guys before I made that tutorial on Grid Navs! ::) I don't understand what's happening in the first example, could you comment it please?

Quote
The only time when trouble might occor would be when you give it a diffrent type (For example INT instead of FLOAT)
Ah. Reassigning a var's type in RB is easy, but it resets the var's value. It doesn't mention what happens when you reassign a var's type to the same one it currently uses though. I'll have to test it like you say. :)
Title: Re: RealBasic
Post by: Al Staffieri on October 25, 2008, 07:38:14 AM
I always hated being required to initialize all my variables before using them. FutureBASIC never required that, so I never did it. I just used variables as I needed them. Now the new FB requires that I set my variables before using them. It's tme consuming and something I'm not used to doing.

Title: Re: RealBasic
Post by: WarHampster on October 25, 2008, 10:53:41 AM
Quote
If You are good at C, why do you still use GM/SC :-\\
It's one thing to understand C syntax, but quite another to program a game with it.

Code: [Select]

LET tempstr$ = ""
// initalizes a empty string to work with

IF COUNTFIELDS(source$, separator$) < fieldNumber THEN
   STOPALERT "There are not enough fields in that string!"
// if the number of fields seperated by separator$ in source$ are smaller than fieldNumber, then display the message
ELSE
   IF fieldNumber = 1 THEN
      LET tempstr$ = output$
      FOR x = 2 TO COUNTFIELDS(source$, separator$)
         LET tempstr$ = tempstr$ + separator$ + NTHFIELD$(source$, separator$, x)
      NEXT
// tempstr$ = tempstr$ + separator$ + the field value that comes before the x (x is given values by the loop so every field value is accounted for) occurance of seperator$ in source$
   ELSE
      IF fieldNumber = COUNTFIELDS(source$, separator$) THEN
         FOR x = 1 TO COUNTFIELDS(source$, separator$)-1
            LET tempstr$ = tempstr$ + NTHFIELD$(source$, separator$, x) + separator$
         NEXT
// tempstr$ = tempstr$ + (the field value that comes before the x [x is given values by the loop so every field value is accounted for] occurance of seperator$ in source$)+ separator$
         LET tempstr$ = tempstr$ + output$
      ELSE
         FOR x = 1 to fieldNumber-1
            LET tempstr$ = NTHFIELD$(source$, separator$, x) + separator$
//tempstr$ = (the field value that comes before the x [x is given values by the loop so every field value is accounted for] occurance of seperator$ in source$)+ separator$
         NEXT
         LET tempstr$ = tempstr$ + output$
         FOR x = fieldNumber+1 TO COUNTFIELDS(source$, separator$)
            LET tempstr$ = tempstr$ + separator$ + NTHFIELD$(source$, separator$, x)
// tempstr$ = tempstr$ + separator$ + the field value that comes before the x (x is given values by the loop so every field value is accounted for) occurance of seperator$ in source$
         NEXT
      END IF
   END IF
END IF
RETURN tempstr$

I commented the things that might be hard to understand.
Title: Re: RealBasic
Post by: EqwanoX on February 22, 2009, 09:45:58 AM
Quote
When I used to make games in REALbasic a long time ago, the system was pretty slow for games. I would suggest learning a language such as TNT Basic,

- Ghost
are you serious!? tnt is faster than rb?
Title: Re: RealBasic
Post by: Gan on February 22, 2009, 12:50:54 PM
Tnt was made in Obj-C in Xcode. Native to mac, while Rb was made all-purpose with large frameworks to support many systems.


-Gandolf
Title: Re: RealBasic
Post by: Silverwind on February 22, 2009, 01:53:59 PM
For games like yours and mine Eq, RB is faster than we can humanly comprehend. Anyone who says otherwise either makes games that are much higher standard than ours or doesn't make them at all. There's way too much talk these days about how much faster "so-and-so" is compared to "this-and-that", and it's a waste of precious time that could be spent making games.

One of  my friends for example rambles about the pros and cons (mainly the cons) of every medium imaginable, and the result is that he seldom produces anything.
Title: Re: RealBasic
Post by: Telstar5 on May 30, 2009, 10:32:22 PM
Uh, hope you don't mind me making my usual, small, uneducated opinion here;

I think RealBasic is a terrible system for game making. Don't get me wrong, what you can do with the game type objects and commands and such are great, stuff like the spritesurface and RB3DSpace - but how you go about getting it to do anything whatsoever is frustrating. It would be more convenient if you could just drag sprites and images into a playing field and then give them sets of instructions when they hit things/collect power-ups/when the space bar is pressed/etc...

Actually, what I just described was Klik & Play. My god, please forgive me.

Edit: Before someone calls me stupid or "i h8 u" because I just slated RealBasic, I should mention that I'm a big RB fan, and I highly recommend it for any development purpose. Especially networking.

Quote
One of  my friends for example rambles about the pros and cons (mainly the cons) of every medium imaginable, and the result is that he seldom produces anything.

That sounds like me as well as every other programmer that ever lived. It's like the Citroen vs Renault argument; you choose one (in this case, a programming language), you stick to it religiously, and you come up with any justification to prove that the other guy's choice is a piece of crap, the end result being that nobody produces anything, and what IS produced is usually just a demonstration of what the other guy can't do. It's like me and my friend David. He's a Python man, and hey, Python is pretty good; but if we sat down next to each other and produced two programs of similar functionality, I'd get it done quicker because I'm using RB and he is using old fashioned interpreted Python: hence, Python MUST be a piece of crap, and my sole reason for using RealBasic is because I have to prove that.

Hmm, for some reason, I feel the need for a bar brawl at a club full of software developers :P
Title: Re: RealBasic
Post by: Silverwind on May 31, 2009, 09:02:56 AM
Quote
Uh, hope you don't mind me making my usual, small, uneducated opinion here;
Nay indeed, the forum needs more posts. Until I get a new computer (sometime this month hopefully) I'll be inactive. Don't let the forum die people, keep posting!

I believe I distort the wording of a Cillet Bang commercial when I say "SPAM! And the boredom's gone..."
Title: Re: RealBasic
Post by: WarHampster on June 01, 2009, 07:07:38 PM
Quote
It would be more convenient if you could just drag sprites and images into a playing field and then give them sets of instructions when they hit things/collect power-ups/when the space bar is pressed/etc...


Wait... what!?
Title: Re: RealBasic
Post by: Gan on June 01, 2009, 09:01:17 PM
Flash uses a similar method.


-Gandolf
Title: Re: RealBasic
Post by: WarHampster on June 01, 2009, 09:10:58 PM
Not really... Telstar described a true "game maker" (IE a program literally makes the game for you)