420 likes | 535 Views
OnME Platform Tutorial. Ken Hui System Analyst OnME Research Laboratory. Content. Part 1: Overview of OnME Platform System Architecture Logic Flow Engine Components Database Editor Server Client library Part 2: Usage of OnME Platform Getting Started Introduction to OnME Editor
E N D
OnME Platform Tutorial Ken HuiSystem AnalystOnME Research Laboratory
Content • Part 1: Overview of OnME Platform • System Architecture • Logic Flow • Engine Components • Database • Editor • Server • Client library • Part 2: Usage of OnME Platform • Getting Started • Introduction to OnME Editor • Case Studies
System Architecture Database Game Server Client • User • Player • Monster • Item • Battle • Map • Event • NPCs • GUI Elements • Server Communication
Game Server Interaction Map Event Game World Player
Logic Flow How is the “Game World” affected by clients?? Game World Time Line server User 2 User 1 Communication Unit – “Control”
Component 1: Database • Schema (Please refer to OnMEPlatform-UsageGuide.doc section 5) • User • ID, username, password, etc… • Player • ID, HP, Attack, Defense, etc… • Item • ID, name, usage, etc.. • Battle • ID, monsterIDs … • Monster • ID, Characteristic, etc… • Fully tested for MySQL DB. • Reasons for MySQL, • Widely supported by community, such as phpMyAdmin UI configuration tool • Free for academic research
Component 2: Editor • User Friendly • Easy to learn • WYSIWYG
Component 3: Servers • It is Centralized and Distributed • Provides clustering and zone-subdivision techniques for massive player load balancing • Allow asynchronous game state synchronization for client to optimize the network delay limitation • Enable flexible modification for different type of mobile application
Component 4: Client Library • Library Documentation • http://onme.cse.cuhk.edu.hk/sampleClientDoc/index.html • Simple Client has packaged in Object and Source Code license • Base on Finite State Machine • By Class named “Logic” • Apply MVC model User event View Controller Common.Logic Common.View Select view Change modification queries Model updates MODEL Player, BagItem, etc…
Client Library INIT • Implement your own game by inserting states • Just “fill-in” your own game’s logic GAME User input MENU Event Ready WAIT
Set up your OnME server • What’ve you got? • onmeworld (world server) • onmebattle (battle server) • Place the files in the following link • c:/Program Files/Tomcat4/webapp/
Start up your OnME server • Open the command prompt • Start->run->cmd • Type the command • cd “Program Files”/tomcat4/bin • catalina.bat run
Prepare your OnME client • Open the Emulator • Start-> All Progams -> J2ME Wireless Toolkit 2.2-> KToolbar
Open the OnME client project • Press Open Project -> OnMEGame
Build your OnME client • Press build and then run
Run your OnME Client • Run the client in theWTK2.2 Emulator • Register a new account • Choose the server: • Local Server (localhost) • Please Try and Enjoy!!
OnME Editor • Game Map Editing • Make your game more attractive • Game Event Editing • Make your game more meaning and playable
Palette • Basic component of a Game Map • Palette is a png file that is composed of basic grids of the map • Each grid is of size 16 x 16 pixels • Example: a palette with 20 grids
Game Map • A Game Map is a composition of palettes, like a puzzlee.g.
Try the OnME Editor • Open the OnME Editor • Open the resource folder • C:\Program File\ tomcat4\ webapps\ onmeworld\ map\map_72
How to Edit? • Choose the grid of palette • Right click on the map to paste fill the grid • Select a rectangle for filling • Right click for filling the whole rectangle • Copy and paste are enabled • Use Ctrl-c and Ctrl-v • Remember to save your map
Restart your server • Stop the tomcat server by pressing ctrl-c in the command prompt • Type in catalina.bat run to start the server again • Then you can see the changes you’ve just made!!!
Game Event • Missions, Interactions, Transactions, etc.. • Three components • Event Trigger • Event DB (sentences) • Event Content • Naming Conversion • event_xx_yy.evt • where xx is the ID of the map • yy is the ID of the event • You can see some example in the resources folder: C:\Program File\tomcat4\webapps\ onmeworld\map\map_72\event_72_yy.evt
Control • Control is the unit of event • Each event is composed of one or more controls
Types of control • There are 12 controls available: • Dialog • Multiple Choice (store the user choice using temporary variable) • To Battle • Alter (combination of Increment and Decrement) • Exchange (for exchanging items only) • Multiple Choice Jump (for making choices with temporary variable) • Conditional Jump (for checking player’s mission variable) • Unconditional Jump • SetMission • AttributeJump (for checking player’s attributes) • ItemQuantityJump (for checking player’s item quantity) • Jump (for moving the player to another map)
Game Event Example • Open an event file • C:\Program File\tomcat4\ webapps\onmeworld\ map\map_72\ event_72_01.evt
Map 72 is shown here Dialog sentences NPC information Event controls Components of Event Editor
The interface for modifying event • NPC (drag and drop, editing name) • Sentence (editing dialog) • Testing the event by altering player’s information
Try to make a simple event • Try to change the dialog first, make a new event if you want • Remember to save the event • Reload the server • Open an IE browser and type in http://localhost/onmeworld/HttpConnector?gamereload