Overview
This week, we made a lot of progress on
the project. We are ahead of schedule to meet our goal of finishing within the
ten week term. We've already made a few changes and are all excited about where
the app is headed.
We've decided to change our game idea from
having levels to being more of a creative/sandbox-mode sort of game. Players
will be able to place planets, suns, asteroids, or any other solar bodies they
want to make wherever they want in the virtual environment. They will be able
to adjust their sizes, velocities, and positions relative to the other bodies
on the screen. We are still trying to decide if we still want to incorporate
some kind of game aspect or just make it a simulation. Making it a simulation
would be cool because it would give the “game” more educational value. It would
make more sense then to incorporate stats and numbers (like a body’s mass,
velocity, and distance from other bodies) in a table. This would really help
make it educational but it wouldn’t make a lot of sense to include it in a
game.
If we were going to make it a game, however, it would need to have
some kind of points system where players could get high scores. One idea we
have is for a player’s score to be based on the number of bodies they can put
on the screen without them colliding. This will become more difficult as they
add more bodies because all of them will have gravitational forces acting
between them. There would be a lot of strategy involved in deciding which moons
should orbit which planets and which planets should orbit which suns. If we did
go this route, we’d need to set boundaries in space and also other constraints
to make the game more fun.
Progress
We made a lot of progress this week in the programming of the
game. Much of this can be seen in the smaller posts we made over the last few
days. As of right now, we have a working physics-based simulation running on
Android and PC. Right now there are only three bodies in space but the code is
set up so that it’s easy to add more. The gravity and physics is realistic and
uses the real formulas for gravity and centripetal force. A user can launch the
bodies around the screen and change the mass/size of one of them. We’re calling
this one the test planet right now because we’re testing all of the future
functionality on this one body before we extend it to work on all of them. On
the desktop version, you can press the “O” key to make the test planet orbit
the sun. You can use the arrow keys to zoom out and in and you can click and
drag to pan the camera around.
Future Plans
We’re going to set it up so that there is a set of control buttons
that slide out of the side of the screen where people can choose whether they
want to be in view mode or edit mode. In view mode they will be able to pan and
zoom the camera without worrying about editing the bodies. In edit mode, they
will be able to select certain planets to edit by clicking on them. They can
click and drag to launch them or click and then scroll the mouse wheel to
change their sizes. There will also be an orbit button on the screen. All of
this functionality will work similarly on the phone. People will be able pinch
their fingers in and out on the screen instead of scrolling the mouse wheel to
zoom and change planets’ sizes. All of the key commands will be replaced with
onscreen buttons. (see picture below)
Challenges
One of the biggest challenges we’ve faced so far is scale. Because
gravity is such a weak force and space is so spread out, we’re having a hard
time fitting everything in a reasonable amount of space. We solved this mainly
by making the gravitational constant equal 1 in the formula in the code. The
real value is 6.674×10−11 N⋅m2/kg2 so this is
obviously a major adjustment. We will account for this by scaling the radius
and masses that we display on the screen. Instead of being 200 meters like it
actually is in the game, it might be scaled to 200×109 meters. Another
problem is that libGDX has a maximum velocity of 2 units/frame. This is why we
can’t set a realistic scale because at 60 frames per second that would mean a
maximum velocity of 120m/s. That would be much slower than actual planetary
motion and it would literally take years for a body to move across the screen. You
also wouldn’t be able to see any acceleration due to gravity if the velocity
was already at the maximum. This wouldn’t be good for the educational factor in
the app. We’ve been working on solving this by, in addition to scaling G, adding
a scaling factor for all of the numbers in our code. We all worked together to
figure out the math behind this scaling because different numbers (e.g.
distance and mass) need to be scaled differently. It seems to be working pretty
well right now but we’ll see what other kinds of changes need to be made in the
future.
Team Roles
Since Nick has the most experience with Java and Android
development, he has been doing most of the actual programming so far. Ebed and
Jiho have been watching Java lectures online to get up to speed. They are also
working on graphics and helping to solve problems and plan for the future.
No comments:
Post a Comment