Wintermute Engine Forum
Game development => Game announcements => Topic started by: yaobifeng on August 13, 2008, 01:33:03 PM
-
I use WME developed a multiply players game.The server use JAVA +Tomcat+ SQL SERVER2000.player can login the server,chating each other,also can upon the game data to server and query reports from server.player can see others moving,speaking in himself's client.here is the screenshot:
user login:
(http://www.bster.cn/1.JPG)
regist user:
(http://www.bster.cn/2.JPG)
scene1:
(http://www.bster.cn/3.JPG)
scene2:
(http://www.bster.cn/4.JPG)
scene3:
(http://www.bster.cn/5.jpg)
-
That looks incredible. I'm sure many people (myself included) would like to hear more about the technical background of this achievement ;)
-
WTH!!!! That looks awesome. I didn't know external coding could allow for a multiplayer game in WME. This must be a breakthrough. More info would be great.
Cheers ::beer
Myles Blasonato
PS: I wish i could play the game but i can't read that language :(
-
haha :D,first,thanks for Mnemonic's perfect working.WME is powerful!!I will write some technical details so any others can use for reference.
- game background:
This is a business simulation RPG game,players(3-6 players) set up some companies,each play acts a duty such as CEO,CFO,CTO and so on.
Each company will receive a sum of money at the first,then every need to do lots of things:hire office,buy productlines,invite employees,buy materials,design and develop new products,sell products........., all of the companies will compete each other.
- game frame
I decided to use WME to finish the game client.of course the game need a server program(i use java write some struts actions and use tomcat to run it,game data was stored into the sql server2000).
- network
The WME client program can connect to the JAVA web server?yeah,it seems impossible if we only use itself's ability.so we use delphi writen a DLL file.There is some functions in the DLL,one of them called http_get(url,result),ok,now we can call it in the game script by follow steps:
1.declare the dll function in the base.script:
external "gui.dll" int http_get(string,string);//arg1:http url address;arg2:return value
2.we can call it like this:
var rt=new String(100);
http_get("http://www.dead-code.ogr/test.jsp?arg=1&arg=2&arg=3...",rt);
we send our client program's data by arg=1&arg=2&arg=3...,and the server will return the result in variable rt,our server sometime return a XML string and sometime return a split string(ex:"123#456#abc#def").
we call DLL function to parse XML string and call WEM's String.Split(..) to parse split string.String.By the way,String.Split(..) has more high performace than DLL XML function.
- GUI
The WME itself's GUI is not strong,we use jsp web page(html,css,javascript....) to implemented most of the windows,the WME client open this page by call the DLL function http_webbrowser(url).This solution cause our game can only run in the window mode.........,but i think it's worthwhile.
- multiply player
client side
Our WME Client store the players in a global array:
actors["tom"]=Game.LoadActor3D("actors\....\p.act3d");
We can get every actor by their name:
var act=actors["tom"];
server side
We have a table to store all player's location,scene....,each WME Client need to report it's latest status and get the players list from server at a certain time rate(such as every 100ms),
var rt=new String(2000);
http_get("http://...../LoginAction.do?p0=9&p1="+courseid+"&p2="+companyid+"&p3="+studentid+"&scene="+Scene.Name+"&actor="+actor.Name+"&x="+actor.X+"&y="+actor.Y,rt);
by parasing the string rt. our client program can know how many actors are online,each one's location,scene,who are speaking,speaking what.....
- others
how to display a custom text on the head of the actor?
do it in the actor's script like this:
var WinSubtitles;
var tiptitle;
while(1)
{
if(WinSubtitles==null)
{
WinSubtitles = Game.CreateWindow("subtitles_window");
//WinSubtitles.SetImage("interface\bst\actor_card.tga");
}
if(tiptitle==null)
{
tiptitle= WinSubtitles.CreateStatic("speaker_name");
tiptitle.SizeToFit();
tiptitle.SetFont("fonts\arial_头
-
WTH!!!! That looks awesome. I didn't know external coding could allow for a multiplayer game in WME. This must be a breakthrough. More info would be great.
Cheers ::beer
Myles Blasonato
PS: I wish i could play the game but i can't read that language :(
::beer
the language is chinese,welcome to BeiJing,the Olympic Games is in progress.
-
WOW!!! Just WOW! you've showed us again how wme is powerful tool. This really gives a lot of thought to all of us in here. :o
Thanks for sharing! ::beer
-
amazing stuff.
-
姚兄
-
姚兄