What machine learning algorithm to use and how to implement it? I have a virtual world with a grid filled with squares (x by y). There are entities that can do:
1. move 1 step in the four cardinal directions
2. eat food
3. fight another entity of a different type
4. mate with the same type of entity to reproduce (create one more of that type of entity)  

The objective is to obtain the highest score possible.
The score is calculated by:
+1 per food eaten
+1 per enemy killed
+1 per entity of that type  

The inputs (neurons) are as follows:
1. position (x, y) on board
2. board size
3. types of entities in adjacent squares (including food, and null if empty)  

I would like to create a program that will create hidden neurons that give rise to a sophisticated moving and attacking pattern that will allow it to obtain the highest score. 

Which algorithm should I use?
I would suggest that you try to apply reinforcement learning, maybe deep Q-learning or some other form of RL.

I don't know if those are going to be the best set of features (the best way to represent the input).