You must be logged in to post messages.
Please login or register

AI & RM Scripting
Moderated by Leif Ericson

Hop to:    
Welcome! You are not logged in. Please Login or Register.4 replies
Age of Kings Heaven » Forums » AI & RM Scripting » player lands: how base_size interacts with number_of_tiles?
Bottom
Topic Subject:player lands: how base_size interacts with number_of_tiles?
local boi
Squire
(id: dragon14)
posted 06-02-18 07:32 PM CT (US)         
EXAMPLE: base_size 9
number_of_tiles [0-1] = 19x19 square (361)
number_of_tiles 2 = 19x19 square + 2 tiles starting on the rightmost corner (bottom side)
number_of_tiles 3, 19x19 square + 4 tiles starting on the right corner and migrating clockwise
number_of_tiles 11 makes a 19x20 square (380 tiles), 19 along top/bottom and 20 along left/right side
number_of_tiles 12 makes a 19x20 square, +3 tiles (383) on the right side, ignoring the rightmost corner tile

I'm not sure what function would map this, since it looks more like a programming function taking from a whatever c programmers call their arrays.

current chart, using base_size 9

f(0) = 361
f(1) = 361
f(2) = 364
f(3) = 366
f(4) = 368
f(5) = 370
f(6) = 372
f(7) = 374
f(8-10) = Untested
f(11) = 380
f(12) = 383

Then I started messing with base_size 0, thinking there's some lower level function working off of number_of_tiles - these functions might not even be connected

But trying with base_size 0 number_of_tiles N I don't get anything until N = 5 (returns 4 tiles)

base_size 0
number_of_tiles 5

lets call this g(X)

g(5) = 4
g(6) = 4
g(7) = 6
g(8) = 6
g(9) = 9

So does anyone know how these work??

edit

So I found some things about base_size and set_avoid_player_start_areas and number_of_tiles



set_avoid_player_start_areas seems to makes terrain avoid a 19x19 square of player lands, which is equal to base_size 9 number_of_tiles 0. It also seems that you can't place objects with set_place_for_every_player AND terrain_to_place_on on those terrains created with set_avoid_player_start_areas, but I'm not sure why in that case (i could be wrong)



When used with player lands and base_size, number_of_tiles is confusing in really low numbers (10 or less) because I noticed it starts creating from the right corner of player lands, adding to base_size instead of, umm, well before today i always assumed that number_of_tiles went first, then base_size overrides it, but on player lands it seems that it creates the base size first, then it adds the number of tiles starting from the right corner and going towards the bottom corner. Then at some point, it starts from the right corner and goes towards the top corner. And the function governing number of tiles is confusing, it's not equal to the number you use, but some weird function that sometimes takes 2 or 3 tiles for what I put.

USA
katsup or mustard

[This message has been edited by local boi (edited 06-02-2018 @ 08:18 PM).]

AuthorReplies:
local boi
Squire
(id: dragon14)
posted 06-02-18 08:29 PM CT (US)     1 / 4       
for lands created using create_land and then using assign_to_player, number_of_tiles does seem to work as expected
<PLAYER_SETUP>
direct_placement

<LAND_GENERATION>
base_terrain FOREST

create_land
{
terrain_type DESERT
base_size 9
number_of_tiles 363
top_border 4
bottom_border 3
left_border 4
right_border 3
other_zone_avoidance_distance 10
assign_to_player 1
}
<TERRAIN_GENERATION>
/*
create_terrain GRASS
{
base_terrain DESERT
land_percent 1
number_of_clumps 99
set_avoid_player_start_areas
}
*/
<OBJECTS_GENERATION>

create_object TOWN_CENTER
{
min_distance_to_players 0
max_distance_to_players 0
set_place_for_every_player
}

create_object VILLAGER
{
min_distance_to_players 6
max_distance_to_players 6
set_place_for_every_player
}

create_object GOLD
{
number_of_groups 8
temp_min_distance_group_placement 20
terrain_to_place_on GRASS
number_of_objects 7
}

using base_size 9 creates a 19x19 square. If number_of_tiles is less than base_size^2, nothing happens : you just get a square

The minimum number_of_tiles to take effect in this case is 363

A bit weird since it actually spawns 364 tiles, but that is probably because C counts from 0, so the array starts from 0 and goes to 363. 362 tiles has no effect

number_of_tiles seems to behave in a similar way to the player lands example above, though, once it starts it increments in 2s except for the first time it does that, which is 3.


If number of tiles exceeds base_size^2 by a sufficient amount, it once again starts creating the tiles, starting from the right corner, working towards the bottom. At 373 tiles, it does the right corner to top corner i mentioned before

Weird.

USA
katsup or mustard
local boi
Squire
(id: dragon14)
posted 06-03-18 06:49 PM CT (US)     2 / 4       
set_avoid_player_start_areas avoids anything inside base_size 9

base_size N creates a square piece of land in both create_land and create_player_lands

number_of_tiles is not actually the number_of_tiles

- When these two commands are used together:
- + in create_land, if number_of_tiles <= base_size^2 then it seems to have no effect.. sometimes?
- + in create_player_lands number_of_tiles is *added* to the base_size
- + number_of_tiles starts making tiles starting from the right corner of a base and proceeds down, then right to top, etc.
- + when used with base_size in create_land.. I've been getting inconsistent results. yesterday I needed to add base_size ^ 2 first, today adding just a few tiles works

USA
katsup or mustard

[This message has been edited by local boi (edited 06-03-2018 @ 07:12 PM).]

Zetnus
Squire
posted 06-05-18 06:31 PM CT (US)     3 / 4       
This is a fascinating read. I'll have to test it when I have time.

........//\
......./ / / \ Check out my Blacksmith submissions as well as my stuff in the Steam Workshop.
....../ / /\\ \
...../ /_/_\\ \ Proud guardian of the Updated New RMS Guide <<<version 2.0 is out<<< and the Random Map Scripting Links and FAQ thread.
..../_____\\\ \
....\\\\\\\\\\\\\/ (unknowingly) the submitter of the 12000th item to the Blacksmith.
local boi
Squire
(id: dragon14)
posted 06-18-18 07:14 AM CT (US)     4 / 4       
Did you find anything out?

Anyway, look at where the villagers aren't placed. right corner, then moving down the bottom side of the 13x13 perimeter defined by the min/max distance
create_object VILLAGER
{
min_distance_to_players 6
max_distance_to_players 6
set_place_for_every_player
number_of_objects 44
}

USA
katsup or mustard
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Kings Heaven | HeavenGames