Right now I'm knee-deep into the underlying data structures for my project, namely the map/collision system. Originally I expected to make the game run on a tile-based map, so I could
be inspired by Notch's Minicraft
(Ludum Dare entry).
But as I've got to implementing the system, and seeing how I intend to have a line-of-sight lighting system, I've been thinking it might be more optimal to have an underlying polygonal collision structure to handle both collisions and lighting, which, funny enough, would be very similar to how the original DooM games did it (For those who don't know, my project is a top-down version of DooM).
So my question would be, what is the better approach? These are some of the requirements.
- Visual representation is still a tilemap, so polygons must adhere to "manhattan" geometry, that is, 90º or 45º angles between lines, and all line lengths are integers (multiples of the predefined cell size).
- Must run smoothly with a large number of entities.
- Different areas (sectors) can have a different ambient light levels.
- Small network footprint as cooperative LAN gameplay is a major objective.
- Maps need be procedurally generated.
I'm leaning towards polygons for several reasons. Chief among them is that it's easier to represent a polygon mathematically. Additionally, by dividing the game area in "sectors", I can sort different areas into drawing/collision lists (something like BSP or portals) for more efficiency. I even might have the fringe benefit of allowing sectors to exist over one another, or even non-euclidean map structures, simply by joining "sector" edges independently of their map coordinates.
But, as is to be expected, I'm mister noobness
here, so would like the board's opinion.
Oh, few caveats:
- Java2d Rendering: yes, I know, not optimal, etc. As I've said before, I want to implement it all by hand before I rely on pre-packaged solutions.
- I want to implement it all: I'm already looking at Straightedge for inspiration / ideas, but I really want to manually implement everything myself to better learn the nuts and bolts of the system, so I'm not interested in API recommendations, but rather on a discussion about the theoretical advantages / disadvantages of each system.
So, discuss! (And thanks in advance)