Waterstorm, Crimson Tide@home

A few years ago my friend and fellow worker Markus Prossegger and myself had the chance to contribute to an innovative computer game called waterstorm. Waterstorm was forged by a young innovative company named Rarebyte which was founded some years ago by a young team of Telematic/Network Engineering graduates.

The game belongs to the 2D multiplayer shooter genre. It is entirely written in java, They decided to use lwjgl for the game engine and FengGUI for the Graphic User Interfaces.

Our part was to implement the Bot System considering the intelligent bahavior of the bots as well as an automatic path finding, which is Markus’ hobbyhorse. To make it short – if you ever want to know how a navigation system finds the right route, ask Markus, he will explain it to you in detail 🙂

Markus will shoot me 🙂 but in the next few sentences i will try to describe what kind of algorithm we decided to use.

Little change of the master plan, Markus misplaced his gun, so he will explain it to you 🙂 ….

Markus its your turn.

First of all we had to decide, what the overall game behavior of the bots should be. We wanted them to act like a human player: (a) select a target, (b) find the best way to the target, (c) attack it or (d) flee to some power ups in case of low ammo or low health. The task of (a), (c) and (d) is simple: if the bot has enough ammo, than attack the closest enemy (could be another bot as well). If the ammo or the health is low, than select one of the power ups as the target. The task (b) is the more sophisticated part of the Bot System – the bot has to find a shortest path towards the target (the enemy or the power up). There are a lot of well-known shortest path algorithms out there, that will handle the task.

But there are some points that have to be considered: the path must not be predictable by a human player (so simple „follow-the-shortest-path“ won’t work) and the server has a limited capacity (there are a number of bots in the game, so the algorithm has to be designed very resource-conserving).

So we decided to use one of the shortest path algorithms, that uses a heuristics to search the space to efficiently reduce the time needed and to „manipulate“ the outcome of the algorithm: the path. We have picked the IDA* (IDAstar), which is a variant of the A* algorithm and allows to perform a series of independent depth-first searches, each with the cost bound increased by a minimal amount. This leads to two ways, to manipulate the resulting path between the bot and its target. First the estimation value (used in the heuristic search) can be blurred by a random value and second the number of iterations can be limited. Both together leads to an unpredictable path as well as speeding up the time needed for the path calculation.

It’s fun to play against the bots – just try it for free at www.waterstorm-game.com

There is always another one who did the job

A few months ago me and my colleagues wrote a project proposal for an internal project call/funding. Our goal was to evaluate the possibility of using small drones, in our case we want to use Quadrocopters, for catastrophe management. Our drones should be used as communication relays, disaster reconnaissance, air gas analysis…

Since a few of us are active members in certain Quadrocopter OpenSource community projects, we have also a basic knowledge about this type of drones.

But sadly we didn’t got the fundings 🙁  just a matter of politics,…….

But as I wrote in my caption There is always another one who did the job in our case the guys from the TU Ilmenau.

[youtube whogQY0h8Sc]

If you would like to read the whole article refer to spiegeltv.de link. (German only)

OpenKM our new Document Management System, nice…..

For months I was searching for a system capable to track and store out internal documents. I tested several systems like alfresco, opendocman,…..

In the end I decided to give OpenKM a try.

OpenKM runs on a JBoss application server, so you are bound to Java.  They use Jackrabbit for their hierarchical content storage.  The frontend is realized with GWT (Google Web Tollkit).

For a full feature list click here.

OpenKM install hints:

I installed OpenKM on a recent Debian 6.0

Getting .pdf, .docx, .xlsx preview running:

First you need to install OpenOffice. Make sure you install …-math, …-writer, … -draw, …-calc packages.

OpenOffice hast to bee run in headless mode. I use following startup script:

#!/bin/sh
### BEGIN INIT INFO
# Provides:        OpenOffice Headless
# Required-Start:    
# Required-Stop:    
# Default-Start:    2 3 5
# Default-Stop:        
# Short-Description:    OpenOffice Headless
### END INIT INFO

PIDFILE=/var/run/openoffice-server.pid

case "$1" in
'start')
 if [ -f $PIDFILE ]; then
 echo "OpenOffice headless server has already started."
 sleep 5
 exit
 fi
 echo "Starting OpenOffice headless server"
 soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" -nologo -headless -nofirststartwizard & > /dev/null 2>&1
 touch $PIDFILE
 ;;
'stop')
 if [ -f $PIDFILE ]; then
 echo "Stopping OpenOffice headless server."
 killall -9 soffice && killall -9 soffice.bin
 rm -f $PIDFILE
 exit
 fi
 echo "Openoffice headless server is not running."
 exit
 ;;
*)
 echo "Usage: $0 { start | stop }"
 ;;
esac
exit 0

To get the preview stuff working you need also pdf2swf. Check your /bin directory there should be a pdf2swf executable or if you prefer you could take the swftool package from ubuntu.

The last step to get the previewer feature running is to set the corresponding config. flags at the OpenKm.cfg file.

  • system.openoffice=on
  • system.pdf2swf=/usr/bin/pdf2swf

Mail Notification configuration:

Mail notification is straight forward. Go to /opt/OpenKM-4.1_JBoss-4.2.3.GA/server/default/deploy/mail-service.xml . Edit the section to your needs.

