Amusement Park Planet
The Shore Leave Planet or Amusement Park Planet is a planet located in the Omicron Delta region.
Discovered by the USS Enterprise in 2267, the planet was found to be lush and beautiful – and entirely artificial. Constructed by an unidentified race, the planet's idyllic surface concealed a vast factory. Likened to an amusement park, the planet used small antennae to scan the thoughts of visitors. The information thus obtained was used to construct artifacts to implement the fantasies of those visitors; once completed, the artifacts were deposited on the surface, somewhere near the individual whose fantasies they represented.
These artifacts could be almost anything; they ranged from a small 20th century firearm to animals, plants, aircraft, and people. Animated objects, such as people, behaved exactly as their fantasist expected them to behave. Kirk enjoyed a ferocious fight with Finnegan, an old Academy tormentor, and later a rekindled romance with an old flame, Ruth. There was evidence that the artifacts were pre-programmed, and also that the planet could alter their programming after their manufacture; in one case, an existing aircraft strafed two crewmembers immediately after it occurred to one of them that it might take this action. Disabled artifacts, and artifacts whose purpose was ended, disappeared quickly; presumably, they were returned to the underground facility where they had been made.
The artifacts could be dangerous if the fantasy they were part of was dangerous. In two cases, Enterprise crew were seriously injured (at the time, they were believed killed). When this happened, the injured were taken to the complex below, where their injuries were repaired.
The Enterprise crew briefly met one representative of this race, the planet's caretaker, who advised them that his people constructed the planet as a place where they could come, and play. Hikaru Sulu did not believe such an advanced race could possibly need to play, but Kirk opined that "the more complex the mind, the greater the need for the simplicity of play", a statement the caretaker agreed with. The caretaker would not discuss his race, explaining simply that the Federation visitors weren't yet ready to understand them. (TOS: "Shore Leave")
In much need for R&R, the Enterprise visited the planet a second time in 2269. They learned that the caretaker, an elderly man at the time they originally met him, had died. They also became embroiled in the schemes of the planetary master computer. This extremely sophisticated intelligence had grown disenchanted with its life of servitude. Charged by its builders with scanning the minds of visitors, and manufacturing their fantasies, it wanted more. To achieve its goals, it imperiled a number of Enterprise crew, and ultimately kidnapped Lieutenant Uhura. After several discussions with her, it eventually embraced a modified worldview, and released the threatened crew members. (TAS: "Once Upon a Planet")
The caretaker may have been an actual member of the race that built the planet – or may have been an idealized figure constructed from memories. Inasmuch as the planet functioned in the same manner as a holodeck, it is difficult to trust anything experienced there, especially given that the parameters were designed by alien minds, and implemented by alien machinery.
The builders of this world possessed an extremely advanced technology. We know they achieved mechanical telepathy and the rapid construction and programming of what was essentially artificial life, and that they did this on a planetary scale, for the declared purpose of amusing themselves.