Game Development Community

Using the Web Plugin w/ Multiplayer? Post your thoughts!

by Dusty Monk · in Torque 3D Professional · 10/30/2011 (12:20 pm) · 13 replies

Hey folks!

I'm currently thinking about where to take Atomic City Adventures next, and I'm kicking around an idea of a free to play, web-plugin-enabled browser version of it. I'm still formulating my design, but the rough idea is essentially you'd come to the Atomic City Website, join the community, and play the single player version through the web browser right there at the website. That part you could do for free, and then over time we release new zones, new content, new missions, which you would purchase. Eventually we'd want to add coop and multiplayer missions as well.

But it all kind of hinges on how well the web plugin actually works, and what other kinds of services you could build through the engine and then rely on the web plugin to do. So if you've actually used the web plugin, I'd love to hear your experiences with it. And what I'd really love to see is any site or service, anywhere, that is currently providing a torque game through the browser, combined with customer services like registration, community, etc. The best example I can think of is Fusion Fall, by the Cartoon Network, but their service was built in Unity, and uses the Unity plugin. The only other one that I know of is the old Instant Action site, which as I recall had quite a few games that actually provided Web-Enabled versions of themselves. But of course, Instant Action is no longer around.

So if you're using or developing any game that uses the web plugin in conjunction with a community oriented site, or if you've started such an endeavor but eventually abandoned it, please post your thoughts, experiences, or just links, here.

Thanks in advance!

Dusty

About the author

Dusty Monk is founder and president of Windstorm Studios, an independant game studio. Formerly a sr. programmer at Ensemble Studios, Dusty has worked on AAA titles such as Age of Empires II & III, and Halo Wars.


#1
10/31/2011 (11:04 am)
I'm working on a project for a client where we've started using OSAKit (osakit.com) to do web deployments. Not that it's much different than the T3D web plugin (it does have some capabilities the T3D plugin doesn't have), but it's much more reliable in my own experience (honestly, I didn't even seriously consider using the T3D web plugin, so there's bias in this). We've gotten the game playing in the browser pretty well, along with passing command-line parameters through the plugin to the exe.

In the context of this plugin, you can download files, so if you manage to put them in the right place and have T3D look there, then you can download content on the fly and then exec() it.
#2
10/31/2011 (2:10 pm)
Thanks Ted I was unaware of the osakit. It definitely looks interesting, so I'm going to dig into it a bit further. Glad to hear that it seems to be doing pretty much the same thing that I want to do.

Any chance you can talk about the project, or when the project is done, provide a link? Would love to see the kit and torque together in action.

#3
10/31/2011 (3:26 pm)
I checked out the OSAKit back during my simulation days. I almost used it for a project with T3D back then. Oddly enough, it didn't test well with the intended audience, they actually preferred the flow of the stock T3D web plugin. They were a pretty peculiar group though.
#4
10/31/2011 (3:56 pm)
@Dusty: Can't talk about it quite yet, though I'm hoping to be able to show something soon. What I can say is that I didn't see any real reluctance to the plugin, and aside from the usual issues when getting people to test a T3D game, it was a nice experience. Of course, it doesn't stream like some of the other plugins either (well, it can stream, theoretically, but you have to get T3D to support that kind of thing by telling it which files to download), but if the game is fairly lightweight (~20MB or less), it's a pretty quick download.

@Scott: Users can be quirky ;) The plugin does need to be signed and branded though, if you want better user acceptance. Even with a set of testers that all were fine with it, you still want to go that extra mile to reassure new users that the plugin is good to go.

Maybe it's time for me to write another blog on online games...
#5
11/01/2011 (4:24 am)
I totally know what you mean about not having time to blog when you're head down trying to make a game! But I'm scouring the community right now looking for people that are doing this kind of work and trying to get experiences. So if you did put something up you'd have at least one ready! :)

I'm a little skittish now about the OSAkit. I went to their site yesterday, and of the three game demos they had showing use of the plugin, one worked, one was a dead link, and the third tried to install a trojan on my development machine. I may still download it this week and make sure it's thoroughly sanitized and then check it out.

#6
11/01/2011 (7:47 am)
Yeah, I came across that demo too at one point :/ It's a downside of packaging with a plugin that you get lumped in with people who do that sort of thing.