If you face the problem that the links in your notification mails are pointing to localhost, you can alter the application.url flag in your OpenKM.cfg.

  • application.url={yourURL}:{yourPort}/OpenKM/es.git.openkm.frontend.Main/index.jsp

Changing from port 8080 -> 80

GoTo /opt/OpenKM-4.1_JBoss-4.2.3.GA/server/default/deploy/jboss-web.deployer/server.xml and edit

Change the port field to 80.

Securing your JBoss

One last thing needs to be done :-). Security! Holy Moly… what… yep.. Jboss runs out of the box like an open barn door. So a good idea would be to secure the jmx-console and web-console stuff. Because of that the jmx-console and web-console are standard servlets you can protect them very easily via enabling the security-constraint.

Securing the jmx-console:

1. Edit \server\default\deploy\jmx-console.war\WEB-INF\web.xml and uncomment the security-constraint section:

<!-- A security constraint that restricts access to the HTML JMX console
 to users with the role JBossAdmin. Edit the roles to what you want and
 uncomment the WEB-INF/jboss-web.xml/security-domain element to enable
 secured access to the HTML JMX console.-->
 <security-constraint>
 <web-resource-collection>
 <web-resource-name>HtmlAdaptor</web-resource-name>
 <description>An example security config that only allows users with the
 role JBossAdmin to access the HTML JMX console web application
 </description>
 <url-pattern>/*</url-pattern>
 <http-method>GET</http-method>
 <http-method>POST</http-method>
 </web-resource-collection>
 <auth-constraint>
 <role-name>JBossAdmin</role-name>
 </auth-constraint>
 </security-constraint>

 <login-config>
 <auth-method>BASIC</auth-method>
 <realm-name>JBoss JMX Console</realm-name>
 </login-config>

 <security-role>
 <role-name>JBossAdmin</role-name>
 </security-role>
</web-app>

2. Edit \server\default\deploy\jmx-console.war\WEB-INF\jboss-web.xml. Uncomment the following section:

 <jboss-web>
 <!-- Uncomment the security-domain to enable security. You will
 need to edit the htmladaptor login configuration to setup the
 login modules used to authentication users.-->
 <security-domain>java:/jaas/jmx-console</security-domain>

</jboss-web>

3. Edit \server\default\conf\props\jmx-console-roles.properties file

4. Edit \server\default\conf\props\jmx-console-users.properties file

5. Edit \server\default\conf\login-config.xml edit following section

 props/web-console-users.properties
 props/web-console-roles.properties

6. under \server\default\conf\props\ copy and rename the two jmx-console-xx to web-console-xx.

Automatically start OpenKM (Jboss) via init scripts:

If you want to start your OpenKM automatically at boot time you can use this init script:

#!/bin/sh
# /etc/init.d/jbossokm: Start and stop JBoss Application Service
### BEGIN INIT INFO
# Provides:        OpenKM
# Required-Start:    
# Required-Stop:    
# Default-Start:    2 3 5
# Default-Stop:        
# Short-Description:    OpenKM
### END INIT INFO

ECHO=/bin/echo
TEST=/usr/bin/test
JBOSS_START_SCRIPT=/opt/OpenKM-4.1_JBoss-4.2.3.GA/bin/run.sh
JBOSS_STOP_SCRIPT=/opt/OpenKM-4.1_JBoss-4.2.3.GA/bin/shutdown.sh

$TEST -x $JBOSS_START_SCRIPT || exit 0
$TEST -x $JBOSS_STOP_SCRIPT || exit 0

start() (
 $ECHO "Starting JBoss OKM."
 rm -rf /path/to/server/default/tmp
 rm -rf /path/to/server/default/work
 rm -rf /path/to/server/default/log
 su -l -c "$JBOSS_START_SCRIPT -b 0.0.0.0 > /dev/null 2> /dev/null &"
 $ECHO "Done."
 )

stop () (
 $ECHO "Stopping JBoss OKM. "
 su -l -c "$JBOSS_STOP_SCRIPT -S > /dev/null &"
 sleep 10
 $ECHO "Done."
)

case "$1" in
 start )
 start
 ;;
 stop )
 stop
 ;;
 restart )
 stop
 sleep 30
 start
 ;;
 * )
 $ECHO "Usage: jbossokm {start|stop|restart}"
 exit 1
 esac
 exit 0

Shutdown problems (network unreachable exception)

If you get an exception at shutdown or your shutdown script does not kill your JBoss then you could check sysctl-setting under /etc/sysctl.d/bindv6only.conf.

Make sure that the net.ipv6.bindv6only=0. !

If you would like to show your appreciation consider to support the guys from OpenKM with a donation 🙂

See PayPal subscription link at the bottom of the page

 


Eclipse 3.6M7 update site not found fix

After installing the new Eclipse 3.6M7 Stream Stable Build I could not connect to any update site nor to another project site.

After some investigation I found out that there must be something wrong with the used IP protocol stack. Eclipse seems to use IP4

So if you start eclipse with

./eclipse -vmargs -Djava.net.preferIPv4Stack=true

eclipse should be able to reach your update sites.

A small update to my Post:

I just found out that the real problem is a new  sysctl-setting under /etc/sysctl.d/bindv6only.conf. LOL

Check the net.ipv6.bindv6only item this should be 0 (null).

After changing reset the sys kernel variabels with:

sudo invoke-rc.d procps restart

have fun