• Advertisement
Sign in to follow this  

Game programming in Smalltalk?

This topic is 2100 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.)

Share this post


Link to post
Share on other sites
Advertisement
[quote name='HKei' timestamp='1334342251' post='4931013']
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).[/quote]

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).

[url="http://www.youtube.com/playlist?list=PLD60480623B5B1382&feature=view_all"]http://www.youtube.c...eature=view_all[/url]

NBOpenGL installation:


[media]http://www.youtube.com/watch?v=RAvlIVG4biM&list=PL6601A198DF14788D&index=60&feature=plpp_video[/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


[quote name='HKei' timestamp='1334342251' post='4931013']
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.)[/quote]

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.

[quote name='HKei' timestamp='1334342251' post='4931013']
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.)
[/quote]

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.

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement