Solved

UNIT MANIPULATION IN 3D GAME LIKE STARCRAFT

Posted on 2003-11-20
5
213 Views
Last Modified: 2013-12-04
Greetings!

I would like to deliver this question to all game coders.

I would like to ask about:

* How those unit like "marines" or "zealot" being process by the program?
* How are they being multiplied in the game?
* How is the game engine related to this kind of game?
0
Comment
Question by:oblivioncode
5 Comments
 
LVL 1

Accepted Solution

by:
aligma earned 50 total points
ID: 9792511
oblivioncode,

I can't give a definitive answer as to how these units are created, but I can tell you how I would do it...

All units have common propreties, such as health, attack damage, range, and movement speed.

I would create a base class which defined all of these properties and provided the basic unit interface.. an example of one method would be IsDead(), if IsDead returned true, then the unit would explode in the shower of blood or explode or whatever it is that unit does.

Then for each unit, for example marines, I would _inherit_ the properties of the base class, and add new properties and methods such as UseStimPack().

Inheritance is an object oriented concept which you can read about on many object oriented tutorials..
"inheritance - the process whereby a derived class inherits members from a base class. A derived class will also add its own members to those of the base class. "
-http://www.glenmccl.com/glos.htm#tag114

When I had created an individual unit, I would store it in a unit Vector. A vector is basically a list which you can store objects in. Then when I was, for example, checking the health of my units, I could just iterate through the vector and check each one's health individually.

I hope this helps.
0
 

Author Comment

by:oblivioncode
ID: 9796037
Thanks aligma,

Great help from you... what im afraid of is the congestion of the program.... im afraid of the infiniteloop.... but i guess that doesnt matter.. but is it ok to use that infinite loop... coz im totaly curious why it doesnt have any delay at all... but great help.. i really appreciate it.. anyone who had somethin else in mind that can help me through this problem..
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This is an explanation of a simple data model to help parse a JSON feed
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now