Allegro library and QuickBasic...
Xxxy Zyryxy

Just wanted to let you know that beginner QuickBasic kids are also interested in Allegro!.. I don't know how to compile Allegro and would like to know if it's worth the effort or not... Will I be able to link DOS and/or Win Allegro and use it with QB?.. Thanks in advance...

Mars

No.

23yrold3yrold

Allegro is C/C++. Aren't there Basic languages for making games already? DarkBasic or BlitzBasic or somesuch?

Zaphos

Quickbasic is a dead and dead-end language infamous for teaching bad programming practices ... I would suggest switching to something fun and socially acceptable like Python with pygame instead of more basic variants.

Mars

Python rules. And pygame is ok, but not all to "pythonic". And it lacks some of Allegro's highlevel functionality (being SDL based and all). There once was an attempt to bind Allegro to Python, but I think they didn't get far. That might be interesting to get into...

Steve Terry

Xxxy Zyryxy? you remember that name everytime you log in :P Anywho I'd pick up some C/C++ books and learn the basics, then learn to compile and link allegro, then maybe a simple game of tic-tac-toe.

jakerohs

I used to use Quickbasic (a loooong loooong time ago) and while it's easy to write simple programs, it ends up being much harder in the long run to do the things that a game requires. There are libraries for blitting+high-res screen modes for Quickbasic, but these really only take you so far.
If you are really interested in getting into making games, it's worth your while learning C or C++. If you like programming in general you're probably going to learn one of these eventually anyway.
I wish I'd known about Allegro, Mingw32 (Free C/++ Windows Compiler) and Dev-cpp years ago. I spent too much time looking for better libraries for QB and never found anything that could do it all.

Joel Pettersson

I started working on my textbased RPG Den Flummiga Dimensionen about 2 years ago. At that time i used QB, but I quickly got tired of it when i noticed its limits. (especially the sourcecode size limit that is a bit over 60KB) So I decided to try another language. I ended up deciding to use C++. I then started learning C++ in my freetime. The first C++ version of DFD was a console application, since I didn't find any good libraries. Then I rewrote it from scratch again when I found Allegro, because the code was slow and inefficient.

Plucky

I don't know about QB, but I know that VisualBasic can call DLL functions even if the DLL was created with C/C++.

Googling:
http://home.apu.edu/~jcox/Demos/vbanddll/vbanddll.htm

[edit] And another link:
http://www.nomad.ee/btrieve/articles/basicdll.html

[edit2] I think VB is essentially a follow-on to QB. ie QB is deprecated.

Chris Katko

QB has been for a very long time. Probably ever since VB came out. It can't call DLLs because it doesn't even know what they are. Unless there was some freak feature I was unaware of.

Plucky

QB 4.5 was introduced in ~1988. VB was introduced ~1991.
Windows 3.0 was introduced ~1990
Windows 3.1 ~1992
Windows NT ~1993

Chris Katko

I didn't quite understand what you were trying to say until I reread my post. I ment to say that QB has probably been depreciated ever since VB came out.

One more thing though, QB had more than a few versions. The last was decently refined (relative to QB), and was called QBasic Extended 7.1.

Plucky

I wasn't making any sort of judgement with your post... I was just confirming QB has been around for a long time. I had already said QB was deprecated.

"Qbasic extended 7.1" was "Basic Professional Development System 7.1", which was released ~1990. QB 4.5 was more of a personal compiler. PDS I think allowed better FAR access. Then there's Qbasic 1.1 that came with MSDos 6 ~1993. IIRC Qbasic 1.1 also showed up with Win95/98.

Evert
Quote:

especially the sourcecode size limit that is a bit over 60KB

Multi file projects :P
I had one QuickBASIC project that had > 300kb sourcecode. At that point, the executables actually becomes smaller than the sourcecode (which says something about the compiler) and I had to use the commandline compiler to compile because the IDE used up way too much memory.

Plucky

"which says something about the compiler"

Or it says something about the language. :)

ks

The sense that I get from browsing this thread is that the power and evolved language of C/C++ or Python should be the deciding factor. Some time ago I asked a question that met with the answer that Allegro users are typically engaged in single person development of small games. I don't recall the context, other than I was being informed that Allegro is a niche product for the hobbiest. If that's the case then perhaps one of the BASIC variants is sufficient, if that's one's interest in programming. If you don't aspire beyond the hobbiest projects, why not?

