3
$\begingroup$

State of Blender's Logic Bricks

I've always been bothered by blender's logic brick system. I feel that it has problems concerning the following elements:

  • Speed
  • Customization/Complexity

Speed

In many of my previous projects that relied heavily on logic bricks, I've always had problems related to logic being executed one or a few ticks late. This led to a great deal of problems.

Customization/Complexity

For one, I feel that there should be a greater amount of logic bricks; however, there are many ways around this. Primarily, I dislike to a great extent the sheer limitations provided by the system. For example, consider the following setup:

jump

What if I don't want SPACEBAR to trigger movement.jump(), but a key that will never be the same as it can be changed through, perhaps, a key-binding menu of the game? How can I have the key dynamic and always changing through logic?

What if I have a whole lot of logic all over the place? It would look extremely messy, and I would have to resort to other methods (e.g. spreading logic over different objects, creating more python to clean up logic).

My Method

Because of the lack of complexity and speed with blender's logic bricks, I've done anything and everything in python. Rather than using an array of sensors, controllers, and actuators provided by logic bricks, I've always stuck with the following setup:

always

And I hate it with abhorrence.

How does it work?

Rather than having a module that includes functions for movement, I would create a python script with a newly-defined class. The code would run every frame. Any script would always use the following:

import imp
imp.reload(script1)
imp.reload(script2)
imp.reload(script3)

This ensures that every script is reloaded as all of my logic is done via script. The logic, in this case (player script), would be included in the __init__() function.

All of my work seems extremely eccentric, unpythonic, and nonsensical.

But it is the only way to get everything working the way it should.

How would I go about this problem?

This has been bothering me to a great extent, and I tried leaving to another engine a while back (the reason for my long absence). Other game engines have systems for game logic that make complete sense and work perfectly. I do not know how to combat this issue. I read about the road plans for 2.8, and I found out that logic bricks will get what seems to be a complete revamp. Should I wait it out (an indefinite amount of time, maybe even a year or longer)? Should I continue with another engine?

$\endgroup$
  • $\begingroup$ I still do not start with logic bricks, but I work on a fork of bge to create new bricks but as I do it only costs a lot of time and I do not have it so I'm very slow,if you are interested in leaving something for a coffee, it would be very helpful $\endgroup$ – user58715 Jul 4 at 3:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.