Swear (151)

1 Name: !WAHa.06x36 : 2005-11-03 16:38 ID:4ECwyo7f (Image: 495x495 png, 43 kb) [Del]

src/1131061133777.png: 495x495, 43 kb

And now for something completely different: Swear is a game I wrote a long time ago (the original version ran on the Amiga!). I never got around to doing a proper release of it, although it was pretty much finished (there might be a bug or two left in, though). But now that I have this fancy site and everything, I figured I might as well try and do a release of it. It's multi-platform, using the Allegro library. You can download it here:

Mac OS X: http://wakaba.c3.cx/releases/mac/Swear.zip
Windows: http://wakaba.c3.cx/releases/other/Swear_win.zip
Source: http://wakaba.c3.cx/releases/other/Swear_src.zip

Theoretically, it should compile on Linux computers too, if they have the Allegro library installed, and you run make os=unix. However, this is largely untested.

As for the game itself, it's the old classic worm game, played in non-euclidean space. That is to say, it is played on the surface of various three-dimensional shapes. It's a pretty simplistic game, and it's old enough to use no hardware acceleration of any kind, so performance may vary (on my Mac, it's leaves something to be desired). There are a lot of tweaking options to play with, though. There's also a feature to merge highscore lists, and I might post mine later if someone wants to try and beat it.

Realistically speaking, I probably won't do much development on this from here on out. If you want to report bugs, go ahead, but there's no guarantee that I'll do anything about them. If you want to take the source and run with it, go right ahead. An obvious thing to do would be to change it to use OpenGL under SDL instead of Allegro, for fancier and faster graphics.

Above all else, have fun!

2 Name: !WAHa.06x36 : 2005-11-03 16:39 ID:4ECwyo7f (Image: 640x480 png, 48 kb) [Del]

src/1131061172998.png: 640x480, 48 kb

Oh, and here's a screenshot. It's all green wireframe-y goodness.

3 Name: !WAHa.06x36 : 2005-11-03 17:34 ID:4ECwyo7f [Del]

Oops, there was a small bug: The default controls were sort of messed up. This has been fixed now, but if you ran the game, you need to use the options page to remap the controls to the correct left-right-up-down ones (or whatever you prefer).

4 Name: Sakurina : 2005-11-03 19:52 ID:/oEhn23D [Del]

This game is simply awesome. No doubt about it, the best game on the Mac platform ever. Hell, I'd pay for this.

5 Name: Anonymous : 2005-11-04 13:22 ID:BwTusqq9 [Del]

This game was awesome!

Makes me a bit dizzy, though.

6 Name: dmpk2k!hinhT6kz2E : 2005-11-04 20:26 ID:Heaven [Del]

This game is great, particularly hunt mode with a torus.

Requesting that the game remember the previously-selected game type (it always starts up with traditional and sphere). Also, could there be a fast-ramp up mode, where you start at something like 50, or the worm grows a lot faster earlier?

UPX makes the game just shy of 50% smaller.

7 Name: Ordinary K!3GqYIJ3Obs : 2005-11-06 14:47 ID:Heaven [Del]

Huge thanks to waha for porting this game to multi-platform, and for helping me get the code compiled and running properly on my Linux machine. Here's how to do it.

LINUX COMPILATION TIPS:

Before you do anything, make sure you have allegro installed. Get it here:
http://www.talula.demon.co.uk/allegro/

After you've got that taken care of, go ahead and unzip the Swear_src.zip file and cd to the src directory.

There is a bit of code in src/lib/goa/allegro/misc.cpp that will cause an error when attempting to compile on Linux, and needs to be changed. Open up your favorite text editor and change line 41 from:

#ifndef OS_MACOSX

to:

#if 0

Now the program should compile without errors by running:

make os=unix

By default, Makefile.magic in both the src and src/lib/goa directories sets CFLAGS and CXXFLAGS to:

-mcpu=pentium -O6 -ffast-math -D_OS_UNIX_

Under gcc 3.4.x, this will generate a warning, because the -mcpu argument is now deprecated (you should use -march or -mtune instead). You might want to set these flags to your hardware's advantage. For example, for my Pentium 4 machine, I set these to:

