You can view the page at http://www.pascalgamedevelopment.com...g-(with-ZenGL)
You can view the page at http://www.pascalgamedevelopment.com...g-(with-ZenGL)
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?
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
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
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!
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.
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.
Any news on this?
I'm thinking in implement full support to Tiled.
Cezar Wagenheimer from Green Sauce Games
Programmer of Druids - Battle of Magic, Abra Academy, Abra Academy - Returning Cast, Rabbit Jump, Dreams of a Geisha and Heroes from the Past: Joan of Arc
Wagenheimer's Game Development Blog
Bookmarks