It's clear that the effectiveness of a neural network depends strongly on the format you give it to work with. You want to pre-process it into the most convenient form you can algorithmically get to, so that the neural network doesn't have to account for that itself.

I'm working on a little project that is going to be using neural networks. My future goal is to eventually use NEAT, which I'm really excited about. Anyway, one of my ideas involves moving entities in continuous 2D space, from a top-down perspective (this would be a really cool game AI). Of course, unless these guys are blind, they're going to be able to see the world around them.

There's a lot of different ways this information could be fed into the network. One interesting but expensive way is to simply render a top-down "view" of things, with the entities as dots on the picture, and feed that in. I was hoping for something much simpler to use (at least at first), such as a list of the x (maybe 7 or so) nearest entities and their position in relative polar coordinates, orientation, health, etc., but I'm trying to think of the best way to do it.

My first instinct was to order them by distance, which would inherently also train the neural network to consider those more "important". However, I was thinking- what if there's two entities that are nearly the same distance away? They could easily alternate indexes in that list, confusing the network.

My question is, is there a better way of representing this? Essentially, the issue is the network needs a good way of keeping track of who's who, while knowing (by being input) relevant information about the list of entities it can see.


  • You absolutely don't want feature or object detection in there - this is a task people are working on for decades and we still don't have good solutions. And if you want any kind of behavior that looks 'realistic' to a player (for humans, animals, cars etc), there are alternatives that are far more suited to the task than ANNs.
    – Wilbert
    Oct 1, 2014 at 8:11

2 Answers 2


Unless I misunderstand the problem (which could be stated more clearly IMO), you absolutely do not want to order entities by distance. It is critical that each input to the neural network denotes the same physical entity throughout - or else nothing will make sense.

You need to specify your problem more precisely, and devise your network inputs accordingly. For instance, if your game agents are tracking N objects and can sense 4 parameters for each (e.g., the position, x-y, orientation, a, and health, h) then each neural network will have exactly 4N inputs. It does not matter in which order you feed these into a network, so long as the order remains the same! (The implicit ordering is what defines "who is who".)

If, on the other hand, the agents are only equipped with M distance sensors - so they know about the environment but cannot track other entities explicitly - (which is a more realistic scenario anyway) then the measured distances will be the M distance inputs. (In that case though it is impossible to know "who is who".)

Another issue is, how are you going to train the network? I assume supervised learning, which means you need to provide training data where the desired network output is provided for specific input values. For instance you might want to train the game agent to avoid collisions by teaching it to move away from other objects...


Entities that are far apart don't need to consider each other in the same way you don't think about the car three streets over. You might not even consider cars behind you until they are tailgating. Inputs should be limited to entities only within a specific threshold.

In any case, rendering data and then deriving it from the rendered data is never going to be as efficient as generating data and then rendering the result.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.