make tiles with different dimensions

Asked by german on 2011-12-29

can i change the number of pixels of a individual tile to make it bigger or smaller than 32X32, for example 24x24 or 48x48 or something like that?

Question information

Language:
English Edit question
Status:
Solved
For:
Stratagus Edit question
Assignee:
No assignee Edit question
Solved by:
b-o
Solved:
2012-01-29
Last query:
2012-01-29
Last reply:
2012-01-02
b-o (chokofehler) said : #1

I would like to know this as well

Best b-o (chokofehler) said : #2

I was looking into this, and found that the tile size is specified in the stratagus source code at src\map\tileset.cpp :

/**
** Size of a tile in pixel
*/
PixelSize PixelTileSize = {32, 32};

But you'd have to change some stuff in src\map\script_tileset.cpp as well, so some occurrences of 32 would be changed to the new tile size:

{
 Map.Tileset.Clear();

 Map.Tileset.PixelTileSize.x = 32;
 Map.Tileset.PixelTileSize.y = 32;

 //

some of the occurrences of 32 also appearing in that file might refer to something else though, since there are 16 tiles per row, and 2 rows would be 32.

I'm not sure if there is anywhere else you would need to change anything, so let me know if you get it working, or post something on the forum at forums.stratagus.com .. if anyone else can confirm that this is all that needs to be changed or if you know of something else that needs to be changed, please comment.

Joris Dauphin (joris-dauphin) said : #3

Tileset has a lot of hard coded stuff :-/
It is possible that some occurrences (of hard coded number) should be replaced by correct Macro/variable.

When changing the tile size, don't forget to adjust animation stuff in lua script (move animation works currently with 32 pixels).

b-o (chokofehler) said : #4

With regards to the movement animation: If I made 64*64 tiles, and left the animations at 32*32, would that cause problems? In other words, is it possible to have a movement grid of a different size than the displayed tile grid, and could you foresee any problems with that in Stratagus?

Joris Dauphin (joris-dauphin) said : #5

It is untested,
So it may work, but it should fail.

I think that most problem will come from the pathfinder
(-with 64x64 tile, a 32x32 unit will occupy the whole tile -> sub optimal solution and false negative
- I don't know how the following of the path will work (we have a list of direction AFAIK)
)

Sub pixel movement is in the todo list of stargus.
So I suppose that some changes are needed in the engine.

german (pepeelgranjero) said : #6

Thanks b-o, that solved my question.