SyntaxBomb - Indie Coders

Languages & Coding => Others => Topic started by: Pfaber11 on October 02, 2019, 11:22:28

Title: Pure Basic
Post by: Pfaber11 on October 02, 2019, 11:22:28
Just downloaded my free copy of pure basic . The free version can only be used for small programs but should be ok to learn on and see if I want to buy it. Had a play with it and seems like it's gonna take some time to get into it .I have had a brief look at it before but not in great detail . So far managed to open a window on the screen and that's where I'm at right now. The reason I would like to learn this is it apparently is very fast and compiles to machine code . Will still be developing with AGK classic for the foreseeable but just want to add another string to my bow and this seemed the obvious choice . If anybody has any tips or advice feel free to comment . I'm not planning on defecting from AGK any time soon.
Title: Re: Pure Basic
Post by: Coder Apprentice on October 02, 2019, 15:26:59
Check out Jon P. Logsdon's book on programming 2D games for PureBasic. It's free. But as far as I know the main example game needs a full version of PureBasic. Honestly if you want to check PureBasic properly I suggest just buy it. It's really not that expensive and you have lifetime free upgrades. For 3D it comes with many examples.

What's good to keep in mind when you start with PB for game development, that it uses two separate engines for 2D and 3D. For 2D is a fairly simple DX9 sprite engine, no built in 2D physics. For 3D it uses Ogre3D 1.8 which is a fairly capable engine that has good backward compatibility with older DX9 level GPUs and uses Bullet for physics. But because they are two separate engines you can't mix their functions/commands. You either use one or the other. You'll find out fast that PureBasic is not geared towards game programming (nor any other specific area) so you'll have to do more manually and certain things won't be as "straight forward" as they're in AppGameKit. Knowing it's quirks is essential so using their forum where many issues had been discussed already is invaluable.

Compared to AppGameKit, PureBasic will give you more speed, control and freedom, but also more work, and decisions to make.

Programming 2D Scrolling Games for PureBasic
http://mycodeserver.com/games_books/ (http://mycodeserver.com/games_books/)

Title: Re: Pure Basic
Post by: Naughty Alien on October 02, 2019, 16:25:35
..PureBasic is fantastic..for me is a huge refresh as things simply works as advertised..all exporters needed for 3D are basically OGRE tools available easy and very stable...speed wise, is also, brilliant...after NF, this is next tool i really like a lot..
Title: Re: Pure Basic
Post by: zxretrosoft on October 06, 2019, 21:14:53
Quote from: Naughty Alien on October 02, 2019, 16:25:35
..PureBasic is fantastic..for me is a huge refresh as things simply works as advertised..all exporters needed for 3D are basically OGRE tools available easy and very stable...speed wise, is also, brilliant...after NF, this is next tool i really like a lot..

Yes, exactly. I agree. PureBasic is a great language, fast. For 79 € completely cool, I never regretted.

From my perspective, it has several reserves. E.g. does not have aggregated sprites or particles, completely physics commands (such as AGK), but otherwise it's a great language.
Title: Re: Pure Basic
Post by: 3DzForMe on October 06, 2019, 21:33:31
Quote..PureBasic is fantastic..for me is a huge refresh as things simply works as advertised..all exporters needed for 3D are basically OGRE tools available easy and very stable...speed wise, is also, brilliant...after NF, this is next tool i really like a lot..

I'll put it on my list, if B3D stops doing the biz due to some Win 1* release. But W10 is the last ever Windows release..... right?
Title: Re: Pure Basic
Post by: MikeHart on October 07, 2019, 06:52:17
It is surpose to be the last release, but the 6 months updates can have an impact. And in a way that an app might not function right.
Title: Re: Pure Basic
Post by: Pfaber11 on October 07, 2019, 12:07:36
I downloaded that book 2d games on purebasic or something and there was no charge . Thanks I'll take a look at it .
Title: Re: Pure Basic
Post by: Pfaber11 on October 07, 2019, 13:23:09
Downloaded 3 books on pure basic to have a look at . Gonna take some time as quite thick but I will give it  a fair crack of the whip.
Pure Basic a beginners guide
Pure Basic reference manual
Learn to program_PB
Should keep me busy for a while . I believe the reference manual is over a thousand pages . By the way  all these books were free as is my version of pure basic . It'll do until or if I decide to start a project in it . Is the OGRE engine built into PB or do I need to download it separately . It may be that I'm not cut out for PB and if that happens to be the case I will stick with AGK2
. I'm into 3d games these days and this will be the direction I'm heading in . Hopefully what I've learnt from using AGK will be useful in PB. Anyway I'll let you know what I think and if I decide it's for me .
Title: Re: Pure Basic
Post by: Pfaber11 on October 08, 2019, 19:28:38
Well I've had a play and have ground to a halt . can anybody tell me what's wrong with this code . The window is supposed to turn red but it doesn't .
InitSprite()

