darkf / darkfo

DarkFO, a post-nuclear RPG remake (of Fallout 2)
Apache License 2.0
136 stars 12 forks source link

Support headless mode (for testing) #103

Open darkf opened 7 years ago

darkf commented 7 years ago

DarkFO should be able to run headless -- that is, without an actual renderer/window. This could be used in the browser as well (and it probably will at first), but also in headless environments such as node.js (so that we can run automated tests on the command line.)

This involves either having a NullRenderer or just overriding heart.draw and whatever heart does to the canvas (since there will be none) similar to how the WebGLRenderer works.

Essentially we strip out the canvases and possibly image loading as well (depending on if we want to test image info and animations and such.)

If we want to run full headless (e.g. node.js), we'll either need to strip out the DOM as well (this means the whole ui module, and audio), or use a DOM library.

The game simulation should continue to run despite not receiving real input and not rendering.

Testing will be covered in a separate issue.