Slowly getting somewhere. RL is really interfereing. But I do expect to end up with something that runs. I'm trying to use the 2D tiles fron the art contest to build a 3D view, maybe even an algorithmically generated one. I'm not (yet, anyway) using the landscape generator I posted here before; it's more or less incompatible with the lanscape tiles from the pixel art contest. From time to time I'll post source code at http://topoi.pooq.com/hendrik/dv/free/fun/wander/
There's a screenshot there, too. Using 3D seems to make the nice little walk-around-on-them tiles look like a huge landscape seen from an airplane. Interesting. Interesting. When I plant some trees, are they going to give me a sense of scale, or will they just look weird?
Or you can acquire the bleeding edge using the monotone revision control system by
mtn clone --db=free-fun.mtn mtn://topoi.pooq.com/free-fun?com.pooq.hendrik.free.fun.wander wander
To compile it, you'll also need the glMlite library, which has a tutorial with links here: http://www.linux-nantes.org/~fmonnier/ocaml/GL/ocaml-opengl-howto.en.php
It's not yet in Debian becasue of technical packaging issues. When you compile it, you'll have good results if you make and install everything. I don't *need* everything, but it got difficult figuring out just what I *did* need.
-- hendrik
It's now more like a game, though technically I can't cosider it one until I provide some kind of scoring feedback. You're plunked down in the middle of a landscape that has red-and-white flags hidden in it (not very well hidden at the moment), Your job is to go to all the flags. You are given a map. It's up to you to not get lost while traversing the landscape. At the moment I haven't implemented fog yet. That should make it easer to get lost. So will blurring the map slightly.
The landcape is made out of liberated pixel cup tiles, but instead of using them in an ordinary orthogonal projection (the way they are designed) I use a perspective view. It's definitely possible to get disoriented by turning.
The code is available as mentioned in the previous message. You'll need ocaml and the glMlite library to compile and run it. Also the usual OpenGL stuff (gl, glu and openglut3) and pnglib. Maybe I left one or two well-known libraries out because they were already on my machine.
It compiles and runs on Debian testing/wheezy. glMlite isn't yet packaged for Debian though; you'll have to download and compile it yourself.
The screenshot on my website is out of date. Sorry.
-- hendrik
Thre's now scoring feedback. It now is a game, and I've enjoyed playing it, though it could probably be made much better if I (or someone else) spent more time at it. Family crises in programmers' households come and go, but free software is potentially forever.
It takes place on a landscape of land and water, but you can't walk on the water. There are eight flags you have to get to, and there's a map to guide you. But even with a map, it's still possiible to get lost. I did while trying it out just now. But that's the point of the game -- keeping from getting lost. On the map the flags change colour when you reach them so you know what you still have to accomplish. The game is started from a Linux shell. Occasional status messages appear there. I'm really not going to have time to figure out OpenGL fonts not to mention finding or making one, so they're probably going to stay on the shell window for a while.
The whole thing has been written in Ocaml (which has a free compiler and LGPL libraries) using the free library glMlite. Unfortunately, that library doesn't have a Debian package, but it's easy to install from source code, provided you have a number of other Debian packages installed. I use OpenGL in its Mesa incarnation. It runs acceptably fast on my testing/wheezy laptop, which is a relatively early-model EEEPC netbook,
I'm going to credit the images I've used by giving the URLs of the relevant parts of the opengameart website, and any relevant bits of data I find there.
When and how do I submit it to the contest?
-- hendrik
the source code ha moved.
I've prepared a draft of the tar.gz file that will be my submission to the code portion of the contest. I've tested it only on the development machine (a laptop running Debian Testing). Download it from the archive link at http://topoi.pooq.com/hendrik/dv/free/fun/wander/index.html I'd like to know if anyone has trouble with the instructions when there's still time to do something about it.
-- hendrik
Hey Hendrik. I've been trying to run your game with no success. Fedora hasn't really packaged most of ocaml yet.
I did manually install ocaml-glMLite from http://www.linux-nantes.org/~fmonnier/ocaml/GL/ however now I'm missing png_loader, svg_loader and genimg_loader. I tried removing them, but if I do that, it complains about
File "wander.ml", line 1, characters 0-1:
Error: Reference to undefined global `Unix'
I'm guessing this won't happen if I had the other cmas, but I dunno what file(s) to install to get those dependencies in line. I'd appreciate any help. Thanks!
Edit: Nevermind the loaders. I figured them out, I had to install ImageMagick-devel and librsvg-devel to compile those pieces of glMLite. I'm still getting the undefined global Unix though.
Edit 2: I figured out the Unix thing, I had to add unix.cma to the makefile. It runs!
png_loader is used on line 656 of wander.ml
I don't need the loaders for svg or jpeg. I hadn't heard about genimg_loader. It sounds interesting.
Debian has an online index, http://packages.debian.org, where you can search for packages by the names of files they contain. Does Fedoora have something similar? If not, the Debian index might give you clues where to look.
Wander definitely does us Unix, on line 33, to get the date and time to initialize the seed of the random number generator. You probably could cut out this code and use a default seed instead. But then you'll always get the same island to explore, which could get boring.
You might, for exapmle, replace
let date = (Unix.gmtime (Unix.time())) in
Random.init (date.tm_sec + 60 * (date.tm_mon + 60 * (date.tm_hour + 24 * (date.tm_mday + 31 * date.tm_mon))));
by
Random.init(68346)
and then recompile the game every time you run it, putting in a different number for 68346.
As the comment in the code says, Ocaml's spec says that you should just be able to say
Random.self_init()
but I found that not to work. But maybe I used it wrong. I'll investigate.
But you get the complaint about Unix on line 1, it might be that the library GL uses Unix itself. If so, I'm surprised you got to build ocaml-glMLite. Or maybe ocaml always complains about libraries on line 1, wherever they are opened.
Let me know how you get on. I don't have a Fedora system here to try anything on.
-- hendrik
I'm the author of the lib that this post talks about, glMLite, I'm just posting to say that the address changed:
http://decapode314.free.fr/ocaml/GL/
The tutorial that Hendrik gave a link is also available there now.
About the png loader, the README explains in detail which lib to install for each image file format, and also explains that you should install the -devel package which contains the C headers.
The makefile of hendrik was indeed missing the unix module, it is required because hendrik initialises the random generator with functions from the unix module (Unix.gmtime and Unix.time).
It is not possible to use Random.self_init () wrongly because there are no parameters to provide. It is supposed to work as expected, and if not, it is a bug. It was known to be buggy on MacOS in the past if I'm not mistaken, but this is surprising that this is buggy on a debian variant (what hendrik is using).
I was happy to find this demo from Hendrik because there are not a lot of public things using my ocaml bindings. I only know a scientific project Zelus https://zelus.di.ens.fr/ and this demo from Hendrik, that's all. So thank you Hendrik! It was a nice gift!
> I had to install ImageMagick-devel and librsvg-devel to compile those pieces of glMLite.
If you only need the png loader, you don't need to compile the other loaders.
It is explained in detail in the README:
https://github.com/fccm/glMLite