Skip to content

Oak v3.0.0-alpha.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@200sc 200sc released this 23 May 04:20
· 507 commits to master since this release
4933876

This release marks the first release of oak v3, an early alpha where much but not all of the engine has been overhauled.

The following packages are in a state we are happy with in oak v3, and we do not expect them to change substantially:
render (and its subpackages)
mouse
collision
shiny (new, brought in from oakmound/shiny)
alg
event
key
oakerr
physics
scene
shape
timing

The main package, oak, is in a mostly good place, but some components like the debug console will likely be moved elsewhere before a stable v3 release.

The joystick package needs to be reevaluated with respect to supporting more controllers before v3 is stable.

The dlog package will still be significantly adjusted, to emphasize it is not meant to be a one-stop-shop logging solution, but just a 'here's what the engine will log to' destination.

The audio and entities packages have not been sufficiently reviewed to where we can say they will not change before v3 is stable.

We currently anticipate an Alpha 2 and Beta 1 release before a final Stable release.

Changelog:

overall

  • The Gopkg.lock and Gopkg.toml files, used for dep, have been removed. Dep has been deprecated and archived.
  • Throughout the project, tests have been expanded, and use of github.com/stretchr/testify has been removed.
  • Throughout the project, errors returned by packages are more regularly errors from the oakerr package.

alg

  • RemainingWeights has been renamed to CumulativeWeights, and the old CumulativeWeights function has been removed.

alg/floatgeom

  • Added the Polygon2 type.

alg/range

  • New package, a port of github.com/200sc/go-dist, representing ranges of colors, integers, and floats

audio

  • DefFont has been renamed to DefaultFont
  • DefChannel has been renamed to DefaultChannel
  • DefActiveChannel has been renamed to DefaultActiveChannel
  • DefPlay has been renamed to DefaultPlay
  • Added FontManager.GetDefault to get the manager's default channel
  • Fixed a bug in blank audio loading where the provided "blank" audio was invalid PCM

collision

  • DefTree has been renamed DefaultTree
  • Attach now takes a *Tree argument, and no longer binds to priority -1
  • PhaseCollision now takes a single *Tree which can be nil instead of a variadic set
  • NewTree now takes no arguments and cannot error. The old NewTree with custom node sizes has been renamed to NewCustomTree
  • Fixed a bug where With would return nil spaces

entities/x/btn

  • Added the Label(collision.Label) option

event

  • Event bindings in the built in bus no longer support priority levels, as they were virtually unused
  • Added the Empty helper, for when a Bindable does not care about its arguments or return value
  • GlobalBind and Bind now take string, Bindable as their argument order, formerly Bindable, string
    • We felt Bind(EventName, func(){}) read better, especially with larger functions
  • Bindables now accept CID, interface{} instead of int, interface{}
  • The global caller list is now built into the CallerMap type
  • Many methods that used to be optional in a Handler are now required

examples

  • Many new examples have been added and most existing examples have been tweaked

key

  • Added the State type, encompassing key down/up/held states, which used to be global to the oak package.

mouse

  • Added the Binding helper, converting a weakly typed interface{} payload into a mouse.Event type
  • DefTree has been renamed to DefaultTree
  • Buttons are now strongly typed

oakerr

  • Errors now can be formatted to multiple languages
  • Several redundant error types have been removed

render

  • Noisebox has been removed
  • Scrollbox has been removed
  • The Polygon type now uses floatgeom.Polygon2
  • Fonts are now copied several times as they are passed around, to enforce that the same font is not used to draw two pieces of text at once, which can panic
  • DrawOffset on Renderables has been removed and Draw has taken on its arguments (x and y offsets)
  • Texts are now drawn from the top left, like all other Renderables.
  • Fonts can now be provided fallback fonts, which they will try to use to render characters that would be rendered as an undefined character
  • Font.Generate can now return an error
  • OverlaySprites takes a slice of pointers instead of structs
  • ShinySet has been removed
  • ShinyOverwrite has been renamed to OverwriteImage
  • ShinyDraw has been renamed to DrawImage
  • Stackables have been changed to an interface that can be externally used, by removing private methods
  • Stackables now have a Clear method
  • FPS types are now Renderables instead of Stackables
  • Deprecated methods have been removed
  • DefFont is now DefaultFont

render/mod

  • gift.Resampling is now aliases as the local Resampling type

render/particle

  • Added the Allocator type to contain particle allocation requests

scene

  • Scene start functions now take in (*scene.Context) as their only argument, a new struct containing everything a scene should need to render, bind, modify the window, etc

shiny

  • New package, brought in from github.com/oakmound/shiny
  • Oak programs shouldn't need to directly interact with shiny other than to decide which driver to use, if not using the default

timing

  • FPSToDuration has been renamed to FPSToFrameDelay
  • Added FrameDelayToFPS

window

  • New package, handling the interface between scene and oak.Controller

oak

  • Setup... constants have been removed and folded into the Config struct
  • Config.EventRefreshRate can now be properly unmarshaled from JSON
  • Added Config.IdleDrawFrameRate, controlling how often the screen will redraw when it does not have focus
  • Config creation and loading has been overhauled, using NewConfig and functional option loaders, FileConfig and ReaderConfig
  • Added the Controller type, containing old package globals and enabling running multiple oak windows simultaneously
  • Most public functions in the package are now methods on Controllers, in addition to default oak.<Method> helpers, which will redirect to a default controller
  • The draw loop has been substantially simplified
  • Backgrounds can now be any type that have GetRGBA() *image.RGBA, enabling complex or animating backgrounds
  • Init now takes in a variadic set of ConfigOptions, so patterns that used to setup config, then oak.Init(scene) now will look like oak.Init(scene, func() {setup config})
  • Shiny gestures are no longer supported at the input loop layer, as they were fundamentally unused. This could be revisited
  • We now propagate the event.FocusLoss and event.FocusGain events on appropriate window changes
  • Key events now have a key.Event payload instead of a string payload
  • Mouse events now trigger both an absolute and Relative event, the latter taking into account the viewport position
  • Keybindings have been removed as they did not cooperate well with other key refactoring. This will be revisited
  • Language constants have moved to oakerr, and are in progress
  • Added UpdateViewSize, to enable resizing the rectangle rendered within the client window
  • SeedRNG is no longer public, and no longer logs excessively
  • Removed Add, preferring AddScene
  • DefShaker has been renamed to DefaultShaker
  • Added HideCursor, ShowNotification, and SetTrayIcon window methods