[Mod] Chess [1.0] [chess]

User avatar
Bas080
Member
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080
Location: Netherlands

[Mod] Chess [1.0] [chess]

by Bas080 » Post

A mod where you have nodes with which you can make a chess board and chess peaces and play chess

Made possible by
Bas080 - Project initiator and developer
Tonyka - 3D model designer
Rubenwardy - Developer

NEW FEATURE!!!
Node ownership
1. Only the placer of the chess spawner can also remove it. (admin)
2. After placing the spawn spawner, all players are prompted to hit the king of his/her desired color if he/she want's to play. This can be the admin or another player.

Recipe also changed because mese is gone:
W=wood
T=tree

WTW
TWT
WTW

Screenshot
Made textures 16x16

Download
https://github.com/bas080/chess/zipball/master
...or see code https://github.com/bas080/chess

Current features
- /giveme chess:spawn and place Chess box in open area
- Border nodes with coordinates NEW tonyka's contributed textures
- Detailed 3d models for the pieces tonyka's contribution
- Chess box that creates the board and pieces when placed rubenwardy's idea
- When chess box is mined it removes all the board and pieces on top of it.
- Chessboard has a border
- All chess pieces (black and white)
- Pieces give light at night tonyka's idea
- Improved texture lighting of pieces tonyka's contribution
- Chess piece ownership.

Must have
- Clear crafting recipes for different pieces in black and white

Should have
- Functions to re-assign ownership
- Chessboard creator can reset match by punching spawn block
- Chessboard creator can interfere in match replacing or removing chess pieces.

Could have
- Rules to avoid illegal moves
- Selection feature where pieces are moved not by digging and placing but by punching piece and punching move to position.
- Time and stats User interface
- Commands and chat messages /move rook a8 to a7 InfinityProject's idea

Please share your ideas on what you would like to see in this mod.
Last edited by Bas080 on Fri Jan 25, 2013 21:08, edited 1 time in total.

User avatar
tinoesroho
Member
Posts: 570
Joined: Fri Feb 17, 2012 21:55
Location: Canada

by tinoesroho » Post

If one wanted to, it's easy enough to create lua entities. Actually coding game rules can be tricky. Off the top of my head, I recommend checking DreamChess's archives for the models. Swipe code from 3danimals or something.
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/

User avatar
tonyka
Member
Posts: 320
Joined: Sat Jun 16, 2012 04:08
Location: Alicante, España

by tonyka » Post

I like playing chess, and therefore your idea

the chess pieces need not be the typical game, may have inspired minetest forms...

ideas of chess pieces:

rook = Dungeon Master
knight = cactus
bishop = a tree
queen = a golden apple
king = the cat nyan
pawn = a rat
My mod: [MOD]3D Forniture 1.0
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)

User avatar
tonyka
Member
Posts: 320
Joined: Sat Jun 16, 2012 04:08
Location: Alicante, España

by tonyka » Post

another idea is that the pieces could have some lighting,...

thus would be beautiful even night play...
My mod: [MOD]3D Forniture 1.0
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)

User avatar
rubenwardy
Moderator
Posts: 6431
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

by rubenwardy » Post

Good idea, the rule coding will be hardest

Also, what is the size?

Solution:

I suggest using a real sized board and
use a "door" spawn like thing so when you place a chess spawner block, the black and white appears around it

No Rules, Players can move the pieces around, but it is not determened if they have won, the players have to notice like in real life.
Maybe if you click the spawn block all the pieces go back to the original.

User avatar
Bas080
Member
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080
Location: Netherlands

by Bas080 » Post

rubenwardy wrote:Good idea, the rule coding will be hardest

Also, what is the size?

Solution:

I suggest using a real sized board and
use a "door" spawn like thing so when you place a chess spawner block, the black and white appears around it

No Rules, Players can move the pieces around, but it is not determened if they have won, the players have to notice like in real life.
Maybe if you click the spawn block all the pieces go back to the original.
The "door" (chess box) idea is good. And hitting it to reset the chessboard really keeps the focus on the game and not the building and placing of the pieces. I consider it a "should have"

User avatar
InfinityProject
Member
Posts: 1009
Joined: Sat Mar 17, 2012 00:52
Location: World of Infinity, US

by InfinityProject » Post

An idea: a grid. Recognizes if pieces are on the grid. Now movement. Commands? Example: /move rook a8 to a7. Just an idea.

User avatar
tonyka
Member
Posts: 320
Joined: Sat Jun 16, 2012 04:08
Location: Alicante, España

by tonyka » Post

this is the minimum version for the shape of pawn

Nodebox pawn:

Code: Select all