-march=pentium4 -O3 -pipe -fomit-frame-pointer -D_OS_UNIX

I'm not sure what the -D_OS_UNIX argument does, but leaving it in didn't cause any harm when I ran make. Also, keep in mind -march will create code that runs ONLY on the CPU you specify. To optimize for your CPU without losing backward compatibility, use -mtune instead.

To save hard drive space, run the following two commands after make runs successfully:

strip --strip-debug main
strip --strip-unneeded main

This reduced the size of the file from 615K to 496K on my machine.

You'll need the swear.dat file from one of the binary zips, or you'll get a Guru Meditation as soon as you try to run the program. Just put it in the same directory as the binary.

You'll only need to keep the following files to run Swear:

main swear.cfg swear.dat swear.ico swear.png swear_res.rc

All other files (the .cpp sources, the .o objects, the .h headers, etc.) can be deleted. swear.cfg will be auto-generated the first time you run the game.

To run the game (at last!), just type 'main'.

8 Name: Anonymous : 2005-11-06 16:31 ID:Heaven [Del]

>>7
I compiled Swear on OpenBSD so here are some comments:

I think you meant _OS_MACOSX_.

-D_OS_UNIX defines _OS_UNIX for the C preprocessor, so that code between #ifdef _OS_UNIX and #endif gets compiled.

The optimizations, stripping the executable, removing -mcpu, etc. are basically pointless. I am not sure why your explanation had to be so longwinded. All that is really necessary is fixing the misc.cpp file.

For anyone trying to compile it on BSD, it requires gmake, so you will additionally have to change make to gmake in the Makefile.magic file. make appears four times there. Also, you should run gmake os=unix instead of make os=unix.

9 Name: Jacob Haller : 2005-11-10 16:04 ID:mkJ/d01R [Del]

I've been enjoying playing Swear in blind random mode. Might it be possible to make it so that the grid becomes visible when you finally crash, so you can see where on the curve you've been?

10 Name: Anonymous : 2005-11-11 08:17 ID:ooHcnKy7 [Del]

i've been having problems with it freezing up in windows xp and 2000 (on three different machines) when i use the "trefoil knot", "m^bius strip", "m^bius twist", and "klein bottle" surfaces... on my laptop (turion w/ windows xp 32-bit) it works for a few seconds, then freezes; on the other two systems it freezes as soon as i start the game... also, i was wondering if it's supposed to say "m^bius" or if that's a bug, too...

11 Name: !WAHa.06x36 : 2005-11-11 08:56 ID:wObJR2P+ [Del]

It's supposed to say "Möbius" but I suppose I should change that to "Moebius" to avoid problems.

And yeah, I noticed the freezing, but I have no idea what causes it. It only happens on x86 machines and not on the Mac, and they're running the exact same code. What's more, it used to work just fine on x86.

Right now I'm out of ideas for that one.

12 Name: Anonymous : 2005-11-11 22:46 ID:Mi2ppS5R [Del]

> "Moebius"

