• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# RTS-Game data

## Recommended Posts

PyroFlo    122
Yeah....!
Sorry
'cause I'm a absolute beginner who thinks that even a "Hello World" in Visual C++ is hard 2 code (((((((((

Du musst mir CPP mal etwas zeigen Ich blicks auf keinem Auge ((

WUÄÄÄÄÄHH!!! Schluchz! Snüff!

------------------
----------------------
CU
PyroFlo the Rookie :)

##### Share on other sites
NuFAN    122
-How many objects (buildings, units, wild animals, trees) does the program have to handle?

It depends on your design. I have about 40 different types of buildings and all in all about 120 different graphics (x4 for rotation) for them, so it's quite much. We only use few military stuff, so 10 units per race are enough. There are no wild animals, and the trees will be blitted. So it depends on you, you can use 500 different units if you want to, but it's senseless. A good mix in design is essential.

-What would be the best way to handle the Map? (Maybe 2 Layers - one for Water,Sand,Grass...

We use a 2d array with 3d-polys as the ground and the buildings and units are blitted above. So you need something like this :

code:
typedef struct SData{    int Ground[HEIGHT][WIDTH];    int Buildings[HEIGHT][WIDTH];    int Units[HEIGHT][WIDTH];    int Items[HEIGHT][WIDTH];    ...} SData;

We used this solution, because the tiles are really small and there will only be big units, so more than one unit per tile is no allowed. I guess you use 2D, so it's quite simple.

-What kind of Info is needed for the Units? (Type,Position,Status,Target,...)

It depends on you again. What kind of pathfinding do you use ? The things found there are needed, but some more information, for example the frame of the animation which is shown and into which direction, the object is rotated. There might be some more important information needed, but this depends on you again.

How do you get data of about 80 megs ? Getting about 5 megs is possible, this is much, but not more. You should try to keep all possible data in one array, for example the multiple layers. Create some constants for each possible ground tile and simply use an int using this way.

#define GRAS_1
#define GRAS_2
#define SEA_1
#define SEA_2
...

Then for example :

Data->Ground[i][j] = GRASS_1;
Data->Ground[i+1][j] = SEA_1;
Data->Ground[i][j+1] = SEA_2;
Data->Ground[i+1][j+1] = GRASS_2;

Creating some water over green grass is useless, so you can easily save memory using structures like this.

Wieso, C/C++ ist doch relativ leicht, einfach ein Buch kaufen und innerhalb kürzester Zeit ist man drin. Übrigens, bin auch "erst" 17.

CU

------------------
Skullpture Entertainment
#40842461

##### Share on other sites
Melo    122
Excuse PyroFlo. He's a Visual Basic Programmer
(He's going to write the Installer for my game and he's doing his
job very well)

The 80 MB - oops, sorry, that was a misstype

I tried it a second time and I think I'll make it now.
But I have still a question: How many buildings and units does
a good game handle? 1000? 2000?

Another problem is the pathfinding. I've heard about an algorithm
called A-Star, wich would be the best.

Here are some specs of my game (called MoonWars):

I don't use races. I have planned a big reschearch tree like in Ascendancy.
The player can select the cathegory during the game, but when one 'branch'
(like Hovercrafts, Mechs, Tanks,...) is selected, the player can't get the
other technologies. (That's quite similar to choosing a race)

I planned ca. 60 different Units.

The size of a normal Terrain Bitmap is 64x64. A normal sized Unit
(like a Tank) is filling out such a tile. For small units (Minigunners,etc.)
the tile is divided into 4 small ones.

I have a problem, because I don't have friends with good programming skills
(except PyroFlo), and so i think i can't finish my program for this
ARI Games software contest. The deadline is December 31.

thanks alot..

##### Share on other sites
NuFAN    122
Hi !

How many buildings and units does
a good game handle? 1000? 2000?

This depends on the game, if you wanna create something like C&C or something like SC3K or a mix between it. C&C has only about 20 buildings, I guess, and let's say 40 units (I don't know the exact number). So you have got 20 buildings which only have to be renderer from one viewpoint (the map can't be rotated in C&C) and 40 different units with many animation frames.

You can easily get 100 frames of animation per unit or even more, but normally rotating the unit into 16 directions is enough and some extra-animations have to be use (for example if a tank shots).

... and so i think i can't finish my program for this
ARI Games software contest ...

I'm sure you won't finish it till deadline, so better create a good game instead of some shit only because of the deadline. You won't even get it work with 5 programmers, because the time's too short. Keep relaxed and forget the deadline.

CU

------------------
Skullpture Entertainment
#40842461

##### Share on other sites
Melo    122
Sorry, but my question was the following:
When a new Unit is constructed, the program creates a structure containing the info of the unit. This struct is stored in an array. How big is the array?

for example:

struct _MoonWars_Object
{
// Type, position, etc.
} Objects[MAX_OBJECTS];

how big is MAX_OBJECTS?

##### Share on other sites
NuFAN    122
This depends only on you and how many units you use. For example, you save the data as an value which needs 4 bytes of memory and you create an 256 array, then you need

256*4

Bytes free memory. You'll have to save more things, so you could easily need a few megs of memory. If you have for example positionx, positiony, status and frame as needed data, then you'll need to have

256*4 + 256*4 + 256*4 + 256*4

bytes of free memory.

CU

------------------
Skullpture Entertainment
#40842461

##### Share on other sites
Melo    122
Hello to every1...

I am going to make a tile based RTS-Game and have already finished quite a lot of stuff
such as a GUI, Music system, Main Menu and a Credits-Scroller (very important
The next thing will be the Game for itself.

Here comes my Question: I'm not sure about the Data-Format.
-How many objects (buildings, units, wild animals, trees) does the program have to handle?
-What would be the best way to handle the Map? (Maybe 2 Layers - one for Water,Sand,Grass...
and the other one for Mountains,Rocks,everything with a status, that can't be changed
during the Game)
-What kind of Info is needed for the Units? (Type,Position,Status,Target,...)

I tried it one time, but i created a data struct with a size > 80Megs :-(
I'm rather young (17) and this is my first "real" game, so it would be great, if you cold
help me. (Tell me, if you'd like to know more details)

Thanx.

Andy