minetest.register_node("chess:pawn",
    {description = 'pawn',
    tiles = {"default_wood.png"}, 
    drawtype = "nodebox",
    sunlight_propagates = true,
    paramtype = 'light',
    paramtype2 = "facedir",
    light_source = 15, --max light is 18
    node_box = {
        type = "fixed",
        fixed = {
            {-0.2, -0.5, -0.3, 0.2, -0.4, 0.3},
            {-0.3, -0.5, -0.2, 0.2, -0.4, 0.3},
            {-0.1, -0.4, -0.2, 0.1, -0.3, 0.2},
            {-0.2, -0.4, -0.1, 0.2, -0.3, 0.1},
            {-0.1, -0.3, -0.1, 0.1, 0.2, 0.1},
            {-0.2, -0.1, -0.1, 0.2, 0.1, 0.1},
            {-0.1 -0.1 -0.2 0.1 0.1 0.2},
        },
    },
    selection_box = {
        type = "fixed",
        fixed = {-0.3, -0.5, -0.3, 0.3, 0.2, 0.3},
    },
    groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
}),
other textures that suggest:
white pieces: default_lava.png
black pieces: default_water.png

not promise anything, but if I have some time, I'll do the rest of figures ...
Last edited by tonyka on Thu Aug 16, 2012 12:22, edited 1 time in total.
My mod: [MOD]3D Forniture 1.0
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)

User avatar
rubenwardy
Moderator
Posts: 6431
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

by rubenwardy » Post

Has anyone started coding this? we should set up a github page, i would like to help.

If you want me to setup the page, i can do
Last edited by rubenwardy on Thu Aug 16, 2012 09:53, edited 1 time in total.

User avatar
rubenwardy
Moderator
Posts: 6431
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

by rubenwardy » Post

tonyka wrote:this is the minimum version for the shape of pawn

Nodebox pawn:

Code: Select all

minetest.register_node("chess:pawn",
    {description = 'pawn',
    tiles = {"default_wood.png"}, 
    drawtype = "nodebox",
    sunlight_propagates = true,
    paramtype = 'light',
    paramtype2 = "facedir",
    light_source = 15, --max light is 18
    node_box = {
        type = "fixed",
        fixed = {
            {-0.2, -0.5, -0.3, 0.2, -0.4, 0.3},
            {-0.3, -0.5, -0.2, 0.2, -0.4, 0.3},
            {-0.1, -0.4, -0.2, 0.1, -0.3, 0.2},
            {-0.2, -0.4, -0.1, 0.2, -0.3, 0.1},
            {-0.1, -0.3, -0.1, 0.1, 0.2, 0.1},
            {-0.2, -0.1, -0.1, 0.2, 0.1, 0.1},
            {-0.1 -0.1 -0.2 0.1 0.1 0.2},
        },
    },
    selection_box = {
        type = "fixed",
        fixed = {-0.3, -0.5, -0.3, 0.3, 0.2, 0.3},
    },
    groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
}),
other textures that suggest:
white pieces: default_lava.png
black pieces: default_water.png

not promise anything, but if I have some time, I'll do the rest of figures ...
You have two light_source properties there.
Last edited by rubenwardy on Thu Aug 16, 2012 18:03, edited 1 time in total.

User avatar
tonyka
Member
Posts: 320
Joined: Sat Jun 16, 2012 04:08
Location: Alicante, España

by tonyka » Post

rubenwardy wrote:
You have two light_source properties there.
hauch!!

certain
fix it in post ...
My mod: [MOD]3D Forniture 1.0
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)

User avatar
rubenwardy
Moderator
Posts: 6431
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

by rubenwardy » Post

Here we are https://github.com/rubenwardy/Minetest-Chess-Mod.

If you want me to add you as an admin / transfer ownership, tell me
Last edited by rubenwardy on Thu Aug 16, 2012 18:02, edited 1 time in total.

User avatar
rubenwardy
Moderator
Posts: 6431
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

by rubenwardy » Post

This line of the door node looks like the job:

Code: Select all

minetest.env:add_node( pos,  { name = 'doors:door_wood_a_c', param2 = newparam } )
And to call this

Code: Select all

minetest.register_on_placenode( on_door_placed ) --Used to setup chess board
minetest.register_on_punchnode( on_door_punched ) --Used to reset board
Not sure about lua for loops, (i mainly do c++) but this is how i think it would work:

Code: Select all

--In a function called on chess:spawn's placing

local x=0
local z=0
local color=0
for (x=1;x<9;x++) --To make 8 rows (9-1)
  for (z=0;z<8;z++) --To make 8 cols (8-0)
     pos=new position(x, -- , z)
     if color==0
           minetest.env:add_node(pos ,  chess:board_black )
     else
           minetest.env:add_node(pos ,  chess:board_white )
     end if
     color=1-color --Toggles color between 1 and 0.
  next
next
THIS CODE WILL NOT WORK - It's used to illustrate how it would be done

Spawn Block Crafting

What will the recipe be? could make it multistep so it becomes a collectors item

1) Black and white wool to look like a chess board in the craft menu

or

2) 3x3 Mese


Or combine for a long process:

To make spawn block

Code: Select all

chesspiece,  chesspiece, chesspiece

chesspiece, chesspiece, chesspiece

chesspiece, chesspiece, chesspiece
And then furnace it.

To make chess piece

Code: Select all

bwool, wwool, bwool
wwool, mese, wwool
bwool, wwool, bwool
* bwool : Black Wool

* wwool : White Wool
Last edited by rubenwardy on Thu Aug 16, 2012 21:40, edited 1 time in total.

