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!
Oh, and here's a screenshot. It's all green wireframe-y goodness.
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).
This game is simply awesome. No doubt about it, the best game on the Mac platform ever. Hell, I'd pay for this.
This game was awesome!
Makes me a bit dizzy, though.
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.
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'.
>>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
.
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?
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...
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.
> "Moebius"
萌えビウス ( ´3`)〜♡
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$
> 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/
>>15
i did install the allegro port... and just reinstalled it and i'm still getting the same errors...
(except that i changed mcpu to march so the thing about thing about mcpu isn't there anymore)
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.
>>18
did that and it compiled... but when i try to run it it says:
Software failure!
Guru meditation: SIGSEGV
You need swear.dat from one of the precompiled versions.
Maybe that should be in the source tarball too. It seems to catch a few people off-guard.
okay, now i just get Bus error (core dumped)
...
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?
>>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?
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.
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.. =(
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.
This game is rad. Make it so one can play across the surface of a tesseract, that would be cool.
A tesseract has sharp edges, which makes it quite uncomfortable to play on.
Soft tesseract?
Finding the mathematical form of a soft tesseract might just be a bit tricky.
It appears that the Klein flask, Moebius * and the Trefoil knot cause Swear to hang on my machine. The other levels work fine.
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.
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, this thread is the first hit.
If you use quote marks, this thread is the only hit.
Awesome game!
I like putting it to Hunt mode with Random shape.
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...
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...
I still haven't figured out what the hell that bug is all about.
Tried running in windowed mode. It still hangs for me.
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?
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.
Thanks. I should probably have looked harder than I did.
Well, I got a bit of inspiration from god knows where, and decided to try my hand at a better Mac OS X port of Swear. The old one ran pretty slow, and it always bugged me. So I threw together this:
http://wakaba.c3.cx/releases/mac/MacSwear1.0.zip
It uses the Mac OS X GUI and OpenGL, and is significantly faster than the old version. It's also a universal binary. Report bugs and problems!
What I'd really like is if someone would feel like doing the hard work for me and porting this to other operating systems, too. I'm too lazy to bother, but I'd really like to see it running on as many systems as possible. The good news for a porter is that it now uses OpenGL code instead of Allegro, making it easier to adapt to anything that supports OpenGL. The bad news is that all the menu code and such has been ripped out and replaced with Cocoa code. The code is fairly well separated into C++ game code and Objective-C GUI code, so adapting the game code for a new platform should be fairly easy. The tricky part is making implementing stuff like highscore lists and such. So if you need a project, here it is!
A quick screenshot of MacSwear.
Pardon my sounding dumb, but... I have downloaded MacSwear, and it appears to run perfectly—but I haven't a clue how to play it. How does one score? And what does "next" mean?
You haven't played the old worm game? You just run around eating the red things to make yourself grow, and try not collid with yourself.
now i wish i had a mac to play this on...
i can't justify spending that much money for something i'd only use to play one game, tho...
Ohh, so DOS.
Man, gotta play this in Blind Mode and Thick Thorus while drunk, should be an unique experience.
Can use a default Windowed Mode.
Hardcore players play in Blind Mode on Random.
hi all,
this looks like a great game, but i cant play it on my Power Mac G4, 400mhz, 512, Mac OS X 10.3.9
any help?
kick52
zuxero46@hotmail.com
Current version doesn't work 10.3. Next one might. Get the old version from http://wakaba.c3.cx/releases/mac/old/, it might work, even though it doesn't run as well.
Very cool snake game.
Fantastic. I am a mathematician, with an special interest in differential geometry, and I am delighted with this program after playing for a while on my Mac. I will try the Windows version and pass the url to my students. Maybe this time they will understand the difference between an orientable and non-orientable surface, maybe even what mean these fancy Betti numbers!
This game look suspiciously alike a game I made a long time ago in Java, published on the web at: http://www.nada.kth.se/~rydh/3DWorm/. Same colors and all.. but not with as many features. (And today most computers are too fast for it since no time delay was implemented so it runs as fast as the processor allows.)
Just curious if the author(s) of this game get any inspiration from that?
No, I hadn't seen that before. I wrote the first version of this ages, ago, probably in 1998 or so. The main inspiration was a really, really bad TRON clone played on a sphere (I think it was this: http://www.aminet.net/package.php?package=game/misc/Revolver_V1.lha).
Yours is a far better game than that ever was. Well, I'd obviously think that since it's very similar to mine. Although you did manage to make a camera that's even more nauseating that what I came up with. It seems to have some issues around the poles, though - I guess you're relying on angles instead of vectors for the camera orientation?
I guess its just a small world, and a good idea. I remember having some problems making it look good around the poles, probably because the camera orientation as you said, is computed from angles that can change very fast near the poles. But I decided to leave it as it was for it looked kinda cool. :)
Anyway, I like your version, it is what I wanted it to be, but never had time to make. Now if only somebody could make a multiplayer version...
Yes, a multiplayer version is really something I'd like to see too, but I never got around to making this because I suck at networking code, especially real-time networking code. If somebody needs a project to work on, there you have one.
Sorry to resurrect an old thread, but what is the license on this thing? I'd like to work on it a bit, maybe port it to SDL, maybe add some framebuffer effects and other trippiness, but that kind of requires knowing the license. Can't make a derived work without one after all.
Call it public domain. I'm not going to complain about anything you do with it, but I do appreciate it if you tell me, and provide source in one way or the other.
If you're going to SDL it, I recommend using the MacSwear source. It's ported to OpenGL, and also slightly re-arranged to be easier to adapt to other systems. However, it does all the interface stuff in Cocoa instead. The menu code in the Allegro version is heavily dependent on the Allegro font code too, so you're out of luck either way.
This game is one of the best games i've ever seen... a lot of fuckin respect goes out for this!
for anyone having trouble with swear running really slow, i got it to speed up A LOT on my freebsd machine by turning antialiasing off.
Strangely on my Panther 10.3.9 G4 Ibook, MacSwear doesn't show up. It crashes just after a few "dock triangle blinks". The App had been started from different folders but to no avail. Am I missing something ?
PS : localized french system
It doesn't support 10.3 currently.
oh, and do you think you could implement a full-screen mode (for total immersion)?
what's this?
>>72
i don't know if macswear does, but the version linked in the first post has a full-screen mode...
Awesome game AAAAA+++
Would play again
Wow, thanks, swear is way too much fun.
A multiplayer feature would be really cool, My friend and I used to play gnibbles (which has up to 4 players) and we would play two snakes each. Anyway, imagine being in control of two snakes in the Klein bottle...
thanks again
i love macswear!! a couple of thoughts though:
1) would it be possible to have shortcuts for selecting 'layer'?
2) 'layer' is a strange term(??)
3) i would like to be a worm on an apple sphere!! similar to the icon, with a bite taken, and a leaf on top!
and 4) dual player sounds awesome! if the other guy crashes into me, HE will be destroyed, right?
It needs a fullscreen mode.
nice!!
Awesome game! One of the best short games to play IMO.
I'm a little confused on the scoring though. The score value for next seems to vary, but I'm not sure why it's higher sometimes. Does it vary based on time between catches, accuracy of hitting the sparkle, or something else?
It's really just random. In hunt mode, it varies with the size and speed and agility of the prey, though.
Thanks a lot for this game. It gives me a brainwash on demand.
heyy, is there a sort of highscore pool for this amzingly fantastic game? That would be amazing. If not, one should be created.
heyy, is there a sort of highscore pool for this amzingly fantastic game? That would be amazing. If not, one should be created.
I did consider making one once upon a time, but then I got distracted like so often happens. I'd be happy if someone else did it for me, though.
has anyone else considered trying to port this game to the nintendo ds? i've been wanting to do it but haven't started working on it yet, so i figured i'd ask so if anyone else has.
I like it
I like it
I like it
lol... This game rocks. Thanks a lot for releasing source code. If I port it, I'll share!
I don't suppose you would be willing to port this to iPhone/iPod touch? I know it would garner lots of eyeballs--not that many games on the App Store are that fun--, but it looks like it would require a complete rewrite.
Please more levels :)
Maybe something like this:
http://www.gomboc.eu/site.php ;
http://www.gomboc.eu/site.php?inc=0&menuId=8 ,
http://www.zeropointnine.com/blog/strange-3d-objects-perlin-noise
Metacage 2,or hollow sphere with some small perforations? :)
Please more levels :)
Maybe something like this:
http://www.gomboc.eu/site.php ;
http://www.gomboc.eu/site.php?inc=0&menuId=8 ,
http://www.zeropointnine.com/blog/strange-3d-objects-perlin-noise
Metacage 2,or hollow sphere with some small perforations? :)
For the low, low price of buying me an iPhone, I can deliver an iPhone version!
Funnily enough, http://wakaba.c3.cx/s/lotsablankers/lotsaglass.html uses almost exactly the same method mentioned in that last link.
Just thought I'd comment on this game, it's amazing! I think I'll be keeping this one around forever. Thanks for it!
Amazing game, I've been playing in the Klein bottle and... it made me realize how lousy my spatial vision is.
Anyway, this game is great in every detail: the evolution of the classic snake concept, the graphics, options, levels, the overall awesomeness factor... thank you so much for developing it.
But, if I had to point out an imperfection, it would be the application ICON. In my humble opinion, it doesn't do any justice to the stunning look of the game. If you know what I mean, there are lots of people out there who "judge books by their covers", and the corollary of that is that they also judge free games by their icons. I hope that you'll change the icon to reflect the graphic goodness of this game.
Bye, and I hope I didn't offend you in any way, my intention is good.
it's like a wireframe version of snake. and very addictive!
This is one cool game! It's really fun to play! It may have been initially inspired by the classic worm game, but with the hunt mode on, it is an entirely different experience, nothing like the classic worm game!
Would it be possible to add a full screen menu option (Command+F)?
Also, a head/mouth for the space worm would make the character more interesting/believable.
What about anti-aliasing? I know, with the spinning action the game doesn't really need it, but the space worm does, as he is pixelated (when he turns).
The game also needs a Leopard sized icon.
And here's the Leopard-size icon! If you like it, download it and use it. Free to share, not to sell. The wireframe sphere is H3g3m0n's work, the icon is mine.
To replace the default icon for the game, (on Mac OS X) right click on the application and choose "Show Package Contents". Navigate into the Contents folder, then into the Resources folder. Copy and replace the swear.icns file. Done!
Whoops, that didn't work. Here:
http://www.filefront.com/13963723/swearicon.zip/
Click "Download".
wow, this is a fun and addicting game. nice!
!WAHa.06x36, it freezes on windows when I go through the surface intersection in the bottle. Maybe this can tell you where the bug lays.
>>118
oh god i hope i forget seeing that before i go to bed tonight. i really don't want to know what kind of nightmares that could cause.
Very nice game! Simple concept, simple -but awesome- graphics, challenging levels, and minimal resources used.. i absolutely love this
I've been doing a little work on a cross-platform SDL version in some bits and scraps of spare time. I'm using the OpenGL code to render the game, of course. But from here, I don't know whether I should be porting the old menu code or just hacking together a new menu. What's the origin/license of this menu code? I couldn't immediately tell. If it's legally unencumbered, I might think about porting it. I've already thrown together a little class to let me render the fonts...
Everything should be as free as it gets.
Great. With that in mind, this weekend I started porting the menu code over to SDL/OpenGL. It's not a beautiful job, but it is starting to work. Can always clean it up later. :)
WIP shot shows the main menu pretty much drawing.
Excellent.
by playing this game every day i will become a super genius
Where to put our highscores?
AWESOME GAME!!! THX !WAHa.06x36 !!!
a friend of mine showed me this game a few years ago and it came across my mind when I looked up snake games in itunes...
it took me forever!!! but I found it :D
also the last maps (trefoil knot, mobius strip & twist, and Keiln bottle) immediately freeze when I run them.
running Win7 64 bit
any ideas?... cause they seem like the coolest levels...
and if you make an iphone app of this... i will buy it :D
> also the last maps (trefoil knot, mobius strip & twist, and Keiln bottle) immediately freeze when I run them.
> running Win7 64 bit
> any ideas?... cause they seem like the coolest levels...
>>105
>>114
Don't forget that in order to build an iPad/iPod/iPhone app, you'll need XCode. And to run XCode you'll need at least a Mac Mini. On top of that, you'll need a $30 (IIRC) developer license if you want to release the game commercially (don't know if you need it if you're not a corporation).
Also, I got it to compile but it gives a guru meditation error. I'm using Bazaar btw, if I get it to work I'll upload it somewhere so you can merge it.
I'm havig trouble fixing it, load_datafile in main.cpp:59 returns NULL.
Lol, had to get it from the Windows zip. It works now, though I'm keen to know how you made that file.
These are the minimal changes for i586:
<code>=== modified file 'creatures.h'
--- creatures.h 2010-12-30 19:58:42 +0000
+++ creatures.h 2010-12-30 20:04:37 +0000
@@ -65,7 +65,7 @@
void place();
void live();
void draw();
- bool skittler::collide(const vector &other,const vector &other_normal);
+ bool collide(const vector &other,const vector &other_normal);
worm *w;
=== modified file 'lib/goa/allegro/misc.cpp'
--- lib/goa/allegro/misc.cpp 2010-12-30 19:58:42 +0000
+++ lib/goa/allegro/misc.cpp 2010-12-30 20:02:54 +0000
@@ -38,7 +38,7 @@
#endif
}
-#ifndef OS_MACOSX
+#ifdef OS_WINDOWS
static LPTOP_LEVEL_EXCEPTION_FILTER prevExceptionFilter = NULL;</code>
Oops, it got screwed up. But you get the idea ;)
Just put in an hour or so on the SDL port after not having had time to mess with it for quite a while. Here's a reasonably complete work in progress Windows OpenGL version.
Whoops. Link: http://www.princessangelpony.com/x/Murphy/SDLSwear.zip
>>136,137
nice... the worm is a bit hard to see sometimes, tho. it makes it really hard to play on the klein bottle. are you going to publish the source code? if so, it might convince me to finally get around to getting a version of this working for nintendo ds...
I should probably link this in this thread, too:
>>139
Indeed. Really dig some of the new graphics modes, by the way!
>>138
Yeah. I think I may actually have messed up the blending modes a bit in the build in the zip file. My latest build changes that around a bit, adds ability to (partially) turn off antialiasing, and makes some of the line thickness selectable (so you can have a thick worm, for example). I'll be releasing the source at some point (or just making the repository public) if for no other reason than I'd like someone that isn't me to maintain a Debian package of it. :) It's kind of a mess, but such is life.
>>141
now that's a game that could really take advantage of the 3d screen on my evo 3d!
Man, this game is AWESOME! I know that you're not fixing bugs, but i just want to say that when i try 4d objects my game crashes. And btw, i have an amiga and im like oh my god! it's an amiga game!
Why is it called Swear?
Love It!
Such humble beginnings...
I still play this game. It's wonderful.