Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Arantor

I see from the documentation that Weltmeister is designed for square tiles in tilemaps but I have the situation whereby I'm looking at non-square tiles for what I'm doing.

Is it possible to support different width vs height tiles or is that something only achievable by changing Weltmeister significantly? Also, the methods in Impact itself that deal with such things, presumably they would need updating too?

If it helps, I have two particular use cases in mind for these changes, the first is for a puzzle game that has vertical rectangles but moves slowly (so that any performance consequences are minor) but the second is for something of an arcade game with larger, rectangular tiles (notionally I'm thinking that a level is going to be somewhere between 7-12 tiles wide, up to 100 tiles high, but that suits for what I want to do, assuming I can identify the tile underneath an entity at any given time, as I'd much rather use Weltmeister for level design than code it by hand or roll my own editor)

1 decade ago by Graphikos

I think you just need to wait a few days. New Impact is due out any day now. Dominic teased us with this photo:

/>			</div>
		</div>
			<div class=

1 decade ago by Arantor

Hmm, that still indicates square tiles, even with slopes. The number of tiles is of course rectangular (being 40x30) but they're still 8px square tiles, which means that for the things I'm looking to do, Weltmeister is likely not an option :(

(Where was that posted, btw?)

1 decade ago by dominic

Weltmeister doesn't support non-square tiles and it's not planned for Impact 1.x.

You could hack the ig.BackgroundMap class to support non square tiles or choose a smaller tilesize: E.g. if your tiles are 32px wide and 16px high, use a tilesize of 16.


Quote from Arantor
(Where was that posted, btw?)

On Twitter and IRC.

Implementing slopes The Right Way(tm), so that they work in every possible scenario, is incredibly hard. It's "easy" to build a hack that works for floor tiles and 45° angles only, but I wanted a more robust solution that works for all types of games, not only Jump'n'Runs.

I'll need a few more days to get this ready. I'm sorry for the delay. I'll definitely release 1.19 before Christmas!

1 decade ago by Arantor

Thanks for the info.

I think I'm going to have to seriously reconsider what I'm doing, the tiles aren't an even ratio like 2:1, the tiles used thus far are based on being 32x25 (long story, heh) but maybe I can adjust the rest of the design to work with either taller or wider squares to get closer to an integer ratio where I can make it work sanely.

That said, actually, I'm thinking I might just do it manually anyway because the player moves over tiles and the tile itself can give the player behaviour (e.g. arrows that affect the player's movement) and that seems to me like it's a bit more than a background map and almost closer to being passive entities that the player interacts with, but I'll experiment and see what I end up with (though I'd be the first to admit I'm not so hot on Weltmeister as opposed to doing stuff myself...)

And yeah, I can well imagine that slopes are tricky, though I won't deny it'll be cool to have slopes that aren't multiples of 45 degrees, can see a lot of fun to be had there.

1 decade ago by Arantor

OK, so I seem to have figured this out in the meantime. Actually, it seems to be fairly straightforward. This is almost certainly going to be broken by the changes in 1.19 but in case it helps anyone running 1.18a...

All you really need to do with it is the following (hopefully not posting too much stuff to those who haven't got a licence)

1. Fix the editor to provide the space for width/height
* First, modify the editor's HTML file where it defines the textbox with id layerTilesize and create another line of markup; I renamed the first to layerTilewidth and the second to layerTileheight.

2. Replace all the instances of tilesize in every file. You'll need to use two variables instead of one, of course, whether you choose to define tilesize: { x: 8, y: 8 } as the default and always refer to that as tilesize.x and tilesize.y, or to create two explicit variables is mostly up to you - but I found it a ton easier to do two separate variables since that meant not altering any of the code attached to saving or loading. Just remember to change the default tilesize declaration for tilewidth and tileheight default declarations.

3. Certain function signatures will be altered by doing the above, notably the background map's constructor (and all its dependents). Provided that you're absolutely methodical about replacing and always use tilewidth then tileheight, it actually shouldn't be a problem.

4. Last but by no means least, there are instances where tilesize is referenced on its own. Now, virtually every reference that's on its own (if not all of them) is for a drawTile call - the parameter is the width parameter for drawing in ig.Image.drawTile, and it assumes it's square. In the case of drawTile calls, just substitute the tilewidth and the tileheight as parameters into the call, because both will be required. I spent about an hour trying to figure out why it was mis-drawing my tiles because I'd just assumed it wanted tileheight by the parameter list, not tilewidth and tileheight.

This needs to be done on all files, looks to me like it modifies the following:
* weltmeister.html
* lib/impact/
background-map.js
collision-map.js
game.js
map.js
* lib/impact/debug/
maps-panel.js
* lib/weltmeister/
config.js
edit-map.js
tile-select.js
weltmeister.js

I haven't tested this thoroughly so it's likely there are some bugs I haven't run into yet, but it's not a mammoth endeavour, far smaller than I envisaged it would be, props to Dominic for the code quality :)

1 decade ago by pjwal

Hexagon tiles would be especially helpful for bird's eye view type strategy tiles.

1 decade ago by pjwal

err, "bird's eye view type strategy games" i mean

1 decade ago by Arantor

As discussed elsewhere, hex tiles is massively more complex than rectangular tiles and if rectangular tiles won't happen before 2.0, I certainly can't see hex tiles happening any time soon (especially as it's even less common, I suspect)

1 decade ago by congwang0517

I hope not only the tile map but also the images map in Weltmeister

1 decade ago by Arantor

Yes, the changes I outlined apply to Weltmeister just as much as they apply to things actually working in Impact itself, which means I can build maps just fine.

Hex maps, though, are a long, long way off if they ever happen in the core.
Page 1 of 1
« first « previous next › last »