Schroedingers-Hat / jsphys

Libraries for physics simulation on javascript canvas
GNU Affero General Public License v3.0
11 stars 1 forks source link

Relativistic asteroids #53

Open capnrefsmmat opened 13 years ago

capnrefsmmat commented 13 years ago

With extendedObjects we can build a spaceship and some asteroids. With arbitrary paths (I believe) we can have bullets. So... relativistic asteroids! The interactive way to learn relativistic physics.

I don't think there's much in the way of making this possible. We just need to figure out how to take advantage of relativity in the gameplay mechanics.

Schroedingers-Hat commented 13 years ago

That was the idea of making everything super-general ^_^ We don't even need arbitrarypaths for this, bullets with a well defined start and end time and constant velocity can be handled easily enough (will become somewhat redundant when arbitrarypaths is implemented, but these objects will be slightly more convenient in some cases). The only trouble will be finding the asteroids (recall wrapping was not possible), but I guess that can be a good education on time dilation and length contraction. I was also thinking have different asteroids emit different spectra (maybe an inhabited asteroid you lost points for which is hotter, or emits radio chatter? Why you don't have a radio, I don't know), your spectrometer could be a limited power-up, but by moving towards things quickly and noting the color one could glean this information.

capnrefsmmat commented 13 years ago

We could also go for interesting gameplay mechanics. We'd have to keep the user's frame of reference attached to the spaceship, since we're concerned with what the rocket can see or do -- and if we do that, the rocket will appear to be stationary in the middle of the screen, with the asteroids moving around it. Add relativistic effects and that'd be a rather unique challenge.

(Yes, it's not an inertial reference frame, but so long as we draw a little rocket flame to make that clear, I think we're fine.)

Schroedingers-Hat commented 13 years ago

Indeed, the phrase momentarily co-moving reference frame comes to mind. ^_^ We could leave an option for not rotating with the space-ship if having everything rotate is too confusing, shouldn't cause any problems.

Schroedingers-Hat commented 13 years ago

Probably not for asteroids, but if you have any other game ideas, recall that the simulation is, in fact, 4D. With the number of vertices we can keep track of w/o webGL -- assuming the actual 3d graphics part is negligable in comparison to the 4D work -- N64 level of graphics (polycount, that is -- res will be much higher) are quite achievable on a low end computer without any real tricks. Looking at what other people have done in canvas, webGL may not even be required for okay looking 3D stuff.

Schroedingers-Hat commented 13 years ago

Ideas for power-ups: Future vision -- display future light cone instead/as well as past. Makes it super easy to aim your laser. Present vision -- turns on drawNow Spectrometer -- displays a wavelength vs intensity graph of the object, so you can get information from its spectrum without having to use doppler shift -- ie have special asteroids that are hotter than others (but still too dim to emit siginificant BB radiation in rest frame). You can detect them by blue-shifting them enough to see the IR as red. Spectrometer allows another way to see Teleport

Instead of lives could have time reversal

Schroedingers-Hat commented 13 years ago

game mechanic: asteroids that reflect certain colors. Your ship's laser is green so you have to be moving to do damage

capnrefsmmat commented 13 years ago

Also you can use reflecting asteroids to hit other things if you're clever. That would be pretty sweet.

Schroedingers-Hat commented 13 years ago

Other ideas: Backstory: You are NAME. Recruited by OPRESSIVE_GOVERNMENT to test their new kamakazi weapons program. Your family will be payed a stipend after your death based on the proportion of the detritus field that you manage to destroy.

Mechanics: Player's ship has a limited mass in its black hole drive, this is emitted as pure photons by opening the containment field briefly, either in the rear or side openings. These are un-focused and result in acceleration Or the front focused opening, which is destructive and also results in acceleration.

As you use up your mass you accelerate more and more readily (could be player controlled for back-side or just use less mass to accelerate at same rate). This becomes a problem when you fire your main gun (accelerate backwards rapidly -- cannot limit as it needs to be sufficient energy to destroy the target). When you are having trouble targetting more asteroids, and the black hole (mass store) is small enough to evaporate quickly you can drop the containment field resulting in an explosion which takes out a few more asteroids. This will happen early if you get hit by one (although after a delay if the BH is too big).

Schroedingers-Hat commented 13 years ago

Yay! Rasteroids now makes sense when showVPos is on. Turns out the degenerate case for photons was actually really really simple once I found the factor of two I dropped by trying to do it in my head :/.

Schroedingers-Hat commented 13 years ago

Aberrated photon reflections look WEIRD. Don't think it's my maths, could be my assumptions, or just my intuition failing me again. Mayhap we should make it draw a persistent line, although then I suppose we'd have to define 'still' which is somewhat counter to the way jsphys works.

Schroedingers-Hat commented 13 years ago

Idea: Accelerating objects. May be useful to add some for plot reason. We don't have to keep track of them if they make it to an interval of c/alpha (and c/alpha > screen width) as the player will never be able to interact with them again. So they can be used for objects that get created (missiles?)