Let's say you were making a FPS game. How would you make the game to where when you move, you don't see everything, but just the part to where you are. Like you don't see the whole chess board, just cells C1, B1, D1, and C2. I'm thinking of making games and would like to keep this in mind. I am going to use the Java2D and/or Java3D API obviously.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
john price wrote:Let's say you were making a FPS game. How would you make the game to where when you move, you don't see everything, but just the part to where you are. Like you don't see the whole chess board, just cells C1, B1, D1, and C2. I'm thinking of making games and would like to keep this in mind. I am going to use the Java2D and/or Java3D API obviously.
Are you referring to fog of war, or to field of view? I'm suspecting the latter. You should do this using graphical libraries like Direct3D or OpenGL. JOGL provides OpenGL for Java.
It will be a lot easier to use a pre-made 3D engine though, like JMonkey.
What is fog of war? And, yes, I meant field of view. How would you use somebody's libraries? Is it like they write classes and you implements them, such as MouseMotionListener? Why couldn't I build my own engine? Would it be too hard?
cc11rocks aka John Price
EDIT: How do OpenGL and Direct3D make the libraries to do this?
How would I make it? What do I put in it? How do I get started with making it? Do I need to know Java3D? Is there a tutorial for making a game engine? Why do I need to build a game engine? Why can't I just code it like regular?
John Price aka cc11rocks
Why do you mean, code it like regular? What is regular?
"Engine" just means the code that is used to draw the 3D world, and the objects within it, and how they behave. It's like the "look and feel" of a graphical program.
Whether you write this code yourself, or use code that already exists, you still need it.
I recommend you go to the JMonkey homepage, and look up what it's about. I'm sure they have an introduction, and tutorials and plenty of other resources to help you get started.
I looked at the website. Why can't you just have a bunch of methods instead of the game engine? Are they the same thing? I haven't used 3D yet, so this may be why I don't understand. So far this is what I think is a game engine:
Using the Java API and "mixing" components to make the game do certain things, such as algorithms, lighting, etc. Why can't you just write this in your code as methods, and not as a separate engine?
cc11rocks aka John Price
So would making my own engine for a small game (to get started) be too much? Something simple like say, a short animation?
Going back to my original question and adding your input, how would I make the engine to where you move?
Would you have to, if you did your own engine, make an item get larger as you get "closer"? Would you have to have everything "pop" up when you get to it? Like you can't see it now, because it's not there? For example, if there is a building and you move closer, it gets bigger. When you open the door, you then draw the inside of the building and remove some of the outside components of the building?
Or is there a better or easier way to do this?
EDIT: Or do you draw EVERYTHING and have like a "camera"? How would you make this "camera"? I'm assuming you would use the engine somehow...
If you want to do all of this by hand, you can use OpenGL. It handles a lot of stuff like camera positioning, distance, field of view, all that stuff. What you do is describe all your graphical objects as a bunch of triangles located somewhere in space, and OpenGL will draw everything for you. Note that there is a lot of math involved, and matrix transformations in particular. http://en.wikipedia.org/wiki/Matrix_theory