Click here to Skip to main content
15,883,910 members
Articles / Programming Languages / JScript .NET

Star Trek "Galactic Conquest" Game Contest Submission (Java)

Rate me:
Please Sign up or sign in to vote.
4.27/5 (6 votes)
6 Aug 2008CPOL3 min read 53.2K   951   25  
Star Trek "Galactic Conquest" Game Contest Submission (Java)
-----------------------------------------------------------------------------------------------------
PROJECT TITLE: Galactic Conquest
PURPOSE OF PROJECT: Game Simulation
VERSION or DATE: 1.0.0
HOW TO START THIS PROJECT: Main.
AUTHOR: Robert Bettinelli
USER INSTRUCTIONS: See Welcome.txt & Help.txt
-----------------------------------------------------------------------------------------------------
Robert Bettinelli rtron1@io-serv.com                                                          (c)2008
-----------------------------------------------------------------------------------------------------
Notes : 
            1)  This Galaxy Has its X&Y Inverted. This is  by design. 
            2)  Backdoor / God Mode Implemented & left in intentionally. 
            3)  Planets are smaller than their actual size, do not adjust your monitor.
            4)  Fully Tested and runs under BlueJ and Eclipse. (0 Errors or Warnings)
            5)  Required Random Class has been implemented into Util Class. 
            
-----------------------------------------------------------------------------------------------------
1-22-08     Created Sector & Quadrant Framework
            Created Player Concepts.
            Created ReadFile 
            Utalized Class Project Zuul Parser & Command Framework
            (Zuul usage heavly modified and used as open source start)
1-24-08     Galaxy Conquest concept. Create Galaxy
1-25-08     Implemented String In Out, Randomizer, and Entry Mathods. 
1-29-08     Started Move Class for Movements 
1-30-08     Completed Move Class for Energy Computations
            Cleaned move, created Nuke
1-31-08     Added day removal.
            Screen display To Screen Class. 
            Add Comments and Header Info to majority of methods & classes
2-01-08     Initiate Fire Method
            Add Method for Handing Energy / Execture Command Confirm.
2-01-08     Rewrite of Command Entry System. (Zuul Gone - it has been assimilated). 
2-03-08     Moved all Misc Functions to Util Class. 
2-04-08     Created Enemy Fire and Move Functions.
2-05-08     Created SRS system. (Short Range Sensor)
2-06-08     Created Damage Control System Class. (non-active)
2-08-08     Utalized Sound class from web - Reworked for String Filename . 
            Creation of Docked Function. 
2-08-08     Fix wav files for 44Hz WAV otherwise no sound.
            Fine tune Docking procedure for sheilds lower & Power Replenishment
            Implement Audio On/Off Option.
2-10-08     1st write of Window Based Interface. 
2-11-08     LRS modified to show 1 sector around. 
2-12-08     Galaxy size adjusted to 6x6 (0-5)(0-5) (Evaluate Difficulty Further l8r)
            Quadrant & Sector Location String Method added. 
            LRS - Denote Ship Location. 
2-17-08     ReWrite of GUI Code for all input/Output through Util Class. 
            ReWrite of Util for display to specific areas of GUI. 
            Implementation of TURN function for status screen. 
            Think about concept for split text and graphic render of Quadrant. 
            Diable sound functions during CORE rewrite. 
2-18-08     Removal of all Java Terminal Accesss.
            Conversion to Command and Button Control. 
            Teaks and Bugs search & repair. 
            Documentation addition.
2-20-08     Redesign of GUI Layout.
            Addition of New Panel (Potential Graphical Quad Layout)
2-22-08     Framework of Graphical Quad. 
2-28-08     Graphics on screen Component Complete. 
3-01-08     Problem with imitermit graphics display
            correct by building in file load wait
            Optimize Graphics display with Graphics Image Array.
            Add Documentation for QuadDraw
            Add Documentation for DisplayData
3-02-08     Added 6 Different Planet Types
            Adjusted Star Graphic.
            Added Some sound Components in.
3-03-08     Try to balance difficulty levels. 
            Realignment of xy on screen display and graphic.
3-04-08     Convert Menu From Dim Array to ArrayList. of Command Class.
            Re-Organize Top Level - Adjust Documentation of Init Point.
            Damage Control also to utalize ArrayList Functionality.
            Start Damage Control Implementation. 
3-06-08     Debug Damage Control & Clean Graphicas. 
            Re-organize Game BlueJ Display Map.
            Game Balance Testing
            Debug Planet Placement and graphics. 
            Win Condition Test. 
            Complete Damage Control
            Reset LRS to Display X & Y #s for Easy reading. 
            Further Documentation
            Test Play.
            Corrected Planet 4 Missing Bug. Adjusted # of Planets in Galaxy.
            LRS Now Clearer.
