Gummworld2 - 0.5.0
Gummworld2 is a pygame framework for a scrolling game, where the map is larger than the display. It emphasizes simplicity and performance.
Version 2.0.0 is released. New HUD, more speed, less junk.
- There is a new and much improved HUD.
- SpatialHash is much faster thanks to a challenge I made to DR0ID. :D
- Demos are tweaked where needed.
- world editor has been retired.
- PGU has been retired.
The full image of the screenshot collage is available in Gummworld2 Downloads (gw2_screenshots.png), as well as the individual screenshots used to make the collage.
::: About :::
Gummworld2 is a pygame framework for a scrolling game, where the map is larger than the display. It emphasizes simplicity and performance. You add the display elements and game logic, the engine provides the framework for timing, events, updates, and rendering.
Tiled helpers are included for elaborate mapping. However, Tiled is not required.
Compatible with Python 2.7 and 3.x.
The fast renderer BasicMapRenderer matured in v0.5.0. The Mana World's map01 blazes. It is a five layer map with many SRCALPHA tiles. See examples/07_tiled_tmw_renderer_complete.py. This is super fast. The demo examples/29_basic_map_renderer.py renders 8,000+ tiny tiles at 800 fps, and typically sluggish jobs like dynamic hex maps at very high speeds.
::: More :::
Also available in downloads (Gummworld2 required):
- gw2_skeleton, a la skellington. Get this for fast skeleton setup. Highly recommended. I've gotten a fair number of how-to questions that are solved by this module layout. (Note: this is not the same as game_skel, also available in downloads. game_skel is standalone, whereas gw2_skeleton is a drop-in skeleton specifically for Gummworld2.)
- The Mana World resources needed by some Gummworld2 examples (sorry, TMW is kept separate because it is GPL v2). This is just a drop-in data directory.
The core of the BasicMapRenderer has had some smarts added to enable it to render all of a Mana World map.
The benefit. A smarter renderer relieves you of manually splitting the map layers up, and deciding what background layers the renderer can manage while you are stuck figuring out how to process the upper layers. An example of this old knuckle-dragging way is in 07_tiled_tmw_renderer_bg_only.py.
The cost. A smarter renderer requires you to modify the avatar slightly (one attribute), set a sort_key attribute on dynamic layers (one attribute), and revise your game loop to notify the renderer of the dirty areas that changed; but it is a fairly repeatable method. An example of this new way is in 07_tiled_tmw_renderer_complete.py.
The other benefit. A smarter renderer is also much, much faster and smoother scrolling. With these efficiencies I was able to run 001-01.tmw at 1024x768 w/ collision handling for 240 fps. This is a 4-layer map with many srcalpha images. =) The original TMW example improved @800x600 from 120 fps to over 500 fps; and @1024x768 from 35 fps to 240 fps. I mighta felt my hair blow back. =)
Why should I care about fps!? =P Simply, the less time spent on the bottleneck in a scroller--blitting--the more headroom there is to add game logic.