I'm interested in PB.... I think?

Everything else that doesn't fall into one of the other PB categories.
Zach
Addict
Addict
Posts: 1656
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

I'm interested in PB.... I think?

Post by Zach »

Hi,

This might turn out to be a long winded sort of post, so sorry about that.. It's a Habit of mine that comes from a strong writing background.

I'm wondering if PB might be the right language for me. Currently I am a DBPro user, but I am still a considerable novice in that regard. I originally purchased DBPro as it had been a curiosity I watched for years, and then, well they had a really good sale going on :wink: I'm not keen on spending lots of money on programming languages, but at the same time the "free" alternatives such as C/C++ or Java, or Python/Ruby/LUA all have little things about them that bug me.. C/C++ in particular I think I will never wrap my head around. I've wasted quite a bit of money on books already. Java feels the same way, although slightly easier - but too verbose for my taste. The scripting languages, are just a pain to get into an kind of EXE form, especially if I ever want to do something cross platform (I like to work with actively maintained, easy to use tools).

DBpro has been an interesting learning experience so far.. But sometimes I feel a little limited in what I want to do with it. I actually think this is because I was spoiled by Python, which is OO and whose syntax I just felt so natural and at ease with. I don't have a problem with Procedural Languages, so it's not that part that bugs me (although sometimes I do feel boxed in).. But I also have concerns about the future of DBPro and how many more updates will be seen, and what kind of feature sets that might mean (if any at all).. Kind of a concern with any commercial language I guess? I mean you can't even make a simple GUI that easily in DBpro without user plugins, and then it's still got to be done in the DBpro Window, or worse off, by way of spawning a separate entirely new window.

So I'm real keen on PB's GUI support, and the whole Win32 API stuff (something I sorely would have to learn to use). As well as some of the other features available, such as Inline ASM ( I always wanted to learn ASM for fun - sick and twisted huh?). I'm most keen on the much easier route for Application Development that PB will offer, though.


I'm curious on hearing the thoughts and opinions from those who have used both, and how they make the transition.. I am aware of PureGDK which can let you combine PB and DBPro. Wondering how extensive that melding is? Can you use plugins made for DBPro, via PureGDK for instance? Have you experienced a real world scenario where combining both languages really paid off and made a program "click" where otherwise it just wouldn't be the same?

