Dark Bit Factory & Gravity

GENERAL => General chat => Topic started by: ttemper on December 09, 2011

Title: which language to start with?
Post by: ttemper on December 09, 2011
hey guys, so over the last week or so i've been dabbling in coding.

a friend of a friend told me about darkbasic pro "free", so i downloaded it, installed and had a play with it.

i did manage to get a nice sinewave scroller happening with custom bitmap font(s) that i drew in photoshop (yeh i also do graphics), a few 'box' rasterbars that were static and had a sine wave to them also, a couple of moving figure 8 logos (sprites) on screen which did look kinda nice.

the one thing i didnt really like is that the compiles are HUGE... ~4mb for a simple dual scroller, couple of bitmap fonts and logos... ouch.... so the more i researched, the more i saw that darkbasic is frowned upon (i can sorta see why) in the demoscene.

ive read some C++ tutorials on the basic stuff, and its a lil' tricky for me as i dont know c++ at all. zip, nadda, nothing. from noseing around the place, i stumbled here, so i was sure to sign up to get some help/push in the right direction.

by the looks of things c++ and freebasic are the main 2 choices here, freebasic with tinyptr addon etc seems all good n such to me, but the more i googled around the more i found that purebasic was popping up around the place more and more. ive checked some of the syntax/code of the sources that were available... and since i code tcl and bash scripts (dabbled in perl and c) purebasic code seemed more inline and understandable to me than the others for the moment.

so upon comparison of freebasic, c++ and purebasic, it seems purebasic is the better choice for me. what im wanting to know is.... is this a good starting language to learn with? to code some nice scrollers, sinewave rasters/logos, load up some bitmap fonts to use, 2d starfields, etc etc etc (ive seen many great demos and source code already on here and a few were from purebasic).

thoughts? would like to get some opinions of fellow coders that know whats what.

thanks :)

Title: Re: which language to start with?
Post by: Raizor on December 09, 2011
Freebasic or Purebasic are probably your best bet, from what you've said. Freebasic is free whereas Purebasic costs money (79 euros). 

Jumping straight into something like C++ is probably going to be a bit frustrating and painful (but if you persevere the pain may well pay off).  There are also other options such as C#, but you'll have dependency on the .Net runtime being available/installed and may need to carry some extra DLLs if you're using OpenGL, which will bump up the size of your demo/intro distribution. Having said that, if size isn't really an issue, C# is a lot easier to get to grips with than something like C++.

It sounds like you're from the old (small is beautiful) school, so Freebasic would fit nicely as it kicks out very small EXE files.

Good luck and feel free to ask any questions about anything :)
Title: Re: which language to start with?
Post by: Shockwave on December 09, 2011
In terms of performance, Purebasic and Freebasic are similar.  I had a go at both and chose Freebasic.

DB produces massive exe's as you've found, C++ is probably the more accepted mainstream choice in the Demoscene, Freebasic and Purebasic will both get you to the point where you're up and running more quickly though...

C# as Raizor said is a really lovely language to use too.. I recently did a microsoft .net course in Visual Basic, the course material was provided in VB + C# and I quickly found myself preferring C# !
Title: Re: which language to start with?
Post by: ttemper on December 10, 2011
hey guys, thanks for the replies.

i think i will probably start off with freebasic, as like you said.... its free. then later on move to c++, I've read code n such, but i don't know how it all works just yet, i guess if i actually sat down to learn the code, it'd all become clearer quicker. I'm a quick learner and I'm persistent when it comes to doing something.

I've seen some nice source codes that i could use and learn with... I'm more of a 'lets try this' to find out what things do, how things work, that's how I've always learnt i guess, rather than a text book approach... and it has worked very well for me in the past, so i think i will do it again... i have a tendency to jump in the deep end.

as for porting purebasic code over to freebasic... not sure how easy or difficult that would be.

I've noticed in quite a few freebasic demos from here that text text scrollers (non bitmap) are all laid out in data form, which i guess cuts down on space... the whole 0 off, 1 on etc makes sense. there is code floating around for a bitmap font loader and such? i saw xal text demo and atx remake which are in purebasic, wouldn't mind ripping some code over to freebasic to mess with and learn from.

