Scenario Author

From SRASWiki

Jump to: navigation, search

Contents

Language

There was some debate about the best way of implemeting this feature. We eventually resorted to using PHP and the Jquery library. The methods in consideration were:

Static PHP forms

This method would involve creating several php scripts and forms for each action that would be required. This would result in many different php pages and condequently a messy, complex solution.

Java

An offline editor was proposed that could be made in Java using the Swing interface. This would be very quick to implement and could be bolted on to our existing prototype scenario editor although would be realtively inextensible.

JSP

This would operate in the same was a the Static PHP Forms with the added bonus of being able to use the classes from the prototype edition. The downside was it would involve the team learning JSP.

PHP and Jquery

This was the eventual selected solution to the problem. It is by far the most extensible and uses new widely accepted technologies. The downside was there was a learning curve for the team as there was no previous experience in JQuery. Despite this the PHP classes for the engine could be reused and maniplulated accordingly and there is scope for a high quality user interface.


How?

The scenario editor is a Jquery UI user interface which uses AJAX in order to submit data that a user enters into the following PHP session variables:

  • pcArray
  • npcArray
  • eventArray
  • timetableArray

All of these are reloaded into the interface upon refresh except for the timetable, this must be completed from start to finish in one go without reloading the page.

When the user has finished creating all the entities, the writeXml button is pressed, this grabs the data from the session and outputs all of the XML to a file in a format to be read by the engine.

The Editor

The most recent version of the editor can be found here. The XML output by the editor is located here.

Personal tools