Subscribe

RubyCube progress

I got some more time to hack on RubyCube so from my original almost ready post I got the following done:

  • Finished the stress test
  • Finished first pass of documentation (rubydoc)
  • More test cases for basic functionality
  • Perspective transform is working
Working on the above items exposed some underlying issues that need to be addressed.
  • Object destruction had to be optimized a bit. This is a bit tricky due to multithreading issues. Basically once the ruby script calls the registered free callback the object is marked for cleanup. The graphics/update thread handles reclaiming the actual memory in the main loop.
  • I couldn’t find an effecient way to do game timers in ruby. This code looks nice but creates too many Time objects:
stopTime = Time.now() + 60
while(Time.now() < stopTime) do
  puts "thinking"
end
So a custom solution has been cooked up. This ties into the existing low level events system used in rubycube (uglier but fast):
timerId = RubyCube.settimer(10, -1) # interval 10 seconds, repeats forever
loop do
  event = []
  while(RubyCube.readevent(event)) do
    if(event[0] == RubyCube::TIMER && event[1] == timerId) then
      puts “hit timer”
    end
  end
end
  • I cut the number of animation types supported and am still working on a test that exercises all of them.
Remaining things TODO:
  • Animation tests
  • Timer tests
Things that have been cut for the first release:
  • Proper lighting support. This really limits the usefulness of perspective mode.
  • Physics support. The APIs are there but not tested or supported for now.
Current priorities for second release:
  1. Lighting support
  2. Texture/Material support
  3. Physics support
  4. Any user suggestions

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Technorati
  • Reddit
  • Digg
  • del.icio.us
  • StumbleUpon
  • DZone
  • ThisNext

Related posts:

Trackback URI | Comments RSS

Leave a Reply