[quote]1. Instead of manually making all of the objects, read a file and go through it to create the objects at the given location.
2. Create an Abstract/Base Class called Level, and have players and such access the object list through Level.
[/quote]
Yes, that sounds exactly correct (edit - although you might find that ‘Level’ can just be a standalone class with no derived classes, rather than a base class).
[quote]The only thing left that I still don’t quite get is what if I want special things done. As in, let’s say events. I don’t know exactly what I mean this is just an idea, but if I want waves of enemies to spawn, and you to be locked in an area until they are all killed, I feel like it would be more difficult to do this without a separate class for that level.
[/quote]
I totally understand why it seems this sort of thing would be easier to hard-code, but for the reasons alluded to elsewhere in the thread, that’s not usually how it’s done. This is one of those cases where you trade a little work up front for much less work later. By that I mean that setting up a data-driven system can be a little more work at first, but for a game of any complexity at all, the amount of work you’ll save in the end will be more than worth it.
[quote]Like, they have it so when you run into an area it changes what you’re doing, or events (public events or other things) randomly happen.
[/quote]
How you would do something like this using data is a good question, IMO, because admittedly it’s not immediately obvious how to do it. The answer is that there’s a variety of ways to do it, ranging from simple to complex.
The (possibly) most complex solution, but the one that arguably offers the most flexibility and power, is to embed a scripting engine and write the game logic in the scripting language. For example, in Java you could use Nashorn and write the game logic in JavaScript. This is often how things are done with large-scale games, especially RPG/adventure games with lots of content. However, the scripting approach can be non-trivial, so you may want to start with something simpler.
An alternative to scripting is just to create an ad-hoc solution that meets your particular needs. For example, your map text file could include a list of ‘trigger’ tiles, each having a code specifying what should happen if the player touches that tile. You Java code would then read these entries along with the rest of the map, set up the triggers appropriately, and then take the appropriate action whenever the player touches a trigger tile. In a sense, this would actually be a scripting solution, just that the scripting language is a very simple ad-hoc language of your own creation rather than an existing language like JavaScript.
[quote]I feel as if it would be more complicated. I’m not trying to make you explain every last thing, but the idea of creating a level through data seems limited on what you really can do.
[/quote]
I certainly understand why it seems that way. The first thing I’d say is that integrating a complete scripting solution (e.g. Nashorn), while perhaps non-trivial, essentially removes all such limitations, and although that may not be where you want to start, it’s likely where you’ll end up eventually if you continue to pursue this. Even without that though, you can definitely implement your own ad-hoc solution that, while perhaps imposing some limitations, will allow you to do what you want to do.
I’ll end by encouraging you to avoid the temptation to hard-code your game content, tempting though it may be
Although it can require a little more work up front, I think data-driven is really the way to go for the kind of thing you’re doing.