OpenWindow(1,200,200,400,400,"pauls program")
ClearScreen(RGB(100,0,0))
FlipBuffers()
Delay(5000)
StartDrawing(WindowOutput(1))

DrawText(10,10,"hello world")
StopDrawing()

FlipBuffers()
Delay(5000)

End
Title: Re: Pure Basic
Post by: Pfaber11 on October 08, 2019, 21:38:34
well I know where I was going wrong I was using a window and screen at the same time or at least trying to. Thanks for reading.
edit
well I'm still moving on very slowly and am thinking of giving pure basic the elbow it's just so slow to get to grips with for me anyhow . Gonna give it a few more days and see how I feel .
Title: Re: Pure Basic
Post by: Coder Apprentice on October 08, 2019, 21:40:18
You opened a window but didn't open a screen inside the window. You can put FlipBuffers() after StopDrawing() but it's not necessary in this case. 

InitSprite()
InitKeyboard()

OpenWindow(1,200,200,400,400,"Paul's program! Press Any Key To Exit!")
OpenWindowedScreen(WindowID(1),0,0,400,400)

Repeat
 
  WindowEvent()
  ExamineKeyboard()
  ClearScreen(RGB(100,0,0))
  StartDrawing(WindowOutput(1))
  DrawText(10,10,"hello world")
  StopDrawing()
 