What are opinions on PB's 2D/3D capabilities and speed versus DBPro's ? I think I read somewhere that PB makes it relatively easier to speed up rendering of 2D sprites by using the GPU (I think this is possible in DBpro as well, but I'm sure its complicated or something). Moreover, DBPro's Text printing functions are notoriously slow - does PB have any similar problems like that?

From the code examples and stuff I have looked out (and admittedly understood very little) I do get the impression that PB is a much more powerful, more feature rich language, which I think is a good thing... Although the whole idea of pointers, etc really scares me (I just don't understand them or what they are good for in a modern language now matter how many "pointers made easy" essays I look at).. Can I program without really having to use/worry about pointers? Does PB have garbage collection? (do I have to worry about deleting everything I make when I'm done with it?)

Lastly.. What does the future of PB look like? (is there a thread with committed future features listed, etc) I don't want to decide to blow a chunk of money on PB only to worry if its gonna be around 1 years, or 5 years from now... I think that's actually happening to me with DBPro in fact, and making it harder to me to keep my dedication in learning it, in strong spirits.

I am definitely interested in making both Applications and Games. I don't have any fancy 3D aspirations, but some classic 2D or Isometric ideas being realized one day, would be extremely awesome..


One more specific question.. One Application I am interested in doing, is something involved with Video Editing, using Avisynth and various Plugins of that nature that it runs.. Some of these plugins generated frame-based metrics in real time (basically a set of data about each individual frame in the video file) and when asking how a similar styled program (no longer maintained, that I want to pick up/rebuild as my own) obtained those metrics, I believe I was told that they are read from Debug output - and to use a utility like Debugview (by sysinternals) or w/e to see them.. I am assuming this is the "Win32OutputDebugString" or whatever it may actually be called (I think there is also Kernel-mode DbgPrint?).

Can that sort of data be easily accessed and manipulated from within PB? I'm assuming by Win32 API calls? If so this is strongly in PB's favor when making my decision to purchase.. As making this one single application will help me and potentially the video editing community itself immensely when dealing with Variable Framerate Video.



If anyone can answer any (or all) of these, that would be a great help..
Image
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6161
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: I'm interested in PB.... I think?

Post by blueznl »

I can only give you a link to the Survival Guide, perhaps that one will help a little...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: I'm interested in PB.... I think?

Post by Trond »

Although the whole idea of pointers, etc really scares me (I just don't understand them or what they are good for in a modern language now matter how many "pointers made easy" essays I look at).. Can I program without really having to use/worry about pointers?
One could say there's two "levels" of pointer usage. The first is very simple, and it's when pointers are used for pass-by-reference passing of structures. You will probably need this, but it's really easy to understand and use.
The second is when you have a pointer to an object on the heap. This is a bit more difficult and you very likely don't need it. In this case you will have to worry about freeing the object when you're done with it. (Pointers in PB are much easier to grasp than I C, IMO.)
Does PB have garbage collection? (do I have to worry about deleting everything I make when I'm done with it?)
No to both questions. PB doesn't have garbage collection, but local variables (which can be as simple as an integer, or as complex as a structured variable with array, list and map members) are freed automatically when they go out of scope (at the end of the procedure or at the end of the program for global variables).
Zach
Addict
Addict
Posts: 1656
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: I'm interested in PB.... I think?

Post by Zach »

blueznl,

Actually.. That is something I have been looking at already and where I look over a lot of the code samples I've seen thus far.

I do like the SQlite support mentioned there as well. I used SQLite with Python as the database for my first Text RPG (-not- text adventure! This is more MUD-like) and lamented at losing it when I made the switch to DBPro.

Some other curiosities I forgot to ask about..

Is it possible to index arrays by Strings instead of Integers? (think like, Key:Value terms)
Or at least, is there a facility available so that I can create a "map" to the index position of an array, based on a string?

And for making a GUI for something like a game for instance.. Right now in DBPro I am faced with the daunting realization that if I want my text entry box (just a simple graphic with a variable built from the Keyboard Buffer printed over it) to act like a REAL text box, I would have to code all that functionality manually...

Can I actually co-op widgets/gadgets via the Win32 API and use a fully functional text box / text area / button, etc.. But still skin it so it goes with my game GUI ? If so is that generally a "difficult" or lengthy/involved task to do?

Sorry for all the questions :oops:

edit: Thanks for your answers, Trond. That is good to know and puts me more at ease
Last edited by Zach on Mon Dec 13, 2010 10:47 pm, edited 1 time in total.
Image
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: I'm interested in PB.... I think?

Post by Trond »

Is it possible to index arrays by Strings instead of Integers? (think like, Key:Value terms)
A map does exactly that (the key is a string rather than integer).

Code: Select all

NewMap Test.i()
Test("five_times_six") = 30
a = Test("five_times_six")
; a = 30
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4326
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Re: I'm interested in PB.... I think?

Post by Rook Zimbabwe »

I would have expected Mistrel to chime in LONG before now... He has coded a program that lets you use all features of your DB Pro in PB... Look in the ANNOUNCEMENTS sectoin or just search DB PRO.

:mrgreen:
And for making a GUI for something like a game for instance.. Right now in DBPro I am faced with the daunting realization that if I want my text entry box (just a simple graphic with a variable built from the Keyboard Buffer printed over it) to act like a REAL text box, I would have to code all that functionality manually...
look in the help file for: Gadget3D
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
Zach
Addict
Addict
Posts: 1656
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: I'm interested in PB.... I think?

Post by Zach »

While that sounds encouraging - the 3D part bothers me.

Can Gadget3D also be used for 2D games? For example, the aforementioned Text RPG that I would be porting over to PB from DBpro.


I'm looking through the help file right now, and I have a lot of hits that included "gadget3d" but not "Gadget3D" just by itself. Hopefully that doesn't required anything to do with the Win32 API? Since the demo does not allow you to use it (I wish it did..)

edit: ah ok I found a link back to the Gadget3D root... but current question still stands. Can this be used with 2D games? Or is there an equivalent command set I can look up in the Help?
Image
PMV
Enthusiast
Enthusiast
Posts: 727
Joined: Sat Feb 24, 2007 3:15 pm
Location: Germany

Re: I'm interested in PB.... I think?

Post by PMV »

The 3D-Engine is OGRE3D and the CEGUI-Plugin from OGRE3D is used for
the Window-Commands. It is not possible to use it with the 2D-Commands.
Äh it is possible, but the 2D will always be over the Window3D. Also this part
is very buggy and i discourage from this lib till the next update.

If you are able to understand ASM, you will also be able to understand pointers,
for sure. :)

The future of PB is not documented. Any update will be released when it's done.
And it is not possible to get information about the new features before it is released.
That is normal since years and longer, but you doesn't have to worry about this,
PB will go on but no one can say, where it is in 5 years. :D

The 2D-Lib uses DirectX9/7 or OpenGL under windows and OpenGL under Mac and
Linux, so it should be fast enough for anything you want to do.

MFG PMV
Zach
Addict
Addict
Posts: 1656
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: I'm interested in PB.... I think?

Post by Zach »

PMV wrote: Äh it is possible, but the 2D will always be over the Window3D. Also this part
is very buggy and i discourage from this lib till the next update.

If you are able to understand ASM, you will also be able to understand pointers,
for sure. :)
Well, maybe when I learn ASM (one day) I'll be able to get pointers down, then...

As for the 2D being drawn over 3D, not really a problem, as any GUI is drawn over what's in the background.. But having to use a 3D mode when not required, I'm sure would come with all sorts of problems.. Though when do you think that next update might be?

Alternatively... are there any real options for using gadgets to build a GUI for a 2D game? Or would you have to make your own GUI with sprites, and then (groan...) code any functionality you need - no matter what?
Image
Thorium
Addict
Addict
Posts: 1271
Joined: Sat Aug 15, 2009 6:59 pm

Re: I'm interested in PB.... I think?

Post by Thorium »

Zach wrote: Well, maybe when I learn ASM (one day) I'll be able to get pointers down, then...
Why "one day"?
Just start learning it.
It's not crazy to learn asm and it's not to hard. It's just another way of programing. Nothing magic or crazy about it. Most talk that you hear about asm are rumor from people that actualy never used it.
PMV
Enthusiast
Enthusiast
Posts: 727
Joined: Sat Feb 24, 2007 3:15 pm
Location: Germany

Re: I'm interested in PB.... I think?

Post by PMV »

Zach wrote:As for the 2D being drawn over 3D, not really a problem, as any GUI is drawn over what's in the background.. But having to use a 3D mode when not required, I'm sure would come with all sorts of problems.. Though when do you think that next update might be?
If you want to create a 2D-Game with the Window3D-Lib, this would be a problem
The last update is far away, so the next one could come today, tomorrow, ... when it's done. :wink:
Alternatively... are there any real options for using gadgets to build a GUI for a 2D game? Or would you have to make your own GUI with sprites, and then (groan...) code any functionality you need - no matter what?
You need a bigger GUI for RPGs and less for racing games.
I doesn't know what you want to do, but if you need a big GUI, this could be helpful:
http://www.purebasic.fr/english/viewtop ... 27&t=31357

MFG PMV
Zach
Addict
Addict
Posts: 1656
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: I'm interested in PB.... I think?

Post by Zach »

Thorium wrote:
Zach wrote: Well, maybe when I learn ASM (one day) I'll be able to get pointers down, then...
Why "one day"?
Just start learning it.
It's not crazy to learn asm and it's not to hard. It's just another way of programing. Nothing magic or crazy about it. Most talk that you hear about asm are rumor from people that actualy never used it.
The issue is more to do with free time, and such.. But I also am a slow learner when it comes to the really boring/basic stuff to do with programming. I'm guilty of skimming a lot, for example.
Image
Zach
Addict
Addict
Posts: 1656
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: I'm interested in PB.... I think?

Post by Zach »

PMV wrote:
Zach wrote:As for the 2D being drawn over 3D, not really a problem, as any GUI is drawn over what's in the background.. But having to use a 3D mode when not required, I'm sure would come with all sorts of problems.. Though when do you think that next update might be?
If you want to create a 2D-Game with the Window3D-Lib, this would be a problem
The last update is far away, so the next one could come today, tomorrow, ... when it's done. :wink:
Alternatively... are there any real options for using gadgets to build a GUI for a 2D game? Or would you have to make your own GUI with sprites, and then (groan...) code any functionality you need - no matter what?
You need a bigger GUI for RPGs and less for racing games.
I doesn't know what you want to do, but if you need a big GUI, this could be helpful:
http://www.purebasic.fr/english/viewtop ... 27&t=31357

MFG PMV

Well I think you are not interpreting what I was saying correctly. I never said that I wanted to create a 2D game using 3D libraries. If you were referring to DirectX/OpenGL etc then they are quite capable of producing 2D graphics, as languages like Dark Basic, Pure Basic, etc have exemplified.

When I think of 2D games, I think of Text Games, Verticle/Horizontal shooters/scrollers, Platformers, etc.. Isometric I suppose it can be debated whether that requires using a 3D library or not, but Isometric games interest me as well.

But as far as 2D goes, that's the kind of thing I want to eventually attempt. However if I were to port my current project over, from Dark Basic Pro, I would still need to solve my GUI problem. I currently do not have a GUI toolset to work with in DBPro because I haven't found one I found suitable to the task.

But this is a question I have seen on the net from various google searches, to try and find out how people solved the problem in their games. A common solution was "use an existing GUI framework and just extend the functionality if you need something else". So that was what my question was about really.

As PB appears to make it much easier to build a GUI using the Win32API I was asking, if I can "co-opt" (borrow) certain widgets, etc like if I needed to make a text entry bar, or a large read-only text box to display some text, and maybe some buttons, and then skin those widgets to fit in with the other graphical elements of my GUI. And the response was to look at the 3DGadgets toolset in PB - however that appears to be more for 3D applications.

I'm merely interested in GUI solution for a 2D game, in a 2D display mode. So I do not have to try and kill my brain trying to code my own text box functions to handle word-wrapping, number of character limits, backspacing, inserting/deleting/copying/pasting selections, etc.. all that stuff that text boxes do.

However another possible solution has occured to me, and I'm not sure if anyone has tried this. In DBPro some folks who know more than I do, have discussed the topic of using a (locked?) 3D plain, to draw a 2D GUI on, the benefit being the work is handled by the GPU and is rendered much more quickly..

So is it possible to create a GUI this way in PB perhaps? Using a plain to serve as the "2D drawing surface" and then using the 3DGadgets in a 3D Display mode to make my GUI? So I could make a GUI and maybe lock one or two plains at the right distance from the camera, and almost use them like viewports or "windows" to the 2D action being rendered onto those plains?


I do thank you for that link to that fullscreen GUI utility however. It could prove helpful to what I want to do as well.
Image
PMV
Enthusiast
Enthusiast
Posts: 727
Joined: Sat Feb 24, 2007 3:15 pm
Location: Germany

Re: I'm interested in PB.... I think?

Post by PMV »

I know what you mean, so you doesn't need to write that much :lol:

Everything is possible, but i doesn't think you want to invest much time. :wink:
At this moment, the easiest way to create a GUI with the 2D-Commands is
to use the link above.

The best solution would be to create a CEGUI-Plugin for a normal PB-created
screen :mrgreen:

Of course, 3D-Mode is much faster on graphic-cards, so it is always faster to
render a 3D-scene instead of using 2D-Methods. I remember, that some one
has created a lib with many functions using PB-OGRE3D (Engine3D) for 2D, but
i can not find this again. :cry:

MFG PMV
epidemicz
User
User
Posts: 86
Joined: Thu Jan 22, 2009 8:05 am
Location: USA
Contact:

Re: I'm interested in PB.... I think?

Post by epidemicz »

Zach,

If Dark Basic and DBPro are good for one thing that is, at least, getting people interested in other, faster, more capable languages. Hit up the demo, it should show you how much faster PB is than DB/DBPro. PB's speed is constantly amazing me, and compared to DB it isn't even funny.

How long will PB last? Who knows, as long as the Dev's don't get hit by a bus, the future looks bright from where I'm standing.

Do you need to learn pointers? Yes, in my opinion, especially if you have any hopes in learning ASM. There's a lot you can do without knowing much about pointers, but things really open up to you once you start understanding how they work.

Also, keep in mind that you aren't married to the built in 2d/3d stuff that is supplied with pure basic. There's plenty of third party frameworks for 2d and 3d, most of the more well known stuff has wrappers for PB already so that work is already done for you, it's just plug and play.

Good luck.
Image
Post Reply