Terrain Data & Terrain Restrictions Data

User avatar
Alexandra
Posts: 21
Joined: Sun Jun 19, 2011 12:22 pm

Terrain Data & Terrain Restrictions Data

Postby Alexandra » Tue Jun 28, 2011 2:02 pm

Here are the files for the terrain data and terrain restriction Data
Attachments
Terrain Restriction Data.zip
(4.92 KiB) Downloaded 18 times
Terrain Data.zip
(4.86 KiB) Downloaded 16 times

User avatar
blejdaq
Posts: 46
Joined: Sat Jun 18, 2011 9:33 pm

Re: Terrain Data & Terrain Restrictions Data

Postby blejdaq » Wed Jun 29, 2011 12:48 am

These definitions are fine. Although i already have some info covered in my internal structures, some not.

TERRAIN_ID - yes, terrain_id is required
INT_NAME_LENGTH - lenghts for strings are never required, can be calculated from strings
INT_NAME - this is not required (one name is enough)
GAME_NAME_LENGTH - not required
GAME_NAME - yes, it's terrain_name
TERRAIN_GRAPHIC_ID - not required, the same as terrain_id
TERRAIN_SOUND_ID - later discussion
MINIMAP_COLOR - yes!
MINIMAP_SHADE_FRONT_COLOR - why this? and how this?
MINIMAP_SHADE_BACK_COLOR - -||-
TERRAIN_UNITS_AMOUNT - once again, cactus is not a UNIT :-) and terrain objects don't need to be tied to terrain type, they will be considered individual objects
TERRAIN_UNIT_ID - -||-
TERRAIN_UNIT_DENSITY_% - -||- but we can later discuss how these can be generated

User avatar
blejdaq
Posts: 46
Joined: Sat Jun 18, 2011 9:33 pm

Re: Terrain Data & Terrain Restrictions Data

Postby blejdaq » Wed Jun 29, 2011 12:53 am

To show you, how my terrain type definition looks like:

Code: Select all

terrain_id,
album_size,
weight,
blend_mode,
exclusive_blending,
name


so i need to add the terrain_sound and minimap_color

User avatar
blejdaq
Posts: 46
Joined: Sat Jun 18, 2011 9:33 pm

Re: Terrain Data & Terrain Restrictions Data

Postby blejdaq » Wed Jun 29, 2011 1:01 am

To the Terrain Restrictions Data:
I thinks this data can be attached to the terrain data.

RESTRICTION_ID - this will be the same as terrain_id
AMOUNT_OF_TERRAINS - what is this?
TERRAIN_ALLOW_ACCESS - yes
TERRAIN_ALLOW_BUILD - yes
TRAIL_GRAPHICS_AMOUNT
TRAIL_GRAPHIC_UNIT_ID
TRAIL_GRAPHIC_ID
- the last three must be reworked

User avatar
Alexandra
Posts: 21
Joined: Sun Jun 19, 2011 12:22 pm

Re: Terrain Data & Terrain Restrictions Data

Postby Alexandra » Wed Jun 29, 2011 10:09 am

Maybe my explanation of the terrain restrictions were not 100% complete, sorry :)

Terrain restrictions theirselves can absolutely not be linked directly to a terrain because terrain restrictions have different properties for the same terrain, linking the restriction data to the terrain itself would lead to 1 terrain restriction
Tho you can link the graphics to the terrain id if you specify the graphic id for each assigned unit ID

I will explain the terrain structure purpose on a simple example with just 3 different terrains.

Terrains List:
1 = Grass 1
2 = Desert
3 = Water 1

Note: Build also means being able to place the object on that type of land in the editor
Restrictions List:
RESTRICTION_ID = 1 (This will be for Infantry)
AMOUNT_OF_TERRAINS = 3
TERRAIN_1_ALLOW_ACCESS = YES
TERRAIN_1_ALLOW_BUILD = YES
TERRAIN_2_ALLOW_ACCESS = YES
TERRAIN_2_ALLOW_BUILD = YES
TERRAIN_3_ALLOW_ACCESS = NO
TERRAIN_3_ALLOW_BUILD = NO

RESTRICTION_ID = 2 (This will be for ships)
AMOUNT_OF_TERRAINS = 3
TERRAIN_1_ALLOW_ACCESS = NO
TERRAIN_1_ALLOW_BUILD = NO
TERRAIN_2_ALLOW_ACCESS = NO
TERRAIN_2_ALLOW_BUILD = NO
TERRAIN_3_ALLOW_ACCESS = YES
TERRAIN_3_ALLOW_BUILD = YES

RESTRICTION_ID = 3 (this will be for normal buildings)
AMOUNT_OF_TERRAINS = 3
TERRAIN_1_ALLOW_ACCESS = YES
TERRAIN_1_ALLOW_BUILD = YES
TERRAIN_2_ALLOW_ACCESS = YES
TERRAIN_2_ALLOW_BUILD = YES
TERRAIN_3_ALLOW_ACCESS = NO
TERRAIN_3_ALLOW_BUILD = NO

And if you assign a restriction ID to a object, it will have all rules declared in the restriction.
This will save aload of data because restrictions have only to be written once and will only be linked to with a number.
I suggest you also add the graphical info to these restrictions because they also have to be written once and will automatically apply if the unit ID got the correct restriction ID assigned.

User avatar
blejdaq
Posts: 46
Joined: Sat Jun 18, 2011 9:33 pm

Re: Terrain Data & Terrain Restrictions Data

Postby blejdaq » Wed Jun 29, 2011 9:40 pm

Ok, i got the point and now trying to simplify it (the less rule tables the faster the engine):

every terrain type contains:
allow_building = 0 / 1
allow_ground_unit = 0 / 1
allow_naval_unit = 0 / 1


And unit (= object of class Unit -> means mobile object) contains:
unit_type = ground / naval

Wouldn't be this much more simplier and with the same functionality?

User avatar
Alexandra
Posts: 21
Joined: Sun Jun 19, 2011 12:22 pm

Re: Terrain Data & Terrain Restrictions Data

Postby Alexandra » Wed Jun 29, 2011 11:36 pm

Yeah aload, and the graphics probably go on the same way but also must have unit classes assigned to them?

User avatar
blejdaq
Posts: 46
Joined: Sat Jun 18, 2011 9:33 pm

Re: Terrain Data & Terrain Restrictions Data

Postby blejdaq » Fri Jul 01, 2011 1:25 pm

Yes, the terrain trails will require extra table but that's minimal overhead.

One question: There are 26 terrains altogether. But AoK claims it has around 40 terrain types because they consider for example an Oak Forest a terrain type too (but basically it's only Leaf Terrain + Oak Tree on it). Do you think this setup has some advantages?


Return to “Engine”

Who is online

Users browsing this forum: No registered users and 1 guest

cron
„Bůh stvořil člověka, když ho přestaly bavit opice. Na další pokusy už pak neměl nervy.“ Mark Twain