So, across a few projects, I've done some work on online content stuff, and one of the few things I haven't done is to have a client ask a server (part of a content delivery network) for files, or have the T3D server ask the CDN to send files to a client, and then exec() those files in the next level/mission. If that can be done (and I don't see why not- though I avoid T3D only because a game server shouldn't shoulder that burden unless it's a single-player game), then you should be able to download files in the background to whatever location your game is located (which is much of what streaming is).
#7
11/01/2011 (7:50 am)
BTW, as an addendum to the above- I'm working on it right now to see if I can have a local client download a file from my web server and then exec() it. That, with one or two other things will get posted as a blog or resource.
#8
11/01/2011 (9:15 am)
That would be an awesome post, and extraordinarily relevant. One of the things I'm trying to wrap my head around now is the best way to deliver content. The most brain dead way seems to use the network API, as you mention, and pull it down either as a part of the mission load process, or write a separate class that uses the same API to pull down all the missions - but like you say, that seems like an huge amount of work for the game client to do. An alternative is to have an external process pull the files down, and then as you say, exec() the client once the files are down. I kind of like that approach, so would be very interested in seeing how your results work out.

Today I'm going to start working with just the t3d demo code and the web plugin itself to see if it works. I know Guy Allard has had some progress with it, but not sure what the state of his project is currently.

Also curious if you're following this thread here, which has quite a bit of discussion on the whole notion of the integrated plugin as a content delivery system, and what your thoughts were, given your recent work on the subject.

Looking forward to the resource when you get time. :)

#9
11/01/2011 (10:44 am)
@Ted - I like that idea. Perhaps request a download via HTTP and have it all drop into the correct areas. What about the zip file mountable file system? Then you just download a zip and then mount it. As an added advantage, any assets could be updated to latest versions since the last one loaded takes precedence. Potential performance hit there, though - haven't tried any of that myself.
#10
11/01/2011 (12:10 pm)
Well, I have two methods working right now:

1) From a PHP file, I send the string for the object to the client and eval() that. Clunky method, since you're basically just sending fragments of missions over (you could send the whole thing, theoretically).

2) Like above, from a PHP file I send strings of content that are then saved (one of the first parameters sent is the file name to save it as, as well) using writeLine() on a FileStreamObject. Still clunky, it uses the client to request the file from a web server, which takes strain off of the server. After the file is saved, it's exec()'ed. If you have a package that you want to download for gameplay, or a series of .cs files, you can do this easily and unlike in #1, it's retained.

There's a #3 where I tried to download and save a .png file sent from a PHP file. It's coming through as text, so that mangles the file, at least using HTTPObject, so I tested using a TCPObject instead, and no joy there either (file sizes for the png I tried to download were off from the actual file).

If you want to muck with code, check this out, and it may be what is needed, though it needs some fixing to work with 1.1 Final, it seems. Things like this frustrate me, since there are resources out there from 2003 that try to address the issue and should be proactively included if web deployment is going to be aimed at.

Also, I could try to integrate libCurl, but yeah, TCPObject and HTTPObject are insufficient to do everything I'd like :/
#11
11/01/2011 (12:19 pm)
I had that post sitting open while I tried a bunch of things, so I missed Richard's post.

Downloading and mounting a zip would be great- if there was a reliable way to download a binary file through the engine. Again, these are issues that have been outstanding for a long time, and I don't suspect they'll be addressed any time soon, so after today's experimentation, I'm looking towards libCurl or something along those lines.
#12
11/01/2011 (12:57 pm)
@Dusty, I recommend steering clear of the web plugin. Trying to support multiple browsers and multiple versions of Windoze with it becomes a nightmare. Add to that the nightmare that is windows virtualization (and a game engine that does not even try to respect the file system conventions of a modern OS) and IE security settings and you have a serious headache. Getting your stuff digitally signed mitigates the pain slightly, but I think you'd be better off using a 3rd party method if you're determined to get your game in a browser.

We spent over 12 months developing Blood Clans as a browser based MMO. Absolute nightmare. Eventually we had to abandon the browser based aspect and have now made the game a stand alone install.

@Ted, I created an auto-updater and asset streaming system that we use in Blood Clans which is based on libCurl. One of the resources on the site uses a thread-safe approach that works very well, and is easy to drive from script. A couple of the other curl resources need to be steered well clear of, but I can't remember right now which is the good one.

One big gotcha is that a typical Torque install requires all files to be located beneath the root folder, which isn't the way modern OS's are designed to work any more. It's ok with a decade old OS's like XP, but vista/win7 need a different approach (it's about time T3D was brought up to date to use user data directories etc by default). Windows explorer absolutely hates a program trying to change data within a program directory, and throws all sorts of strops about it. This applies to stuff like saving prefs and compiled shaders. It's easy enough to make curl save to the users directory somewhere, but then T3D blows chunks when it's asked to read from a location other than where it's installed.
Windows virtualization is supposed to take care of things by creating a virtual filesystem in the users directory that acts as if it is part of the programs folder in an attempt at backwards compatibility. This works fine with a standard T3D install, but for some reason fails miserably when run in a browser.

**EDIT
This is the curl implementation that works for me.
#13
11/02/2011 (5:35 am)
Hey Guy glad to see you jump in here. I had noticed from a number of forum posts that you had some experience with the plugin and was wondering what your current take one. Sadly, your news is not good news, though not wholly unexpected. I really do think the combined community, website and game idea really works best if you can keep the players in the browser and playing at your site. I really want to emphasize the notion of players feeling like they're connected to a community. So if the game is not in the browser, then that means a lot more community services - friends list, chat, perhaps, etc in the game. Urgh.

Okay well great feedback guys thanks for taking the time. Looks like I have more decision making to do.