Just bought BlitzMax...

BlitzMax Forums/BlitzMax Beginners Area/Just bought BlitzMax...

Nathaniel(Posted 2007) [#1]
I've finally bought Max and I'm starting the transition from Blitz3D. I'd like to know some of the stuff which Max has and B3D lacks (that wasn't listed on the product info page)...


WendellM(Posted 2007) [#2]
One thing that I like which isn't on the product page is Strict: it cuts down on annoying typos that can cause problems when variables are auto-declared in Blitz3D. Some prefer SuperStrict (Strict will assume that you want an Integer if you don't specify a type for a variable or function/method whereas you must explicitly declare everything with SuperStrict).

Another one is that conversion from Float to Int now works as it does with all the other flavors of Basic that I've seen (always rounding down rather than rounding .5 and higher up as Blitz3D does). Something to keep in mind when transitioning.

The ability to use alpha in 2D (well, in 3D that acts like 2D) is a nice improvement over Blitz3D.

Oh, and static local variables for functions! If you declare a Global within a function it retains its value between calls (instead of having to declare it outside the function which breaks modularity in Blitz3D). It's local to the function as it should be, even though it's called Global.

Anyway, those are the improvements which don't get a lot of fanfare that I can think of right now. There are other nice touches (like "A :+ B" as an alternative to "A = A + B") that I'm overlooking, no doubt.