Until KeyboardPushed(#PB_Any)
Title: Re: Pure Basic
Post by: Pfaber11 on October 08, 2019, 21:50:20
Thanks Kris I'll have another go . was getting a little despondent . Thanks
Title: Re: Pure Basic
Post by: Pfaber11 on October 08, 2019, 22:26:53
Well I had a play around with that code and this is what I came up with . It's working that's the main thing .
learnt a few things this evening which is good .


InitSprite()
InitKeyboard()
OpenWindow(0,200,200,400,400,"Paul's program! Press Return To Exit!")
OpenWindowedScreen(WindowID(0),0,0,400,400)
  Loopy:
  ExamineKeyboard()
  ClearScreen(RGB(100,100,0))
  StartDrawing(WindowOutput(0))
  DrawText(10,10,"hello world")
  StopDrawing()
  WindowEvent()
  If  KeyboardPushed(#PB_Key_Return)
    End
  EndIf
Goto loopy
Title: Re: Pure Basic
Post by: Pfaber11 on October 09, 2019, 20:11:08
Well tonight I'm gonna get stuck into PB again and see if I can learn something new . Got a spare old note book and am going to dedicate it to PB so I don't forget anything . Gonna see if I can get some Graphics on the screen tonight and maybe get them moving about. Thanks again for all the help from the excellent people on this forum. Happy coding .
Title: Re: Pure Basic
Post by: Naughty Alien on October 10, 2019, 01:45:43
..here are some shots from provided samples...so much of 'touch' of old B3D, but this one is much faster and 3D engine is modern..

..Dynamic shadows, self shading, physics, collisions..

(https://i.postimg.cc/fRb3dxDM/Pure-Basic-Compilation0-2019-10-10-08-36-32-24.png)


..bridge physics example with dynamic shadows and so on..

(https://i.postimg.cc/bJ1dPgH9/Pure-Basic-Compilation1-2019-10-10-08-37-39-62.png)


..physics responsive water surface..

(https://i.postimg.cc/W4BtxCr4/Pure-Basic-Compilation1-2019-10-10-08-40-18-29.png)


..all of this runs on 4K display with over 120FPS no screen tearing or anything..super smooth..3D engine is fully embedded in to language, shader powered, with widely available tools to import media without any voodoo...very very nice..
Title: Re: Pure Basic
Post by: RemiD on October 10, 2019, 07:09:53
if i remember correctly, there is a ogre3d wrapper for blitz3d...

so in this case what would be the advantage of using purebasic ?

the syntax seems more complicated to not do much more (for games)
Title: Re: Pure Basic
Post by: Pfaber11 on October 10, 2019, 10:47:36
yes but I'm getting into it . My next project isn't going to be a game although I could do it with AGK I'm gonna try and do it in PB . gonna give myself a month or two to hopefully get to grips with it . I'm at the stage where I'm putting graphics on the screen . I think it's gonna probably take me 3 months to get reasonably competent . Maybe longer. Happy coding
Title: Re: Pure Basic
Post by: Pfaber11 on October 10, 2019, 10:54:21
I still intend to keep using AGK2 Classic for my Android projects and if I'm releasing it on Android I may as well release it on PC as well . I think PB is a very interesting language . Can't wait to start on the 3d stuff but that is for the future .
Title: Re: Pure Basic
Post by: Pfaber11 on October 10, 2019, 14:03:14
@Remid  Well I'm looking for a language to code programs of different types that can also be used for 3d games and 2d for that matter and out of the handful I've looked at recently PB ticks more boxes . I've started writing a book and taking notes on all the things I need to remember I did this with python too and think this is the way to go , just something to jog my memory when required . I do think AGK classic is very good but I wouldn't want to write a database or some business program in it . You probably can but I don't think it would be an ideal solution. I'm after a good all round programming language. And I know it doesn't make much difference but PB compiles to machine code  and for me that is a plus also. I'm hoping to release something in Pure Basic by Christmas . We'll see. Everything is going ok right now hit a few snags but with a bit of help from the excellent people on here I've made progress .
  You know the language does appear a bit more complicated but I think for things like internet access , and interfacing and probably a load of other things PB wins . specifically I don't know all the benefits but I've been lead to believe there are quite a few . You know if Blitz 3D was being worked on and regularly updated I probably wouldn't of moved onto AGK. and now onto PB. Just hope they keep at it and don't drop it in 12 months as I'm just getting into it . Speed wise so far as moving a sprite on screen there doesn't seem to be much in it between AGK and PB . There we have it . Bonjour.
Title: Re: Pure Basic
Post by: RemiD on October 10, 2019, 17:29:48
(i was asking naughty alien)
Title: Re: Pure Basic
Post by: Pfaber11 on October 10, 2019, 21:55:10
@Naughty Alien
Very nice graphics indeed. Hope to be trying out the 3D OGRE stuff very soon . Now playing with sprites and all is good that I've tried . Got sprites on the screen and detecting hits no problem . Might just write a flappy bird type game to get started . Really glad I took this path now. Thanks to all those that have pointed me in the right direction. I'm picking PB up faster than I thought I would . Have a nice evening .
Title: Re: Pure Basic
Post by: Naughty Alien on October 11, 2019, 01:39:36
@RemiD
..well..very simple reason really..PB is developed product and regularly updated, including embedded 3D engine, which is desktop wise, cross platform, and that is exactly what im looking for. Syntax is something , simple to live with by just adopting specifics of it and using only what i need to achieve my goal. Its rather small comfort price to pay, compared to use of dated system such as B3D with some external libs, which is not in development anymore. Its simply headache free and actively developed product, and thats very important to me.
Title: Re: Pure Basic
Post by: GaborD on October 11, 2019, 02:07:44
Agree to that, it's an important thing for me too.
I will have to try PB. If their 3D implementation is flexible enough to allow hooking into the underbelly of rendering it could be a great choice.
Title: Re: Pure Basic
Post by: Naughty Alien on October 11, 2019, 05:26:47
..underlying engine is Ogre3D, which i think, you will not have an issue to play with, considering showcase of what is achievable with it..

https://www.ogre3d.org/showcase
Title: Re: Pure Basic
Post by: MikeHart on October 11, 2019, 08:02:11
So far i only could find info that its developer Fred is not working much on PB anymore, that he switched country and is working a regular job. Does anyone have contrary info?
Title: Re: Pure Basic
Post by: Pfaber11 on October 11, 2019, 08:31:08
Damn that's not good news . just hope they keep on supporting it or maybe it's been out that long it's a finished product .
Title: Re: Pure Basic
Post by: Steve Elliott on October 11, 2019, 08:38:06
That's the problem when people use a 'free updates for life' business model.  Eventually they run out of money and quit.
Title: Re: Pure Basic
Post by: RemiD on October 11, 2019, 12:01:23
@Naughty Alien>>ok, that's what i wanted to clarify, with blitz3d + a ogre3d wrapper (+ ogre3d external lib) or with blitz3d + a irrlicht wrapper (+irrlicht lib), you can most likely achieve the same renders... (since the 3d engine would be the same)

(i am not interested to use such functionalities, just curious)

Title: Re: Pure Basic
Post by: Naughty Alien on October 11, 2019, 13:47:47
Quote from: MikeHart on October 11, 2019, 08:02:11
So far i only could find info that its developer Fred is not working much on PB anymore, that he switched country and is working a regular job. Does anyone have contrary info?

..do you mind to share source of this information? I couldn't find anything on forum.
Title: Re: Pure Basic
Post by: Coder Apprentice on October 11, 2019, 16:10:17
I think Fred having a "day job" happened many years ago. Actually he switched a couple of times between full time PB development and having a day job during PureBasic development. There is a fluctuation in the frequency of updates but if there is one thing you can say about PureBasic that it never went away or morphed into another product. It has been around for 19 years. If there is any serious show stopper bug that usually gets a fast maintenance update.
Title: Re: Pure Basic
Post by: Naughty Alien on October 11, 2019, 16:42:14
..yes..from what i have seen on forums, it seems Freed working like this since 2012, if im not mistaken, and it is nothing new about that, which also explains lifetime update license..after all its 21 years old language already, and i guess, guys in development does some work for a living somewhere else, and spending their free time developing PB and getting some money for it, which is fine..i dont think PB is going anywhere any time soon..
Title: Re: Pure Basic
Post by: Pfaber11 on October 11, 2019, 20:30:32
That's cool I like to think it'll be around for a good while yet . Seem to be taking to it pretty well I dare say I may hit the odd stumbling block but that is to be expected. How long have you been using PB Naughty Alien and how have you found it compared to other languages like AGK and blitz3D . I'm finding it easier than python which I sunk 6 weeks into only to find it was not my thing and packed it in . It's gonna take a few weeks for me to be producing stuff like I was with AGK but I quite like the challenge . It took me six weeks to produce my first game with AGK classic and it was really crap. My second and third efforts improved  and every game I've made since has steadily gotten better . My next creation is going to be different in that it will not be a game although some may look at it as a bit of fun . By the way my first game with AGK is not available for download . It really was very bad .
Title: Re: Pure Basic
Post by: Naughty Alien on October 12, 2019, 08:27:39
..well..to me PB is conceptually identical to B3D...solid, embedded 3D engine, with also 2D commands so, you can develop whatever you like, all in one package, without installing anything outside of default installer. Difference with B3D is that it came with also embedded GUI designer, so if you creating apps or anything which require GUI, you have it all ready, which was not case with B3D (or any BRL languages for that matter, as you needed some external libs to make things pleasing to work with)...speed wise, it is far ahead from B3D and AGK and its very much in same ballpark with NB/NF, from what i was able to see. For folks who are after 3D games, is not subject of thinking, considering that underlying engine is well proven modern Ogre3D. Export tools needed for Ogre3D are widely available and very stable. What used to be an issue for me before (exporting geometry/animations from 3dsmax), is breeze now with very well built exporters, which exports not just geometry but also materials and so on. PB is really nice refresh. Everything works as advertised, which is not case if we talk about AGK(3D wise). For B3D apart from dated 3D engine, you are limited to windows only, while PB target all desktops, seamlessly. After all, language is 21 years in development, so that says a lot. I agree with RemiD that syntax is a bit awkward, but to me thats small matter as benefits overweighting shortcomings massively..
Title: Re: Pure Basic
Post by: Pfaber11 on October 12, 2019, 15:06:53
Done a bit with sounds today pretty straight forward. Much the same as AGK . I got the basics down to write a little 2D game. Well happy with my progress. On day five and I'm taking my time. Had some useful pointers off some of the guys on here. . Anyway have a nice day.
  Got a fair bit done today and my little program is running sweet now. was having flickering text but have sorted that. All running very smoothly now and how I wanted it . Not sure how to set the FPS yet but will be looking into that tomorrow. I'm breaking it down into little chunks and learning a bit at a time while building my hello world program with graphics and sound .
If anybody knows how to set the FPS I would appreciate a nudge in the right direction.