so yeah, I'm here and willing to learn, so point me in the right direction.

pref to start of with a nice bitmap scroller (i have already created my own custom bitmap font in 64px, 32px and 16px to use), then sinewave it, rotate letters, etc

thanks again guys.
Title: Re: which language to start with?
Post by: Shockwave on December 10, 2011
Quote
I've noticed in quite a few freebasic demos from here that text text scrollers (non bitmap) are all laid out in data form, which i guess cuts down on space..

Probably mine.. It does make for a smaller intro but it was done because of pure lazyness on my part.

Here's a little (old!) tutorial about drawing bitmap graphics in Freebasic

http://www.dbfinteractive.com/forum/index.php?topic=3788.0 (http://www.dbfinteractive.com/forum/index.php?topic=3788.0)

There are some other useful resources around here by rbz (bin2bas and bmp2raw) which you will definitely need to resource music and sound into your programs.

Why don't you have a go at loading a picture and post your questions and problems and we'll get started :)
Title: Re: which language to start with?
Post by: ttemper on December 11, 2011
ok, i'll try pull up a picture first. i see that you guys use tinyptc_ext.bi alot, so i decided to have a look around for various things, and saw that fbgfx.bi is similar. whats the advantage of using tinyptc over fbgx? the overall compile size?

as before when messing with darkbasic, i had all my image files as png (i saw pload() around the place too), so wouldnt it be easier to just load in the 8bit png than convert the bmp to raw/data? im just trying to get an idea of what would be the easiest way without losing much quality of the picture(s).

also i want all my graphics and music compiled inside the exe, so is that possible if i dont use tinyptc_ext?

thanks in advance.
Title: Re: which language to start with?
Post by: Shockwave on December 11, 2011
fbgfx is freebasic's built in graphics library, there's nothing wrong with it really and you can still create single file executables with it by using the #include function to get your data in.

Indeed there are methods to load .png files, I even recall Jim writing something that enables you to use Directx to load images.

If you resource your images as 256 colour bitmaps then you'll inevitably see some deteriation in quality of the image, for some things it won't matter, but if your artist has made you an ass kicking picture then yep, you'll need to protect those colours!

As for the advantage of tinyptc over anything else?  Well I suppose that it's being able to have the fine control over everything  as there are no graphics commands - and small exe sizes.  You start by placing colour values into an array of pixels and over time build up a library of your own functions and commands... Really though it's up to you what approach you take.

Your goal at first should be to get something on the screen and never mind resourcing everything into the file at this point because you have to walk before you can run. :)

Try drawing some dots :)
Title: Re: which language to start with?
Post by: ttemper on December 12, 2011
ok thanks for that, ill 'walk' with tinyptc_ext for the moment and see how i go, can always adapt/learn other techniques after.

so for the moment, ill try pull up a bitmap on screen.

thanks again.
Title: Re: which language to start with?
Post by: ttemper on December 12, 2011
ok, im extremely lost atm... *sigh*...

what im trying to do is use tinyptc_ext with fbpng, but i cant get it to work. ive tried to search for 'help', wiki, whatever on tinyptc_ext and fbpng to no success, so im stuck.

tbh atm, i would rather use a png loader to get my graphics and then use tinyptc_ext to display them, but like i said, i got no clue on what to do. spent a few hours today going around in circles and now im just frustrated to hell. if i had documents to go by to show what commands do what it would make things easier for me.

ive tried looking up tinyptc_ext, but im confused as to how you grab the data to show on screen.

if you can point me in the right direction for documents to show me what the commands do, that'd be appreciated. an index so to speak (dark basic had this, and was easier to find out what to do and how). *extremely frustrated atm*  :telloff:

basically, i want to load up proper png file (as you would do your bmp2bas .bas file) and display it on screen.



Title: Re: which language to start with?
Post by: Shockwave on December 12, 2011
Try drawing some dots first.
Tinyptc is all about drawing dots -,you'll need to write drawing functions yourself.  If you can't draw dots just post the code you have done in a fresh topic and we can go from there.