Building a simulation model to match its real equivalence is a non-trivial task. On one hand, a complex model may introduce too many parameters, which could be impossible to tune by hand. On the other hand, a simplified model may not capture the important details of the model and thus reduce the credibility and capability of the virtual model. In this work, we propose a neuro-musculo-skeletal model for virtual insects (using specifically the ant as an example) and an automatic solution to the problem of parameter optimization. More specifically:We propose a uniform encoding of sensory information, high-level commands and control strategy, with the spiking patterns of the neural system. Such an encoding paradigm provides the equivalent representation as real organism and shows the potential of using spiking neurons as the building block for accomplishing general tasks. The network also provides a continuous mapping from the sensory information/high-level commands to low-level control, in contrast to the discretized mapping in previous work11.We use the evolutionary algorithm to automatically find the optimal values for both the controller and muscle parameters. Given the high dimensions of the model state spaces, we resolve the challenge by dividing the optimization into a two-stage procedure. The first stage optimizes the parameters of controller and muscles for the standard gait of walking straight forward, while the second stage progressively extends the skill repertoire by considering curve trajectories and uneven terrain.We integrate the prior information (foot trajectories) of real ants during the optimization process via the evolution algorithm. The introduction of ground-truth data from real ants allows the quantitative comparison between the proposed model in this work and existing models11. The result shows that the trajectories generated from this model presents smaller deviations from the ground-truth data.