# AI and rendering to screen

I'm using LWJGL, however I'm a bit confused on what to do.

I'm trying to write an AI simulation, however I'm stuck at this problem. I have one camera, and I plan to move the camera to the mob position and then save it to the screen, then I will then use that to input into the neural network, then it does its action, then I move onto the next mob and repeat. Then, finally I move the camera to the player position so I can see what is happening.

The problem is that I just want to see out of the player eyes and not the mob eyes. However, I'm confused on how to do it. http://www.lwjgl.org/wiki/index.php?title=Taking_Screen_Shots the only way I can think of getting the information for what the mobs see is to take a screen shot if I render it to the screen. But, then if I do this all I will see is everything jump around a lot.

The code will look something like this

public class Game() {
public Game() {
camera = new Camera();
player = new Player();
ArrayList<Mobs> mobs = new ArrayList<Mobs>();
}

public void update() {
player.update();
for(int i=0; i<mobs.length; i++) {
camera.setPos(mobs.get(i).getPos();
mobs.get(i).render;
saveScreen();
mobs.get(i).logic();
}
}

public void render() {
player.render();
}
}


There must be a better way. For example, maybe it possible to not render to the screen to input the data into the mob. Or maybe, I don't need to save it to say .png to then put into the neural network.

• I have no experience with lwjgl, but I would try to add an own camera object to each AI entity and have it render off-screen, while the actual camera which renders to the users screen stays independent of the AI. – Philipp Jul 9 '13 at 10:56