Solved

UNIT MANIPULATION IN 3D GAME LIKE STARCRAFT

Posted on 2003-11-20
5
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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…

690 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