.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   OT - Kind of (http://forum.shrapnelgames.com/showthread.php?t=4684)

chewy027 November 30th, 2001 06:16 AM

Re: OT - Kind of
 
well i guess i'll have to get started on the research and development part of it http://forum.shrapnelgames.com/images/icons/icon7.gif . Figuring out all the little details.

One question to Will, could you clarify a little bit for me about "classes". I followed everything fine just that word didn't fit to me. Sorry.

dogscoff November 30th, 2001 04:02 PM

Re: OT - Kind of
 
Classes and OO design:

As I understand it (I've studied programming but never really done any) OO design is diferent from regular programming design because:

In regular programs, you set up a system with a bunch of rules to govern how the things within in that system behave. Then you drop a load of itms into that system and the system looks after them. For example, you might make a menu screen, and the menu checks constantly to see whether one of it's buttons has been clicked and what to do if it has.

In object oriented (w00p!) design you set up a bunch of classes, with their own rules about how they interact with on another and the system they live in. Those classes then spawn objects (A class is essentially just a blueprint for an object) into the system, and you just sit back and watch them interact with one another like a little ecosystem. In the menu example, each button would be an object. (probably all from the same class) Each button would watch out for it's own mouse clicks, and store it's own information about what to do when it is pressed.

Of course it's never as easy as I make it sound...

Anyway, the advantage is that an object within a system is by definition smaller and less complex than the system itself. Therefore, it's easier to capture and define all the possible permutations and interactions for that object than for a system. This means you can break your code down into (relatively) simple and (utterly)self containd parts.

Furthermore, because objects are treated as self contained and completely independent of outside intererence, it's easy to add, remove, replace and alter them to/ from/ within your program.
As long as its interfaces remain unchanged, you can just pull it out, make whatever changes you need to within it and then drop it back in without fear of generating some seemingly random error on the other side of your software.

Or something.

*Dogscoff skulks back to his pint.

chewy027 November 30th, 2001 06:07 PM

Re: OT - Kind of
 
thanks for the clarification guys really helped.

Anyone else with some words of wisdom http://forum.shrapnelgames.com/images/icons/icon7.gif

Spyder November 30th, 2001 06:22 PM

Re: OT - Kind of
 
KISS (Keep It Simple Stupid)

Make sure that the current section of code WORKS. If its slick and doesn't work, it doesn't do any good. In the words of my Assembly Language Professor (Yep, was a long time ago http://forum.shrapnelgames.com/images/icons/icon7.gif ), "When all else fails, use Brute Force." Once you have a section of working code, then you can 'slick'en it up.

Avoid the 4 P's (Piss Poor Prior Planning).

Everthing is ultimately dependent upon your preparation. Decide early on what you want & how you want it, and, don't give in to Feature Creep. Maintain your objective, add features later.

One other thought....Graphics is window dressing, mechanics will make or break the game. Make sure your (game) mechanics are solid, and the graphics can be added/prettied up later. This relates directly to the 4 P's.

[ 30 November 2001: Message edited by: Spyder ]</p>

Alpha Kodiak November 30th, 2001 06:25 PM

Re: OT - Kind of
 
Without trying to give a detailed lesson in object oriented design and programming (OOD/OOP), let me put it this way: an object in a program should model an object in the real world. LemmyM gave a good example with a class called "Ship". All ships have some basic things in common, so having a class called ship enforces that all types of ships have those things in common.

This leads to one of the most powerful aspects of OO: inheritance. Let's talk about a beagle. A beagle is a dog, which is a mammal, which is an animal, which is a living thing. So, we can define a beagle by starting from living things. A living thing has certain properties which we can assign to class cLivingThing. Class cAnimal derives from cLivingThing (which gives it all of the properties of cLivingThing). We then add to cAnimal the characteristics that distinguish an animal from other living things (plants, etc.) Class cMammal derives from cAnimal and adds the characteristics of a mammal (i.e. mother feeds baby milk). Class cDog derives from cMammal and finally cBeagle derives from cDog. Now, if we want to define a German sheppard, we only have to derive from cDog, everything else is already set up.

One of the big benefits to this is that what can be shared, is. For instance, if there is a bug in a routine that defines part of cLivingThing, we only have to fix it in cLivingThing, not in all of the things that are derived from cLivingThing. They all pick up the fix for free.

At any rate, that is a highly simplified account of what OO is. There is much more involved, but hopefully that gives you some idea of what you can do with it.

chewy027 November 30th, 2001 08:54 PM

Re: OT - Kind of
 
all that makes great sense thanks for the input. Keep it coming.

Lemmy December 1st, 2001 02:12 AM

Re: OT - Kind of
 
classes are at the base of object oriented design.
every object in the program is a member of a class. Classes are made of attributes and methods. For example a class Ship could have attributes :
size
movement points
and a method:
move

then every ship in the program must have a size and a number movement points.

Before you start designing maybe you should first read a bit about OO design, it's really usefull to break a program down to little understandable bits of information.

Lemmy December 1st, 2001 02:22 AM

Re: OT - Kind of
 
<blockquote><font size="1" face="Verdana, Arial">quote:</font><hr>Originally posted by Will:
Even if the game itself doesn't make it to something close to a working computer game, you will learn a lot of skills that are very valuable in the world today. And you just might come up with a better game idea, and since you've already gone through the process once, the second time around will be much easier<hr></blockquote>

that is so true, in my short(3 years) programming career i tried to make 3 games, the first one was in Jave but just too complex, the second one was in C++, i did this with a friend of mine who is really good at C++ and graphical stuff, but that was also too complex and once we had a design we estimated it would tak 2-3 years to make, so we gave that one up.
And now i'm working on my 3rd game, trying to follow every Object Oriented rule i learned at school, and it's going quite well, i haven't programmed on it for about a month now, but not because it's too difficult or complex, but a lack of time(school/civ3). It's turn-based and while i program it i learn lot's of new stuff, like the mechanism to end a turn and start the next players turn, it sounds simple, but it took me a while to make it solid and dependable( that is bug-free http://forum.shrapnelgames.com/images/icons/icon7.gif ). Without the experience from my first two "games", i never would have gotten so far as i am now.
hmmm talking about it makes me wanna go home and continue working on it.

[ 30 November 2001: Message edited by: LemmyM ]</p>

Will December 1st, 2001 04:06 AM

Re: OT - Kind of
 
Well, all there really is to do now is find a way to learn whichever language you're going to use. I would recommend either signing up for a class (as in a classroom, with teacher and students, not object blueprint http://forum.shrapnelgames.com/images/icons/icon7.gif ), or tracking down someone who can tutor you. Really try for those two, since the other alternative is getting a book that teaches you, and that is a pain. The book doesn't respond to all your questions, when the book does respond to questions, it never seems to be when you ask it, and the book doesn't keep you on-task.

And then, you start learning. "Hello World!" http://forum.shrapnelgames.com/images/icons/icon7.gif

--edit: forgot to uncheck "Show Signature".

[ 01 December 2001: Message edited by: Will ]</p>

chewy027 December 1st, 2001 04:11 AM

Re: OT - Kind of
 
well actually i will be taking a programming class next semester here at Princeton. I know basic stuff but want to learn more. Maybe someday i'll be able to follow through with a game. But until then i've got a lot of ideas i should organize and refine.


All times are GMT -4. The time now is 01:15 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.