I continue to use Allegro for my limited needs and am not above considering the use of a BASIC language if it fulfills those needs. So, for anyone who is interested I'll provide a list of BASICs that I've encountered. (I'm sure there are many others...)

BCX (free BASIC to C translator): http://groups.yahoo.com/group/BCX/

GLBASIC: (uses GCC, OpenGL, SDL) www.glbasic.com

GAMBAS (free linux based, interpreter): http://gambas.sourceforge.net/

BlitzBasic: www.blitzbasic.com

DarkBasic: www.darkbasic.com

PureBasic: (compiles to machine code) www.purebasic.com

Basic4GL (free interpreter):http://www.basic4gl.net/

SDLBASIC: (free) http://sdlbasic.sourceforge.net/

XBLite: (free) http://perso.wanadoo.fr/xblite/

Zaphos
Quote:

If you don't aspire beyond the hobbiest projects, why not?

Many people who are hobbiests do have aspirations beyond that niche, and even for those who don't, it's generally better to pick a language that has a future, doesn't teach bad style as a rule, and is socially acceptable.

Evert
Quote:

Some time ago I asked a question that met with the answer that Allegro users are typically engaged in single person development of small games.

I'm not a software developer, nor would I want to be.
That doesn't mean that I don't need to write code professionally. Something for which BASIC is thoroughly inadequate.

ks

Now, before I add another reply to this thread, keep in mind that I have no real stake in this argument.

It would seem to me that one could choose a BASIC variant and maintain structured professional code to produce professional products. I'm sure that's been the case for some of the better known BASICs, such as VB, VB.net, and PowerBasic. These are tools with perhaps greater limitations relative to languages such as C/C++/Java/C#/whatever, but satisfying the ends must count for something. I periodically browse the BlitzBasic site - and what I've noted is that the users are generating product, despite the (historical) baggage associated with BASIC.

With respect to coding professionally, where do languages such as Fortran and APL (J www.jsoftware.com and K www.kx.com)fit? At the other end, perhaps it would be best to adopt languages such as Eiffel and Smalltalk.

Of course if you wish to apply for a programming/software engineering job, listing BASIC experience will in all likelihood not help as much as C/C++.

Ultimately, I suspect that some variants are better than others and a talented individual would not be hindered.

Evert

Perhaps I should have been clearer. Writing code professionally in my case means numerical evaluation and simulations in the context of scientific research. BASIC is unsuitable because it is not portable enough and there isn't enough support for it to begin with. Java is unsuitable because it is too slow. Pascal too suffers from a lack of portability.

The languages that are suitable are C (or C++, though portability may again be an issue and numerical calculations mostly don't need all the bells and whistles even if they are sometimes useful) and Fortran, which has quite good support and optimized compilers on high-end computers.
This is why I mainly use C. I know a little Fortran, but I mainly use existing code which gets linked to my own C (C++, actually) code.

I wouldn't want to apply for an engineering job though, certainly not software engineering.

Thomas Fjellstrom

ks: you forget one of the slickest BASICs I've ever seen: RealBASIC, but then, I haven't seen many BASICs ;) Just VB and QB really.

ks

TF: Yeah, I've browsed the RealBasic site, but have you seen the asking price? I recently considered the purchase for tasks intended for both Windows and OS X, but stuck with Allegro.

Evert: Understand. I'm guessing you make use of C/GSL but if for no other reason than curiousity, have a look at J (an APL successor) which is referenced above. The site also provides a small number of books that use math/calculus as the teaching vehicle. It's amazing what can be packed into one line of code.

Zaphos

I feel there are several cases to consider before we say if basic is a good idea or not -- it does depend on context:

(1) You're coding an engine from the ground up in basic -- you have some decent blitting functions in C, maybe some sound and input, but everything else is in Basic.

Why not? Because anything complex will become difficult to maintain, not to mention inefficient, in ways that are not fix-able because they are factors of the language; optimizations and clean code tend to be very hard to implement.

(2) You're extending a feature rich, reasonably optimized engine with basic as a scripting language.

This is a decent plan, but I would suggest checking out other 3D engines which are not basic-based as well, as BASIC has very few advantages over other languages, it's not a good reason to limit one's engine choices, and because a language is not usually a difficult thing to pick up and it's a good thing to be confident you can do.

(3) You're an artist who knows some Basic, you don't want to think about coding any more than you have to, and you just want to see your art do something nifty in a simple game of your own design.

In this case I would suggest basic.

As to the assertion that BASIC can be used to create maintainable, structured code, well, I feel that a heavily modified variant could be manageable, but no more so than an existing, widely used language, and furthermore that said existing widely used language would probably (A) not be much more difficult to learn than the heavily modified basic, (B) would probably be cleaner -- it would not have hackishly tried to force a bad language into a good design, and (C) would be more widely used, and therefore more likely to be useful in the future.

Evert
Quote:

I'm guessing you make use of C/GSL

Yup. GSL is awesome. It saved me a lot of time from having to implement some things myself. It is lacking in some areas though and I hear it has some nasty bugs (haven't encountered any though).

Quote:

but if for no other reason than curiousity, have a look at J (an APL successor) which is referenced above.

Looks ok, although I wouldn't want to start using it over C+Fortran+GSL+GNUPlot. I'll keep it in mind though.

Quote:

As to the assertion that BASIC can be used to create maintainable, structured code, well, I feel that a heavily modified variant could be manageable, but no more so than an existing, widely used language

You can write perfectly structured code in (Quick) BASIC, just as you can write the most horrible garbage in C. Structured code isn't a language feature.

Eli Gottlieb

Get Delphi. It can link to any library that C/C++ can, and teaches much more structured programming.

Evert
Quote:

Get Delphi

Delphi isn't portable.

Were you addressing the OP? As an alternative to C on Windows Delphi might be a good idea for a beginner, but I would hesitate to actually suggest it.

Thomas Fjellstrom

Its somewhat portable. I've got Kylix on my machine at this very moment.

Thread #343929. Printed from Allegro.cc