Results 1 to 10 of 10

Thread: Tiled CSV map loading (with ZenGL)

  1. #1

    Article: Tiled CSV map loading (with ZenGL)


  2. #2
    Nice one! I'm currently at work so I haven't completely gone over it yet, but I will when I get home.
    Are you going to do a second tutorial, for the more advanced topics?

  3. #3
    Yeah, I plan on releasing an XML loader, which afterward I'll merge with this tutorial to show how to do it more professionally, then I'll release an XML + base64 Tiled loader.

    As for objects and other attribute reading, that will probably come as a last tutorial, or maybe I'll throw it in with the general XML reading tutorial. I think in most future tutorials or examples, I'll just list this article as "required reading" to avoid trying to explain a lot of stuff again, but they'll probably be different enough to require a lot of explanation anyway.

    I'll have another one up by next weekend, at the least. School's a killer

  4. #4
    Nice! But tileset, which are used here, is not good for position with floating point values or for scaling the map by camera(when linear filtering is enabled). Seems, there is a need to write another tutorial about how to prepare proper tileset, which will be rendered correctly in any cases

  5. #5
    Yes, I used a very simple method for drawing so it would be easier for people to port code to other engines. There are some interesting things with ZenGL I would like to try in the future, such as using the sprite engine and this mysterious function: tiles2d_Draw (going to have to see if it does what I think it might).

    Unrelated, but I've been doing a basic performance test; how many 32x32 sprites can engines render at 60fps on my computer?
    love: 6100 // Love 2d; OpenGL; interpreted scripting
    zgl: 20200 // ZenGL; OpenGL; compiled
    gm7: 3100 // Game Maker 7; DirectX; interpreted scripting
    enigma: 10500 // C++; OpenGL; compiled
    java: 18100 // OpenGL; "compiled" to Java bytecode
    flash: 2000 // supposedly hardware accelerated but I don't know
    This is a super rough estimate, as there may be other areas each of these excels at, and I didn't do any specific bottleneck checks between cpu / gpu, although I wouldn't be surprised if ZenGL was limited by my GPU currently. I also didn't check whether anything besides flash did dirty rectangles automatically (because I'm drawing all the sprites at the same x,y coords)

    I think you deserve a pat on the back, Andru Of course there are hundreds of other libraries and engines, so take these with a grain of salt!

  6. #6
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Might I put forward the suggestion of Prometheus? I have been working quite hard on getting speed up there lately... I doubt it will get ahead of Zengl, but it might be interesting to see how good of a job I did

    Oh, I'm working on a slightly better looking bunch of code that does the same thing based on this myself so I might put that up too...

    And for the record, I am hella biased so yay. Nice tut though dazappa.

  7. #7
    Quote Originally Posted by dazappa View Post
    this mysterious function: tiles2d_Draw (going to have to see if it does what I think it might).
    If I have a free time I will try to describe it in wiki. This function can increase speed of rendering for tiles, because it uses faster clipping and no need to call asprite2d_Draw many times, that decreases CPU using.

  8. #8
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Currrently in the process of writring an article for the alternate method of loading data from those TileD tmx files based on this... TBH there is still some work to be done on my program but its getting there quite nicely. To tell the truth, I will also include this into Prometheus_Core and etc; thats my bias for you. When you're developing a library why not make it as good as it could be right?

    For the sake of all the others I will include the code as a standalone console application. On the brighter side you dont need lazarus, just plain FPC with classes, crt and sysutils. If you dont need the clrscr and delay calls for debugging then its just sysutils and classes so yay. And even then it should work without either
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  9. #9

  10. #10
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    I like Tiled. Was playing with it sometime last week. As long as you organize your assets well it can be used rather effectively.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •