Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: 'Tiled' Tile-map Loader  (Read 201977 times)

0 Members and 3 Guests are viewing this topic.

crypto

  • Guest
Re: 'Tiled' Tile-map Loader
« Reply #120 on: March 25, 2014, 02:47:59 am »
Unfortunately, the beta drivers didn't help.

I just tried it on my netbook running archlinux and an Intel GMA 3150 and I have the same issue. I built SFML from the sfml-git package available in AUR and built sfml-tmxloader & BenchMark using the CMakeList.txt included in the git repo.

But when I remove the half pixels and rebuild, it works.

Here's the ouput from glxinfo on my netbook:

OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) IGD x86/MMX/SSE2
OpenGL version string: 2.1 Mesa 10.1.0
OpenGL shading language version string: 1.20

Could it be something introduced in SFML-2.1? (I tried using the official 2.1 build as well, same issue)

Worst case scenario, I'll just remove them until I find a better fix, as my current game is zoomed in and doesn't show any artifacts when scrolling.

dabbertorres

  • Hero Member
  • *****
  • Posts: 505
    • View Profile
    • website/blog
Re: 'Tiled' Tile-map Loader
« Reply #121 on: March 25, 2014, 03:57:16 am »
Just so you know, the sfml-git package is about a month out of date, but looking at the list of commits, there shouldn't be any differences.

fallahn

  • Hero Member
  • *****
  • Posts: 507
  • Buns.
    • View Profile
    • Trederia
Re: 'Tiled' Tile-map Loader
« Reply #122 on: March 25, 2014, 10:45:34 am »
hmm, this is a real head scratcher. I just tried a fresh build of sfml on mint 16, and built the tmx benchmark via cmake/make. It works fine. I'll make a note of this on the issue tracker, and try to find some other machines to test on.

crypto

  • Guest
Re: 'Tiled' Tile-map Loader
« Reply #123 on: March 25, 2014, 02:37:33 pm »
In benchmark, try setting your view to 80x60 pixels and see what you get.

I added this to line 61:
view.setSize(80, 60);

You cans see the difference in the two images I've attached. The offset is really subtle, I don't really see it if I don't zoom the view.

fallahn

  • Hero Member
  • *****
  • Posts: 507
  • Buns.
    • View Profile
    • Trederia
Re: 'Tiled' Tile-map Loader
« Reply #124 on: March 25, 2014, 03:07:09 pm »
Ah, yes I see it now. Presumably a floating point rounding error. Not sure what can be done about that.  :-\

Ricky

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
    • Tejada
    • Email
Re: 'Tiled' Tile-map Loader
« Reply #125 on: March 30, 2014, 08:17:30 pm »
Hello,

Sorry to bother, I'm interested in the project and I'd like to learn how to use it however I can't even get it built!
It's probably something wrong on my side but here is the error cmake is giving me:

CMake Error at CMakeLists.txt:32 (install):
  install Library TARGETS given no DESTINATION!


CMake Error at cmake/Modules/FindSFML.cmake:307 (message):
  Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY
  SFML_GRAPHICS_LIBRARY)
Call Stack (most recent call first):
  CMakeLists.txt:40 (find_package)

Hey guys, still no luck.
I've built zlib and box2d and I still am getting this error:

CMake Error at CMakeLists.txt:32 (install):
  install Library TARGETS given no DESTINATION!


Line 32 reads : install(TARGETS pugi ${PROJECT_NAME} LIBRARY DESTINATION lib)
Wilt thou yet say before him that slayeth thee, I am God? but thou shalt be a man, and no God, in the hand of him that slayeth thee.

fallahn

  • Hero Member
  • *****
  • Posts: 507
  • Buns.
    • View Profile
    • Trederia
Re: 'Tiled' Tile-map Loader
« Reply #126 on: March 30, 2014, 09:13:55 pm »
CMake can't find SFML - which is quite common on windows (because... windows). Alternatively you can just add the cpp files to your project, and as long as you link to zlib (and optionally box2d) everything will work fine.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: 'Tiled' Tile-map Loader
« Reply #127 on: March 31, 2014, 08:01:10 am »
Did you even read the error message? The issue is with installing pugi and has nothing to do with finding SFML.

Might be a misshaped CMake file. Would have to test it myself to say for sure. If you just want to build it, then you could remove that install line and copy pugi to the destination yourself. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

fallahn

  • Hero Member
  • *****
  • Posts: 507
  • Buns.
    • View Profile
    • Trederia
Re: 'Tiled' Tile-map Loader
« Reply #128 on: March 31, 2014, 08:12:25 am »

CMake Error at CMakeLists.txt:32 (install):
  install Library TARGETS given no DESTINATION!


CMake Error at cmake/Modules/FindSFML.cmake:307 (message):
  Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY
  SFML_GRAPHICS_LIBRARY)
 

?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: 'Tiled' Tile-map Loader
« Reply #129 on: March 31, 2014, 08:22:56 am »
CMake Error at CMakeLists.txt:32 (install):
  install Library TARGETS given no DESTINATION!


Line 32 reads : install(TARGETS pugi ${PROJECT_NAME} LIBRARY DESTINATION lib)
? ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Noob

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: 'Tiled' Tile-map Loader
« Reply #130 on: April 04, 2014, 07:34:19 pm »
Is a compiler that supports C++11 really necessary?

I'm using VC2010 and would hate to have to move to one of the more recent and somewhat unintuitive versions.  :-\
Killing goblins at Lumbridge. Windows 7 - 64 bit. AMD Radeon HD 6700. Using VS2012 Express, SFML 2.1 - Static.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: 'Tiled' Tile-map Loader
« Reply #131 on: April 04, 2014, 08:09:25 pm »
You can look at the source to see whether there are C++11 functions in use.

Personally the only reason I can kind of understand for sticking to VS 2010, is if they have bought it or are forced to do so by a company. Other than that there are no reasons to stay with something that is two major version behind. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Noob

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: 'Tiled' Tile-map Loader
« Reply #132 on: April 08, 2014, 02:19:12 pm »
Ok, so I got this working after a bit of trouble setting up zlib.

Thx for this awesome tool!
Much easier to use than my own convoluted map making system.

Is there a way to only draw what is currently within the view to improve performance on big maps?
I loaded a 1024 x 1024 tile map where each tile is 64 x 64 pixels, and I get around 11 FPS.

I know if I'm having FPS issues as a result of map size then I should just break the map into smaller maps that get loaded individually as the player enters that area, but I would like to be able to implement this feature for if I need to in the future.
Killing goblins at Lumbridge. Windows 7 - 64 bit. AMD Radeon HD 6700. Using VS2012 Express, SFML 2.1 - Static.

fallahn

  • Hero Member
  • *****
  • Posts: 507
  • Buns.
    • View Profile
    • Trederia
Re: 'Tiled' Tile-map Loader
« Reply #133 on: April 08, 2014, 02:30:13 pm »
Currently the map loader creates a vertex array for each tileset used on a layer, so one tileset on one very large layer will create one very large vertex array. You could possibly break this down by using multiple tilesets, or use multiple layers - for example 4 separate layers to create 4 quadrants of the map. The map loader will then only draw any vertex array which intersects the view - so the worst case scenario is when the view is at the centre of the map and all 4 vertex arrays are drawn at once. Best case only one smaller vertex array is drawn, which ought to apply to the majority of the map. This is semi-scalable up to the point a single layer fits entirely in your view - but you could go ahead and split it again into 16 quadrants, making the vertex arrays much smaller, at the cost of a more convoluted map file in Tiled

EDIT:
actually when I wrote that it wasn't true that the map loader performed culling of vertex arrays which weren't in view. I've updated the source on github so now it does.
« Last Edit: April 08, 2014, 04:47:13 pm by fallahn »

Conor

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: 'Tiled' Tile-map Loader
« Reply #134 on: April 09, 2014, 09:24:59 pm »
Hello guys! This sounds like a brilliant tool. I've been trying to get it working for a bunch of hours now. Could I please have some help?

Here is my errors:

Error   2   error LNK2001: unresolved external symbol "public: __thiscall tmx::MapLoader::MapLoader(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0MapLoader@tmx@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)   C:\Users\Conor\Desktop\Visual Studio 2012\Projects\ConsoleApplication9\ConsoleApplication9\Source.obj   ConsoleApplication9
Error   1   error LNK2001: unresolved external symbol "private: virtual void __thiscall tmx::QuadTreeNode::draw(class sf::RenderTarget &,class sf::RenderStates)const " (?draw@QuadTreeNode@tmx@@EBEXAAVRenderTarget@sf@@VRenderStates@4@@Z)   C:\Users\Conor\Desktop\Visual Studio 2012\Projects\ConsoleApplication9\ConsoleApplication9\Source.obj   ConsoleApplication9
Error   3   error LNK1120: 2 unresolved externals   C:\Users\Conor\Desktop\Visual Studio 2012\Projects\ConsoleApplication9\Release\ConsoleApplication9.exe   ConsoleApplication9

Here is the code:
#include <stdio.h>
#include <string>
#include <zlib.h>
#include <tmx/MapLoader.h>

#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

int main(){
        tmx::MapLoader("maps");
}
 

I have proven SFML works and everything just before that one bad line of code, but when I try tmx::MapLoader(anystring) it produces those errors. I personally think it's a problem with zlib being linked but I can't for the life of me figure it out after hours of trying.

I'm on windows 7 with VS 2012

SFML 2.1
zlib 1.2.8

Thanks for your time. :)