Multi user publishing environment mupe application platform
This presentation is the property of its rightful owner.
Sponsored Links
1 / 66

Multi-User Publishing Environment (MUPE) Application Platform PowerPoint PPT Presentation


  • 69 Views
  • Uploaded on
  • Presentation posted in: General

Multi-User Publishing Environment (MUPE) Application Platform. Tutorial v.1.21 [email protected] MUPE – Multi-User Publishing Environment. MUPE is an application platform for rapid development of (mobile) multi-user context-aware applications and services.

Download Presentation

Multi-User Publishing Environment (MUPE) Application Platform

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Multi user publishing environment mupe application platform

Multi-User Publishing Environment (MUPE) Application Platform

Tutorial v.1.21

[email protected]


Mupe multi user publishing environment

MUPE – Multi-User Publishing Environment

  • MUPE is an application platform for rapid development of (mobile) multi-user context-aware applications and services.

  • All parts of MUPE are written in Java (J2ME in clients)

  • Everything is available under the Nokia Open Source license 1.0.

  • MUPE server contains a simple virtual world, that is extended for each application.

  • Scripted client UI script language – one client for all applications.

  • Context information is added to the system from the network, or from each user client.

  • Communications data compressed

  • http://www.mupe.net

  • http://pong.hiit.fi/mupedev


Key features

Key Features

  • Optimised for the wireless network

  • Minimized network data traffic (data compression) – compulsory for services whose price depends of it

  • Optimised graphics (download at connection)

  • Dynamic content (objects in the client can be referred at a later time)

  • Persistent content – all content is serialized

  • Only server side application programming

  • Support for camera, sound, video with MMAPI

  • Public screen support


Architecture

Architecture


Mupe application platform overview

MUPE Application Platform Overview

Wireless network

Client

MUPE

Core

MUPE

Server

End-user devices:mobile phoneswith J2ME

Middleware:connections

MUPE application

functionality

Context

External

producers


Mupe in more detail

MUPE in more detail

Connection middleware

Client

Client

Manager

World

Manager

MUPE

Server

Client

Client

Manager

Client

Client

Manager

Client

Wireless connection

Internet

Context

Manager

MUPE

MUPE

MUPE

Context producer

Context producer

Context producer


Mupe server 1 21

MUPE Server1.21 


How the server works

How the server works?

  • Clients make method calls to the server, and the server replies with a valid UI script.

  • All connected users can get push messages if using TCP


Server static dynamic separated

Server: Static/Dynamic separated

  • Clients make method calls to the server objects(or receives PUSH message)

  • Server returns a valid UI script

  • UIs can be created with XML – no need for programming/compilation

  • Added application logic – Java (J2SE) programming

MUPE Application Programming

Java(J2SE)

XML

DYNAMIC:

Application logic

STATIC:

UI & Interaction


Multi user publishing environment mupe application platform

APIs

MUPE Server

Client API

clientMethodName(User caller, …)

MUPE

Client

internal

XML API

XMLmethodName(User caller, …)

XML File

XML File

XML File

XML File

XML File


Structure

Structure

Parser

AbstractWorld

1

*

Base

contains

1

World

*

1

1

*

BaseExtensions

owned by

0..1

Room

Service

Item

User

Messaging-

Service

Grouping-

Service

Message

Group

ContextManager


The basic mupe server

The basic MUPE Server

  • A Fully functioning virtual world

  • Easily customisable for new content with Java and XML (only server side programming needed – no J2ME programming required)

MUPE Virtual World Content Super Classes

User

Room

Item

Service


Building a new mupe server

Building a new MUPE Server

AbstractWorld

World

User

MyUser

Room

MyRoom

ContextManager

MyContextManager


The world creation

The World Creation

Abstract

World

Parser

World

AbstractWorld()

World()

createDefaultRoom()

createContextManager()

createWorldContent()


User connections a new instance of the user object

User Connections – A new Instance of the User object

World

Phone

Parser

clientCreateUser()

elsewhere


Multi user publishing environment mupe application platform

Push

  • TCP allows the server to push information to each connected user


Each content object has 1 class file and n xml files

Each content object has 1 Class file and N XML files

  • All objects that can have a UI must have an XML file

  • All objects that can be created on the move must have creator.xml

  • All objects that can be accessed directly must have description.xml

  • All objects that can be edited must have Editor.xml

  • Any number (or none) of other XML files allowed

  • The superclass ones are used if none defined and needed

MyUser

Xml/content/MyUser/

Description.xml

Creator.xml

Editor.xml

Etc.


Creating applications with mupe

Creating Applications With MUPE


The connection handled by the framework

The connection (handled by the framework)

Client

Server

clientSubscribe

XML UI: character creation

User::clientCreate {1} {$(nickname.text)}

