Jump to content
  • Advertisement
Sign in to follow this  
Shamino

The Object Oriented Game Setup

This topic is 4872 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, here goes, My class hierarchy, as of now: PhysicsEngine, TextureEngine, RenderEngine, SoundEngine -> //////////////Communicates with above classes////////////////// Mobiles->PlayerMobile, Ships, Planets, Asteroids, Comets ////////////////////////////////////////////////////////// /////////////////Mobile Derivations//////////////////////////// Ships->Starfighter, Stardefender, Spyship, Worker, Tradeship, Battlecruiser, etc... Planets->Ice, Lava, Green, Aquatic, Desolate, Desert Asteroids->Mineral 1, Mineral 2, Mineral 3, Mineral 4, Mineral 5, etc... ///////////////////////////////////////////////////////////// I'm setting up on a Client and Server basis, each child of Mobiles is a client to the 4 engine classes said at the top, the clients communicate with these 4 "master" classes to help determine what they do, how they act, how they are drawn, etc... Each client holds some simple information, It gets a texture ID from TextureEngine, it gets a milkshape model which is declared in the client itself, it sends this information to the render engine, render engine applies the proper texture ID based upon what was given from the texture engine, and ultimately, draws it on the screen. Each client also holds sound information, to determine what sounds are made in what occasions, This is what I got so far, like 20 empty classes, without content, only ideas so far... Anyone to be a judge?

Share this post


Link to post
Share on other sites
Advertisement
Your game models seem to sound like entities. In which case I'd make a template class that encapsulates every possible type of unit. I don't quite understand how it all works. Although writing a slightly different model for moving objects, ship objects, planet objects, asteroid objects sounds. It sounds bloated a little xP

You need to define what exactly each entity will do before making a class that encapsulates all the different types of objects in your game.

Share this post


Link to post
Share on other sites
Quote:
Original post by Shamino
I could define what each individual class does in psuedo-code if thats what you mean?
I'm saying in order to define a data model that works with all the types of entities you need to find out what sorta actions each entity has. (Can you mine asteroids? What sorta game is this? What sorta animations are you making? What is the view in the game? how are ticks done? turn based? rts-based?)

Share this post


Link to post
Share on other sites
Oh, i already have all that information figured out, i just didn't post it...


The game is a 3d Space Based Flightsim/RTS.

You start with your home planet (can be translated into a command center compared with other games), you start with a space station, which can build ships... Ultimately you can upgrade your space station to build better ships, cuz in the year 4000, you don't really launch things from planets anymore, rockets? pshh!

Asteroids can be mined for various rare minerals, otherwise most of your resources come from your planets...

You basically build up your home planet, conquer and explore the solar system, possibly even galaxy, for other planets, but beware, opposition will appear at the most inopportune times! And your enemies are vast and numerous!

Key Features:

Full 3d realistically large maps, normal space travel would take you hours to cross a solar system, thus why we have warp speed!

The ability to dogfight with the enemy alongside your PC comrades, possibly even network play for dual commanders!

Build your planet up, conquer others, kill the baddies in the process, mine for minerals, research new technologies, and more!

.....

Thats all i got so far.. :d

Share this post


Link to post
Share on other sites
You probably need to write a game design document that covers how the game works, maybe concept sketches before you can truely start writing out code that fits into the game. I'm not really a person to ask about that sorta stuff though :P

Share this post


Link to post
Share on other sites
Well, I havn't written any code yet, Just looking at how the game will work in an object oriented perspective, I do know what I want the final product to look like, and how it will be gameplay wise, for the most part..

Share this post


Link to post
Share on other sites
Quote:
Original post by Shamino
Well, I havn't written any code yet, Just looking at how the game will work in an object oriented perspective, I do know what I want the final product to look like, and how it will be gameplay wise, for the most part..
Well.. you probably need to write alot of tools first :P

Map editor, unit editor, things like that.. ? It takes alot of work, make sure you know how to do those sorta things. (May be very difficult for someone new to game programming.)

Share this post


Link to post
Share on other sites
hmm, never really thought about a map editor, would be useful... I was thinking to make the map a bit more seamless than you might think... like, your mission will be inside of the solar system....

but the whole universe is there to play with, yknow?

When you're making a custom game (like a skirmish or something), you are given this huge starmap, with hundreds of stars on it, each one has a solar system, you click on the map which star you want to work around.....

Unit editor... hmm, I don't plan on commercializing the game, it will be my first big game....

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
To me it sounds about right the way you are trying to do it (but I am no expert). I think 20 classes you said is a little too much, I dont think your using polymorphism/inheritance.

Example:

Physics, Texture, Render, Sound = 4 classes

Player, Ships, Planets, ASteroids, Comets = 5 classes

All of the following inherit from Ships -> Starfighter, defender, spy, worker, trade, battlecruiser = 6 classes

And for Asteroids you dont need seperate classes for each type of asteroid. The same for players, planets, and comets since they are different only by the value of the variables within the class (example color, mineral type, size, etc).


Adding that up it is only 15 classes.

I really am not sure how else you would object orient design what you want. I dont think templates have anything to do with this (as another poster recommended) so unless they can explain their logic I wouldnt go with templates (but again i am no expert).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!