jj1bdx / erltrek

An Erlang Star Trek game
http://jj1bdx.github.io/erltrek
Other
16 stars 2 forks source link

Sub-sector play and coordinate definition #12

Open jj1bdx opened 10 years ago

jj1bdx commented 10 years ago

From https://github.com/jj1bdx/erltrek/issues/5#issuecomment-37977167

@kaos: "Sub-sector play was just an idea I got, when realizing that the ships position is (in bsd trek, could be in erltrek) actually at a finer level than sectors (being a fractional value for x and y resp.). So we could introduce a third view (the first two being the galaxy chart/long range scan and short range scan for quad and sector level of detail) for a single sector. With the current level of detail, a sector can hold no more than one of: ship, base, star, black hole, etc.. With a higher level of detail with sub-sector details, we could allow for all of these to be in the same sector (maybe not all of them at the same time, though). So, this could mean that we can move up close to a enemy ship and board it, or give a closer view of a starbase for docking etc.

Maybe not such a great idea after all.. (trying to show this on a short range scan won't be perfect..) How to render a sector where a klingon ship has moved into the same sector as a star, for instance.. unless the "biggest" object get precedence and the smaller ones can be seen as "hiding" in that sector.. you'd get a surprise hit if fired at from a hiding ship: "Klingon ship at x,y hit you..." heh ;)"

@jj1bdx: "Sub-sector stuff may need to allow multiple entities in the sector. That looks interesting, though that will have to change the definition of collision between two entities. Now the code is depending on the sector array for a quadrant for detecting a collision or hit."

kaos commented 10 years ago

The collision is not that hard, as the positions are in fractions of a sector. We only need to add a size property for the various objects and we're good to go.

What's trickier is how to display multiple objects in a shared sector on a short range scan, I think.