Welcome, Guest. Please login or register.
Did you miss your activation email?
Pages: [1]   Go Down
  Print  
Author Topic: [LFT] 3D interactive game similar to Doom  (Read 619 times)
0 Members and 1 Guest are viewing this topic.
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2593
Referrals: 13

WWW Awards
« on: May 03, 2009, 03:47:32 PM »


lft = looking for team

That said, i was reading around and saw a nice project that we could do if anyone is interested in it. Basically it's a remake of the old doom game using java and openGL. I haven't done anything with Java and openGL yet so it's a good challenge to test my skills. If you are interested make a post below and what you want to help with (game engine design, AI, gameplay design, graphics etc)

Quote
CS335 Final Project Description
In this final projection, you will be working in small groups to design and implement a 3D interactive game similar to Doom, the landmark first-person shooter game by id Software in 1993. The game environment is a 3D maze and the goal of the game is to “disable” anything that moves in sight.

The pdf can be found here: http://www.vis.uky.edu/~r...Project%20Description.pdf

Quote
CS335 Final Project Description
In this final projection, you will be working in small groups to design and implement a 3D interactive game similar to Doom, the landmark first-person shooter game by id Software in 1993. The game environment is a 3D maze and the goal of the game is to “disable” anything that moves in sight. It is highly recommended that you get a copy of the red book -- http://www.opengl.org/documentation/red_book/ . Or at least, book-mark this web site http://www.glprogramming.com/red/ which contains an old copy of this book in HTML format.
Preliminary
All the examples in the red book are written in C with structured programming. While the translation from OpenGL calls in C and OpenGL calls in Java is trivial, these examples all use GLUT for window management and user interaction. Luckily, GLUT is a minimalist interface for window management. Similar to GLEventListener, GLUT is also designed to use callback-function. Below is the entire program to draw one triangle – similar to the first JOGL example presented in class
The first six lines in the main function create a window at position (100, 100) with width 320 and height 320 and a title "3D Tech- GLUT Tutorial". The next call, glutDisplayFunc registers a draw callback function called renderScene, which is defined in the beginning. The last call, glutMainLoop, is an infinite loop (yes, this program won’t terminate as it is) in which different callback functions, if
#include <GL/glut.h> void renderScene(void) { glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_TRIANGLES); glVertex3f(-0.5,-0.5,0.0); glVertex3f(0.5,0.0,0.0); glVertex3f(0.0,0.5,0.0); glEnd(); glFlush(); } void main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DEPTH|GLUT_SINGLE|GLUT_RGBA); glutInitWindowPosition(100,100); glutInitWindowSize(320,320); glutCreateWindow("3D Tech- GLUT Tutorial"); glutDisplayFunc(renderScene); glutMainLoop(); }
registered, will be called at proper time. In this particular case, only the display function – renderScene—will be called when the window needs update (refresh). In other words, renderScene is the equivalent of the display in GLEventListener in Java. For the understanding of the sample code, only a handful of other functions need be introduced. They are:
Function Name
Function
Java Equivalent
void glutReshapeFunc(void (*func)(int width, int height))
Register a callback function when the window size changes
GLEventListener::reshape
void glutKeyboardFunc(void (*func) (unsigned char key, int x, int y));
Register a callback function for keyboard strokes
KeyListener
void glutMouseFunc(void (*func)(int button, int state, int x, int y));
Register a callback function for mouse clicks.
MouseListener
void glutIdleFunc(void (*func)(void));
Register a callback function whenever the program is idle, often used for animiation
(not really, but you can set up a timer to do this)
A more in-depth tutorial about GLUT can be found here http://www.lighthouse3d.com/opengl/glut/
Minimum Requirement
Each player in the game is represented an avatar. Each avatar should be animated to have walk/running motion. One avatar is controlled by the user via keyboard. Your game should automatically control all the remaining avatars. This computer-controlled avatar should have some intelligence to look for the human-controlled avatar. You should provide at least two types of different avatars with different intelligence and running speed. One is equipped with a laser gun, and the other is equipped with a rocket launcher. Ann avatar can disable an opponent by two weapons (switchable by the keyboard).
? A laser gun: This is a precision weapon; anything that is within its direct line of sight will be “disabled”. The time of flight is instant.
? A rocket launcher: This will launch a rocket propelled shock grenade (RPSG). It has a proximity fuse; anything with a certain range can trigger its explosion. It is relatively slow moving, so animation of its flight is needed.
To make the game simpler, there is no counter of health. Disability is immediate once hit. Disability is represented as a freeze and the frozen avatar disappears after three second. You game should support two modes of viewing, switchable by a keyboard stroke.
1. Bird-eye: it shows the overall game level, you can change the viewpoint by the mouse. Left-button drag: rotation (similar to the interaction you have implemented in the third homework); Right-button drag: zoom in and out.
2. First-person perspective. That’s the similar view for Doom.
Your game should keep track of the number of enemies disabled by the human player. Computer-controlled avatar will not attach each other. The game can end when time-out, or a pre-defined number of “disabled” is reached, or the human player selects to quit.
Design Guideline
This project should be carried out by a group of three people. One is the game designer, one is the AI designer, and the other is the avatar/item designer.
Game Design
Game designer designs the overall framework of the game, including game layout design, visual rendering and interaction. He/she will develop the overall logic of the game, which should follow the following outlines.
It is recommended to use an array to store the game layout. A sample maze code can be found here http://www.opengl.org/res...ode/samples/more_samples/ (search for Maze). Note that it uses quadstrips to draw the wall more efficiently, you can choose to use other basic structures such as cubes. Update AIUpadate AvatarDrawInitlization
•Setup JOGL
•Load model/texturesShutdown
•Clean up JOGL
•QuitUser input
•Keyboard
•mouse
The drawing of avatars is implemented by the game designer. The animation of the avatar can be consulted from this code http://www.opengl.org/res...examples/demos/demos.html (scroll down to the end of the page) . While the data structure is based on a 2D array, the walking of the avatar should be continuous in four directions (up/down/left/right), do not jump from one grid to another. In other words, it should take multiple steps to move from one grid cell to another.
AI Design
AI designer is responsible to update the status of computer-controlled avatars. There are two levels of avatar intelligence. The first is just to walk randomly in the game layout, and if the human-controlled avatar is within its field of view, chase it and start firing within a certain range. In order to walk in the
maze, a recursive search algorithm can be used. The second of level of intelligence is to be aware the location of the human-controlled avatar and automatically navigate through the maze to chase it. Both should be implemented and the user can select the difficulty. AI designer is also responsible for the weapon system. He/she will develop code to animate the weapon once fired, in particular the RPSG’s trajectory using the PC’s real-time clock. He/she will also develop code to determine a shot is a hit or a miss.
Avatar Design
Avatar designer develops the appearance of the avatars and the necessary code to load the models from computer. In particular avatar design will develop a GUI to change the texture of a 3D model, in particular the avatar’s face. This texturing tool can be a stand-alone problem with a possible user interface shown below. The left side shows the 3D model, while the right side shows the texture image. The goal is to assign every vertex in the 3D model to a 2D texture coordinate on the 2D image. The user can select via the mouse a point in 3D and click on the 2D image to indicate its corresponding location. The pair of green dots shows an example. Every vertex in the 3D model must have a corresponding 2D texture coordinate. Since you do have to do this manually, work with models with a low vertex counter.
goMaze (Layout, currentXY, directionIndex) { // input // layout: the maze layout // currentXY: the current location // directionIndex: allow four directions, up/down/left/right // figure out the delta step given the current index of direction [dx,dy] = direction[directionIndex]; If (hit(Layout, currentXY +[dx,dy])) { // hit is a function to test if the input location hits a wall. // if dead-end, change direction directinIndex = (directIndex+1)%4; } else { // if not dead end, move in that direction currentXY = currentXY +[dx,dy]; } // recursively go to the next station. goMaze(Layout, currentXY, directionIndex); }
The user can load a 3D model and save the correspondences to a text file. The use of the standard OBJ file format is recommended but not required (a brief introduction about this format can be found here http://www.eg-models.de/formats/Format_Obj.html ). Java provides a standard object file loader http://java3d.j3d.org/uti...ties/loaders/obj/sun.html. The nice thing about using the obj file format is that there are some good free models in OBJ file format. For example, http://www.altairmodels.com/Free-3D.php .
In order to facilitate picking, you could use the selection function provided in OpenGL. Check http://www.glprogramming.com/red/chapter13.html for more details.
Sound
Your game should be able to play various sound clips as necessary. Thanks to Java, sound playback is extremely easy. Check chapter 18 (multimedia) of your java text book. (Your chapter number may be different if you are using an edition other than the fourth)
Be collaborative
While this project is dived into three relatively independent pieces, this division is just a suggestion; you should feel free to rearrange the tasks. Be collaborative, you and your group members are all on the same boat. If the boat has a hole, everyone will sink.
Extra credit
You can implement any of these for extra credits. Partial credit will be given if a partial implementation is finished.
1. (15 pts) More animation effects, such as door open and close, explosion (which can be rendered as a particle system, a C example is show here http://www.student.nada.k...L/examples/explosion.html
2. (15 pts) Live camera input. This extra task requires a web camera. Your avatar can be texture-mapped with a live image captured from the web camera (your face, for example). Sample code to capture the camera input and apply a per-pixel change is provided here. In order to compile and run this sample code, you need to download the Java Media Framework http://java.sun.com/javas...a/jmf/2.1.1/download.html. If you encounter an error while installing, click on “ignore”. This SDK seems to be fairly old (but still usable). In order to perform texture update, you need to use the glTexSubImage2D function. Consult the red book for more information (http://www.glprogramming.com/red/chapter09.html, look for “replacing all or part of a texture image”).
3. (20 pts) Network capability to play head-to-head. For simplicity, no computer-controlled avatar is necessary in this mode of operation. That is, only two players connected via the network, each is controlled by a real person. In Java, network connection is easy to implement. Basically, you use a few function calls to establish to a connection between two client programs. Once the connection is established, the network connection can be used as an input or output stream that you can read/write data to, similar to what you can do with local files. In order to implement this network capability, the two clients basically only need to exchange the avatar state via the network. That should include the avatar’s location, orientation. If one avatar fires a weapon, send the event of weapon firing and let one program decides if that weapon is a kill or not. This will make sure that the state of the players are (almost) consistent. For your reference, a networked Tic-Tac-Toe game is presented in chapter 18 of the text book. An even simpler sample program (less than 200 lines) can be found online at here http://www.dr-mikes-maths.com/tictactoe.html.
Submission and Grading
Each group will have a five-minute presentation on May 7th (the scheduled final time). A presentation template will be provided later. Each one of you is required to submit your final project package to the CS online system by May 7th midnight. The submission should include the source code (with project settings if possible), a simple user manual, and a simple design documentation explaining the overall code structure. While the above files should be the same for members in the same group, each member of the group is asked to write the individual contributions of everyone in the group and give each of the other two a grade between 0 and 200 -- assuming you will give yourself a grade of 100. While the overall theme should be collaborative to finish this group project, this is designed to prevent someone from taking a free ride all the way through. When you give other a rating, keep in mind that it should reflect the background/preparation of others. If you have used java efficiently before this class, it is unfair to assume others will have the same efficiently. Be courteous and be fair. Name this file “report.txt” and include it in your submission.
Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2593
Referrals: 13

WWW Awards
« Reply #1 on: June 10, 2009, 04:03:51 PM »

I would reckon it would be an awesome experience to make a Java doom game with a team of developers, designers, and writers but no one seems to be interested?  nopompom
Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
Pages: [1]   Go Up
  Print  
 
Jump to:  

Your Ad Here