XML UI: default room


Reconnection

reconnection

Client

Server

clientActivate(caller, passcode)

XML UI: default room

(or last room user was in)


Basic user creation

Basic user creation

XML Script for Character Creation

<template type='form' id=''>

<editfield title='Nickname' id='nickname' />

<command type='ok' text='Ready'>

<g_send type='tcp' type='request'>

User::clientCreate

{1} {$(nickname.text)}

</g_send>

</command>

</template>

MUPE Server: Class Constructor

public User(User caller, Base location, String name)


Customize the user creation

Customize the user creation

XML Script for Character Creation

<template type='form' id=''>

<editfield title='Nickname' id='nickname' />

<choicegroup id='type' title='Character type'>

<i_choice name='0' text='Fighter' />

<i_choice name='1' text='Thief' />

<i_choice name='2' text='Wizard' />

<i_choice name='3' text='Gnome' />

</choicegroup>

<command type='ok' text='Ready'>

<g_send type='tcp' type='request'>

Player::clientCreate

{1} {$(nickname.text)} {$(type.selected)}

</g_send>

</command>

</template>

MUPE Server: Class Constructor

public String Player(User caller, Base location,String nickname, int type)

Player(…, 1, ”Bob”, 3)


Server side dynamic xml methods

Server Side Dynamic XML methods

Allows the UIs to be created with references to the Java code.

The code is evaluated prior to sending to the clients.

Description.xml - A Room description with dynamic calls

<template type='form' id=''>

<string text=‘!#XMLGetContents#!’>

<command type='ok' text='Ready'>

<g_send type='tcp' type='request'>

!#XMLGetID#!::someMethodname {withStringParameter}

</g_send>

</command>

!#XMLGetRoomCommands#!

</template>

MUPE Server: XML Embedded Method

public String XMLGetContents(User caller)

public String XMLGetRoomCommands(User caller)

public String XMLGetID(User caller); // provided by the framework always


Server side dynamic xml methods1

Server Side Dynamic XML methods

The evaluated UI Script

<template type='form' id=''>

<string text=‘You see a treasure chest. It is locked and made of Iron.’

<command type='ok' text='Ready'>

<g_send type='tcp' type='request'>

133::someMethodname {withStringParameter}

</g_send>

</command>

<command type=‘menu’ text=‘pick lock’>

<g_send>133::clientAction {picklock}

</command>

<command type=‘menu’ text=‘Hit’>

<g_send>133::clientAction {hit}

</command>

<command type=‘menu’ text=‘pick up’>

<g_send>133::clientAction {pickup}

</command>

</template>


Server side dynamic xml methods with parameters

Server Side Dynamic XML methods with parameters

!#XMLGetRoomCommands {param0} {param1}#!

public String XMLGetRoomCommands(long caller, long param0, String param1)

<string id=‘!#param0#!’ text=‘!#param1#!’ />

<command text=‘!#param1#!’>

<g_send>!#param0#!::clientMethod {1}</g_send>

</command>

!#XMLGetRoomCommands {!#XMLGetID#!} {param1}#!


Server side dynamic xml file inclusion

Server Side Dynamic XML file inclusion

The evaluated UI Script

<template type='form' id=''>

<string text=‘You see a treasure chest. It is locked and made of Iron.’

<command type='ok' text='Ready'>

<g_send type='tcp' type='request'>

clientPoll

</g_send>

</command>

!#/commands.xml#!

</template>

Commands.xml:

<command type=‘menu’ text=‘pick lock’>

<g_send>133::clientAction {picklock}

</command>

<command type=‘menu’ text=‘Hit’>

<g_send>133::clientAction {hit}

</command>

<command type=‘menu’ text=‘pick up’>

<g_send>133::clientAction {pickup}

</command>


Parameterised xml files

parameterised XML files

<!--param0=idparam1=xparam2=yparam3=cropxparam4=cropyparam5=cropwidthparam6=cropheightparam7=framewidthparam8=frameheightparam9=anyotherattributes,suchasselectable="true“param10=Anyhooks,atributes,etcinsidetheitem-->

<imageid='!#param0#!'x='!#param1#!'y='!#param2#!'resource='bm_all'

cropx='!#param3#!'cropy='!#param4#!'cropwidth='!#param5#!'cropheight='!#param6#!'

framewidth='!#param7#!'frameheight='!#param8#!'!#param9#!>

!#param10#!

</image>

getDynamicXML(<filename>, <caller>, <parms …>);

getDynamicXML(”ui_icon.xml”, this, XMLGetID(0),2,3,4,5,6,7,8,9,10);


The general problem

The general problem

Server

Client

ID=4

ID=st1

?

Room

ID=34

User

ID=11

User

ID=17

ID=kot

?

