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.set_timer(10, -1) # interval 10 seconds, repeats forever
loop do
  event = []
  while(RubyCube.read_event(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

This entry was posted in game programming, ruby, rubycube. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>