Advertisement

force fields

Started by March 27, 2002 05:52 AM
29 comments, last by berserk 22 years, 9 months ago
I''m having trouble deciding how to handle force fields, or shields, in my game. Think of a typical space shooter, they usually have some kind of force fields around the ships. Lets say that a force field is produced by a shield generator. If I have 1 generator on the ship, I have 2 choices: 1. force field represents a bounding sphere about the ship. This can get weird for large long ships. 2. force field is layered right on top of armor, so if armor gets hit, first you deduct points from the shield, then armor. Also, since its just one shield generator, it doesn''t matter from which side the ship gets hit, there''s no "front" and "back" shields. If the ship has 2 shield generators, then there are more decisions to make: 1. both force fields overlap and can be treated as one, only stronger 2. force fields divide the ship, so you could have "front" and "back" shielding. If this option is chosen, then how to decide where exactly the 2 force fields meet on each ship? And what if there are 3 shield generators, how to divide the ship in 3 even sections? What do you think is the best approach here? Anyone got any other ideas about force fields?
"2. force field is layered right on top of armor, so if armor gets hit, first you deduct points from the shield, then armor."

"1. both force fields overlap and can be treated as one, only stronger"

That would be my choice.

____________________
Pedro Santos «» Project Y «» GameDevPT
Advertisement
That is simple and it makes sense. But people like the ability to "allocate" shields from back to front, from one side to another. And while having a single shield for small ships is okay, what about very large ships? one would think they ought to have seperate shields for different areas
I remember the old star wars game x-wing used to allow you to allocate shields, either it surrounds the ship, full front shield or full back shield. So whenever your ship gets hit, all you have to do is to decide whether it''s front or back of the ship.
You can also look at one Star Trek game out there. It was based on the game Star Fleet Battles. In the game, it didn''t matter what size the ship was, all ships had 6 shields. On front and back, and the front side and back side of each ship. One reason for this design was that the game took place on a hex grid, so it was easy to see what shield was hit.


---
Make it work.
Make it fast.

"Commmmpuuuuterrrr.." --Scotty Star Trek IV:The Voyage Home
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][LWJGL Tutorials for NeHe][LWJGL Wiki][jMonkey Engine]
How about a variation on the bounding sphere idea. For a small vessel, use a single sphere. For long vessels, have a sheild generator near each end, and the spheres interact like metaballs. You''d get a kind of peanut shaped feild.
You are not the one beautiful and unique snowflake who, unlike the rest of us, doesn't have to go through the tedious and difficult process of science in order to establish the truth. You're as foolable as anyone else. And since you have taken no precautions to avoid fooling yourself, the self-evident fact that countless millions of humans before you have also fooled themselves leads me to the parsimonious belief that you have too.--Daniel Rutter
Advertisement
I agree that your best bet is to keep it simple, however, you could use both solutions by dividing different ships into two or three classes, each having its own properties and solutions.

We''''re sorry, but you don''''t have the clearance to read this post. Please exit your browser at this time. (Code 23)
We''re sorry, but you don''t have the clearance to read this post. Please exit your browser at this time. (Code 23)
since this is the game design forum and not the math and physics or graphics forum, I can understand why no one said so, but for long ships there are these things that I think are called ellipsiods, they are to ellipses what spheres are to circles

Using cylindric coordinates:
X = rx*cos(A)sin(B)
Y = ry*sin(A)sin(B)
Z = rz*cos(B)

(X,Y,Z) is a point on the ellipsoid E
(rx,ry,rz) is the ellipsoidic axes (or radius tweaks)
(A,B) is the cylindrical coordinate angles.

I like the meta-ball suggestion though...
... or let a ''shield'' rather be some reactive armor, like
laserbombs, shooting back at the invader.
( don''t listen to me )
"Self awareness is the interaction between 3 different parts of your brain. The Cog, the Left and the Right side of you brain..."
quote: Original post by Anonymous Poster
since this is the game design forum and not the math and physics or graphics forum, I can understand why no one said so, but for long ships there are these things that I think are called ellipsiods, they are to ellipses what spheres are to circles


True, but would that make sense in the context of force feilds? While there should be no reason why a spherical field couldn''t be stretched a bit, I think many people would have an expectation that force fields are just plain round. Besides, this approach still doesn''t address more unusual ship geometries. I mean, what if a ship is a big L shape, for instance? The metaball approach handles this simply by placing multiple feild generators at appropriate points along it''s length.
You are not the one beautiful and unique snowflake who, unlike the rest of us, doesn't have to go through the tedious and difficult process of science in order to establish the truth. You're as foolable as anyone else. And since you have taken no precautions to avoid fooling yourself, the self-evident fact that countless millions of humans before you have also fooled themselves leads me to the parsimonious belief that you have too.--Daniel Rutter

This topic is closed to new replies.

Advertisement