Monday, August 30, 2010
Self compiling!
I am pleased to say that bmx2 (STILL haven't decided on a new name yet) is now fully self-compiling!
In theory, this just involved converting the existing bmx source files to bmx2 via a little 'convbmx' util, but in practice it has been a tricky and at times somewhat mind bending exercise.
In particular, with 2 sets of sources I had to stop and think several times which one I actually needed to modify - and occasionally even found myself modifying the wrong one!
But it all seems to be working remarkably well now, and although I've only managed to compile the compiler itself as a C++ target (because that's the only target with sufficient filesystem support right now), the 'new' compiler has compiled all my other little tests successfully to html5, flash, xna and android.
Some more details about how it all works...
Bmx2 will required that the appropriate SDK's for the various targets be installed separately. For example, to compile to c++ you'll need MinGW installed. Current list of supported targets/SDK's is:
* HTML5 - HTML5 compatible browser required for testing.
* Flash - Open source Flex SDK required.
* XNA - Visual C# Express + XNA framework
* Android - The Android SDK (plus Java SDK and 'Ant' on Windows).
* Native (ie: C++) - Mingw/GCC (will probably add visualc support too in future).
* iPhone - XCode.
This has the obvious benefit of making life a whole bunch easier for myself, but it also means you'll be able to take full advantage of the various SDK tools available. For example, iPhone projects will be 'real' xcode projects, so you'll be able to edit them in xcode, mess with the NIB file etc. When you compile your bmx2 program, the translator simply replaces a chunk of text in a 'main' file somewhere in the target project, and leaves the rest of the project alone.
Installation of SDK's can be a little messy in some cases, but the compiler already automagically deals with any PATH or ENV var issues which makes life a whole lot easier.
Some more details on the new language:
* 'Type' renamed to 'Class'.
* Identifiers now case sensitive.
* Private can at last be used inside classes!
* A single 'End' can be used to terminate blocks, eg:
Function MyFunc()
Print "Boo!"
End
Ye olde bmx1 style terminators are still permitted too.
* Function/method overloading added, eg:
Function DrawImage( image:Image,x,y )
...
End
Function DrawImage( image:Image,x,y,frame )
...
End
* 'Proper' constructors, eg:
Method New( x,y )
Self.x=x
Self.y=y
End
* Support for 'properties', eg:
Method X() Property
Return x
End
Method X( x ) property
Self.x=x
End
* Simple class template support, eg:
Local list:=New List<Actor>
* Simple 'boxing', eg:
Local list:=New List<IntObject>
list.AddLast 10
list.AddLast 20
Local n=list.Last()
* Auto type inference for initializers, eg:
Local t:=New Actor 'instead of Local t:Actor=New Actor
* Strict mode is back, but will effectively mean bmx1-style SuperStrict (or possibly even stricter). Default mode will be plain bmx1-style Strict (and probably even lazier).
I agonized for a while over whether bmx2 should go 'SuperStrict only', but after realizing that some of the superstrict crowd wanted things even stricter(!) while I wanted things more relaxed, I decided to keep Strict in there in the hope the final product will appeal to a wider range of people.
I have a related theory on this: SuperStrict users prefer C# over C++; Strict users vice versa...
* Module 'Imports' can now be cyclic, eg:
'Module A
Import B
'Module B
Import A
I can't BELIEVE I thought this wasn't a big deal in bmx1!
It was kind of mission to get going too - I basically had to change the compilation process from a top down, 2 pass algorithm to a 'compile on demand' one.
It worked out really well though - the entire program is compiled simply by compiling 'Main'...which causes anything main depends on to compile, and so on.
As a nice side effect, you end up with a very clear picture of what code the program actually uses, meaning apps should be nice and tight.
It's not all good news though (assuming you already though it was) - here are a few nasty 'detail' things that may or may not be fixed/improved over time, but for now would be very hard to do efficiently in ALL target languages. I consider them pretty minor, but you're free to disagree with me on that...
* Strings and Arrays are NOT objects in bmx2 the way they are in bmx1 - they are more like primitives such as int and float, eg:
Local t:Object="Hello world" 'OK in bmx1, Error in bmx2.
* Multidimensional arrays are out, although you can still have arrays of arrays, eg:
Local t[10,20] 'OK in bmx1, Error in bmx2
Local t[][10] 'OK in bmx1 and bmx2.
* Arrays can not be 'downcast' in bmx2, eg:
Local t:Object[]=New Thing[10]
Local p:Thing[]=Thing[]( t ) 'OK in bmx1, Error in bmx2.
This will mean that arrays may have to be manually 'wrapped' in some situations.
And that's it for now. Hope you found it informative!
Bye,
Mark
Monday, July 19, 2010
Update
***** BMX2 news *****
Well, I still haven't settled on a name for this yet, but anyway, here's a quick update on where the project is going...
The source language will be very bmx-like, with a few tweaks and additions including:
* Simple class templates
* Function overloading
* Constructors
* Properties
...and some stuff removed, such as pointers. Yes, POINTERS! Function pointers too!
Target languages I'm aiming for upon release are:
* JavaScript
* ActionScript
* Java
* C#
* C++
* Python (just as an experiment - probably wont be much lib support for this to begin with).
Target platforms I'm aiming for:
* HTML5
* Flash
* XNA
* Android
* Native GL
* iPhone
The system will also include an interpreter for debugging/preprocessing. Ideally, you should also be able to use the interpreter for scripting, but that may end up being in a future release depending upon difficulty level.
I'm keeping the modules *very* simple for the initial release, but they should still be grunty enough to do some decent games with depending on your target platform.
The 'official' IDE will be a custom job written in the language itself. However, it should be usable enough (well, I'm using it) and it will at least run *everywhere*. Of course, there are likely to be 3rd party IDE offerings too, so hopefully everyone will be happy in the end.
More to come...
Thursday, May 27, 2010
The plan!
Ok, here's the plan:
I am currently working on a 'light' version of BlitzMax designed to run on a wide range of target platforms. For now, let's call it 'bmx2'.
Bmx2 will be similar to bmx language wise, but will have a much smaller and simpler set of modules that will be targeted at simple 2D game creation.
But the major feature of bmx2 is that it will be a 'translator', designed to convert code from bmx2 syntax to as many target languages as possible - preferably in as human readable a form as possible.
I have already made considerable progress generating output for the following target languages: C++, C#, Java, JavaScript and ActionScript. I also plan to add python add some stage, and...?
In addition, I have a simple Blitz2D/Max2D-like module underway and some very simple 'system' modules for the following platforms: Win32, MacOS, Linux, HTML5, Flash, XNA, Android. There's an iPhone version too, but it's status is very much 'up-in-the-air' right now due to licensing issues.
Anyway, development has now reached the point where I am interested in getting more people involved.
Right now I'm interested in people who are keen on language design and/or have some experience with several languages. If that sounds like you and you'd like to get involved please contact blitzmunter at gmail dot com.
Flash demo (well, not *that* flash - very simple actually! You may need to click window to activate too):
Same demo running on HTML5, Android and XNA:
LOTS more info soon.
Peace out!
Mark
Monday, March 29, 2010
BMX News!
Ok, there's been a lot of conjecture about 'the future of Blitz' at blitzbasic.com lately, so it's probably a good idea to let everyone know that the fine minds at BRL are currently working on a solution to the 'BlitzMax on LOTS of platforms' problem - and yes, 'lots of platforms' includes the iPhone.
Given that game development these days involves developing for a wide range of platforms, I feel this is the logical next step for Blitz as a game development language, and I'm confident the end result will be pretty cool!
I don't want to give too much away about how this will work (or, of course, when it will work!) because, to be honest, I don't know 100% myself yet - more news 'when it feels right'!
Bye,
Mark
Monday, December 28, 2009
Yet Another Avatar Review!
Hi,
Well, just got back from seeing Avatar on the biggest movie screen in town and, well, yes, WOW!
***** Warning! Spoilers Below! *****
From a purely technical standpoint, I thought it was, as hyped, the best CGI movie yet.
Although I was disappointed with the previews shown earlier this year (it all looked a bit 'fake plastic blue' or something) the final product was somehow much more convincing.
I suspect this is mainly because you were bombarded with such a huge amount of gee wizziness that any cracks in the visuals were just lost in the flood, but I think there was also something else going on, and what I consider to be Avatars *real* achievement - the very convincing facial animation of the CGI actors.
This hugely helped 'sell' the characters as realistic entities, and not just CGI (erm) 'avatars' standing in for real actors. Granted, the characters aren't actually human, and if they had been it may not have worked so well. But they did successfully achieve a sense of realism I haven't seen yet in supposedly realistic CGI animation.
The 3D was fine, but not IMO particularly any better than, say, Up3D, and I still can't see myself being happy with having to watch ALL movies in 3D!
Finally, the scenery was stunning, surprisingly New Zeland-ish in fact with what look like plenty of ferns and 'koru's all over the place, and was teeming with plenty of imaginative and quite beautiful animals and plants.
As for the actual story, I actually enjoyed the first half of the movie immensely.
The story gets stuck in right from the outset, and before long our paraplegic hero has transferred into his brand new, 9 foot tall blue alien body and is hoofing it madly through the forest for the sheer hell of it.
It's an exciting, romantic moment, and the movie carries on in that spirit for quite a while. There's even a quite nicely pitched bit of human-alien romance in there which works surprisingly well.
But of course, this is an evil-humans vs virtuous-natives story, so the film has to eventually turn into a huge prolonged orgy of military violence - about an hours worth in fact.
At this point, the movie changes tone dramatically, and things start getting a bit weird. The virtuous-natives are apparently too stupid to save themselves without human help (there's some vague 'chosen one' device at work too) at which point it gets a bit (more) condescending.
But, the visuals remain strong, and the battles are pretty spectacular. It all manages to remain more or less entertaining right until the (pretty crappy) ending, although you feel like you've mostly lost touch with the characters by then.
A shame really. If this really is some kind of American Indian or Afghanistan allegory (as has been claimed) or something, I can think of far more interesting/subversive ways to end it. But hey, this is James Cameron, and he seems to be far more comfortable with characters who carry BIG SEXY guns - indeed, by the end even our hero has grabbed himself a gun and has ditched his wimpy bow and arrow/knife combo...
But bah, I liked the first half, didn't like the second - no doubt there are some people who think the opposite! A case of something for everyone, perhaps...
Whatever, it was, first and foremost, hugely entertaining.
Bye!
Mark
Saturday, December 19, 2009
Happy Christmas!
Ho ho ho,
Well, it's that time of year again - must be time for a Christmasy blog!
It's been an interesting if low key year, during which I managed to fail yet again to get anything substantial done, but still managed to learn a lot of things along the way.
The evolution of BlitzMax into a threaded language has been probably the most interesting/challenging thing I've done, and in particular the development of an entirely new garbage collector.
It's still not perfect though, as there are some 'pathological' situations which can still upset the GC. The solution to these problems is to make the GC 'generational', which basically means keeping track of 'old' and 'not so old' objects. Ouch.
This apparently requires the addition of nasty things called 'write barriers' - little bits of code that get called every time a pointer is written to a variable (reference counting actually involves a write barrier of sorts) . I have a feeling this can be achieved 'on the cheap' using virtual memory techniques though, and it's something I'll probably be looking into next year.
And the $64,000 question - what about 3D?
Well, the truth is, I just don't really feel that I have anything new or particularly clever to offer 3D wise right now - and haven't for a while. There are plenty of good 3d libraries out there these days (and many of them free!) and competing with them has just become more and more scary. I guess what I'm really after is some kind of dinky new approach or something that simplifies life the way Blitz3D did.
I could certainly do more to promote and support the 3rd party 3d modules for BlitzMax around these days though. My general suckiness at marketing etc issues not withstanding, I'll make an honest attempt to do something about this soon!
I'd also like to do something *I'd* use to write a game with, and to be honest my requirements for a 3D engine are pretty minimal. As much as I'd like to a do a bumpy/specularly extravaganza, the truth is I just don't have the resources to do it justice. In which case, why not do something simpler, faster etc that works on more hardware. I guess what I'm saying is, as with programming languages, my first priority is to do something I'd be comfortable using myself, and all this next-gen stuff creates a certain amount of tension in that respect.
But all power to guys like Josh Klint and his leadwerks engine which requires a reasonably high spec - they're definitely pulling the technology in a good direction as opposed to, say, Intel and their craptacular graphics cards. Honestly, we'd have been better off with GeForce 4's!
Gaming wise, I've actually had something of a gaming renaissance in 2009, although this is probably more down to my being a bit more open to trying new gaming 'forms' than any resurgence on the industries part.
I have thoroughly enjoyed games such as Mirror's Edge, Infamous, Arkham Asylum, and esp. Uncharted 2 and kind of feel that gaming is heading in interesting directions these days.
Many of these games feel almost 'mini-game-ish' in nature, with set pieces sort of strung together by sequences of 'actual game'. The 'actual game' bits can sometimes get a bit monotonous, often consisting of 'wack a mole' style combat, but the set pieces are usually very cool - certainly cool enough to keep me playing for the next one!
Mirrors edge really stuck out for me though. The actual game bit basically consists of running very fast from point A to point B - and it works really well! Keeping your speed up is key, and do so allows you to run up walls and jump over huge gaps without it all feeling too silly/impossible. But I feel it's let down a bit by having too many restart points, which basically allows you to get lazy as you can always just try again. IMO, they should have made the levels a little easier, but with fewer restart points. It would've made for the same overall difficulty, but have given it all a little more tension.
I'm also very much looking forward to 'Demons Souls':
http://www.youtube.com/watch?v=VT89mvjxudk
Not available in stores here in NZ (why?) but I've got it ordered and it should be here next week. Good too see developers being brave enough to make a game *hard* again!
Anime-wise, I must confess to having watched a lot of 'high school romance' style Anime lately. In particular, I find the Anime adaptations of the Japanese 'girl games' by Key Visual Arts (haven't played the games...though they're apparently quite raunchy!) really entertaining. Not quite sure why, perhaps because there's usually an element of the supernatural in there or something, but they're definitely skilled at building up characters and manipulating the viewers emotions.
But 'Death Note' was probably the Anime highlight of 2009 for me. A simple premise - a guy discovers a note book that will magically kill off anyone whose name he writes in it - is taken in gloriously confusing directions. The amazing thing about the show is that despite the fact things keep getting more and more complex (the book has an apparently never ending set of rules governing its usage) you're never really lost by it all. There is the odd bit of exposition here and there, but overall it's just a brilliant bit of story telling.
Movie-wise, I didn't get to see all that many movies this year (too busy watching Anime and playing games!), but I did thoroughly enjoy Star Trek, Synecdoche New York and esp. Coraline.
The thing I always liked about Star Trek was the Kirk/Spock dynamic, and I felt the movie kept this intact very nicely. Yes, it was a bit of an incoherent mess ('racist' Vulcans? Surely racism is not logical!), had too many lens flares (Well, I liked them!) and featured probably the biggest god machine coincidence in living memory (Kirk AND future Spock AND Scotty all accidentally stranded on the same minor planet?!?) but I thought the actors caught the essence of the original characters just fine.
Synecdoche New York is probably a bit of an old farts movie, concentrating as it does mostly on death and 'what have I done with my life' issues, but it's also funny, wildly imaginative and thought provoking. The main character builds a 'miniature' of his world inside a huge warehouse, and after a while what's real and what's 'acted' becomes blurred. And, of course, the ending is killer...
Coraline is...awesome. A bit goth, but if you can handle that, see it!
Music-wise...is it just me, or was 2009 a bit of a loss? Waiting for someone to kick things into gear again...
Coolest moment of 2009: Obama getting elected.
Bummer moment of 2009: Obama's Nobel peace prize acceptance speech.
Anyway, getting WAY off track. Have an excellent 2010 and code the good code!
Bye,
Mark
Thursday, October 1, 2009
Little Big Planet
Yes, I'm a year behind the times, but I didn't actually expect to like it at all given that: a) I've never found physics based puzzle games all that fun, and b) I'd seen it an expo when it first came out and thought it looked pretty ugly.
But now that it's hit the bargain bins, I decided to give it a blast, and I'm very glad I did.
First impressions: It's a very 'English' game: the voice-over is very similar to that used in Hitch-hikers-guide-to-the-galaxy, and I think I even recognized some music from the excellent 70's TV show 'Vision-On' in there. It's actually nice to see a game 'projecting' personality like this.
Second impressions: It's simple, but fun. There is a lot of variety in the environments/graphics, and the designers have managed to come up with a very impressive number of ways to reuse the physics elements - yet they haven't 'overcooked' the puzzles: they're generally short and to the point.
Third impressions: I was totally wrong about the graphics, they're excellent! I think I may have been put off a little by the 'sack doll' player character. In default mode, he looks a little too much like the 'maggot monster' in 'nightmare before Halloween' for my liking - just a little bit creepy. But he does grow on you and you can customize him massively (I'm currently in soothing magical girl mode!). Ultimately, I think the realistic graphics complement the realistic physics beautifully.
Fourth impressions (about a week later): It's still simple, but still fun! OK, I've probably only put 5 or 6 hours into it so far, but that's damned good for me!
Minor grumbles: A fraction too much inertia on the player for my liking; sometimes you can't see where you'd like to and there's no manual camera (although 'leaps of faith' are seldom punished); while it's primarily a 2D game, there are in fact 3 'layers', and it can sometimes be hard to work out which layer you're on - worse, the game sometimes automatically moves you to a different layer, every now and then with fatal results (but this is probably worth it, as it also increases the speed at which you can whizz around levels).
I haven't played around much with the game creation stuff yet, but it looks pretty impressive and was apparently used to create ALL the in game levels. The online user maps are less impressive, but again I haven't looked too closely at these. More later…
Peace out!
Mark