How to program a chess: a forum based tutorial
Following Ivllatrix's logic, we could model our chess pieces this way:
// A triangle is composed of 3 verticesstruct mdl_triangle{ unsigned int vert_index[3]; // Vertex Index numbers};// A chess piece is all one colour and is composed of trianglesstruct mdl_piece{ unsigned char col[3]; // Material colour unsigned long int num_tri; // Number of triangles mdl_triangle *tri; // Triangles unsigned long int num_vert; // Number of vertices float *vert[3]; // Vertices};// A game set is composed of 32 chess piecesstruct mdl_game{ mdl_piece *piece; // Chess pieces};
Quote:
Following Ivllatrix's logic, we could model our chess pieces this way:
// A triangle is composed of 3 vertices
struct mdl_triangle
{
unsigned int vert_index[3]; // Vertex Index numbers
};
// A chess piece is all one colour and is composed of triangles
struct mdl_piece
{
unsigned char col[3]; // Material colour
unsigned long int num_tri; // Number of triangles
mdl_triangle *tri; // Triangles
unsigned long int num_vert; // Number of vertices
float *vert[3]; // Vertices
};
// A game set is composed of 32 chess pieces
struct mdl_game
{
mdl_piece *piece; // Chess pieces
};
Exactly :)
Hey guys,
Massive model loading change set comming your way:
http://www.eng.uwaterloo.ca/~rramraj/Gamedev/chess_tutorial/src_tree/chess_src.zip
Enjoy :D I used the milkshape 1.7.3 sdk to write the plugin (I actually just edited one of the examples). To install the plugin (located in the tools folder) simply copy the dll to your milkshape directory and export away.
I think this is probably going to be one of the biggest, if not the biggest single subsystem in our game. I'm going to be spending the next few days writing the tutorial on programming chess logic and taking care of the remaining subsystems. If you have any questions, concerns, comments or queries just post :)
Will post later,
- llvllatrix
Massive model loading change set comming your way:
http://www.eng.uwaterloo.ca/~rramraj/Gamedev/chess_tutorial/src_tree/chess_src.zip
Enjoy :D I used the milkshape 1.7.3 sdk to write the plugin (I actually just edited one of the examples). To install the plugin (located in the tools folder) simply copy the dll to your milkshape directory and export away.
I think this is probably going to be one of the biggest, if not the biggest single subsystem in our game. I'm going to be spending the next few days writing the tutorial on programming chess logic and taking care of the remaining subsystems. If you have any questions, concerns, comments or queries just post :)
Will post later,
- llvllatrix
Do you mean only copy "ms_r3d_exporter.dll" into my milkshape 3d folder? which is located in my program files?
what should I do next after I copy the "ms_r3d_exporter.dll" into my milkshape 3d folder?
When I tried to run the "msPlugIn.dsw" in the tools folder, a message box appeared.. It says "please specify the executable file, executable file name"..
where should I browse for the executable file name?
should I browse and the open the "ms3d" or the "ms_r3d_exporter.dll"?
when i open the "ms_r3d_exporter.dll", it says bad file.. but when I open the "ms3d" there is nothing there..
what should I do...what should I do ? T_T
what should I do next after I copy the "ms_r3d_exporter.dll" into my milkshape 3d folder?
When I tried to run the "msPlugIn.dsw" in the tools folder, a message box appeared.. It says "please specify the executable file, executable file name"..
where should I browse for the executable file name?
should I browse and the open the "ms3d" or the "ms_r3d_exporter.dll"?
when i open the "ms_r3d_exporter.dll", it says bad file.. but when I open the "ms3d" there is nothing there..
what should I do...what should I do ? T_T
First let me explain the concept of a plugin...although I'm sure most of you know what one is...A plugin is basically a way to extend the functionality of your program. If you've seen a windows media player visualization then you've seen a plugin. Plugins are typically dll files which are put in a location where the driver program, in our case milkshape, can find them. We are going to be using our plugin to export from milkshape to a format our program can understand (ie the set of model loading classes). I named the format r3d or resource 3d. We can then use the set of classes I wrote to import and draw this format in our opengl window.
Do you mean only copy "ms_r3d_exporter.dll" into my milkshape 3d folder? which is located in my program files?
[/quote
Yup. Remember that you need to have version 1.7.3 of milkshape for the plugin to work.Quote:
what should I do next after I copy the "ms_r3d_exporter.dll" into my milkshape 3d folder?
Once you have the plugin installed, it appears in the file->export->r3d... menu in milkshape. Click this button and our export code will execute.Quote:
When I tried to run the "msPlugIn.dsw" in the tools folder, a message box appeared.. It says "please specify the executable file, executable file name"..
where should I browse for the executable file name?
should I browse and the open the "ms3d" or the "ms_r3d_exporter.dll"?
when i open the "ms_r3d_exporter.dll", it says bad file.. but when I open the "ms3d" there is nothing there..
what should I do...what should I do ? T_T
lol, calm down. I remember there was an MIT prof who said "you should never get too sad when your projects break or too happy when they run. They certainly don't feel the same way about you." :D
Basically the only reason you would ever want to "run" a plugin is to debug it. Under normal operation, the driver program calls the plugin. Milkshape, however, is designed not to run plugins in this manner....its a software protection thing. Anyway, you dont need to build and run the plugin because I have alreay compiled the dll for you. If you want to make your own changes to the plugin, simply compile the plugin and copy it over to the milkshape directory.
The stuff you want to look at is in our gl basecode. I have converted all of our assets to .r3d using the plugin and we can now import them into our basecode. See if you can use the classes to draw the entire chess scene :)
Will post later,
- llvllatrix
I don't think I can do it... T_T
My milkshape 3d version is expired... T_T
what should i do...
I don't have credit card, so cannot buy this product T_T
My milkshape 3d version is expired... T_T
what should i do...
I don't have credit card, so cannot buy this product T_T
lol, you dont have to buy it; I have converted all of our models into the desired format. You should be able to find it in the data section of the gl basecode.
but I cannot open the "file->export->r3d" just like u said..
a message box appeared... it says "This version has expired! You cannot save your work anymore.. Please register http..etc"
that means I cannot view the .dll
any other ways to let me view it...
a message box appeared... it says "This version has expired! You cannot save your work anymore.. Please register http..etc"
that means I cannot view the .dll
any other ways to let me view it...
Quote:
but I cannot open the "file->export->r3d" just like u said..
a message box appeared... it says "This version has expired! You cannot save your work anymore.. Please register http..etc"
Well, the only reason we are using the plugin is to convert our ms3d assets into r3d files, which I have already done. Beyond that, the only other reason to use the plugin is to create new r3d models.
Quote:
that means I cannot view the .dll
any other ways to let me view it...
lol, not much to see. Its just a save as dialog box and thats about it. If you really want to create your own assets then you're probably going to have to write an asset exporter from blender or something. It shouldnt be that hard...most 3d modeling programs have an sdk for plugins.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement