Chaos Project

Featured Projects => Advanced RPG Creator => ARC Welder => Topic started by: Ryex on October 29, 2011, 05:29:00 pm

Title: Holly Freaking Crap: AKA Rabbyt
Post by: Ryex on October 29, 2011, 05:29:00 pm
so you know how I'd been working for literally months trying to come up with a way to draw the map editor in a fast working manner, getting frustrated because the drawing library in wx simply wasn't fast enough? and then about four months ago I said that I had managed to get a library called pyglet working in wxpython and it was finally fast enough to be usable? well in the quest for libraries that would be fast enough I came across rabbyt long before I found pyglet. in fact it was rabbyt that lead me to pyglet. alas I could never get rabbyt working under wxpython. then three days ago I took another look and realised that the same method I had used to make pyglet work would make rabbyt work too!

rabbyt is a c-extension for python that uses opengl to draw sprites, and it's FAST. seriously I had 10,000 sprites flying around the screen changing size, color and rotation bouncing off the walls of the window and it was running at a smooth 32-31 fps INSIDE wxpython and it was only useing 26-27% cpu (keep in mind that this is in python) that's dam impressive

it was an incredibly simple edit to get my current tile map to render in rabbyt I only had to change 5 lines. and it too ran at 30 FPS at 8-12% cpu usage where as before using the pyglet sprite version it was using 60% to run at that FPS

Now, as this is an editor I don;t need to run a fps, because the only time I redraw the screen is when something changes.

also, another benefit to rabbty is that I suddenly have the ability to NOT draw all the sprites in the tile map just the ones on screen. which means I'll be drawing 10,000 sprites max instead of the 120,000 that would be in a 3 layer 200x200 map.

now, because rabbyt is a compiled extension this will delay our MAC version as a mac version of the current library hans't been compiled yet and we'll have to get a mac and do it ourselves.
Title: Re: Holly Freaking Crap: AKA Rabbyt
Post by: ForeverZer0 on October 29, 2011, 05:32:44 pm
That is beautiful thing.
That is a helluva difference in performance. We can probably use it for the animation panels, too.
Title: Re: Holly Freaking Crap: AKA Rabbyt
Post by: Blizzard on October 29, 2011, 11:00:24 pm
I love you.

BTW, we can still use the pyglet version for the Mac release. Or maybe you can get the rabbyt developers to compile a Mac version.
Title: Re: Holly Freaking Crap: AKA Rabbyt
Post by: Ryex on October 31, 2011, 12:52:57 pm
we can get the source for rabbyt and compile it ourselves, shouldn't bee to hard. there have been versions compiled for previous releases of the library


Also, it's official, rabbyt is the best thing ever. I converted all my work to rabbyt (it was ridiculously easy to do, I did have to deal with the fact the rabbyt treats the center of the sprite as the rendering point instead of one of the corners though) and then compiled it into an exe and tested it on my netbook. my netbook runs a 64bit 1gh dual core processor and while this is powerful for it's class it's still pretty darn weak. the editor ran smoothly and never went above 25% cpu even when I was dragging the mouse around and forcing it to redraw as fast as it could. If it runs this well on my net book people will need a pretty weak sauce PC before they start feeling any lag.
Title: Re: Holly Freaking Crap: AKA Rabbyt
Post by: Fantasist on November 01, 2011, 03:02:11 am
Ah, rabbyt. It made my life easier during my little experiments with pyglet.
If you want to find out minimum requirements, you could probably use RM Clock to lower your CPU's frequency. Not that it's really required, most people have computers good enough to render the interface and play 2D games as long as they gave their graphic drivers.