[wipz] Battle Chess

Post » Wed Mar 09, 2011 12:30 pm

To summarize the above conversation: I am interested in recreating a working chess game in Oblivion similar to Battle Chess, like the originator of this thread was doing before apparently abandoning the project. I have the project scoped out in some detail, but one unresolved problem involves integrating a computerized player ("chess engine") with Oblivion. To make this possible, Oblivion needs to be able to send and receive command line messages with an external application.
Only two ways appear to exist to do this: (1) Create an OBSE plugin, or (2) force Oblivion and the external application both to interact with a text file (which I think also would require an OBSE plugin...)
DragoonWrath, I'll definitely take you up on your offer for assistance. Please PM me when you have a chance so we can discuss details.


While I believe I could write such a plugin if given enough time to learn, and while I am willing to do so, this project could be released much more quickly if I could get some help! Would anyone be willing EITHER to:
(1) write the plugin that allows the Oblivion script engine to communicate (send and receive text) with the external application, or
(2) design the user interface (i.e. the chess battlefield in Oblivion) with some general guidelines I can provide.
Is anyone interested in either? Would it help if I mention I have an awesome idea for how to integrate this into an upcoming WEPON quest?
User avatar
Tamara Primo
 
Posts: 3483
Joined: Fri Jul 28, 2006 7:15 am

Post » Wed Mar 09, 2011 9:08 am

BREAKTHROUGH!
I have successfully determined how to get an external chess program to write to a text file, and with Pluggy I should be able to get Oblivion to read that same file and write a response. Will have to do more experimenting tomorrow.

I REALLY wish EvilTechie had left some of his resources behind. The chessboard in the above screenshots is much more beautiful than anything I have come up with so far.


If anyone is interested in participating, please let me know. I could really use the help!
User avatar
Micah Judaeah
 
Posts: 3443
Joined: Tue Oct 24, 2006 6:22 pm

Post » Wed Mar 09, 2011 10:58 am

I've received permission to use Houdini 1.5a, the current champion as far as computerized opponents go. In my own simulations it regularly beats every other computer opponent it plays! So the difficulty will be in making the engine a worse player than it normally is, or to put it another way, determine how to scale the difficulty.

Still trying to figure out how to get Oblivion and Houdini to communicate. For this to work, I need to make the following communication possible:
1. Player tells Oblivion to start a new game.
2. Via Pluggy, Oblivion writes initialization commands to a text file, and also communicates Player's first move.
3. The chess engine reads the text file, executes the requested commands, and erases the text file.
4. The chess engine calculates its move, writes it to a text file, and waits until called again.
5. Oblivion reads the text file, moves as indicated, and erases the text file.

#3 is the one I'm having the most trouble with right now. I'm really hoping that someone with more experience than I will volunteer to assist :)
User avatar
cheryl wright
 
Posts: 3382
Joined: Sat Nov 25, 2006 4:43 am

Post » Wed Mar 09, 2011 9:06 am

Pluggy is unnecessary; you should just write an OBSE plugin that communicates with the chess engine directly. All of the documentation, such as it is, for writing OBSE plugins is in the obse_plugin_example project that is included in OBSE's source code.

OBSE is made using Visual C++ 2005; doesn't look like Microsoft is still offering that one, though. It'll work just fine (IIRC) with Visual Studio 2008 or 2010; might as well go with the latest version. The "Express Edition" is http://www.microsoft.com/express/Downloads/# - that's the free version. College students can get the full version free through Dreamspark.com (you need a valid .edu e-mail address). You also need the http://msdn.microsoft.com/en-us/windows/bb980924, and you need to follow http://msdn.microsoft.com/en-us/library/ms235626%28VS.80%29.aspx (though these are somewhat outdated and at least some of them you'll discover are unnecessary because the file in question already has the value you need). You should also create a Oblivion_Path http://msdn.microsoft.com/en-us/library/ms682653%28v=vs.85%29.aspx that points to your Oblivion install directory (where Oblivion.exe can be found).

With those things done, double-click obse_plugin_example.sln; it will have a little wizard to update the project from 2005 to 2010; this should work without errors. At this point, you should be able to compile and build the example plugin. The things you most want to look at are main.cpp and obse/PluginAPI.h - PluginAPI.h documents how OBSE plugins work, and main.cpp gives you several examples of how to use the things described in PluginAPI.h.

For starting your own plugin, the easiest thing to do is to copy the obse_plugin_example folder, rename it to what you want, then rename each of the files with obse_example_plugin in them to the values you want (there's obse_plugin_example.sln, obse_plugin_example.ncb, obse_plugin_example.vcproj, obse_plugin_example.vcproj.COMPUTERNAME.username.user, etc.). You also have to manually edit obse_plugin_example.sln (as in, use Open With... and choose a plaintext editor, like Notepad++) and change the two instances of "obse_plugin_example" in line 4 to the new name you want. Then double-click that .sln file to have your new project named whatever you want.

Once you've got this figured out, you're pretty much set; you just have to read PluginAPI.h and understand how main.cpp works (this requires at least a bit of C++ knowledge), and then start editing main.cpp to have the functions you need - which will probably be a function to start the chess engine, a function to get the computer's next move (which takes the player's last move as an argument), and a function to end the engine (probably).
User avatar
NAkeshIa BENNETT
 
Posts: 3519
Joined: Fri Jun 16, 2006 12:23 pm

Previous

Return to IV - Oblivion