3-08-08     Damage Control Test Ok
            Added WormHole Access.
            Remove access to Controls in Damage Status
3-10-08     Added Worm Hole & Sun Sling Shot. 
            Added WH & Sun Graphics. 
            Sound Fx Moved to Fx Folder
            Graphics Moved to Images Folder 
3-15-08     Grpahical Shots Added. 
            Added More Audio Que. 
3-17-08     Added Planet Reward Systems. ("Away mission")
            Added More Audio Sounds. 
            BackDoor God System Implemented - This is for Development and Fun.
3-18-08     Added Enemy Destroyed Graphic.
            Improved Away Mission functionality 
            Improved Game Balance. 
            rewrite of graphic shot system for directionality loop. 
            Addition of Second  Enemy Type Ship.
3-19-08     Adjusted brightness on Battleship JPG.
            Damage Control (menu Display) Bug found - debug required. 
            Adjusted Shot from battleship to be larger than fighter.
3-20-08     Damage Control to accululate damage.
3-23-08     Damage Control Bugg Found.
            Menu to Show ITEMS OFFLINE.
            Outer Game Driver Added for Simplicity only. 
            God Mode Menu adjusted.
            Corrected Planet Miscount.
3-26-08     Added Long Range Sensor Probe.
            Add probe reward to planet Search.
3-31-08     Scoring (Framework Idea to be added)
            Point Solution :    2 / Any Move Function.
                                2 / Turn
                                5 / Fighter Destroy
                                7 / Battleship
                                1 / During Docked
4-01-08     Score System Complete.     
4-04-08     Documentation. 
4-09-08     Scroll Toggle Bug Found - Rewrite of toStr method. 
            Quadrant test function added & Tested. 
            Projectile Class Added (Probe & Nuke Handled Identically)
                
            
            
----------------------------------------------------------------------------------------------------- 
Application Homage, Design  and Theory - Galactic Conquest io-serv                            (c)2008 
-----------------------------------------------------------------------------------------------------
Web Referance : http://www3.sympatico.ca/maury/games/space/star_trek.html
-----------------------------------------------------------------------------------------------------
Opening Statement : This application I based mostly on my own memories of a game that I played in
days long gone by.  I used to connect to something called "Compu-serve" on my Commodore-Vic 20 using
a 300 baud modem and played online Star-Trek. Neat simple game. Round two with this is when I got
a Commodore 64 and spend 3 days typing in the code into the Vic-Basic O/S only to have the computer
crash on running it and loosing all my work. That was a tad upsetting. But I learned alot.  So now,
in Java class I base this application on those designs with my own thinking on how they may have 
achived what they did to assemble their game into a cool application. I do the same but add my 
own touch.

On a quick search of the net I find the above shown link where there is many iterations of what I 
used to play. You will notice that although I based my design loosly on what was, In the following
usage manual you will see the additions the thinking and the handling of the programming concepts
to put this app together.  
-----------------------------------------------------------------------------------------------------
Basic Game Play & Components.
-----------------------------------------------------------------------------------------------------
This game was built from the ground up as shown on the above revision listing. This was 1st designed 
using the Java Terminal, although it had some draw backs. 1st thing is that when feeding output to
the terminal you cant determine if the class that is accessing it is 1st generation or another
instance of that class (which means you could acidently have 300 of the same object sending info
to the terminal), when crossing over to the GUI i did in fact find  that this was occuring (part
of the learning curve i guess). Anyway, once the basic foundation was created I switched to a gui
display that was a bunch of text windows.  From that I switched the main display to Full Graphics.
Once the Full Graphics display was working, I added and expanded on the graphics to allow a
more favourful game play experience. And here is the basics of the game :

THE GALAXY
The Galaxy is randomly created Quadrant by Quadrant. [6][6]
Once a Quadrant is created it is populated by sectors. [6][6]
Sectors Randomly are populated with :
Ship                - Your Ship.
Enemy Fighters      - Lighter Less armour and less of a punch
Enemy Battleships   - Heavy armour & heavy hit 
Stars               - Take up space. (For looks only)
Suns                - Travel into these and you automatically sling shot around it 
                      (Temporal displacement) gain 3 day units.
Wormholes           - Travel randomly from the wormhole to another spot in the Galaxy (Doesnt cost you a turn).
Space Stations      - If adjacent then you automatically DOCK and gain Energy replacemnt evey turn.
6 Types of planets. - You can scavage planets for random items or nothing. (Uses 1 turn). 

