Solved

UNIT MANIPULATION IN 3D GAME LIKE STARCRAFT

Posted on 2003-11-20
5
216 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Specific format 21 196
C# code editing and collaboration 3 110
This code tracks birthdays 3 72
How to parse the string and split the sub directory names in asp.net 7 38
This is about my first experience with programming Arduino.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

813 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

11 Experts available now in Live!

Get 1:1 Help Now