Project Updates

Wednesday, November 10, 2010

Speedups

Recently I optimized several parts of the SDK, mostly to be able to support a "bullet hell" type game (one of the ideas I'm kicking around.)

Here is a little summary of what I accomplished:

  • Entities are much faster
  • The heap is now faster and more memory efficient and lets you allocate up to 256MB 16MB (up from 1MB!)
  • The Layer component was eliminated and folded into Entity so parenting is more efficient.
  • Spritebatches were implemented; performance is not too shabby with 5000 moving sprites a frame on a 3.2ghz desktop.  It's definitely CPU bottlenecked; eventually I'll offload sprite rendering completely to the GPU via....
  • The Shader module; shaders will bring huge performance gains without a doubt :P 

Tuesday, November 9, 2010

Providing Tengoku as a DLL

Today I considered that to make Tengoku accessible from any language, practically all you need is the system compiled as a dynamic library, and this API of 4 whopping functions. I think.

  • ten_evaluate ( string ) : string
  • ten_push ( int ) : void
  • ten_pop () : int
  • ten_wrap ( function ) : int
And maybe double and triple variants for ten_push and ten_pop.

Ten_wrap would take a native function and make it something that Tengoku can execute, since it makes extensive use of callbacks. 

Ten_evaluate would take a simple string containing Forth "script", likely usually just a single function name, and return a string of whatever was output to the console.  Since it would be against SwiftForth's commercial license, all code compilation words would be inaccessible; and you could only access game engine words.  (So, all logic would be in your native language, which would be the point of it anyway.)

On second thought, that probably isn't it.  You also need multitasking and messages, which right now are intrinsic to Plexi and Walnut, respectively.  And a more efficient way of getting the address of objects and then their properties, else it would just be too slow to be more than a demo.

Maybe there can be a way of automatically go through and generate the DLL and headers using the stack comments.