Haaf's Game Engine module

BlitzMax Forums/BlitzMax Programming/Haaf's Game Engine module

N(Posted 2006) [#1]
I'm going ahead and releasing this since Gab is asleep and I think his work on it is pretty sufficient to get started (helper classes will likely be in another module should he decide to add them later).

First off, here's a link to their website (documentation and C++ examples can be found there): http://hge.relishgames.com/

Anyhow, this is the Haaf Game Engine in BlitzMax. No longer do you have to use Max2D (yuck), but instead you can use a robust and very easy to use 2D engine.

Instead of ramble on and on about it, I'll just list the neccessary stuff.

Haaf is licensed under the LGPL. When statically linking to LGPL'd code or libraries, you have to open source your entire project. This does not apply to dynamically linking to the code and using an import library, which is exactly what this module does. So for anyone who was at all worried about this, you're in the legal clear.

Now, the vast majority (in other words, pretty much all of it) of the code in the Glimmer.HGE module is done by Phil Ings (aka Gabriel aka Sybixsus), I do not take credit for it and I doubt he provides any warranty for it. The very most I did is fix some stuff and help him with some things.

Cower.HGEWrap, on the other hand, is code that is dependent upon the Glimmer.HGE module. Some people don't like using underscores in code.. I happen to be one of those people. Thing is, if you happen to look at HGE, you'll notice that it has a pretty liberal use of underscores. I decided to do away with that by wrapping the class in my own class (which streamlines some stuff in the process -- native BMax helper classes coming later).

These modules do not come with the libraries neccessary to compile them. I've purposefully left them out for licensing reasons and because getting the full HGE package is a very good idea, and including only what's neccessary in this would likely discourage that. So you will have to go to the HGE site (linked above) and download the full package.

Some things to note:
-There are three folders under lib: gcc, bc, and vc. You want gcc. Now, before you do anything with them, prefix 'lib' to each of their names such that you get 'libhge.a' and 'libhgehelper.a'. Now, place these in your BlitzMax/lib folder (or in your MinGW/lib folder).
-You'll probably want to copy HGE.dll and bass.dll into your system32 folder for the time being, since it may be inconvenient for you to have the DLLs in the applications execution directory.

And, last but not least, BASS is NOT free. You will need a license to use it commercially. HGE uses BASS, so if you plan on releasing a commercial product or shareware product, you will be required to license BASS. As far as I'm concerned, BASS is worth the money, so this isn't really a problem for me. But it is mentioned in the licensing details for HGE and I'm mentioning it here now just in case you miss it.

I think that's all there is to say, if I think of anything else I'll probably add it later.

So anyways, download here.


Haramanai(Posted 2006) [#2]
You did it again. Thanks this looks intersting.


MarkT(Posted 2006) [#3]
Intresting, Will take a look tomorrow.


Gabriel(Posted 2006) [#4]
Nice one, Noel. Thanks for your help with getting the original module done. I plan on having a look at the first of the helper classes today. I feel like I'm in over my head with it, but I thought that about the original module too and I got there in the end, albeit with some help. I'm particularly interested in the particle, distortion, anim and sprite helper classes and I'll release them if I can get them working.

In case anyone's wondering why you might want this over Max2d, it features render to texture, batch rendering ( using vertex buffers ) and automatically rebinds textures when focus is lost. And that's just for starters. If I can get the helper classes working, you also have a very impressive particle system ( which has a great particle editor ) and some great distortion special effects.

And here are the converted example/tutorials from the HGE Package, converted to work with my module. They don't use Noel's wrap, but I'm sure it won't be too hard to make that change should you want to. I've only converted the first two tutorials because all the rest require the helper classes, which are not done yet.

www.animebowlingbabes.com/hge/hge_examples_1_2.zip

-


Will(Posted 2006) [#5]
cross platformity?


N(Posted 2006) [#6]
Nope, uses DX8.


N(Posted 2006) [#7]
Uploaded a new version, contains some changes to allow you to load music, effects, textures, etc. from memory.

Only thing to note is that this will break anything that used the Texture/Stream/Music/Effect_Load functions because you'll have to convert to a CString manually now.

However, I'd say the advantage of being able to use IncBin'd data is worth the changes you'll have to make.

I've provided a rather crude example of this in the archive.


taumel(Posted 2006) [#8]
Wow, interesting!
Only sad thing is that i can't use it on the Mac...


Anyway thanks,

taumel


Robert Cummings(Posted 2006) [#9]
In case anyone's wondering why you might want this over Max2d, it features render to texture, batch rendering ( using vertex buffers ) and automatically rebinds textures when focus is lost.


Blitzmax supports render to texture, batch rendering using vertex buffers and automatically rebinds texures when focus is lost.


xlsior(Posted 2006) [#10]
Thanks, will definitely need to take a look at this!


Gabriel(Posted 2006) [#11]
Blitzmax supports render to texture, batch rendering using vertex buffers and automatically rebinds texures when focus is lost.


Since BlitzMax is a language, I guess it could be said to support anything you can code for it. Max2d doesn't support any of that out of the box, only via some third party modules. It's never reliably rebound textures when focus is lost and regained for me. I've also never seen it shift particles in the thousands the way Noel was doing it yesterday with HGE, so I wouldn't say batch rendering was a strong point.

But as always, don't like it, don't use it. Interesting to see your standard "go troll elsewhere" reply doesn't apply to yourself.


Panno(Posted 2006) [#12]
renamed the lib files / copy to bmax libfolder /copy dll's
but bmax 1.16 cant find interface to glimmer/cower

hmm whats wrong


TartanTangerine (was Indiepath)(Posted 2006) [#13]
This does sound like a nice module, the showstopper for me though is the lack of Mac support.

Nice work though guys! I'd be interested to see the implementation of VBO since the buffered mode in Bmax just does not work! Of course I have my own implementation which is much faster but I'm a noob when it comes to these things and it would be nice to learn from the experts :D


Gabriel(Posted 2006) [#14]
Panno : Sounds like you haven't copied the modules to glimmer.mod and cower.mod respectively. ( In your "Program Files\BlitzMax\Mod" folder )

You need GCC installed and setup too, of course, because you'll need to build the modules from source.

Tim, Taumel: True, but it is open source, and the renderer is ( apparently - I haven't viewed the source yet ) abstracted so you could presumably write an openGL renderer for it if you so wished. Not a trivial task, I'll admit, but the architecture is already there so if your familiar with OpenGL coding ( as Tim, at least, obviously is ) it might not be all that bad.

Or maybe someone is already working on a Mac port. I wouldn't know, but the RelishGames forums might have info.


Robert Cummings(Posted 2006) [#15]
Offtopic:
But as always, don't like it, don't use it. Interesting to see your standard "go troll elsewhere" reply doesn't apply to yourself.
I guess thats what people get for correcting your errors? Thanks.


Gabriel(Posted 2006) [#16]
I guess thats what people get for correcting your errors? Thanks.


It's what people get for correcting yours, so why not? And when you have to change the question in your answer, you're not correcting anything.


taumel(Posted 2006) [#17]
@Gabriel/Noel

It really looks interesting...thanks again!

As for the particles i once did a little fillrate-test with blitzMax in order to test some stuff for me...

http://www.marune.de/taumel/test/_max/waben/waben_win.zip
http://www.marune.de/taumel/test/_max/waben/waben_osx.zip

Move the mouse-wheel for increasing/decreasing the number of objects.



Greetings,

taumel


Gabriel(Posted 2006) [#18]
Thanks Taumel. I don't have the particle helper class wrapped yet, but I'll try out a comparison if and when I get it done. As far as I can tell, the Sprite and Rect helper classes are wrapped and working fine.


smilertoo(Posted 2006) [#19]
894 sprites before it drops under 85fps.


xlsior(Posted 2006) [#20]
Taumel: That looks pretty nice!

492 sprites before going under 85 on mine. (Radeon 9600Pro 128MB)


N(Posted 2006) [#21]
2,580 particles before it collapsed in on itself like a neutron star.


Duckstab[o](Posted 2006) [#22]
4041 Particles before it dropped below 30fps pritty cool
1401 Before if dropp below 85-84 fps


Gabriel(Posted 2006) [#23]
Haven't had a chance to verify/debug everything but so far I've wrapped the vector, color, particlesystem, particlemanager, sprite, rect and font helper classes.

Little screeny of Tutorial 3 running, demonstrating use of the particle system, font and sprite helper classes.




Mr. Write Errors Man(Posted 2006) [#24]
What's the state of this project? It sounds very good.

-AF


N(Posted 2006) [#25]
It's done.


Gabriel(Posted 2006) [#26]
What's the state of this project? It sounds very good.



The HGE class is complete and available in the downloads above. As for the helper classes, I completed all but one or two, which didn't seem particularly useful. Considering the lack of interest, I couldn't justify spending the time it would take to put together some documentation and releasing it properly.

If you particularly want the helper classes and you're prepared to live without docs, you can email me and I'll send it to you.


Mr. Write Errors Man(Posted 2006) [#27]
Thanks guys. I'll try to find time to fool around with HGE during the weekend.

I would use HGE most of all because of higher compatibility with older cards. All the other stuff is really just extra goodies. I can't say yet if I would really need some of the helper classes.

Thanks again for your excellent work.

-AF