Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Scheme Options?

A topic by Pixel_Outlaw created May 16, 2024 Views: 509 Replies: 14
Viewing posts 1 to 7
(2 edits)

Hello All,
After some fun in the past with both Common Lisp and InterLisp (that was a fun hack) I'm trying to take a whack at Scheme this year.
I was hoping to make a native application with real time action. I'm not a fan of the browser adding additional layers and slowing things down. I tend to prefer making arcade games so I really value not having a lot of mystery meat between player and inputs.

I've tried Chicken with Allegro (example doesn't seem to exit cleanly on Linux Mint, last updated 11 years ago - repo frozen).
I've tried Chicken with Hypergiant (got lost in dependency compilation)

I've tried Guile with Chickadee (compilation issues with the two required libraries)

Racket using r5rs mode doesn't seem to have much for real time games.

I know that libraries don't just appear because somebody wishes them to exist.
They take hard work and people constantly have to keep re-wrapping when the C libs change.
I'm hoping I'm not in dire straights for a native Scheme game.


(3 edits) (+1)

--- Regarding Chicken Scheme

Ah, as far as Allegro goes in Chicken Scheme (5)

Change the use on line 3 to import.
Changing line 62 here to have (exit 0) instead of (quit 0) seems to close the window properly.

it's a start I think I can make this work...

--- Regarding Chickadee in Guile:

I tried my best installing Guile from source (seems to have gone OK) but the last mile on the two Chickadee libraries was tough.

Manged to get the .so files installed and the required Guile GL and SDL2 bindings installed,  but it ended in failure when libturbojpeg couldn't be found despite me installing it.

Trace below from building Chickadee. After grabbing bindings and installing system libraries.

https://pastebin.com/XGr1c8ZZ

I can help you get your setup working. 

I'm surprised that you say Racket doesn't have decent options in game dev, what about https://github.com/avelino/awesome-racket#game-development ?

I am using Guile with guile-hoot for WASM compilation. It would be a browser game, but if you want to use chickadee instead, maybe I can help you with that.

First, what is your operating system? Which lisp and game library do you want to go for? (Say, Guile + Chickadee?)

Thanks nchatz314.

My system:
  Kernel: 6.5.0-1022-oem x86_64 bits: 64 compiler: N/A Desktop: MATE 1.26.0 info: mate-panel

    wm: Metacity 3.44.0 dm: LightDM 1.30.0 Distro: Linux Mint 21.2 Victoria base: Ubuntu 22.04 jammy

Guile would be fine if it runs fine on Mac and Linux. (I've got a friend from work who uses Mac computers.)

Chickadee would be fine if it also handles Mac and Linux.


As you can see in the log above it claims libturbojpeg0-dev is already the newest version (2.0.3-0ubuntu1.20.04.3).
Yet when building Chickadee it can't seem to find libturbojpeg.
I'm not sure what the 0 is about but this is what comes with Mint.
I was hoping to avoid installing guix as that drags down TONS of extra data.

Chickadee is using the autotools build system, so just run ./bootstrap and then ./configure before make. If you're missing something, it should be caught at the configuration step, not at the make step. Try this and let me know what you got.

Looks like I'm missing the bootstrap option.
Below is the tree command for what I downloaded from Chickadee's website.

https://pastebin.com/7P7BhJ35

If you download the release tarball as opposed to cloning the git repo, you won't need to bootstrap. You can ./configure and make as usual. Does it configure successfully?

(2 edits)

It appears to say gl is missing despite me grabbing the OpenGL tarball for GNU Guile and running './configure' followed by 'sudo make install'
Output from the OpenGL tarball:
https://pastebin.com/47F5hLiU

https://pastebin.com/15Kfii3m

Output from Chickadee:
https://pastebin.com/9ryihs8U

My guess is that guile does not see the installed module. You can launch an instance of guile and test the command: ,use (gl).

You either need to use --prefix and configure it to be installed somewhere else or modify the GUILE_LOAD_PATH environment variable.

Submitted

I had to compile guile-gl, guile-sdl2 and chickadee with the `--prefix=/usr` option on Debian for it to work properly. It must be a path issue but I dont fancy going through Guile's subtleties atm; the clock is ticking :).

HostSubmitted(+1)

You installed Guile modules to /usr/local but your distro's Guile is configured to load from /usr by default. You'll need to set GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH accordingly to pick up modules from /usr/local/share/guile/... and /usr/lib/guile/...

Submitted

Here's the script I use to compile and install Chickadee on my machines:

https://gitlab.com/binary-ec/chickadee-debian/-/blob/main/chickadee-install.sh?r...

Submitted

I wrote my game last year with Chicken and SDL. It was pretty smooth and the only harder was compiling and packaging for distribution (as always...). I didn't try to interface chicken with a game engine as I was interested in working in lower level, and making a game with SDL alone isn't that hard.

The code is MIT; feel free to use and reuse and hopefully that can get someone going :D

Thanks, I'll look into this too.
Generally I've avoided SDL(2) due to xkeys not being compatible with some usb controllers.
Worth a look thanks!

Submitted

FWIF about a decade ago, I developed an SDL-based engine on top of Guile, called SLAYER.

I haven't been maintaining it for a while (I know that I ran into some compatibility issues with newer versions of Guile), but I just checked under WSL2 (after installing a few additional packages) and it mostly works, including OpenGL rendering. (OpenGL isn't mandatory if you only want 2D graphics)

The packages I had to install (via apt) in order to build it: guile-2.0 guile-2.0-dev libsdl-ttf2.0-0 libsdl-ttf2.0-dev

If you want to give it a try, it's available here (it has some documentation):

https://github.com/panicz/slayer

It also used to have a website on a Ukrainian GNU server, but it is now defuct.

I developed it on Linux, but at one point, I managed to build Windows binaries under Cygwin or MSYS, and they are available as "winslayer" here: https://download.gnu.org.ua/release/slayer/

After building the binaries, you can enter the "demos" directory, and try out some of the demos (such as ./schess.scm, ./pong.scm etc.)

BTW I haven't participated in any game jam before, but I'm using it as an opportunity to improve the programming environment that I work on in my spare time, called GRASP (it is built on top of Kawa, and runs on Android and JVM). In my experience, the Scheme implementation that is the best for video games is Racket (but I'd spare myself r5rs compat, and just go with #lang racket). At one point, I had some broken packages on Ubuntu, and wasn't able to build SLAYER, and I quickly wrote a thin compatibility layer between SLAYER and Racket, and called it "sracket"

https://github.com/panicz/sracket