?
Solved

UNIT MANIPULATION IN 3D GAME LIKE STARCRAFT

Posted on 2003-11-20
5
Medium Priority
?
228 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 200 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Introduction to Processes

719 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