Hiding Logic Bricks???

Hi everyone,

Since I´m not a coder I do most of my game using Logic Bricks.
After some time this can get very confusing.
Here is a screenshot of the Logic Bricks, used only for the Player Controls so far, and there has to be added a lot more to it.


So now it would be awesome if there is a way with that we can hide all the logic bricks we don´t need for now, just as we can do with each other object/node/etc.

Hope you can help me.

States. Yes you can have multiple states active at the same time.

But then I have to redo most of my logic. Why can´t we simply hide logic bricks?

to hide them completely, you need to click on the “player” (the name of the object) who’s in the photo you posted, but if you want to remove some I do not know exactly how to do it. :no:

Because it’s not practical, especially in your case. You would like to hide the bricks you don’t need ‘for now’. I suppose that’s because your logic could be split up into components. When using states you could easily select these components and view separately. If you would try the same thing by hiding/revealing bricks you would have to remember how to differentiate the components and do this one brick at a time.

I also doubt that hiding/revealing would be possible without still showing the hided bricks, or a flag/layer system would have to be added. This would seem to complicate things unnecessarily i.m.o.

yeah, one trick is to take a complicated section of logic and push it into another object and then use a message to trigger, and a return message with data,

also, there is the logic brick top python converter(I have not used it) but it will be slower then pure logic,

also name EVERY block,
this makes it easier,

move blocks up and down the list, and group by function

also states are good if you like to use them,

my current project is not even that complicated and I am using more bricks then you :smiley:

another thing, reuse any bricks you can

another thing delete unused

another thing again LABELS! :smiley:

another thing

one collision sensor--------python

import bge

cont=bge.logic.getCurrentController()
own=cont.owner()
Collision=cont.sensors['Collision']

if Collision.positive:
    if 'Enemy' in sens.hitObject:
        Do stuff
    if 'Health up' in sens.hitObject:
        add health


this way you can use 1 collision sensor for all collision related events

same with rays near etc

Do you need some help learning python?

your games look really nice,

if you need python and you can’t write it , just ask I will try and write it/ teach you how

I’d have gone crazy had I stuck to using logic bricks. If you can read, you can make python code.

python is VERY slow when you use it in 1000 objects even if its just

import bge
cont=bge.logic.getCurrentController()
own=cont.owner
own.applyMovement((0,0,1),1)

do the same with logic

and you will see the difference

always-------and------movement

You you can easily create the same mess with Python code too. Most-likely it will be much more.

If you have such many logic, you should ask yourself if it is all at the right place.

You wrote that it all belongs to “Player Controls”. The natural place would be indeed the object representing the player. Unfortunately there is no useful naming at the bricks so I can’t guess if that is really the case.

But I do not see why you need 8 collision sensors and 40 property sensors. 6 keyboard sensors are plausible.

Nevertheless here are some hints:

A) [as mentioned already] move logic that belongs together to a separate state. Ensure this state is initial enabled.
B) give the logic bricks meaningful names. This will help you (and others) to read the logic structure
C) move logic that can be separated to another object. I can’t suggest anything as I do not understand what your logic is doing.
D) look if you can create some dynamic processing with Python. I guess a lot of the property sensing/processing can be moved to a few Python controllers.

Hiding logic bricks could be done through the outliner if the logic bricks were listed there.

In OOP programming, there’s an anti-pattern called a god object. I think this can apply here also. If one object seems to have too many logic bricks, it might be doing too much.

However, I think once you get to this level of complexity with logic bricks, you could probably handle programming; fortunately, BGE uses Python for scripting. Imagine a newbie having to learn C++ first :eek: