BGHelper Refactored

how can i use the mouselook function?

Well, I included examples - if you go to the MouseLook scene and press 0 to switch to the Camera, you’ll see it working. To use the function’s fairly simple - you would only have to implement this script:


from BGHelper import *
MouseLook() # There are other arguments that you can change to control how it performs, but simply running the function is enough to actually have MouseLook implemented.

thank you so much ! i think this idea of consolidating game engine helper functions into one library is an amazing idea and a huge help for people like me so thank you again

New version of BGHelper (V1.3). This version adds Callback objects and simple Python collision detection.

FYI, methods like getVectTo() and alignAxisToVect() are also in C++. So the heavy lifting (vectors, matrices, etc) is done in C++ for both versions. The Python one will probably still be slower than the brick (extra data copies and such). However, the difference shouldn’t be too terribly drastic.

That’s good to know - so what could be causing the Python slow-down?

BGHelper V1.4 released.

BGHelper V1.5 released. Added gradual ranges, node pathfinding, and a new function to switch between two values.

BGHelper V1.6 released. Added efficient and powerful NodeMap-based pathfinding, and soft-body pinning (for things like capes, for example).

New version of BGHelper - V1.8. Added soft-body pinning example, joystick class, and joystick profiles (!). If anyone wants to help create some profiles, I’d appreciate it.

I made a ‘Joystick.blend’ to test it out and I have,
A basic joystick FPS starter blend, it includes:

Basic ‘Call Of Duty’ look (instead of mouselook) using the joystick.
Basic Movement using the joystick
Basic Crouching using the controller (button ‘O’)
Basic Jumping using the controller (button ‘X’)
Basic Pause using the controller (start button)
A text file that says which ‘Button’ is which.

If you want I can send it to you and you can use it as a resource for this thread? Because I would’ve loved this instead of manual effort! >_< Thanks for the thread SolarLune. :slight_smile:

No problem. The profiles are more for controllers rather than the setups themselves - it’s not really for a FPS or TPS setup in particular, but more for allowing one to access different game controllers’ button layouts. However, if you have any controller profiles (name to button / axis index values), I’d be glad to include them.

EDIT: For custom controller profiles, keep the same names as the template so that we can have a standard. While, obviously, a 360 controller has no ‘triangle’ or ‘square’ buttons, by using the same name across profiles, we can have a working standard on which games will perform the same across different controllers (i.e. the X button on a 360 controller will shoot just like the Square button will on a PS2 controller).

Updated with a new version.

Uh, this post is so old(and also the BGHelper ), but I have to resort to it.

I was testing the most recent version of The BGHelper and have some problems in the api using blender 2.69. I only found problems in the “NodeMap”, the class CNodeMap()

Seeing the console, apparently the problems are related with vectors.

^ Sorry for not seeing this, carlo. I’ve started refactoring the BGHelper module out-right completely over the past few months, so it should be easier to use and work better overall. The new version lacks a lot of the old features of the original BGHelper module, but it’s a lot better for organization and usability, in my opinion. I’ll update the main post.

The new refactored BGHelper module continues to be worked on. I’ve added some more stuff, as well as haven’t mentioned stuff I’ve already added, like:

> The ability to create views easily and auto-move added views (i.e. add a view and have it automatically move the views to position them all on screen).

> A new mesh class that allows you to definitively get specific polygons and vertices. In the BGE currently, you have no control over which polygons or vertices the built-in mesh object will fetch. My custom CMesh class rectifies this by ordering the polygons. So, the mesh object’s polygon_list[0] value will always be the polygon that has the least value on the X, Y, and Z positions, in that order. You can easily work with this to grab specific faces, or identify faces easily (i.e. select the first 10 faces of a mesh).

> An audio module that allows for simple playback of sounds and music. I need to add things like callbacks when a sound finishes playing, or limits (so you can only play x amount of a certain sound, for example), but as a base, it should work alright.

You can get the code on my SVN page, as usual.