Jump to content

Debugging Brains


Recommended Posts

So, I'm working with brains.

if you use the debug key helpers and hit the pause key, you can pause the game and a bunch of debug information gets overlayed into the game window. Information like total memory for Lua and how many objects are active, etc. etc. etc.

If you then select some monster or player (by using c_select() on the console) additional information will be displayed (relative to that instance you selected) including the brain. This particular part is very important for brain development because it will update the brain in real time and show which behaviour is running or which behaviours failed, etc.

However I have a huge brain and whenever I try to use this to watch the brain decision process the game crashes with the following error:

[00:01:30]: Assert failure 'text_len < MAX_NUM_CHARS' at ..\source\game\render\BitmapFontRenderer.cpp(145): Trace follows...

Which is a bummer...
Is there a way to increase this MAX_NUM_CHARS? (I'm betting not, but...)

Here is the brain when i dump it to the console:

[00:01:30]: Priority	
[00:01:30]: |   Sequence	
[00:01:30]: |   |   stuck	
[00:01:30]: |   |   alive3	
[00:01:30]: |   Sequence	
[00:01:30]: |   |   drop_activeItem	
[00:01:30]: |   |   drop	
[00:01:30]: |   DontBeOnFire	
[00:01:30]: |   Parallel	
[00:01:30]: |   |   StayInTheLight	
[00:01:30]: |   |   MaintainLightSource	
[00:01:30]: |   Parallel	
[00:01:30]: |   |   GoForTheEyes	
[00:01:30]: |   |   ChaseAndAttack	
[00:01:30]: |   RunAway	
[00:01:30]: |   Sequence	
[00:01:30]: |   |   notBusy_heal	
[00:01:30]: |   |   ManageHealth	
[00:01:30]: |   Sequence	
[00:01:30]: |   |   notBusy_sanity	
[00:01:30]: |   |   ManageSanity	
[00:01:30]: |   DoScience	
[00:01:30]: |   Priority	
[00:01:30]: |   |   MasterChef	
[00:01:30]: |   |   ManageInventory	
[00:01:30]: |   Parallel	
[00:01:30]: |   |   IsDay	
[00:01:30]: |   |   Priority	
[00:01:30]: |   |   |   ManageHunger	
[00:01:30]: |   |   |   Sequence	
[00:01:30]: |   |   |   |   notBusy_lookforTouchstone	
[00:01:30]: |   |   |   |   FindAndActivate	
[00:01:30]: |   |   |   Sequence	
[00:01:30]: |   |   |   |   no home	
[00:01:30]: |   |   |   |   looking for home	
[00:01:30]: |   |   |   Selector	
[00:01:30]: |   |   |   |   Sequence	
[00:01:30]: |   |   |   |   |   notBusy_goPickup	
[00:01:30]: |   |   |   |   |   FindResourceOnGround	
[00:01:30]: |   |   |   |   Sequence	
[00:01:30]: |   |   |   |   |   notBusy_goHarvest	
[00:01:30]: |   |   |   |   |   FindResourceToHarvest	
[00:01:30]: |   |   |   |   Sequence	
[00:01:30]: |   |   |   |   |   notBusy_goChop	
[00:01:30]: |   |   |   |   |   FindTreeOrRock	
[00:01:30]: |   |   |   |   Sequence	
[00:01:30]: |   |   |   |   |   notBusy_goMine	
[00:01:30]: |   |   |   |   |   FindTreeOrRock	
[00:01:30]: |   |   |   |   Sequence	
[00:01:30]: |   |   |   |   |   notBusy_goBurn	
[00:01:30]: |   |   |   |   |   FindThingToBurn	
[00:01:30]: |   |   |   |   Sequence	
[00:01:30]: |   |   |   |   |   nothing_to_do	
[00:01:30]: |   |   |   |   |   Not	
[00:01:30]: |   |   |   |   |   |   ActionNode	
[00:01:30]: |   |   |   Sequence	
[00:01:30]: |   |   |   |   maxSearchDistance	
[00:01:30]: |   |   |   |   lookingForSomewhere	
[00:01:30]: |   Parallel	
[00:01:30]: |   |   IsDusk	
[00:01:30]: |   |   Priority	
[00:01:30]: |   |   |   ManageHunger	
[00:01:30]: |   |   |   Sequence	
[00:01:30]: |   |   |   |   no home	
[00:01:30]: |   |   |   |   looking for home	
[00:01:30]: |   |   |   Selector	
[00:01:30]: |   |   |   |   Sequence	
[00:01:30]: |   |   |   |   |   notBusy_goPickup	
[00:01:30]: |   |   |   |   |   FindResourceOnGround	
[00:01:30]: |   |   |   |   Sequence	
[00:01:30]: |   |   |   |   |   notBusy_goChop	
[00:01:30]: |   |   |   |   |   FindTreeOrRock	
[00:01:30]: |   |   |   |   Sequence	
[00:01:30]: |   |   |   |   |   notBusy_goHarvest	
[00:01:30]: |   |   |   |   |   FindResourceToHarvest	
[00:01:30]: |   |   |   |   Sequence	
[00:01:30]: |   |   |   |   |   notBusy_goMine	
[00:01:30]: |   |   |   |   |   FindTreeOrRock	
[00:01:30]: |   |   |   |   Sequence	
[00:01:30]: |   |   |   |   |   nothing_to_do	
[00:01:30]: |   |   |   |   |   Not	
[00:01:30]: |   |   |   |   |   |   ActionNode	
[00:01:30]: |   |   |   Sequence	
[00:01:30]: |   |   |   |   maxSearchDistance	
[00:01:30]: |   |   |   |   lookingForSomewhere	
[00:01:30]: |   Parallel	
[00:01:30]: |   |   IsDusk2	
[00:01:30]: |   |   Priority	
[00:01:30]: |   |   |   ManageHunger	
[00:01:30]: |   |   |   Sequence	
[00:01:30]: |   |   |   |   try to go home	
[00:01:30]: |   |   |   |   go home	
[00:01:30]: |   Parallel	
[00:01:30]: |   |   IsNight	
[00:01:30]: |   |   Priority	
[00:01:30]: |   |   |   CookFood	
[00:01:30]: |   |   |   ManageBase	
[00:01:30]: |   |   |   ManageHunger	

Which is not nearly as informative as the in-game option

 

Then I started thinking can I try and do my own overlay? I would completely disregard the stuff from the instance itself and focus only on the brain. Maybe this way it will be lesser than the MAX_NUM_CHARS?

I'm not sure I made myself clear, I hope so...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...