diff options
-rw-r--r-- | .dir-locals.el | 5 | ||||
-rw-r--r-- | TODO.org | 320 |
2 files changed, 225 insertions, 100 deletions
diff --git a/.dir-locals.el b/.dir-locals.el index d9a19a4..b4034ae 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -1,4 +1,7 @@ -((scheme-mode +((org-mode + . + ((org-archive-location . "::* Archived Tasks"))) + (scheme-mode . ((eval . (put 'call-with-transform-excursion 'scheme-indent-function 1)) (eval . (put 'with-transform-excursion 'scheme-indent-function 1)) @@ -97,12 +97,156 @@ ** TODO [#C] Instanced rendering A nice optimization when rendering the same mesh a bunch of times. +* Improvements + +** TODO [#A] Implement <rect>, <vector2>, <vector3>, and <vector4> as packed f64 bytevectors + Currently, it's expensive to use these types when performing OpenGL + operations such as writing to vertex buffer objects because Guile + does scm->f64 conversions before writing to a bytevector. To take + advantage of Guile 2.2's float unboxing, we can implement these + types as a record type with one field: a bytevector. The + bytevector will store all of the fields packed together. To take + advantage of unboxing, the procedures that get/set these "fields" + should be inlined. + +** TODO [#B] Clean up imperative rendering API + The functional, monadic rendering API is nice and clean, but the + low-level imperative API is very messy. Perhaps it could use some + syntactic sugar for all of the "call-with-foo" forms. Also, a + naming convention needs to clearly differentiate procedures/macros + in the imperative API from those in the high-level API. + Originally, I didn't expect users to really ever have to use the + imperative API, but the introduction of sprite batches has made me + realize that writing custom low-level rendering routines will be + common enough to merit a nice API. + +** TODO [#B] Treat shaders like procedures + One can view a draw call as the application of a shader program. + The arguments to the shader program are uniforms and vertices. + +** TODO [#B] Use uniform buffer objects + Uniform buffer objects allow setting many uniform values at once, + rather than performing a GPU call for each, which results in better + performance. + +** TODO [#C] inotify-based live reloading + Better than periodically making 'stat' calls in a loop. + +* Documentation + +** TODO Document rendering API + I can't settle on a rendering API, so I haven't bothered making + good docs for it. Once the above rendering tasks are complete, + it's probably safe to write docs. + +** TODO Write a tutorial + Walk a beginner through the basic features of Sly and establish a + simple development workflow. + + - Start the game loop + - Render a sprite + - Move the sprite + - Live hack + +* Bugs + +* Releases + +** DONE 0.1 Release + A 0.1 release was made under the project's old name, guile-2d. Now + that things have changed so drastically and the name has been + changed, a new 0.1 release will be made. + + - [X] New REPL server + Use the (system repl coop-server) module in Guile 2.0.11. + - [ ] Screencast + - [-] Relatively complete documentation (it's a start) + - [X] Clean up font module + - [X] Add GLSL shaders + - [X] Finish FRP module + - [X] Make basic webpage with HTML docs + - [X] Basic rendering (must support sprites and text) + +* Archived Tasks + ** DONE [#A] Game loop + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Features + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: Provide a game loop structure that responds to input events, updates the game state, renders the scene. Use a fixed update timestep and cap the maximum FPS. +** DONE [#A] Allow modules to declare state via signals, including OpenGL resources + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Improvements + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: + This is a tricky one. The major headache with my Lisp Game Jam + attempt was that the signal framework had to be abandoned + *everywhere* except the top-level environment of the script that + starts the game loop. The reason for this was that the game state + typically required that the SDL window was opened and the OpenGL + context was available in order to work. Thus, at the top-level, we + first had to open a window and only then could we define signals. + The goal here would be to eliminate this major restriction so that + a game can be factored into many Guile modules and still declare + time varying state with signals. One important consequence here is + that all OpenGL resources *must* be declared as signals that wait + for the game loop to start before loading. + +** DONE [#A] Implement sprite batch in terms of a mesh + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Improvements + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: + Fix code that assumes meshes to be static, allowing for the dynamic + sprite batch use-case. + +** DONE [#A] Pure Scheme 4x4 matrix multiplication implementation + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Improvements + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: + Guile 2.1.2's float unboxing optimizations should enable this to be + both fast and not allocate so much. The GSL dependency can be + removed (yay!) once this is complete. Be sure to use Guile's ,x + metacommand to view the disassembly to ensure that the necessary + optimizations are indeed being used. + +** DONE [#B] Use a single OpenGL resource guardian structure + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Improvements + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: + This will deduplicate code amongst all Scheme data types that wrap + OpenGL resources, because right now each one uses its own separate + guardian. + ** DONE [#A] Input + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Features + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: Provide hooks to respond to keyboard, mouse, and joystick events. Wrap SDL keycode, mouse button, etc. constants in our own enumeration. @@ -113,6 +257,13 @@ - [X] Joystick ** DONE [#A] Sprites + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Features + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: Encapsulates an image and all of its transformations: position, rotation, scale, color, etc. @@ -122,6 +273,13 @@ - [X] Use a sprite batch when drawing if one is currently bound ** DONE [#A] Sprite batches + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Features + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: Efficiently render a large number of sprites. Only change OpenGL context when necessary. For example, don't change texture when rendering several sprites in a row that use the same one. @@ -132,12 +290,26 @@ - See: https://bitbucket.org/rude/love/src/d95dfb67079a60f8de64304dac9002544695f1bb/src/modules/graphics/opengl/SpriteBatch.cpp?at=default ** DONE [#A] Tilesets + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Features + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: Break an image up into many small pieces. Useful for creating maps. - [X] Algorithm to split texture into tiles - [X] <tileset> type ** DONE [#A] Coroutines + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Features + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: Provide a way for users to easily script asynchronous behaviors using coroutines and a scheduler. @@ -145,6 +317,13 @@ - [X] Agenda ** DONE [#A] Vectors and matrices + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Features + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: Vectors and matrices are needed constantly for games. Provide an easy-to-use module that provides procedures for common vector/matrix math operations @@ -153,13 +332,34 @@ - [X] Matrices ** DONE [#A] Fonts + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Features + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: - [X] Write wrappers for needed FTGL functions - [X] Write font rendering procedures ** DONE [#A] Sound + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Features + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: Provide helpful wrappers around SDL sound procedures? ** DONE [#A] REPL + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Features + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: Provide a REPL that plays nice with the game loop. Easier said than done. @@ -172,111 +372,33 @@ - Will be available in Guile 2.0.10! ** DONE [#A] Upgrade to SDL2 + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Features + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: - Write necessary bindings and release [[https://git.dthompson.us/guile-sdl2.git][guile-sdl2]]. - Replace freeimage with sdl_image 2.0 ** DONE [#B] Animations + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Features + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: Create a data type to represent an animated sequence of textures and/or texture regions. ** DONE [#B] Asset Management + :PROPERTIES: + :ARCHIVE_TIME: 2016-02-27 Sat 12:07 + :ARCHIVE_FILE: ~/Code/sly/TODO.org + :ARCHIVE_OLPATH: Features + :ARCHIVE_CATEGORY: TODO + :ARCHIVE_TODO: DONE + :END: - [X] Live asset reloading - -* Improvements - -** TODO [#A] Implement <rect>, <vector2>, <vector3>, and <vector4> as packed f64 bytevectors - Currently, it's expensive to use these types when performing OpenGL - operations such as writing to vertex buffer objects because Guile - does scm->f64 conversions before writing to a bytevector. To take - advantage of Guile 2.2's float unboxing, we can implement these - types as a record type with one field: a bytevector. The - bytevector will store all of the fields packed together. To take - advantage of unboxing, the procedures that get/set these "fields" - should be inlined. - -** TODO [#B] Clean up imperative rendering API - The functional, monadic rendering API is nice and clean, but the - low-level imperative API is very messy. Perhaps it could use some - syntactic sugar for all of the "call-with-foo" forms. Also, a - naming convention needs to clearly differentiate procedures/macros - in the imperative API from those in the high-level API. - Originally, I didn't expect users to really ever have to use the - imperative API, but the introduction of sprite batches has made me - realize that writing custom low-level rendering routines will be - common enough to merit a nice API. - -** TODO [#B] Treat shaders like procedures - One can view a draw call as the application of a shader program. - The arguments to the shader program are uniforms and vertices. - -** TODO [#B] Use uniform buffer objects - Uniform buffer objects allow setting many uniform values at once, - rather than performing a GPU call for each, which results in better - performance. - -** TODO [#C] inotify-based live reloading - Better than periodically making 'stat' calls in a loop. - -** DONE [#A] Allow modules to declare state via signals, including OpenGL resources - This is a tricky one. The major headache with my Lisp Game Jam - attempt was that the signal framework had to be abandoned - *everywhere* except the top-level environment of the script that - starts the game loop. The reason for this was that the game state - typically required that the SDL window was opened and the OpenGL - context was available in order to work. Thus, at the top-level, we - first had to open a window and only then could we define signals. - The goal here would be to eliminate this major restriction so that - a game can be factored into many Guile modules and still declare - time varying state with signals. One important consequence here is - that all OpenGL resources *must* be declared as signals that wait - for the game loop to start before loading. - -** DONE [#A] Implement sprite batch in terms of a mesh - Fix code that assumes meshes to be static, allowing for the dynamic - sprite batch use-case. - -** DONE [#A] Pure Scheme 4x4 matrix multiplication implementation - Guile 2.1.2's float unboxing optimizations should enable this to be - both fast and not allocate so much. The GSL dependency can be - removed (yay!) once this is complete. Be sure to use Guile's ,x - metacommand to view the disassembly to ensure that the necessary - optimizations are indeed being used. -** DONE [#B] Use a single OpenGL resource guardian structure - This will deduplicate code amongst all Scheme data types that wrap - OpenGL resources, because right now each one uses its own separate - guardian. - -* Documentation - -** TODO Document rendering API - I can't settle on a rendering API, so I haven't bothered making - good docs for it. Once the above rendering tasks are complete, - it's probably safe to write docs. - -** TODO Write a tutorial - Walk a beginner through the basic features of Sly and establish a - simple development workflow. - - - Start the game loop - - Render a sprite - - Move the sprite - - Live hack - -* Bugs - -* Releases - -** DONE 0.1 Release - A 0.1 release was made under the project's old name, guile-2d. Now - that things have changed so drastically and the name has been - changed, a new 0.1 release will be made. - - - [X] New REPL server - Use the (system repl coop-server) module in Guile 2.0.11. - - [ ] Screencast - - [-] Relatively complete documentation (it's a start) - - [X] Clean up font module - - [X] Add GLSL shaders - - [X] Finish FRP module - - [X] Make basic webpage with HTML docs - - [X] Basic rendering (must support sprites and text) |