ID=bob

Room

ID=31

User

ID=7

User

ID=67

ContextManager

ID=2

How to know which object’s methods to call?


Easy solution always use same id s on client and server

Easy solution: always use same id:s on client and server

Server

Client

ID=11

Room

ID=34

User

ID=11

User

ID=17

<image id=’11’ … />

Room

ID=31

User

ID=7

User

ID=67

SuperUser

ID=2


What object is called on the server side

What object is called on the server side?

<OBJECT ID>::<clientMethodName> {param1} {param2} … {param N}

(exceptions: clientActivate, clientCreate, clientSubscribe, clientPoll)

Client

Server

134::clientMakeSomething {param1} {234}

Determine object - evaluate

<I_settext id=‘str1’ text=‘update text’ />


Bag of tricks

Bag of tricks

  • The client needs to determine what object to call on theserver side

  • Many things can be determined in the server side already

  • UI/Interaction & User self need to be determined on the client side


Client side database service key

Client Side Database $(service.<key>)

For every application

Application defined:


Mupe applications

MUPE Applications


Game 1 mupe dungeon

Game #1 MUPE Dungeon


Game 2 firststrike

Game #2: FirstStrike


Preview firststrike with a public screen

Preview: FirstStrike with a public screen


Introduction to mupe client xml scripts

Introduction to MUPE Client XML Scripts


Single ui

Single UI

Template

id=‘main’type=‘form’

Template

id=‘main’type=‘canvas’

<template type='form' id=''>

<editfield title='Nickname' id='nickname' />

<choicegroup id='type' title='Character type'>

<i_choice name='0' text='Fighter' />

<i_choice name='1' text='Thief' />

<i_choice name='2' text='Wizard' />

<i_choice name='3' text='Gnome' />

</choicegroup>

<command type='ok' text='Ready'>

<g_send type='tcp' type='request'>

Player::clientCreate {1} {$(nickname.text)} {$(type.selected)}

</g_send>

</command>

</template>


Multi ui

Multi UI

Template

id=‘main’uigroup=‘g1’

Template id=‘chat’uigroup=‘g1’

Template id=‘avatar’uigroup=‘g1’

<setactiveui='chat'/>


Update item

Update Item

Template

id=‘main’uigroup=‘g1’

Template id=‘chat’uigroup=‘g1’

<string id=‘w’ />

Template id=‘avatar’uigroup=‘g1’

<i_settext id=‘w’ ui='chat' text=‘hello, world’ />


Add ui

Add UI

Template

id=‘main’uigroup=‘g1’

Template id=‘chat’uigroup=‘g1’

<string id=‘w’ />

Template

id=‘avatar’uigroup=‘g1’

Template

id=‘newUI’uigroup=‘g1’

<template …/>


Object creation into template

Object Creation into template

<object_name id=‘<ID>’ …/>

<string id=‘123’ text=‘Hello World.'/>

<string id=‘123’>

<parms>

<text>‘Hello World.‘</text>

</parms>

</string/>


Object attributes

Object Attributes

<imageid=‘1'resource='bm_all'x='5%'y='25%'>

<i_attributename='description'value='Buy beer'/>

</image>


System hooks

System hooks

<i_hookname='on_resource_loaded'>

<i_equalattr='resource_id'value='res_tile'>

<i_eventid='timebar'hook='start'/>

</i_equal>

</i_hook>


Item hooks phone buttons

Item hooks: phone buttons

<i_hookui='game_canvas'id='player'name='on_left_down'>

<!– handler -->

</i_hook>

name='on_left_down‘

'on_right_down‘

'on_up_down‘

'on_down_down‘

'on_fire_down‘


Standard system provided item hooks

Standard (system provided) item hooks

<i_hookname='on_show'>

<i_hook name='on_hide‘

'on_select‘

'on_selector_enter‘

'on_selector_leave‘


Item hooks custom

Item hooks: custom

<i_eventid='timebar'hook='timetick'/>

<i_eventid='timebar'hook='timeout'/>

<i_hookname='timetick'>

<!– implement -->

</i_hook>

<i_hookname='timeout'>

<!– implement -->

</i_hook>


Timers finalise

Timers: finalise

<g_starttimerid='timeout'times='8'time='1000'finalise='true'>

<i_eventid='timebar'hook='timetick'/>

<break/>

<i_eventid='timebar'hook='timeout'/>

</g_starttimer>


Timers initialise

Timers: initialise

<g_starttimerid='move_tmr'times='16'time='100'initialise='true'>

<g_allowuserinputvalue='false'/>

<i_eventid='timebar'hook='stop'/>

<g_sendtype='tcp'>!#param1#!::clientMoveChar {!#param2#!} {!#param3#!}</g_send>

<break/>