(Please note : Most graphics are ICON files converted to jpg or gif files. Graphics were take from Fan sites from multiple locations)
(              Sound files were also taken from fan sites and multiple locations converted to 44KB/s for proper playback)

THE SCREEN
Screen is seperated into Eight individule sections. 
Top Most - The Captain, ship name, Turn etc.
Main Left - Main Graphic Quadrand Graphic Area. 
Main Top Right - Status Display Area - Shows Current Player / Ship Stats
Main Bottom Right - Notice Scoller - Shows all actions, notices, information and events, pay attention to all info here.
Bottom Menu Listing - Showns menu choices.
Bottom Prompt - Informs you of what your choices are.
Command Entry Point - Enter all command codes / selections here. 
Execute Command Button - Once an entry has been made this either locks in or executes the command.
(Note : X & Y has been inverted see revision notes)


SEQUENCE
Basic intro file is displayed.
System Initalization
Captain & Ship Name Entry
Difficulty Level Set
Galaxy Generated & Items Placed. 
Game over ?
    All screens are generated
    Menu is displayed
    Application waits for game command.
    Execute command.
    Enemy Retaliation
    Cleanup & Evaluate Win or Die
loop
End of Game.

THE COMMANDS
[j]-HyperNav    - Jump to Quadrant & Sector (hyer space jump)
                  Provide Quadrant X & Y as well as Sector X & Y
                  Cost of jump = (((deltaQuad * 200)+(deltaSect * 10)) * addPercent);
                  adder Percent is based on if the Sheild s up.
                  200 for each quadrant, 10 for each sector
[t]-Thruster    - Inter Quadrant move, 10 for each sector.
                  Provide Sector X & Y 
[f]-Fire        - Fire at enemy Max 200 Energy Units
                  Provide Sector X & Y
                  Hit is based on 10% Chance Miss- Then 75% will hit, 25% is random hit
[x]-Nuke        - Nuke Quadrant 
                  Requires Mass amount of energy (400 Energy units and increments
                  200 units on every new launch)
[s]-Sheild      - Sheild Settings
                  (Provides Menu) - Set Required Energy amount divert to sheids.
[r]-SRS         - Short Range Sensor
                  Displays summary of item count in Quadrant.
[l]-LRS         - Long Range Sensor
                  Does 1 Quadrant adjacent scan of current location and displays Galaxy Scan Info.
[a]-LR Probe    - Long Range Satilite Probe
                  Provide Quadrant X & Y For Sat Launch
                  Does 1 Quadrant adjacent scan of Quadrant Location and adds info to LRS info.
[p]-Planet!     - Planet Salvage - Random Planet Salvage. (only available when planet is in Quadrant)
[d]-Damage      - Damage Display
                  Shows Critical systems Damage list (if Damaged)
[o]-Options     - Options Menu
                  Displays Menu for Scolling option & Audio Option.
[h]-Help        - Basic Help info. 
[q]-Quit        - Quit The Game. 

THE ENEMY
Fight of Flight! 
They Can scare - For each turn, they will move or shoot. 
                 If they move their sheild get improved.
                 If they shoot they will hit you with a percentage of their yeild. 
                 If your sheild is up the energy will be directly removed from the sheilds.
                 As well there is a chance for systems damage.
                 If you sheild is down it will impact on your hull.

CLEAN UP & WIN or DIE EVALUATION
Conditions for end of Game are as follows :

Win         1) All enemies destroyed within the time units allowed.

Loose       1) Out of Energy
            2) Destroyed by Hull Damage Reaching 0.
            3) Out of Day units. 
            
Simulation End - a Quit is an end Simulation  condition  which I did not make a Win or Loose. 

NEAT STUFF TO WATCH FOR
1) Sound.      - Yes there is sound, adds a whole new dimension to this application.
2) LRS         - Long Range Scan utalized a Graphics Text Paint Mode to draw directly to the graphics screen.
3) Shooting!   - Graphics routine built to make shooting look neat.
4) Destroyed   - Once a fighter or battleship is destroyed the icons are changed to Destroyed version of itself.
5) Development - God Mode - use "whatcanido" command. Please note this will show god mode development tools.
                 (These commands will cause Ship Systems to annouce bad command although they will process.) 


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer Nottawasaga Valley Conservation Authority
Canada Canada
I have background in programming(many languages), web design, hardware and software. Currently I hold a lead database programming position for the Nottawasaga Valley Conservation Authority... Programming in vb.net and java comes 2nd nature to me and of course I do this for fun. I also used to design in cobol and pascal and run a BBS(anyone remember what this was?). Anyways, drop me a line maybe I can help you.

Comments and Discussions