Advertisement

AI using Web Services

Started by December 15, 2005 02:24 PM
7 comments, last by Kylotan 18 years, 11 months ago
Hi, Does any of you know about any games, in which the AI uses Web Services or in any other way uses some sort of Distributed Gaming? I'm currently doing a project on the matter, but can't seem to find anything about it. Thanks in advance... :)
If by distributed gaming you mean a system where the AI involves multiple computers, then sure.

Deep Blue and other chess supercomputers.


While those certainly aren't using MS Web Services, I can easily imagine somebody creating a SOAP interface for them. The entire game state can be transmitted in 64 bytes, and the resulting move transmitted in 2 bytes.

A distributed AI wouldn't work well for any large scale realtime game, at least not with current technology. Small scale games like Warcraft 2 would be feasable.

Between the latency and bandwidth, you'd have a hard time keeping it realtime.

Since SOAP is (supposed to be) stateless, you'd have to transmit the entire game state with each call. Most games use delta-encoding or other techniques to preserve the state between calls. Your complete world state going to be several KB at least. You could probably make a single SOAP call to update the AI for everything involved, so the return value is going to also be moderately large.

With a bit of imagination and careful encoding you could probably do a game on the scale of a 256x256 Warcraft 2 world in realtime. Since you'd have to transmit the entire map each time, you're looking at 100K of uncompressed, unencoded data, including the board, objects, and each of their goals and actions. You could probably decrease it to around 5K or so with very careful encoding. Considering these games often update the game state just a few times each second, it would be possible on a reasonably fast connection.

frob.
Advertisement
Hi frob,

thank you for your reply!

I could imagine there's quite a few limitations as to do it real time, but I read this article (http://www.gamedev.net/reference/articles/article1948.asp) with some interest and wondered whether it had actually been done by anyone (or something similar).

As for my project, which I might need to explain a bit more about as to make my question more understandable, it is study-related (mainly theoretical) and I don't deal with real-time problems (for now, anyways). I'm working on turn-based games and AI's in that area, which allows for longer response times from the AI.

Being new to AI, but having done quite a bit web development (also using web services), I saw an opertunity to merge two areas I find interesting to study (and write my thesis about). But, as my question shows, I haven't been able to find anything about it so far (as reference material).

So, my focus is mainly theoretical, but I would like to draw some parallels to actual work. And, my plan is also to create a simple AI (as a web service) that can support players in the game of Risk (not the most simple game, I know), but I would like to have something to, if not compare, then relate it to.

Hope my question and explanation makes sence... :)

/MarTor
Since you never actually defined it, I'm going to define the game AI as a process of evaluating the current game state, possibly considering previous states, and also possibly using some model to predict future game states. The information is processed in to one or more commands for each NPC. It is much more than just pathfinding toward the most vulnerable target.



That article appears to describe a prototype system the author called "The Meesha Network"

It seems to describe a (theoretical) massive P2P game engine. The prototype network only implements a distributed map, with no players, events, NPCs, or game logic.

It's certainly not the first adaptive load balancing P2P games to be proposed. My first exposure to that type of idea was in 1997, to be written in Java, where a custom class loader would pass around the game logic and keep the work balanced on all the players, maintaining a persistent massive world, etc. Needless to say, it was either not implemented or not successful. [grin]


Several games implement fully-connected peers, but not in the way the article suggests. It isn't uncommon for network games select a single peer to be authoritative, and the other peers validate their results on their own simulation to detect cheating. If the authoritative peer is disconnected from the game, the remaining peers re-negotiate an authoritative peer. It's a harder model to follow due to firewalls and NAT, but it is a good model.

Due to bandwidth, firewalls, NAT, and other constraints, the more traditional client/server approach is generally used. A host notifies the public repository that their game is available. Players get their values from the repository and are introduced to the host in a way that can intelligently handle firewalled and NAT connections.

Chess and Go have exceptionally huge open-ended cyclical search spaces and have simple rules that lend themselves to parallization. Smaller games with simple rules often have very small non-cyclical search spaces and can be handled by a single machine. FPS style games generally have complex rules that would be difficult to convert into a distributed processing architecture.


The article never mentions, nor do I know of, any existing games (other than Chess and Go) with a distributed AI implementation.

Maybe some other industry vets know of such a game.

frob.
Ok, thanks!

I take it, from your last comment, that you work with either games or AI (or both)? If so, can you tell me a bit more about it? Maybe name specific games you've developed? And, would you care to answer some more general questions regarding game AI (interview like)? (It's all for my thesis).

Anyways, I'll leave the topic open for now, in case others knows about some games that uses AI as either Web Services or another form of distributed gaming.
Really, I think you've hit upon 2 areas that don't go so well together ;) But yeah, I suppose you could distribute some AI, but I doubt you'd use web services to do it.

One thing that interests me is in how a program like the Last.fm plugin aggregates music data from thousands of people listening to CDs and MP3s. Then, it can return recommended bands for you to listen to based on the other people who have similar tastes to your own. I expect their algorithm is quite trivial but this is a good example of where a web service is used as part of software making an intelligent-looking decision, and which wouldn't be possible without the distributed aspect.
Advertisement
Hi Kylotan,

You are probably right! But then again, as you suggest yourself with the Last.fm example and as described in lots of literature, there are areas where you can benefit from it.

Again, I probably need to stress the point that it's a thesis I'm writing, which means that I'm more concerned with the theoretical aspects and AI as Web Services is just part of the analysis. I'm just looking for examples to support the theory. But since there seemingly isn't that much evidence to support the theory, my conclusion will probably be in the same line as your critic / doubt, that it's not that feasible.

Again, thanks for your reply, any thoughts are greatly appreciated! :D
It seems like web services and AI are just completely orthogonal. Web services are designed for engineering network systems, AI techniques are algorithms for solving problems. You can use web services to connect together computers that are running AI algorithms, but anything that can be done with web services can be done without web services. Any benefits to it would be more in the realm of software engineering than artificial intelligence.
Quote: Original post by MarTor
You are probably right! But then again, as you suggest yourself with the Last.fm example and as described in lots of literature, there are areas where you can benefit from it.


Is the literature you speak of concerned with distributed processing in general? I think a lot of the applicability of distributed processing would be for long-running, complex tasks where performance is important. On the other hand, web services tend to be more suited to running many short-lived tasks, and are not especially efficient.

This topic is closed to new replies.

Advertisement