Mar
05
2013
4

Rubinius support for rbSFML

After I finished the chapter deadline for the publisher I had some free time in the weekend. I spent some of it in making rbSFML compatible with the high performing Ruby implementation Rubinius. Sweet! Sure it required me to do a pull request to the Rubinius repository and do some fixes for them but it is now fully supported.

So if you want to do parallel tasks with rbSFML that should now be fully supported as well since Rubinius doesn’t have a GIL so using native threads there is actually worth it.

I’ve encountered a minor problem with it on Arch Linux. Somehow Rubinius gets it to crash inside Nvidia’s library libGL when the opengl context is being destroyed and I don’t understand why. But well I’ll track it down and fix it as soon as I get time. But it is still usable since the crash happens only when you are exiting the application and as it is destroying the last window created.

Nov
15
2012
0

Making games in Ruby so far

Well I’ve been playing around in rbSFML now for a while and it’s been very satisfying to see how fast and easily your game evolves in Ruby. I recommend this language and I will try to give some tutorials for it.

Of course there are still some problems, like that every math operation is a heavy method call. Ruby truly embed the proverb for optimization:

The fastest code is the one never run.

(more…)

May
25
2012
0

Game projects have been updated yet again

Well just wanted to let know that the game projects have been updated again with more 3D projects and I have reformatted the pages a little to make them easier to read and take information from.

The Space Shooter, Real Time Strategy and the First Person Shooter games have all been uploaded and is now available for download. I hope you enjoy them.

Aug
17
2010
1

Walk trough the memory with CallStack

Took me one day to complete this. These classes will let you walk trough the call stack with C++ and access local variables or arguments in other functions than the current one. I’m trying to follow the KISS(Keep-It-Simple-Stupid) method so it’s very straightforward to work with. The documentation can be found here. And here’s the GitHub repo.
(more…)

Aug
02
2010
1

Ascension – View script draft

Aight I’m coming somewhere now and is about to start on the three mode/view classes that will be called View, ViewController and ViewModel and they will work after the Model-View-Controller concept and first one to be made is the ViewModel which will be the configuration script interface to the application.

It will work like this that the game is going to open the folder “data/views” and in there it’s going to look up all the files that fit *.view and load each and one of them into their own ViewModel class.

Here’s an example script:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
self.SetName("Test")
 
OnInit = self.NewMethod("OnInit")
OnInit < Standard.Kernel.PrintLine("YAY! =D")
OnInit < quit_button.RegisterSignalHandler("Signal.Button.Click", OnButtonClick)
OnInit < background.FitToWindow()
 
OnDeinit = self.NewMethod("OnDeinit")
OnDeinit < Standard.Kernel.PrintLine("Auuw! D=")
OnDeinit < quit_button.UnregisterSignalHandler("Signal.Button.Click", OnButtonClick)
 
OnButtonClick = self.NewMethod("OnButtonClick", "b")
OnButtonClick < Application.Quit()
 
self.RegisterSignalHandler("Signal.Controller.Init", OnInit)
self.RegisterSignalHandler("Signal.Controller.Deinit", OnDeinit)
 
background = self.AddImage("data/graphics/background.png")
background.x = 0
background.y = 0
background.visible = true
 
quit_button = self.AddButton("Quit", "data/graphics/button.png")
quit_button.x = 100
quit_button.y = 50

There’s a lot more to be done here and some parts that I don’t show. For example I will also allow the ViewModel to receive the signal “Signal.Controller.Update” which is a signal from the controller that the view
is being updated. And the view always get updated once each frame. Though I would prefer to avoid the use of this signal as it will slow down the engine significantly if this method needs to be called each frame. And what if we got 100 objects showing that needs their own OnUpdate method called, and so on and so on. It will end up with that we only got 5 FPS or something like that. So instead I will add a lot of stuff like the “SetBackgroundImage” and the “AddButton” methods so that we prepare before it starts instead of working every frame.

Jul
26
2010
1

Ascension – Doxygen documentation site

Well I think I finally understands how GitHub works and how great it really is. I’ve added a github page where I’ve posted my Doxygen documentation of the Ascension project. Should help me alot while working on it as I don’t need to look up on each specific function on what it do but just simply have the documentation on a separate display to reference.

The documentation site is: http://groogy.github.com/Ascension/

Jul
21
2010
2

Ascension configuration

Well I’ve started working on the configuration system integrated into the main controller of Ascension and I got a small draft that first assumes some default values and then reads a configuration file to give us a chance to change these values from an external resource.

Well Anyway the configuration is saved with normal Madness Script and is separated by modules that are named after whatever category they are concerning.

Here’s an example:

1
2
3
4
5
6
7
8
9
Graphics < Width = 1024
Graphics < Height = 728
Graphics < Fullscreen = false
Graphics < AntialiasingLevel = 1
Graphics.Compile
 
Keyboard.Bind("Move Up", Keyboard.UP)
Keyboard.Bind("Move Down", Keyboard.DOWN)
// Etc. etc.
Jul
19
2010
0

New Ascension classes – Symbol and BaseController

Well I’ve added two new classes to the project and I believe that there won’t be any more changed to them as they have all functionality I want with them.

First are the Symbol class which is an idea I got from Ruby symbols. They are supposed to be used as optimized identification strings where comparison is as fast as it can be. The second class is the BaseController which implements the base functionality of a controller. It implements the ability to ask which will let an outside non-friend class query the controller after a specific value . I thought of it like a system based on “Answering a question” which is sent to the controller.

All of this can be found in the Github repository.

(more…)

Jun
24
2010
0

Madness Script comeback!

Oh, I got to dust it off. I’m thinking about to use it instead of Ruby for Ascension. I am having a problem with getting Ruby embedded in the application for windows. Whenever I tried any output to a file or stdout, it crashed.

So I’ll play around with Madness Script instead for Ruby. I won’t change or improve Madness Script cause it crashed in a dead end. But the latest version should work well enough.

May
19
2010
0

Ascension’s Loading Manager

I did something pretty cool today ^^ Well at least I think it’s pretty cool. Also quite simple. A module in Ruby that’s pretty independent and can be used for most applications. It’s called LoadingManager and it will queue things needed by the application and load them in a separate thread for you without you even having to be aware that it is run in another thread.

Here comes an example with it using Rubygame surfaces

1
2
3
4
5
6
7
8
9
10
11
require 'rubygame'
require 'loading_manager.rb'
 
LoadingManager.load Rubygame::Surface, "image1.png"
LoadingManager.load Rubygame::Surface, "image2.png"
LoadingManager.load Rubygame::Surface, "image3.png"
 
# Will print something between 0.0 to 1.0 depending on how far the thread has gone
p LoadingManager.progress
# Wait for the loading to finish before exiting the application.
LoadingManager.join

(more…)

Powered by WordPress. Theme: TheBuckmaker