Game programming in Smalltalk?

Started by
1 comment, last by HKei 11 years, 12 months ago
Is there any usable, actively maintained game library for Squeak/Pharo? Preferably a low level wrapper around OpenGL, but others would work as well. Now this is mostly out of curiosity (Smalltalk is always nice for trying things out, so it's also great for writing prototypes).

The problem I have so far is that most projects I find have either already been discarded or were apparently written specifically for a version that I don't use. Maybe I'm doing it wrong, but it's still annoying (and that's only graphics. Haven't found anything on Keyboard/Mouse/GamePad input (of course mouse and keyboard has to be there somewhere, else Pharo wouldn't work) or sound yet.)


Though I suppose if such a library doesn't exist, I will try Scala/LWJGL instead.

(Oh, and before anyone brings it up: Performance is, at the present, a non issue for me. Interpreted or not, it will be a while until I start writing stuff where performance problems come due to anything other than my own incompetence, so I prefer to write my code the way I consider fun rather than what's maximally efficient.)
Advertisement

Is there any usable, actively maintained game library for Squeak/Pharo? Preferably a low level wrapper around OpenGL, but others would work as well. Now this is mostly out of curiosity (Smalltalk is always nice for trying things out, so it's also great for writing prototypes).


I have a series of videos that show what can be done using the old Croquet/Cobalt bindings to Squeak and Pharo. There is an up to date set of bindings available (currently only on Pharo) called NBOpenGL, which are created directly from the specifications found on the Opengl website, which likely makes them more up-to-date than anything you can currently get in a commercial development system (unless it has an option to visit the website dynamically and recreate the bindings).

http://www.youtube.c...eature=view_all

NBOpenGL installation:


[media]
[/media]

Note that some steps of the video may no longer be required.

using a new NBCog VM and the latest Pharo 1.4 image, try this code in the workspace:


Gofer new
squeaksource: 'NBOpenGL';
package: 'ConfigurationOfNBOpenGL';
load.


and then

(ConfigurationOfNBOpenGL project version: '1.0.2') load



The problem I have so far is that most projects I find have either already been discarded or were apparently written specifically for a version that I don't use. Maybe I'm doing it wrong, but it's still annoying (and that's only graphics. Haven't found anything on Keyboard/Mouse/GamePad input (of course mouse and keyboard has to be there somewhere, else Pharo wouldn't work) or sound yet.)


Keyboard input isn't as consistent as it could be in either Squeak or Pharo, though people are constantly discussing ways to normalize it for cross-platform use, both for games, and for more robust business apps.


Though I suppose if such a library doesn't exist, I will try Scala/LWJGL instead.

(Oh, and before anyone brings it up: Performance is, at the present, a non issue for me. Interpreted or not, it will be a while until I start writing stuff where performance problems come due to anything other than my own incompetence, so I prefer to write my code the way I consider fun rather than what's maximally efficient.)


With the NativeBoos custom "JIT" VM, you can specify that specific methods or sets of methods are written entirely in native code, and you can even bypass the overhead of the VM completely when calling one method or external library from another.

The real issue with writing a realtime game in Squeak/Pharo is the overhead from automatic garbage collection, which can cause ugly pauses in a frame-rate-vital game.

There is a new solution for Squeak/Pharo called Spoon which has a much lower garbage collection overhead than the current systems, but I haven't yet been able to test how much difference it will make in a real game.
Thanks for the information. I only saw it now because after 2 days I thought noone was going to reply. I'll try NBOpengl now, I'll see how far I get with the rest. (Although judging by the fact that this topic is on the first page when searching for 'Smalltalk Keyboard Input' in google, not too many people other than me seem to try this - that or I'm the only one for whom it isn't immediately obvious).

This topic is closed to new replies.

Advertisement