萌えビウス ( ´3`)〜♡

13 Name: Anonymous : 2005-11-12 21:51 ID:Heaven [Del]

ビウスっては何だよ?

14 Name: Anonymous : 2005-11-13 01:02 ID:ooHcnKy7 [Del]

i just tried to compile it on freebsd 6.0 (amd64)...

yuki$ gmake os=unix
gmake -C lib/goa
gmake[1]: Entering directory `/usr/home/hotaru/src/lib/goa'
g++ -mcpu=athlon64 -O6 -ffast-math -D_OS_UNIX_ -I. -c -o allegro/bitmap.o allegro/bitmap.cpp
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
allegro/bitmap.cpp:1:21: allegro.h: No such file or directory
In file included from allegro/bitmap.cpp:4:
./goa/bitmap.h:6: error: expected constructor, destructor, or type conversion before '*' token
./goa/bitmap.h:6: error: expected `,' or `;' before '*' token
./goa/bitmap.h:7: error: expected constructor, destructor, or type conversion before '*' token
./goa/bitmap.h:7: error: expected `,' or `;' before '*' token
./goa/bitmap.h:8: error: expected constructor, destructor, or type conversion before '*' token
./goa/bitmap.h:8: error: expected `,' or `;' before '*' token
In file included from allegro/bitmap.cpp:5:
./goa/png.h:38: error: expected constructor, destructor, or type conversion before '*' token
./goa/png.h:38: error: expected `,' or `;' before '*' token
./goa/png.h:39: error: `AL_CONST' was not declared in this scope
./goa/png.h:39: error: `BITMAP' was not declared in this scope
./goa/png.h:39: error: `bmp' was not declared in this scope
./goa/png.h:39: error: `AL_CONST' was not declared in this scope
./goa/png.h:39: error: initializer expression list treated as compound expression
allegro/bitmap.cpp:7: error: expected init-declarator before '*' token
allegro/bitmap.cpp:7: error: expected `,' or `;' before '*' token
allegro/bitmap.cpp:33: error: expected constructor, destructor, or type conversion before '*' token
allegro/bitmap.cpp:33: error: expected `,' or `;' before '*' token
allegro/bitmap.cpp:50: error: expected constructor, destructor, or type conversion before '*' token
allegro/bitmap.cpp:50: error: expected `,' or `;' before '*' token
allegro/bitmap.cpp:73: error: expected constructor, destructor, or type conversion before '*' token
allegro/bitmap.cpp:73: error: expected `,' or `;' before '*' token
gmake[1]: *** [allegro/bitmap.o] Error 1
gmake[1]: Leaving directory `/usr/home/hotaru/src/lib/goa'
gmake: *** [libgoa] Error 2
yuki$

15 Name: Anonymous : 2005-11-13 03:42 ID:Heaven [Del]

> allegro/bitmap.cpp:1:21: allegro.h: No such file or directory

You forgot to install the allegro port? http://www.freshports.org/devel/allegro/

16 Name: Anonymous : 2005-11-13 14:23 ID:ooHcnKy7 [Del]

>>15
i did install the allegro port... and just reinstalled it and i'm still getting the same errors...

17 Name: Anonymous : 2005-11-13 14:24 ID:ooHcnKy7 [Del]

(except that i changed mcpu to march so the thing about thing about mcpu isn't there anymore)

18 Name: dmpk2k!hinhT6kz2E : 2005-11-13 20:20 ID:Heaven [Del]

Try munging around with -I a bit. I don't know where Allegro installs its headers in *nix by default, but maybe -I/usr/local/include/allegro might work.

19 Name: Anonymous : 2005-11-14 08:07 ID:ooHcnKy7 [Del]

>>18
did that and it compiled... but when i try to run it it says:

Software failure!
Guru meditation: SIGSEGV

20 Name: !WAHa.06x36 : 2005-11-14 08:52 ID:4ECwyo7f [Del]

>>19

You need swear.dat from one of the precompiled versions.

21 Name: dmpk2k!hinhT6kz2E : 2005-11-14 09:49 ID:Heaven [Del]

Maybe that should be in the source tarball too. It seems to catch a few people off-guard.

22 Name: Anonymous : 2005-11-14 12:22 ID:ooHcnKy7 [Del]

okay, now i just get Bus error (core dumped)...

23 Name: dmpk2k!hinhT6kz2E : 2005-11-14 19:44 ID:Heaven [Del]

Does it start at all? Ie, do you at least get a window on startup? Or does it just die at command line?

Also, have you run any of the Allegro demos?

24 Name: Anonymous : 2005-11-15 13:15 ID:ooHcnKy7 [Del]

>>23
no window, just dies at the command line.
i haven't run any of the demos... i installed the allegro port using portinstall... would the demos be somewhere on my system or do i have to download and compile them?

25 Name: Alexander!DxY0NCwFJg : 2005-11-17 10:53 ID:1ZBb9kSE [Del]

Haha, I've been playing this game forever. Feels strange that it wasn't released until now. Silly distracted WAHa. ; ) Good that it's out now, it's a game even "normal" people tend to like.

26 Name: Anonymous : 2005-11-17 13:50 ID:Rer3AWs2 [Del]

The game runs really sluggish on my FreeBSD 6.0, Nvidia GF4MX (using the Nvidia binary module); Allegro, SDL, OpenGL, -march or -O2 make no difference.. =(

27 Name: !WAHa.06x36 : 2005-11-17 17:41 ID:4ECwyo7f [Del]

If it can't get direct access to the framebuffer, it'll run dog slow. I don't know what would cause it to do or not do that, though. However, it doesn't use SDL or OpenGL at all, so that has nothing to do with it.

I think there's some X extension that's needed for direct framebuffer access, but I forget what it is.

28 Name: Eleo : 2005-11-17 22:34 ID:Io5/ddW6 [Del]

This game is rad. Make it so one can play across the surface of a tesseract, that would be cool.

29 Name: !WAHa.06x36 : 2005-11-18 05:40 ID:Heaven [Del]

A tesseract has sharp edges, which makes it quite uncomfortable to play on.

30 Name: Anonymous : 2005-11-19 13:46 ID:yd5n9F6n [Del]

Soft tesseract?

31 Name: Anonymous : 2005-11-20 15:01 ID:Heaven [Del]

>>30
what!

32 Name: !WAHa.06x36 : 2005-11-20 17:21 ID:Heaven [Del]

Finding the mathematical form of a soft tesseract might just be a bit tricky.

33 Name: Manne : 2005-11-21 01:38 ID:jss//FCh [Del]

I love this game!

34 Name: Manne : 2005-11-21 16:46 ID:Qmlc/Hbz [Del]

It appears that the Klein flask, Moebius * and the Trefoil knot cause Swear to hang on my machine. The other levels work fine.

35 Name: !WAHa.06x36 : 2005-11-21 18:07 ID:Heaven [Del]

Yeah, I can't figure out why. The code used to work on x86, and it still works on PPC, but suddenly it's started locking up on x86.

36 Name: Anonymous : 2005-11-22 10:12 ID:ooHcnKy7 [Del]

just tried compiling again on freebsd 6.0 amd64 (after a cvsup/buildworld/installworld) and now i'm getting the guru meditation even tho i have the swear.dat in the directory...

37 Name: Anonymous : 2005-11-26 20:38 ID:ooHcnKy7 [Del]

38 Name: anon!21anon4H3U : 2005-11-26 22:48 ID:Heaven [Del]

>>37, this thread is the first hit.

39 Name: Anonymous : 2005-11-27 04:52 ID:Heaven [Del]

If you use quote marks, this thread is the only hit.

40 Name: dustin : 2005-12-12 01:14 ID:xSjg4F7X [Del]

Awesome game!

I like putting it to Hunt mode with Random shape.

41 Name: Anonymous : 2005-12-13 09:37 ID:ooHcnKy7 [Del]

for anyone having problems with it freezing up on certain shapes on windows, changing it to run in a window instead of fullscreen fixed it for me...

42 Name: Anonymous : 2005-12-13 09:37 ID:ooHcnKy7 [Del]

for anyone having problems with it freezing up on certain shapes on windows, changing it to run in a window instead of fullscreen fixed it for me...

43 Name: !WAHa.06x36 : 2005-12-13 10:43 ID:Heaven [Del]

I still haven't figured out what the hell that bug is all about.

44 Name: Manne : 2006-01-18 16:51 ID:hlkRUWiA [Del]

Tried running in windowed mode. It still hangs for me.

45 Name: Anonymous : 2006-01-25 13:41 ID:YMAVLOmv [Del]

Great game.

I was quickly looking through the source to find how to add shapes to it, but could only find the torus and the sphere. where do the other shapes live, and is there a way to add more of them?

46 Name: !WAHa.06x36 : 2006-01-25 16:40 ID:4ECwyo7f [Del]

The other shapes are defined in explicit.cpp and implicit.cpp, using (duh!) implicit and explicit mathematical forms.

You can add surfaces, but I've not put any effort into making this easy for anybody but me, as the engine has some non-obvious limitations. But by a bit of trial-and-error, you should be able to do it, if you have the maths experience to express levels as mathematical expressions.

47 Name: Anonymous : 2006-01-26 10:59 ID:YMAVLOmv [Del]

Thanks. I should probably have looked harder than I did.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: