Really Slick contains free 3D OpenGL screensavers. The screensavers are originally written for Windows, but the downloads page contains links to ports of. This screensaver features a very realistic and accurate 3D model of the Solar System. Embark on your own exploratory voyage with this screensaver of unparalled beauty!!Easy ScreenSaver Studio v.4.0 This is a ScreenSaver maker software to make your own ScreenSaver easily as well as a ScreenSaver management tool.
The latest version of the can be found at. This article describes the implementation of an OpenGL screen saver based on a discrete simulation of predator-prey interaction. The simulation is called Wa-Tor. It was originally described by in the magazine. It simulates the hypothetical toroidal Planet Wa-Tor (Water Torus) whose surface is completely covered with water, occupied by two species: fish and sharks. The sharks are the predators.
They eat the fish. The fish exist on a never ending supply of plankton. Both sharks and fish live according to a strict. This simulation of a simple ecology is highly dynamic as both species are walking a thin line between continuing life and extinction. The screensaver is based on a dialog based MFC application combined with OpenGL for the 2D drawing. As usual, for OpenGL, using the binary without a hardware or drivers correctly supporting it will result in very low frame rates.
The source code requires Microsoft Visual Studio V7.1 in order to compile, MSVC6 is not supported. Set of rules In this paragraph, I will briefly explain the basic rules for a Wator simulation and describe the changes necessary in order to implement the screensaver. In general, the simulation is based on discrete time steps. The simulation runs on a rectangular grid. To represent the toroidal world, opposing sides of the grid are connected. If an individual moves out on one side of the simulation domain, it reenters immediately on the opposing side. Fish and shark move every time step (if possible) and interact according to the following set of rules: Rules for fish In every time step, a fish moves randomly to one of the four neighboring fields, provided it is empty.
Every fish has a predefined 'breed time'. On exceeding this time, it gives birth to a new fish in one of the neighboring cells, provided this randomly selected cell is free. (If not nothing happens.) Breed time counter of both the original and the descendant fish will be reset to zero. Technically fish never die. They live until they reach the breed time, then they clone and both parent as well as offspring restart their life cycle. (To clarify: according to the simulation the parent dies and creates two offspring individuals, but I don't delete the parent, I just reset it.) The following picture shows options for prey movement.
Arrows indicate possible movements. Fish are not allowed to move to cells occupied by sharks. If there are no free neighboring cells no movement occurs. Rules for sharks Sharks move randomly to fields that are either free or occupied by fish.
Every round they lose one point of energy. If they enter a field occupied by a fish they eat the fish and gain a defined amount of energy. If the energy level drops below zero the shark dies. If the energy exceeds a predefined value sharks create an offspring in a free neighboring field.
The energy is split evenly between the parent and the child. Modifications made to the original algorithm In order to turn this simulation into a screensaver, I made some changes to the original set of rules. According to the original algorithm, sharks do not move randomly. Instead they move specifically to cells in their neighborhood containing fish. Testing this is slow, thus I allow only random movement.
Surprisingly there is no visible difference. Dewdney suggested an implementation very similar to a cellular automata. If you implement Wa-Tor that way and by looping over all cells in the simulation domain, you are forced to include cells that do not contain any individual in the calculation. Since this is too slow I chose to implement it as a linked list, thus instead of looping over all cells, my algorithm loops over existing individuals only. Theoretical background The information provided here is taken from the Wikipedia article on.
For a more detailed explanation I refer you to this article. Drawing the number of individuals per species versus time yields curves characteristic for the so called Lotka-Volterra equations (also known as predator-prey equations). Diagram: Population size vs. Time for a predator prey model. This behaviour can be described by two differential equations. There usual form is: where::.
y is the number of some predator (here: sharks). x is the number of its prey (here: fish). t represents the development of the two populations against time. alpha, beta, gamma and delta are parameters representing the interaction of the two species. Although the solution to these differential equations show a periodic behaviour, they can not be expressed in terms of normal trigonometric functions.
However, an approximate linearised solution yields a simple harmonic motion with the population of predators leading that of prey by 90%. Screen saver basics Technically a Windows screensaver is a normal executable with the extension scr. Additionally it has to have a defined command line interface in order to display itself in configuration mode, in preview mode or in screen saver mode. Command line optionn Saver action /P:### Start the screensaver in preview mode. Treat ### as the decimal representation of a HWND. Popup a child window of this HWND and run in preview mode inside that window. /C:### Open the screen saver configuration dialog.
If ### is not present GetForegroundWindow should be the parent of this dialog. Otherwise ### should be treated as the decimal representation of a HWND, which should be used as a parent. /S Run as screen saver in full screen mode. When there is some kind of keyboard or mouse activity in the screen saver mode, the screen saver is ended. Table 1: Command line options. Installation Download the archive with the binary and copy the file WatorSaver.scr to your Windows/System322 subdirectory.
I do not provide a setup program due to the simplicity of the installation process. Configuration After moving the screen saver to your windows/system32 directory, you can edit its settings like any other screen saver settings. Go to the Windows desktop, right click, and in the context menu, select the display options entry. The configuration dialog allows setting up the simulation parameters described above as well as additional settings for the display options. Screensaver parameters All changes made to the parameters will be reflected instantly in the preview window. The following table lists the parameters and their meaning for the simulation process: Prey breed time The number of time steps necessary before a prey can create an offspring. Energy per hunted prey The energy a predator gets for each prey individual it eats.
In each time step, the predator loses one energy point. It dies when the energy falls below zero. Energy to create offspring The minimum amount of energy a predator must have in order to create an offspring. When creating an offspring, the energy is evenly split between the newly created offspring and the parent.
Pixelsize The size of an individual in pixels. Reducing this number will require very high performance! Limitations Like most screensavers, this is a program featuring a controlled amusing misuse of system resources. It is currently a beta version and you use it without warranty of any kind!
Currently the screen saver does not support multiple monitors. Moreover it will only save your screen if you disable all static text displays in its configuration dialog.
This won't change in future versions but I don't consider this a problem since today's TFT Displays don't need a screensaver anyway. You use it at your own risk, no warranties of any kind! Wator Screensaver Copyright 2007 Ingo Berg This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA USA References A more detailed introduction on screen saver programming and issues related to this article can be found at the following places:. Probably the simplest possible OpenGL screensaver.
All you need to know on OpenGL initialization and basic Windows screensaver design (highly recommended). A good starting point to learn more about screensaver programming. Very detailed information but some of the information is outdated (Windows 95/98 specific). This screensaver uses code written by George Yohng and published at CodeProject that simplifies Windows dialog scaling related issues. It saved me a great deal of work!
The page is in German, but it is the best looking applet available and you don't need to understand the text anyway since it will tell you nothing that you won't find on this page. Since I took some of the explanations from this site, I'd like to give it credit here. Find out more about the theoretical background of predator prey simulations at this Wikipedia article. Excellent page with a lot of OpenGL tutorials and their source code for a variety of platforms and languages. This screensaver does not depend on 3D hardware. Thus you might want to give it a try if you don't have accelerated 3D graphics. (And believe me you don't want to use my version without hardware support for OpenGL.) Rev 0.90 (Beta): First version of the screensaver released.
This is a beta version released for testing purposes only. There is much room for improvement like adding multiple monitor support. Rev 1.0: This release contains bug fixes and slight modifications that make the screensaver look prettier (nothing spectacular). Fixed bug that prevented the screensaver from running on ATI graphics cards.
Added a background pattern. Changed title bitmap. Statistic is now scaled between its minimum and maximum. Rev 1.01:. Support for multiple monitors added.
The screensaver can now be deactivated by mouse moves. Rev 1.02:. License changed to GPL-II.
RDABC 11-Apr-07 11:39 11-Apr-07 11:39 Would it be worth the effort to add plankton to the frenzy as a live or die entity. This could go full circle adding a new set of rules for the Plankton.
Plankton feed on the excrement of sharks and fish (more points from sharks). Fish still feed on the plankton but like the sharks they too are having to search for food.
Plankton will also be following the fish and sharks. Other changes could show energy levels of of the fish/shark by the hue or how bright it's color is. This would provide more study as to how sharks are moving and attaining food. We did this years back with the Life simulation where a green square was a noobe, blue was living, red was dieing off. This created a more interesting colorful pattern. RDABC wrote: Other changes could show energy levels of of the fish/shark by the hue or how bright it's color is.
This would provide more study as to how sharks are moving and attaining food. We did this years back with the Life simulation where a green square was a noobe, blue was living, red was dieing off. This created a more interesting colorful pattern. I once had this implemented and it looked pretty unspectacular.
Clearly not what one would expect. The problem is that the motion that you see on the screen does not primarily originate from movement of fish or sharks but from permanent creation of new offspring. The most individuals (approx.
99%) don't move at all. They cant move because they have no free space in their neighboorhood to move to so they sit there waiting to die. Did it really take that long to find a equillibrium?
Normally it takes only a few seconds. Nevertheless I like the idea that people enhance the code. And there is quite some room for enhancements. I'm see the remote possibility to crash the saver when loading data belonging to a simulation witch a different pixel size. This should be dealt with accordingly. It shouldn't happen when the saver terminates normally but since i just removed a bug potentially crashing the saver i would be cautious. I'll see if I add this or something similar, currently I'm quite busy.
Tbrammer wrote:I'm also thinking of other enhancements: + the population may react to 'islands' on the background picture. Islands could be recognized by their colour. + fish population depending upon krill (or other food) density Reacting to islands? Could be interesting to watch, The 'islands' could define different sets of simulation parameters. Interesting perspective for a fish to enter a zone and suddenly it lives longer or can create more offspring.
The fish population depending on a third species is interesting I once started a version with three species but never finished. If you succedd i'd be interested to see your version. Highcooley 13-Nov-06 13:45 13-Nov-06 13:45 Hi there Played around with the Screensaver and was deeply impressed how much fun it is. Really good work with the Open GL realisation.and nice graphics too.
But now to my problem: I once tried to set the pixelsice to a high value (can't remember how high.but was for sure 50).just for testing out, how the fishes and sharks would react on such a small space. Now i can't go back to the settings screen again.it just does not want to open anymore. I can do the settings by start the screensaver manually with the.scr file.changes also take place when I start the screensaver over the.scr file. But the real installed screensaver over windows does not change the pixelsice back.i tried to uninstall and reinstall the screensaver but no chance.it won't work again. Does anybody have any Idea, where i can set this value back to normal? Any dll oder other hidden setting files? Thx for your Help.
Tadeusz Westawic 3-Feb-06 17:28 3-Feb-06 17:28 I could easily be wrong, but. I think what Dewdney meant by cellular automata approach is different from your interpretation. I think he meant it in the sense of using a blitter to process the shark and fish data. Blitting lends itself well to parallel processing cellular automata. I am not sure we as programmers have any direct access to bltters anymore even though I think they must exist on our graphics cards. Does anyone know how to access one?
Does anyone know what I'm talking about? I'll explain if invited. Anyway, I didn't mean to crash your article. I, too am a longtime fan of Scientific American and have written WaTor using both the list approach and the blitter approach on an Amiga platform. Tadzu Tadeusz Westawic An ounce of Clever is worth a pound of Talent.
Tadeusz Westawic wrote:I think what Dewdney meant by cellular automata approach is different from your interpretation. I think he meant it in the sense of using a blitter to process the shark and fish data. Blitting lends itself well to parallel processing cellular automata. I dont know what he meant by his original implementation but according to his article it was quite slow. There is no mention of parallel implementation or using a blitter in his original article. This implementation is different from his original suggestion but there is not much of a visual difference. The list approach was chosen for performance reasons only.
I guess one could calculate the whole thing entirely on a modern GPU which would result in an excellent performance. I have seen wave equations and Navier Stokes equations solved with several hundrets fps on state of the art NVIDIA/ATI GPU. Regards, Ingo. You may be interested in the following articles describing making use of modern GPU's for solving PDE's: I don't have the time to to convert Wator to use the GPU, I'm not even sure I have the right one to do it.
But it would surely be fascinating. I saw a Navier-Stokes equation beeing solved with 400 fps in realtime using a graphics card.
This is just amazing. Especially because until last year I worked at the University and wrote a flow simulator there and I was happy to calculate one frame in 10 sekonds. Although you cant quite compare it seeing real time flow simulated on a computer is amazing. Regards, Ingo. Iberg 16-Aug-05 11:59 16-Aug-05 11:59 The version available for download here will not work with ATI cards. I believe the reason lies in the way the ATI display drivers work if MFC is involved.
Using MFC and OpenGL probably brings you to the dusty corners of Windows programming where strange things can happen. The main problem occurs when using the standard OnPaint event handler for the drawing of the screensaver. Thus it can be fixed by removing OnPaint completely and putting the drawing logic in the OnTimer function instead. Thus the CPaintDC call that causes the problem can be omitted safely. I will publish a new version within the next days/weeks that will solve these problems. I know from my managed DirectX I've been working on, I have to declare the window style as SetStyle(ControlStyles.UserPaint ControlStyles.AllPaintingInWmPaint, true). By seting these two control style bits, it fixes the infighting that comes from painting somewhere else and invalidating the form, triggering the base OnPaint over and over.
If what you're saying is the bug, something like this would fix the problem, I should think. I must admit, I haven't looked at the code recently, and I don't have MSVS installed on my laptop right now either, so you may have already done something like this. If not, this is something that you're going to want to do anyway. Even if other graphics cards aren't causing you problems. Thanks for your reply. I'm not sure whether it is a bug or an incorrect Windows API Flag or style. Since it ran flawlessly on any other graphics card I blamed it on ATI.
In fact the hint you gave seems to be exactly what I was looking for. I posted to several newsgroups and gamedev.net but gut no reply that could solve the issue.
As a last resort I removed OnPaint completely and put it in the timer callback thinking by myself that this must then be the only way how OpenGL and MFC can work together flawlessly on ATI cards. If I can fix it with the SetStyle as you suggested I will use this since I guess this is the better way to do it. In fact you did me a great favour by pointing this out. Since I had no idea what the original problem was. The whole issue left a bad taste, since although the fix I applied is a clean solution and probably has even fewer overhead than a OnPaint call, I just hate it to work around problems without finding out what went wrong in the first place.
So anyway a version that runs on ATI cards should appear here in the next few days since i submitted it last week. Kind Regards, Ingo.