<i_setframeid='player'delta='1'/>

<g_moveid='player'deltax='!#param2#!'deltay='!#param3#!'/>

</g_starttimer>


Item traversal foreach

Item traversal: Foreach

<g_foreachgroup='maincanvas'>

<g_setselectablegroup='maincanvas'id='$(this.id)'value='false'/>

</g_foreach>


Comparison operators

Comparison operators

<i_equal id=’12’ attr='type'value='sound'>

<resourceid='res_snd1'type='wave‘url='$(reference.content)'/>

<g_showgroup='object_open_view'id='av_play_button'/>

<g_showgroup='object_open_view'id='av_stop_button'/>

</i_equal>


Graphics resources

Graphics: resources

<resourcetype='image'id='res_fighter'url='$(service.baseurl)/fight.png'/>

<resourcetype='image'id='res_blackmonster'url='$(service.baseurl)/b_monst.png'/>

<resourcetype='image'id='res_yellowghost'url='$(service.baseurl)/y_ghost.png'/>

<resourcetype='wave'id='res_fireball_sound'url='$(service.baseurl)/fireball.wav'/>

<resourcetype='wave'id='res_sword_sound'url='$(service.baseurl)/sword.wav'/>


Graphics images from resources

Graphics: images from resources

<image id='img4' x='30' y='130' cropx='16' cropy='32' cropwidth='16' cropheight='16' resource='res'/>

<image id='img2' x='40' y='40'

resource='res'

framewidth='16' frameheight='16'

cropx='0' cropy='16' cropwidth='48' cropheight='16'

selectable='true'/>

1

4

21

22

23

24

31

32

33

34

Use only a single resource for graphics if possible!


Animation

Animation

<i_setframeid=‘img2'delta='1'/>


Items vs global

Items vs. Global

Dynamic update:

<i_ …> = Item dependant (I.e. id=‘’)

e.g. <I_settext id=‘string’ … >

<g_ …> = Global functionality

e.g. <g_allowuserinput />,

<g_send … />


Tilemap

Tilemap

<tilemapui='game_canvas'id='map'x='16'y='16'rows='9'columns='9'tilewidth='16'tileheight='16'bgcolor='white'opaque='true'><i_addtileresource='res_tile'/>

<i_addtileresource='res_forest'/>

<i_rowindex='0'data='0,0,0,_,_,_,0,0,0'/><i_rowindex='1'data='0,1,1,_,_,_,1,1,0'/><i_rowindex='2'data='0,1,1,_,_,_,1,1,0'/><i_rowindex='3'data='_,_,_,_,0,_,_,_,_'/><i_rowindex='4'data='_,_,_,0,1,0,_,_,_'/><i_rowindex='5'data='_,_,_,_,0,_,_,_,_'/><i_rowindex='6'data='0,1,1,_,_,_,1,1,0'/><i_rowindex='7'data='0,1,1,_,_,_,1,1,0'/><i_rowindex='8'data='0,0,0,_,_,_,0,0,0'/></tilemap>


Current development

Current Development


Location extension for mupe client

Location Extension for MUPE Client

  • The J2ME location API (JSR-179) will be implemented

  • Client can determine it’s location and call a method on server

  • Client can use LANDMARKS to determine a known location prior to a method call.

  • Two games in development highlighting these features


Bluetooth extension for mupe client

Bluetooth Extension for MUPE Client

  • At least device discovery implemented

    • Can determine which other connected users are close by

  • Games utilising this feature in development


Context producers

Context Producers

Problem: Even though the client can determine the context, this is battery consuming

Solution: Make components to the network that can feed this information to the system

  • Developments:

    • Ekahau Positioning

    • Bluetooth positioning


Central server for locating mupe services

Central server for locating MUPE services

  • A central MUPE search tool for locating the services.


Thank you

Thank You

http://www.mupe.net

[email protected]

http://pong.hiit.fi/mupedev/


Setup

Setup

  • The big screen device is a standard MUPE client

  • Run it on the Wireless Toolkit Emulator (version 2.2 or higher).

  • Get UI files from http://www.mupe.net and place them on the folder wtklib\devices

  • Specify from the WTK EmulatorProjectSettings… User Defined  Key Value pair: [type - observer]

  • Connect&use like any other client.


Public screens

Public Screens

World

ObserverRoom

PC

ObserverUser


Public screen connections a new instance of the user object

Public Screen Connections – A new Instance of the User object

World

Phone

Parser

clientCreateUser()

elsewhere


Content differentiation for observer

Content differentiation for Observer

public String XMLGetContents(User caller) throws MupeException {

String retStr = "";

if(caller instanceof ObserverUser) {

// content for the public screen!

} else if(caller instanceof User) {

// normal Users

}

return retStr;

}


  • Login