Use Cafu to Create a Chess-Like Game?

Get technical support about the C++ source code and about Lua scripts for maps, entities, GUIs, the console, materials, etc. Also covered are the Cafu libraries and APIs, as well as compiling, linking, and the build system.
Post Reply
denimalpaca
Posts: 2
Joined: 2011-07-07, 18:12

Use Cafu to Create a Chess-Like Game?

Post by denimalpaca » 2011-07-07, 18:20

I'm brand new to Cafu (found out about it yesterday) and I was wondering if (and how) one could use this engine to create a game other than a shooter (I say this because the demo is one). I'm still reading through the Wiki but I thought I'd ask here too.

My aim is to make a unique 3d Chess game and I was just wondering how and if it is possible to create entities on the map that would move based on set patterns (like Bishops and Rooks do in Chess) and how to integrate the squares so that the pieces treat each square uniquely and not just as a floor.

Any help would be greatly appreciated, thanks!
User avatar
Carsten
Site Admin
Posts: 2160
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Use Cafu to Create a Chess-Like Game?

Post by Carsten » 2011-07-08, 19:11

Hi denimalpaca,
welcome to the Cafu forums! :welcome:
denimalpaca wrote:My aim is to make a unique 3d Chess game and I was just wondering how and if it is possible to create entities on the map that would move based on set patterns (like Bishops and Rooks do in Chess) and how to integrate the squares so that the pieces treat each square uniquely and not just as a floor.
Ah, this is a very nice idea, Chess in Cafu sounds wonderful! :-D

I'm not entirely sure how you want to have the details of viewing the chess board and moving the pieces, but the floor of the board is obviously easy to create with brushes of alternating colors.

Then I would set a total of 64 info_generic entities (related scripting reference), one per square in its center, and give it an entity name that expresses the row and column of the square, e.g. "info_square_3_7" for the square of row 3 and column 7.
(It's probably possible to use copy and paste to place all these entities, and/or to edit the map file in a text editor to get it done easily and quickly.)

Each piece would be an entity (e.g. a static_detail_model) as well.

Eventually you can use script code to move the pieces depending on player input.

I'm really excited about this, it's a great idea and will be a wonderful MOD, and I'd be more than happy to help you with any question that you might have!
:up:
Best regards,
Carsten
denimalpaca
Posts: 2
Joined: 2011-07-07, 18:12

Re: Use Cafu to Create a Chess-Like Game?

Post by denimalpaca » 2011-07-09, 21:21

Thanks for the advice! I'm going to work on getting a working model of standard chess going in the next few weeks. From there I'll try to get the 3D portion working (shouldn't be too much harder - just more levels).
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests