Ace knew all along that they were only characters from a videogame.
...Or at least, he worked it out very early on in the series and has been up to his neck in denial ever since.
There is evidence starting from the very first episode, in which Ace reaches out a hand to Mark's computer screen (see point 1:32). That particular scene was trying to convey the homesickness of the two main leads - Mark for his previous home in England, and (by this theory) Ace for the home which he knows is inside the computer. Later in the series, Mark tries to confront Ace about this directly. Ace's reaction is nervous and hesitant, not his usual Fish Out of Water act. He tries to brush it off as his sidekick having another of his Comically Missing the Point moments; but Mark is being direct, saying word for word that Ace is not from a real world.
There are other moments. Surely, Ace going through that entire Ace Lightning fan convention gave him a hint.
He probably just doesn't want to believe it. Who can blame him? It's his life we're talking about.
It's not until the final series, after he's gained human emotions and the end of the world is pressing down with renewed vigour, that he finally gets tired of pretending he doesn't know something is up and admits what he has known all along: that he is "not real".