Skip to content

Seclusion Game Engine 2.0

Compare
Choose a tag to compare
@onpon4 onpon4 released this 30 Apr 17:16
· 14 commits to main since this release
v2.0.post0
57b33ba

This update to the Seclusion Game Engine is a big one with some compatibility-breaking changes which will make the SGE more robust in the long-term, as well as some significant enhancements. Unfortunately we weren't able to get everything we wanted into this release, but it's significant enough that we've decided to release it now.

As mentioned, this release breaks compatibility with previous SGE releases. However, the latest releases of all xSGE components are still compatible with SGE 2.0. (Due to this and the fact that we're not done with certain xSGE updates, new xSGE releases are not being made to coincide with SGE 2.0 just yet.) Compatibility breakages are as follows:

  • Mouse wheel input is no longer detected as mouse button presses; mirroring the upstream changes in SDL2 and Pygame 2, the mouse wheel is now given its own API. Instead of event_mouse_press to detect mouse wheel motion, use the new event_mouse_wheel_move events.
  • Most methods now require certain arguments to be keyword arguments. Most cases will raise a syntax error if you try to specify them as positional arguments.
  • The frame parameter of many draw methods has been repositioned earlier so that it is the final parameter that can be specified as a keyword argument. This can cause invisible compatibility breakage in code which was specifying one positional argument that is now required to be keyword arguments, since it would get interpreted as the frame argument instead of simply raising a syntax error. Affected methods include draw_line, draw_rectangle, draw_ellipse, draw_circle, and draw_text. Recommended course of action is to manually check all calls to these methods and ensure that they aren't passing an invalid positional frame argument. (For backward compatibility with previous SGE versions, specify the frame parameter as a keyword argument.)
  • sge.gfx.Color now raises TypeError instead of ValueError when an invalid type is given.

Other changes to the SGE include the following:

  • It is now possible to control the sampling frequency of audio playback, as well as whether said playback will be in stereo or mono.
  • The default sampling frequency is now 44100 Hz instead of 22050 Hz. This improves default sound quality.
  • It is now possible to force the game to scale up only by integer amounts with the new sge.game.scale_integer attribute.
  • It is now possible to both get and set the exact size of the window the game is in via the window_width, window_height, and window_size attributes of sge.game.
  • It is now possible to detect when the user resizes the window with the new sge.dsp.Game.event_window_resize.
  • Two functions, sge.dsp.list_fullscreen_modes and sge.dsp.fullscreen_mode_ok, have been added to allow querying what fullscreen modes the system is capable of.
  • Support for drawing and projecting "polylines" (multi-segmented lines) has been added.
  • Support for applying a kind of Python-based pixel shader to sprites has been added via the sge.gfx.Sprite.draw_shader method. This method is slow and not as flexible as true shaders, but may be useful for some applications.
  • sge.gfx.TileGrid now supports two hexagonal tiling methods.
  • All drawing methods now support anti-aliasing in the Pygame SGE.
  • Some bugfixes.