BrainInfo->viewdata!?

Feb 27, 2007 22:21 BrainInfo->viewdata!?
I'm trying to write a brain for fun.

In brain.h the BrainInfo->viewdata states "view_width*view_height bytes of terrain data". In my case view_width is 29 and view_height is 29. So I should have about 841 bytes of viewdata. Although in reality I only have about 256 bytes of data, and I'm not sure this data is correct.

Does anyone really use the viewdata? It looks like all the samples just uses theWorld. Is that assumed to be 256 by 256? I don't see any parameters that define its size.

Thanks
Feb 28, 2007 06:11
Wow, in the three or so half-finished bots I've written, I've never even noticed viewdata. I would play around with it more and see what you come up with iterating through it.

It might be useful for things relating to terrain like pathfinding - with the Ryan2 brain using a good A* algo - but most other tasks are going to be related to objects (pills, tanks, bases, shells, LGMs). Thus, might not be used too much in brains.
Feb 28, 2007 17:08
Sticks wrote:
Wow, in the three or so half-finished bots I've written, I've never even noticed viewdata. I would play around with it more and see what you come up with iterating through it.


I have looked at the data in the debugger after attempting to use it. And I don't believe its correct. It does give you data. Although I don't think its correct data, its not all there. Or at least its not correct to my interpretation of the comments.

I take it you just use BrainInfo->theWorld? Does that contain everything on the map and its current state?
Mar 01, 2007 04:19
Yeah, I just use theWorld pointer (along with passing in some value for the square I want to look at). I haven't tried looking at the terrain for the whole map but I'm thinking it's allowable. If you use a borg like Sfinktah or Namik, they can display the terrain of the map in a minimap if I'm not mistaken.