Nice! Just add a “Preview:” label and it will be perfect
I’ve just done it after my last message.
Victor, how hard it would be to make white lines go away? I mean such thing doesn’t happen in e.g. tiled sprite object so why it does here?
//edit: Other than that, it works fine. Though I’ll wait for finished version before I’ll do anything “real” with it, other than a quick test. For example, I’ve accidentally forgot to set tileset image and then when I’ve clicked part of window with “Select tileset first” part (don’t want to check actual text here), GD hanged, first became white then “App not responding” window showed up. So until this bug is fixed I won’t use it for anything real as I don’t want to risk accidentally losing hours of work.
Also white lines happens only between columns of tiles, not between rows so it seems to be something different about how those are rendered.
I can’t make them go away.
It happens there because each tile is a different part of the texture (it’s not the same OpenGL Quad). In the tiled sprite object, there is only one OpenGL Quad.
I’ve disabled the texture smoothing, I’ll try with the texture smoothing on but I think I’ll get part of the tiles instead of the blank lines.
I can’t do anything apart from rounding the view coordinates, but I can’t do it from the object.
For example, in Contruct 2, when you insert a TileMap, it asks you if you want de automatically round view coordinates.
Here is a new version :
TileMapObject-beta2.zip (1.1 MB)
It contains a small workaround to avoid blank lines during preview (still get blank lines during the edition or if the object coordinates are not integers).
Do you still get blank lines ?
Will try that tomorrow. Now I am so tired that I have problems thinking straight. I have “extreme makeover” of my apartment and was busy putting together and moving furniture around. Gah, too bad other stores now have gone (at least in Poland) IKEA route and offer DIY kits instead of pre-build furniture. Sure, it probably would cost more (labor & taking more warehouse and transport car space), but I’d gladly pay for the convenience.
Anyway, will try tomorrow and I generally don’t care about how things look while editing as long as it looks similar enough.
Also (on old object, beta 1) oddly enough, I didn’t get blank lines when coords weren’t integers no matter how hard I tried to do so, so it must have to do more with viewport.
Also it may be totally bad idea in this case, but how about you’ll render tilemap as a grid of quads instead of each tile being separate quad?
Eg. like grid object in blender:
Then for each face you’ll do some UV mapping that points to texture coords from atlas (a.k.a tileset).
Here’s PoC using same grid as previously and a tileset I’ve done for a friend for his 2D minecraft game:
Please note that “pink trash” around is because this was quick proof of concept and didn’t take a time to uv map it or remove faces altogether. Of course you’ll want to do either if you end up using my idea . Also any color lines between ground/grass tiles is again because it was supposed to be quick proof of concept and didn’t uv map those with pixel precision. I can share blend file if you want me to do so.
Grid of Quads doesn’t exist in SFML. Each tile is a quad (made of 4 points, each containing its position and the texture position (for mapping))
There are no other ways to do that.
Note that a grid of quad is just a grid containing several individual quads.
But can’t you just make OpenGL calls directly to make such grid?
It would be exactly the same ! I’m currently using the most optimized way to render a tilemap allowing huge performance.
Please, stop asking useless questions about things you don’t have any idea about…
By the way, I hope to be able to port the extension to the web platform as soon as possible. Victor, let me know if you have any idea or remarks about it (rendering issue/performance or special things that you could think of)
I saw that Pixi.js doesn’t work the same way as SFML. There are some examples of Tilemaps on the internet : they use sub-texture (texture created from a part of a base texture) and several sprites to render Tilemap It doesn’t seem to cause performance issues
No, I don’t get the blank lines in preview with this version
I have a suggestion, maybe it not possible because GD use tilemap object as a single object, but how about that if we put a tile on Layer Back, that would be Z Order 0 in GD Scene editor, if we put a tile on Layer Middle, that would be Z Order 1 in GD scene editor, so to use Z Orders individually for each tile. This way we could easily solve overlapping not only inside tilemap object editor between tiles but also in the whole game between tilemap object and any other objects. This way we don’t have to use multiple tilemap objects only to solve overlapping with other objects. If it not possible because of GD scene editor, then it is a suggestion to 4ian to integrate tilemap object editor with GD scene editor to be possible
And I have a question about what features are planned for tilemap object.
I know about the collision but how about conditions, actions and other extensions in general?
I have just tried to use some mouse, key condition and object actions on tilemap objects and nothing works.
So seems like the beta is exclusive to platformer automatism, do you plan to change this in final release?
I really hope to be able to use it in any ways
There is nothing exclusive to the platformer automatism, the tilemap just return its hitbox (collision mask) made of all tile’s collision mask like any other object. What conditions don’t work (Key condition, what is that ?) ?
Well, just tried, mouse press, mouse over object, key press, pixel perfect collision, object delete, hide, move, separate, nothing works with tilemap object. That’s why I call it “platformer exclusive” as it works best with platfromer automatism to make a scene for platformer games
But I didn’t have time to test it intensively, maybe on the weekend, at the moment tested only a few things and this is my experience so far.
Mouse over object, pixel perfect collision are exclusive to the sprite object (that’s why they are in the sprite section !)
I’ll see for the others.
EDIT : Moving the tilemap and remove at at runtime already works, I don’t know what you are talking about.
I’m talking about the actual object itself.
whatever condition: Delete object Platforms
whatever condition : Hide object Platfoms
whatever condition : Do +whatever to X position of Platforms/Y position of platfroms
whatever condition : Add Force at angle whatever to Platforms
“Platfroms” is the tilemap object itself in the example.
These are actually working (I’ve just test them).
If they dont it’s not my fault as I dont have to implement them as the object inherits a base class containing all these features.
In my computer on Ubuntu in fact, any action or condition using a TiledMap object fails because the compilation does not work: it seems that when I copy the files, I was with root permissions and when launching Game Develop as a normal user, I do not have permissions to read the files inside CppPlatform/Extension/include/TileMapObject.
So the compilation fails because files can’t be accessed by GD.
(So the problem is not in Victor code, it’s just that GD should have displayed a better error message).
To fix it, change the permission of the TileMapObject directory inside CppPlatform/Extensions/include so that it can be accessed by any user