Terrain questions
Hello, I'm doing a project to simulate a certain robot in Breve with Steve, but I am completely new to breve. I have experimented a bit with some basic things, and I have to say I like it. However after having experimented on the behaviour of the agents, I wanted to experiment with different terrains. Unfortunately I can find practically no documentation on how to set up a terrain or how the agents interact with the terrain (collisions, avoiding walls etc). I find this odd, so my first question is: am I just overlooking the documentation on terrain manipulation/creation?
If not, I'll say a bit more about the project in hopes of anyone reading this being able to give me some useful information. I'm supposed to simulate a surveillance robot in a room (2D, looking at it from above) with walls and objects. That means the terrain has to have a floor, outer walls representing the size of the room, and stationary objects representing any objects in the room. Do you have any simple tips for me on how to represent these kind of things in the terrain? Like how to make the terrain have a max size, how to let the agent know where he can and can't walk, how to create the objects or anything else?
I have a map of this room in a .txt file, which I added as an attachment. The dots represent a free space, the O's an occupied space. The size of the room is 105 by 75 spaces. Is there a way for Breve to read from this file automatically? And then say add a stationary object on every space that is an O in the map or something like that?
Thanks in advance.
| Attachment | Size |
|---|---|
| Map - VU.txt | 7.86 KB |

Re: Terrain questions
Hello there,
I have never used it myself, but I remebered seeing something in the documentation, perhaps you have already read it. Anyway, here you go:
http://www.spiderland.org/node/2737
Looking at the documentation for the Terrain class, I could understand that you cant create a terrain map from a file buy you can create a plain terrain and set heights at specific points using the set-height method.
I suppose you could write a program that reads your txt file, and sets the terrain's height to, say 10.0 if you read a "O" and 0.0 if you read a "." in the (x,y) position given by the lines and cols in the text file.
Alternativelly, you could just use a plain Floor and set up Stationary boxes at the desired positions, according to the file.
To read a file in Steve you use the File class, then you can use the methods read-line or read-line-as-list to get the text from each line and process it.
I suggest you give a good look at the API docs.
Good luck!
Julio