tonyg(Posted 2007) [#3]
OOP, multiple lists, dynamic arrays with slicing, in-built tmaps, x-platform, modules, field x=5 declarations, methods, source code.


Gabriel(Posted 2007) [#4]
Quicker variable assignment. Eg:

MyIsntThisAVeryLongVariableName=MyIsntThisAVeryLongVariableName+1


Becomes :

MyIsntThisAVeryLongVariableName:+1


But quite frankly the coolest thing about BMax is the link with the GCC compiler and therefore the ability to link with loads and loads of third party libraries. TrueVision3D, HGE, Lua, etc, etc..

Not to mention being able to write some functions in C and link the object code directly without having to mess around with DLL's and intermediate code.


Grey Alien(Posted 2007) [#5]
Welcome aboard, I'm sure that you'll love it!

No one said OOP yet, for me that was a very big attraction.

Also I don't believe my framework is listed on the front page yet ;-)


CS_TBL(Posted 2007) [#6]
OOP + events 'n eventhooks

Once you get the idea you won't ever code without 'em anymore.


ImaginaryHuman(Posted 2007) [#7]
Welcome to the BlitzMax community! BlitzMax is, for me, the best and most polished incarnation of `Blitz Basic`.


Nathaniel(Posted 2007) [#8]
@WendellM
All of those sound like nice improvements; I will especially appreciate the conversion from Float to Int and alpha image (both of which I found annoying in B3D).

@tonyg
I don't know what "slicing," "in-built tmaps" or "x-platform" are...

@Gabriel
Nice, lol!
I plan on seriously trying TV3D as soon a I become a little more accustom to the 2D module of Max.

@Grey Alien
Thanks. Your framework looks like it can make life A LOT easier.

@CS_TBL
How do I use it?

@AngelDaniel
Thank you. Yes, so far it looks well worth the $80.


tonyg(Posted 2007) [#9]
In your IDE look at the Language documentation and there is a section called 'Slices' which explain what they are.
Check Modules / Misc / Maps for information on TMaps. Do a search in these forums for TMap and you'll get lots of good debate.
X-platform = Cross_Platform : e.g. the ability to produce programs which compile on different platforms.


Dreamora(Posted 2007) [#10]
what B3D had and BM does not have: Buffers. Get used to the fact that you can not draw to texturebuffer / imagebuffer anymore


Who was John Galt?(Posted 2007) [#11]
Reading the whole intro and language section in the BM docs is a must to get acquainted.


CS_TBL(Posted 2007) [#12]
Bubbel Boy:

The idea of events is that rather than telling a function directly in its face to perform an action, you let the function wait for given commands and perform when such a command occurs.
It's kind of like an army, a general won't instruct all his 1000 soldiers individually what to do (this is how non-event programming works), but the general just gives a generic signal (or he has someone play a trumpet or horn) and then the soldiers listen to it and act according to it. The advantage? In the first case it would mean that more soldiers would've mean more function calls (or a bigger FOR loop), in the event case, nothing more needs to be done. As long as you create a function that listens to a certain signal, it'll work. If such a listening function is not present, nothing will happen.

There are plenty eventhook examples in the forums. Stuff to look for: EventHook, EmitEvent, TEvent


Perturbatio(Posted 2007) [#13]
I don't know what "slicing," "in-built tmaps" or "x-platform" are..


Slices are essentially portions of arrays or strings (although the syntax is slightly different with strings than it is with arrays).

Slices:
Local a:Int[] = [1,2,3,4,5]
For Local i:Int = eachin a[2..]
	print i
Next


One thing you can't currently do with slices (but according to Mark's worklog will be added at some point) is concatenate them.

TMap: One example of many.


Nathaniel(Posted 2007) [#14]
@tonyg
Thanks, I think I get it now. "Slices" look very useful (e.g. figuring out what the player typed).

@Dreamora
Thanks for the warning.

@Nomen luni
I'm almost done doing that :)

@CS_TBL
I see. That does seem a little more efficient than directly telling the function to preform.

@Perturbatio
Thank you for the explanation.

@Everybody
I can't wait to try out BlitzMax on Linux!


computercoder(Posted 2007) [#15]
Its cool in linux... Be sure to read up on how to get it running under your distro. There's plenty of how-to's in the Linux forums.

Its a bit of a hassle, but once you have it setup, it works well enough. I'm not speaking of the current IDE under Linux, but BlitzMAX itself. The apps run about the same on all os platforms.

Oh, to the topic: I got Max specifically for the following reasons:
1) X-Platform
2) OOP
3) Easy to use and follow the language
4) Extensible
5) Can use OpenGL directly (even tho I currently don't use that)
6) Its priced so well I couldn't resist!

There are others. But these are the top reasons.


Nathaniel(Posted 2007) [#16]
Ya, thanks for the tip.


Nathaniel(Posted 2007) [#17]
Little update...
I like everything I've seen so far, accept the docs. I like B3D's doc system much more. (Mainly because they're orginized alphabetically and in categories.)

BTW, is there a "MouseXSpeed" command?


Perturbatio(Posted 2007) [#18]
BTW, is there a "MouseXSpeed" command?


http://www.blitzbasic.com/codearcs/codearcs.php?code=1933


Nathaniel(Posted 2007) [#19]
Thanks Perturbatio. Exactly what I wanted...


Nathaniel(Posted 2007) [#20]
I know how to rotate images:

SetRotation (angle#)


it rotates ALL the images. How do I rotate one desired image?


Dreamora(Posted 2007) [#21]
You set that, draw the image and set it back.
You could create an image object class that does this on "per image object" base with its own draw command for example.

There is no "per image" attribute beside position.
The rest is a rendering state and will remain until you change it again.


Perturbatio(Posted 2007) [#22]
SetRotation, drawimage, SetRotation?

Function DrawImageRot(image:TImage, x:Float, y:Float, rot:Float, Frame:Int=0)
	Local OldRot:Int = GetRotation()
	SetRotation(rot)
	DrawImage(image, x, y, Frame)
	SetRotation(OldRot)
End Function



Nathaniel(Posted 2007) [#23]
Thanks, Pertubatio!


Nathaniel(Posted 2007) [#24]
Can someone help me with adding mods? I've tried adding JV-ODE and TV3D lite to Max but the compiler runs into unrecognized functions (when I run examples).


Gabriel(Posted 2007) [#25]
Do you own a TV3D license? The module won't run without the TV3D engine. Full instructions are provided in the download on where to put the files.


Nathaniel(Posted 2007) [#26]
No, only the lite. Can I get the TV3D engine for free?


Gabriel(Posted 2007) [#27]
I am nothing to do with TrueVision. I do not sell the engine, I just wrote a module to interface between BlitzMax and TV3D. Both modules ( lite has no source, pro has source and support from me ) require the engine from the TrueVision guys.

Can you get it free? Yes and no. You can get a version for for free, but that version is incompatible with BlitzMax. You will be able to get a new version, compatible with BlitzMax, when it's released to the public. You can currently get that version for free, but only if you bought the previous version.

And no, I don't know when they will publicly release the version which can be made to work with BMax. The official line is very soon, but that's been the official line for a year, so they're very much from the "it'll be done when it's done" school of programming.


Nathaniel(Posted 2007) [#28]
In that case I think I'll wait until they release the next version. :)

Anyways, I'm not going to use Max for 3D (yet).


Nathaniel(Posted 2007) [#29]
How do I delete an object from a type? (In other words the opposite of "something = New somethingelse")


Dreamora(Posted 2007) [#30]
just null-ify it again.
You can not delete objects manually, thats up to the garbage collector as BM is GC driven, not manual hack'n'mess approach based as languages from the past (C++, B3D and the like)


Nathaniel(Posted 2007) [#31]
just null-ify it again.


Again? What do you mean? Every frame my code counts how many objects there in the type. That number never goes down-even if I stop making objects for a while.


Gabriel(Posted 2007) [#32]
Every frame my code counts how many objects there in the type.

Could you clarify that a little? There are no objects "in the type" in BlitzMax as there were with Blitz3D and BlitzPlus because BlitzMax does not keep an internal list of them.

How do I delete an object from a type?

Again, it's not "from a type" because the type doesn't have a list of them, unless you've added one of your own. In which case you get rid of it by losing all your references to it. Remove it from any collections ( lists, maps, etc ) that it's in and allow any other variables holding the object handle to go out of scope and it just gets picked up automatically.

Essentially, objects are destroyed automatically as soon as you become unable to reference them.


Nathaniel(Posted 2007) [#33]
This is quite confusing. I was keeping track of the *things* by using a function like so:

(This won't do anything in BMax.)
Local var1 = 0 'That's the counter

For Local var2:type_name = EachIn my_list

   var1: + 1

Next

DrawText ("There are this many things: " + var1,0,0)


So I should redefine all of owner's variables as Null to get rid of the owner? (There aren't any collisions in my code yet.)


Gabriel(Posted 2007) [#34]
I don't know what "owner" is. If you want to get rid of an object of type type_name, just remove it from the list.


Nathaniel(Posted 2007) [#35]
Owner AKA object (which you said isn't correct)...
I don't know what else to call it.

But HOW do you remove it? By getting rid of all of it's collisions and references?


Gabriel(Posted 2007) [#36]
I didn't say anything about object not being correct. I just said that they're not being stored "in the type" any more because types don't keep their own lists. Evidently you're using one of your own.


Nathaniel(Posted 2007) [#37]
I found the right command:

"ListRemove(list,object)"

Right?

[Edit]YES! It worked. Thanks for your help Gabriel!


Gabriel(Posted 2007) [#38]
Yes, that will work. Better yet, keep the TLink which is created when you put it into the list with ListAddLast or ListAddFirst and then just say RemoveLink(MyLink). This way should be faster, but both works.


Nathaniel(Posted 2007) [#39]
Thanks for the tip-and your time :)


Canardian(Posted 2007) [#40]
I just bought BlitzMax too, I was using Blitz3D earlier.
My BlitzMax Demo version had expired long time ago, so I couldn't test it fully, but I don't regret buying it.

I tested some file writing program, which wrote a 1GB test file. The proggy ran under Microsoft Visual Studio 2005 C++ Pro just as fast as with BlitzMax, while on Blitz3D is was remarkably slower. I wouldn't be surprised if it would run even faster on BlitzMax than on VS 2005 C++, as Microsoft is not very good at making software :P

Then I tested some demos I had written with Blitz3D earlier, and I was amazed that with klepto2's MiniB3D ext 0.41 the same program ran FASTER than with Blitz3D! Probably because I used lots of polys, and DirectX gets slow with a bigger number, and has it's limits there too.

What can I say, I'm totally happy with BlitzMax, and can't wait for simonh, klepto2 and Mark Sibly to get their even faster 3D OpenGL mods out.

Big thanks to everyone who makes BlitzMax every day a bit better!


Dreamora(Posted 2007) [#41]
DX does not get slower with bigger numbers.
Its DX7 that was not meant for that and on which B3D is basing (as Max2D in DX mode)


Dabz(Posted 2007) [#42]
After being a bit of a Max nay-sayer myself, I have been plugging away with it (Using the community IDE) and I must say, that I am now swayed towards it! :)

After spending god knows how many years fannying about with BlitzBasic, Blitz3D and Blitz+. Max has been the only language that's really let my programming skills shine.

And for this reason, I am pretty close to releasing my FIRST commercial game. And I bet others where in the same boat as me!

Still, the IDE is cack... So come on BRL, give us something nice to work in! ;)

Dabz


MGE(Posted 2007) [#43]
Go BlitzMax! I'm not as high tech as some of you coders, I just use BMax in the same style as I've coded all my life, top to bottom as fast as possible! lol.. I just bought BlitzMax as well, having a blast coding with it!


Dreamora(Posted 2007) [#44]
Better IDE: thank ziggy and use blide and donate some bucks to him or get Blide Plus :)


Dabz(Posted 2007) [#45]

Better IDE: thank ziggy and use blide and donate some bucks to him or get Blide Plus :)



I've tried Blide, and even though it is a nice looking IDE, there's still too many bugs that crop up for me.

One, which really does get on my nipple ends, is that when you want a project to open on start up, the project somehow gets corrupted, and makes Blide unusable. And I've never figured out how to remove that option on start-up. It also does swallow a lot of resources... But for me, its a recurring problem.

But, I digress, Ziggy has paved the way on what an IDE should do for Max, he has made a good job of it, and I do take my hat off for him as obviously, there has been a lot of hard work gone into there, and releasing the standard free one is very generous of him (So who can really complain). But, I would rather spend less time worrying about an IDE going haywire, and more time worrying why collisions have gone all to pot! :)

Qide, by Qube looks great, but, its a side project of his and he told me he is waiting for mark finishing mucking around with the output of the compiler, as it may change the debugging part, which he doesnt want to write again.

All in the, the Community Edition is holding up for me, its got enough little extra's in there to make programming more manageable, as well as the docs are nice and tidy so finding stuff is less of a pain!

Dabz


ziggy(Posted 2007) [#46]
@Dabz: Hey, thanks for for your positive feedback, just thought I need to let you know that those bugs you mention were solved some months ago. Current version 0.8.17 b is very very stable. It is still using some memory to mantain its internal database with intellisense and all this things.


Dabz(Posted 2007) [#47]
Thank's ziggy, I'll check it out! :)

Dabz


Dabz(Posted 2007) [#48]
Nice one, but, I've found another quirk... I have 4 files in a project:-

1) Main.bmx
2) Setup.bmx
3) misc.bmx
4) Joy.bmx

Now, when I run the application from Blide, it fires up as expected... I play for a while, then hit ESC... The app closes then magically re-runs again, then I hit ESC again, and it closes for good and goes back to the IDE.

Running it in the community edition, it fires up, I have a play... press ESC, then it returns to IDE! mmmmm

Just thought I'd let you know! ;)

Dabz