How should values that “don't exist” sometimes be handled as input data?

I'm currently training an agent to learn how to fight in a shooting game.

I'm using the bullet positions of the agent's opponent as one of the features. The features "don't exist" when the opponent isn't firing a bullet.

What should I substitute the feature with when the opponent of the agent doesn't fire a bullet? Right now, I'm considering using "0", but are there better alternatives?

Having to input a non-existing feature is a common problem in machine learning models. Entering 0 and 0 could mean the position { x: 0, y: 0 }.
But if you'd input "nothing", that still would be 0 (because nothing * weight = 0).
• If your network supports negative activation values (range: -1, 1), you should try to input it as -1.
• I don't think the learning model will have a hard time if you'd just input 0 as input, like you proposed.
• Add an extra input feature, 'bullet exists'. 0 if there is no bullet, 1 if there is a bullet. Then just input 0 for the x and y coordinates.