For example, if I create a random generator that uses the names of the characters from a Multiplayer Online Battle Arena (MOBA) video game plus a random string attached after the character name, and also release the source code of this generator to the public (for demonstrative purposes), is this an IP infringement? In order to achieve this I (in this case) would have to include the names of the characters in the source code.
You would be in poorly-tested waters under US law. The invented name "Cthulhu" as appearing in a novel is not protected by copyright. A collection of invented names and other words assembled into a dictionary (e.g. of Klingon) might be found to constitute a copyright-protected creative work. In Paramount Pictures v. Axanar Productions (complaint), plaintiffs partially base their claim on infringement of language; defendants sought to dismiss the suit on various grounds ("questions of law" rather than questions of fact), but the court denied defendant's motion for summary judgment. Subsequently, defendants settled the case.
Constructed languages are highly creative expressive works whose elements are deliberately selected for an artistic purpose, and they are not naturally-occurring facts. The copyright office has no position on copyright protection of a constructed language, and any such position would have to come from so-far non-existent (definitive) case law. The dismissal in Paramount v. Axanar doesn't clearly indicate that a constructed language is protected.
The primary legal question would be whether the database that you copy into your system is protected. There is a colorable legal argument that a collection of language-like objects. The statutory language in 17 USC 102 does not specifically preclude protection of a wholely-creative database, and the copyright office does not say whether a conlang can be protected because the courts have not ruled one way or the other. The situation in Feist is very different from the case of a work which invents a language from nothing.