DimensioneX/RSS: Difference between revisions

From DimensioneX
Jump to navigation Jump to search
No edit summary
Line 19: Line 19:
You get a exhaustive explanation on Wikipedia http://en.wikipedia.org/wiki/RSS, if you want to look at the final result of how your game feed might be, just [http://feeds.feedburner.com/UnderworldOnlineGameFeed|look at this one].
You get a exhaustive explanation on Wikipedia http://en.wikipedia.org/wiki/RSS, if you want to look at the final result of how your game feed might be, just [http://feeds.feedburner.com/UnderworldOnlineGameFeed|look at this one].


== Steps ==
= Steps =


In brief, here is what it takes to have your game's RSS feed up and working:
In brief, here is what it takes to have your game's RSS feed up and working:
Line 42: Line 42:
== Step 2 - Authorize creation of the Journal file ==
== Step 2 - Authorize creation of the Journal file ==


DimensioneX is designed for server safety so it will never create files on the server without authorization.
DimensioneX is designed for server safety so it will never let the game developer to write files on the server without authorization.
So before your game can write the journal file, you have to authorize it.
So before your game can write the journal file, this must be authorized.


Open your game's settings file ('''worldnavNN.properties''' in the '''dimx/WEB-INF/system''' directory) and add this line (if the setting is already there, just edit it):
Open your game's settings file ('''worldnavNN.properties''' in the '''dimx/WEB-INF/system''' directory) and add this line (if the setting is already there, just edit it):
Line 53: Line 53:
  journal=C:/journal.txt
  journal=C:/journal.txt


In this setting you tell the game engine where the journal file will be created and how to call it. Here we choose to create it on the C: drive, root folder and name it journal.txt. Adjust the value to your own preference.
In this setting you tell the game engine where the journal file will be created and how to call it. Here we chose to create it on the C: drive, root folder and name it '''journal.txt'''. Adjust the value to your own preference.
Save, close, next step.
Save, close, next step.
== Step 3 - Insert Journal instruction in the game ==
Just for getting the things started, we can place a Jornal instruction in a frequently called point of the game code so that we can easily see if it works.
Let's open your game (if you don't have one, just pick one out of the DimensioneX kit) and insert this event code:
EVENT onNew
Print "Hello!"
Journal "New player!",gameinfo("site"),"A new player named: " & $AGENT.name & " has entered the game","user:" & $AGENT.name
END_EVENT
If the game already has got an event named '''onNew''', you can just insert the Journal instruction.

Revision as of 03:55, 21 June 2011

Dimx logoinvsmall.gif

back to DimensioneX WIKI main and Italian WIKI


This article describes how to make your game to produce a standard RSS feed with the main in-game events. The RSS feed can be either used by followrs like it is, or it can be piped to other Web 2.0 services and websites such as Facebook, Twitter, etc.

Why producing an RSS feed is so important

It takes much effort to let people to enter and try out your game. Normally you want your visitors to come back, and play more. An RSS feed is a simple and yet standard device to let people outside the game to stay informed about what happen inside the game. Thanks to popular Web 2.0 services such as Facebook and Twitter, by publishing important in-game event news you stimulate new user's curiosity and make them enter and try out your game, thus making it more viral.

This technique, also, is the basis for our DimensioneX-to-Facebook kit, which can turn any DimensioneX-powered game into a full-fledged Facebook App. This aspect will be dealt in another tutorial.

So, you want to create an RSS, just read on.

What is an RSS feed

You get a exhaustive explanation on Wikipedia http://en.wikipedia.org/wiki/RSS, if you want to look at the final result of how your game feed might be, just at this one.

Steps

In brief, here is what it takes to have your game's RSS feed up and working:

  1. Make sure your game runs on DimensioneX 6.4.9 or later (if not, update the game engine)
  2. Authorize your game to write a Journal file on your game server
  3. Place Journal instructions in the game, at specific (and important) in-game events
  4. Verify the journal file is being created
  5. Transform the journal file to a standard RSS feed by using our PHP script (or write your own)
  6. Publicize the feed to your users
  7. (optional) pipe the feed to popular services: FeedBurner, Twitter, Facebook

Step 1 - Update your game engine

First, verify you are running an updated version of DimensioneX. The DimensioneX version is displayed on the connect screen of your own game ("built with DimensioneX ...")

If the game engine is not updated, then the Journal instruction won't be available.

So, if it's the case, go download the most recent version and upgrade.

Step 2 - Authorize creation of the Journal file

DimensioneX is designed for server safety so it will never let the game developer to write files on the server without authorization. So before your game can write the journal file, this must be authorized.

Open your game's settings file (worldnavNN.properties in the dimx/WEB-INF/system directory) and add this line (if the setting is already there, just edit it):

#
# journal
# Path of a local file for producing RSS
# e.g. C:/journal.txt
journal=C:/journal.txt

In this setting you tell the game engine where the journal file will be created and how to call it. Here we chose to create it on the C: drive, root folder and name it journal.txt. Adjust the value to your own preference. Save, close, next step.


Step 3 - Insert Journal instruction in the game

Just for getting the things started, we can place a Jornal instruction in a frequently called point of the game code so that we can easily see if it works.

Let's open your game (if you don't have one, just pick one out of the DimensioneX kit) and insert this event code:

EVENT onNew
	Print "Hello!"
	Journal "New player!",gameinfo("site"),"A new player named: " & $AGENT.name & " has entered the game","user:" & $AGENT.name
END_EVENT

If the game already has got an event named onNew, you can just insert the Journal instruction.