User avatar
Bas080
Member
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080
Location: Netherlands

by Bas080 » Post

rubenwardy wrote:Here we are https://github.com/rubenwardy/Minetest-Chess-Mod.

If you want me to add you as an admin / transfer ownership, tell me
I'm happy to see that you and others are excited about this idea.

Rubenwardy, i don't mind not being the owner. I would however like to push code to the git.

My github name is also bas080. Please add me when you get the chance :)

User avatar
rubenwardy
Moderator
Posts: 6431
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

by rubenwardy » Post

Bas080 wrote:
rubenwardy wrote:Here we are https://github.com/rubenwardy/Minetest-Chess-Mod.

If you want me to add you as an admin / transfer ownership, tell me
I'm happy to see that you and others are excited about this idea.

Rubenwardy, i don't mind not being the owner. I would however like to push code to the git.

My github name is also bas080. Please add me when you get the chance :)
A step ahead of you :)

Already added you




I think we should make it a collect able,

So it should have a long make process.

What do you think?
Last edited by rubenwardy on Mon Aug 20, 2012 20:33, edited 1 time in total.

User avatar
Bas080
Member
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080
Location: Netherlands

by Bas080 » Post

rubenwardy wrote:
I think we should make it a collect able,

So it should have a long make process.

What do you think?
I'm sorry... I made my own git... the way i did it makes it easier to test the mod. It works right away. I used the template you setup. The code that has been implemented is checkers board maker. Now the pieces... and later the rules to avoid illegal moves.

I like the co-op idea. Will make separate LUA file for pieces and later for rules and interaction.
Last edited by Bas080 on Mon Aug 20, 2012 21:37, edited 1 time in total.

User avatar
rubenwardy
Moderator
Posts: 6431
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

by rubenwardy » Post

Bas080 wrote:
rubenwardy wrote:
I think we should make it a collect able,

So it should have a long make process.

What do you think?
I'm sorry... I made my own git... the way i did it makes it easier to test the mod. It works right away. I used the template you setup. The code that has been implemented is checkers board maker. Now the pieces... and later the rules to avoid illegal moves.

I like the co-op idea. Will make separate LUA file for pieces and later for rules and interaction.
Ok, you add me and tonyoka then
Last edited by rubenwardy on Mon Aug 20, 2012 21:59, edited 1 time in total.

User avatar
Bas080
Member
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080
Location: Netherlands

by Bas080 » Post

Was thinking, should the chessboard spawn box check if the chessboard fits in the area before it it placed or should it carve out enough space(remove nodes that are in the way of the chessboard spawning).

I'm pro checking if enough place, if not do not spawn chessboard and display chat message "Not enough space to place chessboard and pieces." Then you should mine the box again and try it somewhere else.

User avatar
rubenwardy
Moderator
Posts: 6431
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

by rubenwardy » Post

Bas080 wrote:Was thinking, should the chessboard spawn box check if the chessboard fits in the area before it it placed or should it carve out enough space(remove nodes that are in the way of the chessboard spawning).

I'm pro checking if enough place, if not do not spawn chessboard and display chat message "Not enough space to place chessboard and pieces." Then you should mine the box again and try it somewhere else.
That is good.

User avatar
TheLoLMan
Member
Posts: 190
Joined: Sat Jun 16, 2012 13:43

by TheLoLMan » Post

lol good

User avatar
tonyka
Member
Posts: 320
Joined: Sat Jun 16, 2012 04:08
Location: Alicante, España

by tonyka » Post

I'm creating the rest of figures, in a few days I put the complete code ...
My mod: [MOD]3D Forniture 1.0
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)

User avatar
tonyka
Member
Posts: 320
Joined: Sat Jun 16, 2012 04:08
Location: Alicante, España

by tonyka » Post

still not very well use github, so I created a fork .. in mine ...
and I have added the rook ...

& my nick in github is "tony-ka"
Last edited by tonyka on Sat Aug 25, 2012 13:21, edited 1 time in total.
My mod: [MOD]3D Forniture 1.0
Download: 3DForniture_v_1.0.zip
Page development (European Castilian):
Moviliario 3D (proyecto 3D Forniture)

User avatar
rubenwardy
Moderator
Posts: 6431
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

by rubenwardy » Post

tonyka wrote:still not very well use github, so I created a fork .. in mine ...
and I have added the rook ...

& my nick in github is "tony-ka"
Ok, do a pull request :)
Last edited by rubenwardy on Sat Aug 25, 2012 13:39, edited 1 time in total.

Jordach
Member
Posts: 4527
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

I am great at playing chess, I'd love to help out.
viewtopic.php?f=10&t=19056 Solar Plains Dev Server

User avatar
Bas080
Member
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080
Location: Netherlands

by Bas080 » Post

Jordach wrote:I am great at playing chess, I'd love to help out.
Hey Jordach, you are free to implement functions to the chess mod. There is a git and many functions to still be programmed. I am now thinking about how to implement chess piece ownership. This should avoid other players interfering in ongoing matches. Also illegal moves and movement commands are still to be programmed.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests