GithubHelp home page GithubHelp logo

chessmod's People

Contributors

captaintom14 avatar en4395 avatar ramou avatar riri404 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

chessmod's Issues

Factor graphical pieces into a ChessPieceSet class

The interface for set should access the color and then allow you to draw for each piece type. The choice of set is deliberate so you can't play on a board with matching sets, and so the board knows which set goes where. If people gripe, maybe I'll make that dynamic, but I see no immediate benefit.

I will allow (and make) some custom sets, but will try to load dynamic sets via a JSON file that is consistent with existing block and texture notations:

e.g.

assets/chessmod/models/block/chesspieces/setname/pawn.json
assets/chessmod/models/block/chesspieces/setname/knight.json
assets/chessmod/models/block/chesspieces/setname/bishop.json
assets/chessmod/models/block/chesspieces/setname/rook.json
assets/chessmod/models/block/chesspieces/setname/king.json
assets/chessmod/models/block/chesspieces/setname/queen.json
assets/chessmod/textures/block/chesspieces/setname/material.png
assets/chessmod/textures/block/chesspieces/setname/material.png.mcmeta

I'll support the animation notation for the textures with the material.png.mcmeta notation (the file is optional).

The blocks will be scaled to 3/32 but I'll examine the models and use the piece height to adjust each TileEntity's collision box. I'll support the standard JSON notation until (or unless) I find a way to dynamically interpret things using the other notations.

The basic piece implementations that I have now will be the default available and will speficy their own setname

Pieces and complete sets will be registered when found, with an optionally defined item tile for the bag 'o pieces (the complete set) and the standard tile-rendered version of pieces defined in the block subset. Recipes of pieces will live in:

data/chessmod/recipes/setname/pawn.json

but I will override that and use any single block defined in:|

data/chessmod/recipes/setname/set.json

which, instead of using the standard recipe notation will dynamically register a recipe based off of that described in #27

Support chess ranking according to standard ranking rules

When playing on a ranked table, only complete games get ranked. I don't want to put in time trying to think about how a player might blow up the table to avoid a losing score. Ranking makes you stronger. If you want to be an ass, people won't play with you... if it gets bad, I'll track incomplete games with the option for both players to agree to annul. Keep classy, you chess-playing minecrafters.

Use the Elo Rating System

It turns out this isn't super clear.

So, if you have players with rating R1 and R2. They play a game and score S1 and S2, where that score is 1 point for a win, 0.5 points for a draw and nothing for a loss. Their new ratings, denoted by R'1 and R'2 would be:

R'1 = R1 + K*(S1-(10R1/T)/(10R1/T+10R2/T))

R'2 = R2 +K*(S2-(10R2/T)/(10R1/T+10R2/T))

K and T would be configurable in the mod and would default to 32 and 400 respectively. If people really wanted it, I'd allow for K to scale with ratings in a way specified in the config, but this seems a reasonable starting point.

Look at ways to cache vertex generation so we can speed up rendering

There's no noticeable issue yet, but if we can get it to fast render that would be great.

If we have to use textures as determined by #8 then we might be able to make a large sprite that is a white/black checkerboard and then use the uv so that we can just draw the pieces with one texture and get away with FastRender. We might combine this with any other vertex caching we can do.

Rendering for TileEntities needs better primitive operations

The way all this is done is 3D geometric shapes off of 3D geometric shapes. It'd be nice if we had something that represented that. Draw your shape centered around a normal vector with the "down" being tangent to whatever you were drawing off of (or perpenducular to the normal vector at its "down" point). Then just allow for regular polyhedron primitives, with die-based face-labels where appropriate, prisms, pyramids. The also allow for the curved stuff if we get fancy, so spheroids and whatever you call cylinders and cones when the bases can be elipses and not just circles. At that point, thrown in the torus because WTF.

allow the chaining of shape drawing using a builder pattern, e.g.:

Side square = new Square (10);
Side tinySquare = new Square (5);
Vector normalVector = new Vector(0,10,0);
ShapeSpaceNode regularCuboid = shapeSpaceTree.prism(square, normalVectrr);
ShapeSpaceNode smallerIrregularCuboid = cube.face(Cuboid.UP).prism(tinySquare, tinySquare.scale(05), normalVector.scale(0.5));
ShapeSpaceNode sphere = smallerCube.face(Cuboid.EAST).spehere(1);

When we make the regularCuboid we specified one face and the prism just projects the other end along the normal vector. Since it's straight up, we'd get a 10x10 cube whose down face was on (0,0) of the x/z axis ('cause we're in minecraft). the smallerIrregularCuboid would sit on top of the regularCuboid and would be 5x5 at the bottom where it touched and 2.5x2.5 at the top. Lastly, we draw a sphere that touches the center of the east face of the smallerIrregularCuboid and has a radius of 1. Vectors and 2D shapes can scale, the ShapeSpaceNode allows a slide with cartesian reference (0,0) x/z on the reference point with the y axis being along the tangent (or along a passed normal) or radial reference along the similarly specified tangential plane (default or specified normal vector) and we can even pick faces off the sphere with two radial arguments (off of up and north).

Since this builds a Tree, we can also specify names to nodes as we create them, traverse upwards and downwards (namespaces to a parent node) and otherwise have an easy go of making complex figures. We should be able to re-bind textures as needed, and at the end it should allow us to extract all the necessary vectors, grouped by texture so we can get single draws on groups and hopefully cacehable.

TileEntity implementations need default packet-based client syncing

We should provide default implementations for the network packet management to update clients on server changes, an overrideable hasChanged so that the server-side can determine if a change has been made since the last time it updated clients and a default tick() method that overrides the abstract base class and calls a doTick that must be overridden. doTick will get called and then the superclass will check hasChanged, and notify clients that have the chunk loaded, once, if needed.

Make a Roadmap to 1.0

It's a bit of a jumble of chaos now. Make tickets, close what bugs me, update version number by an amount that is not entirely arbitrary, but really not fixed. There's even a bunch of stuff I don't have in the issues that should be there, like a list of the Chesses versions I'll be doing (all of them, do I need all before 1.0???). This'll be good practice anyway. Gettin' better at stuff all the time is how you stay better at all the stuff.

Ender-link boards

Thanks for the idea, Gina!

Allow the linking of two boards. First, they need to be made into ender boards, which can be done by crafting the table with an ender pearl. Then if you right-click a board on an ender board block in the world will link the two boards. When placed, any move played on one board will be played on the other board, and all state will be synched.

Use `chessmod` as my namespace

The internal namespace is my shitty canonnical name instead of chessmod

com.htmlweb.chessmod should just be the package structure above... I don't know how I misunderstood the naming convention that much!

Implement a means to challenge a player for a Tournament Board

I originally wanted to whack a person with a chess glove but I think a handshake over a Tournament Board will be fine. Player picks a side. Other player picks a side. First player rejects if it's the wrong player or accepts is if it's the right player. Black indicates the game is started. White can withdraw from the game before their first move at no penalty (causing the board to reset).

Add `Fifty-Move` draw option

Given the [Rules of Chess](https://en.wikipedia.org/wiki/Rules_of_chess
There has been no capture or pawn move in the last fifty moves by each player, if the last move was not a checkmate.

Let the board offer this to either player after its occurrence. Keep it on offer until such time as a pawn moves or a piece is captured (when it will be reset).

Apply this on Tournament Chessboard and above.

Implement the Tournament Board

Diamond and obsidian instead of iron and coal!

It should track game lifecycle:

  • Unassigned (no players, previous player has requested reset)
  • Waiting for Player to Join (one player has initiated)
  • Waiting to Start (the second player has accepted challenge)
  • Playing (black has begun the timer, or directly here if no timer)
  • Done (checkmate, draw (manual or auto), concession)

This means it must track the two players, what side they control and board state, and allow appropriate transitions between Board States.

State transitions should have some guarantee. After a configurable amount of time without a move, the other player may claim victory or draw. After a configurable amount of time, a challenge may be rescinded. After an appropriate amount of time, either player may reset a tournament board to the unassigned state. Default timing guarantees should be mod-configurable.

Tournament Board guarantees can be altered by the application of a timer.

I've been on the fence about board breaking. In the end, I've decided that if you break a board, its state is cleared and there is no tournament result. If a player gets a reputation for being an ass about playing, folks just won't play with them on that server, and that's better than my farting around with an overbearing technical solution.

  • Challenging a Player to a game 46
  • Support Elo Rankoing 28
  • Ranking Board 65

Make gradle run my tests

As of now, I can't run gradle build because it can't find my JUnit 5 libs. That should be easy enough to fix if I understood gradle, but that hasn't been a priority. Right now, I run the tests in eclipse as usual.

Only send client a tileentity update when state has changed

This should drastically reduce packet traffic.

I suggest keeping an oldstate value in the entity. Check for oldstate on the server-side during the tileentity's tick. If it doesn't match, send the update to the client. That field can be marked as server only, I suspect.

Make material use for recipe reflect in display

I'm thinking of:

mWB
cBW
www

Where m is a nugget, c is a wool block, W is any block, B is any block and www is any wood.
I would then use the corresponding block texture, scaled as needed.

I would use the metal block relating to the nugget. I would use a scaled-down version of the wool (I want felt). I would use the scaled down (to a square on a board) version of the blocks for W and B. I would use the wood blocks for the base. Except for the base, where I'd use the appropriate parts of the texture (north side, wrapped around and the middle of down), I would use the up texture on each block. I intend to use the W abd B up textures for the pieces as well, but we're not there yet :D

Make a heirarchy of board types

  • Make a simple wooden board, no rules, you can just play.
  • Make a rules-based board
  • Make an ender-linked quantum entangles class of boards 66
  • Make a tournament board, implements rules, tracks player results, wins, etc... 49
  • Make a Chesses board 67
  • Make an AI-playable board that will play either color, wins/losses aren't globally tracked, only plays regular chess. 68
  • Make Puzzle Boards that will allow players to try famous chess challenges. 43

Add a minimal method to do Pawn Promotion

Probably just a list of pieces on the side, each color on each side. This'll let us manually set up boards more readily. It means that it's not really promotion, it's arbitrary piece placement. We'll have to make a nicer promotion system within the gui eventually.

Add `Threefold Repetition` draw option

Detect threefold repetition. If the board is in this state, give either side the option to declare a draw. Tournament Chessboard and above should support this.
Threefold repetition: The same board position has occurred three times with the same player to move and all pieces having the same rights to move, including the right to castle or capture en passant. --Rules of Chess

Players lose the option to claim a draw if they don't take it on the turn it arrives, or don't claim it with their move. This implies that if they expect a claim with their move, the board must allow them to indicate a draw claim, which would be automatically validated upon play (they would get their draw). The claim before move should be announced, and failure of the claim should also be announced.

If the same board happens five times, the draw is automatic (maybe make that configurable)

Gold Chessboard recipe results in Wood Chessboard

hello again, i just found out in survival that when i craft the golden one, it makes still wooden table, you have 2 crafting recipes for one table, and the golden one has no recipe. Please fix this, i need the golden one :D

Thanks, JaJackULTIMATE I'm on it!

Found this immediately. facepalm The commit will be a record of my shame.

Make a placed board a TileEntity

Is that meaningful? I want it to have state. The state is currently undefined, but it's gonna be some String. I think currently that'll be a comma-separated list like:

wR,wN,wB,wQ,wK,wB,wN,wR,
wP,wP,wP,wP,wP,wP,wP,wP,
,,,,,,,,
,,,,,,,,
,,,,,,,,
,,,,,,,,
bP,bP,bP,bP,bP,bP,bP,bP,
bR,bN,bB,bQ,bK,bB,bN,bR,

Make collectible piece set interface

I want to be able to build and use different pieces. Make a chessboard and it comes without pieces, then you craft it with various things to get pieces

a = material-type
b = chessboard

aaa
aba
aaa

pawns

axx
xbx
xxa

bishops

xax
xbx
xxa

knights

xax
xba
xxx

rooks

xax
xbx
xxx

queen

xxx
xbx
xax

king

If you mix the 6 resulting items together, you get a piece bag (if compatible). Right-clicking on a board with the piece-bag adds/swaps the sets. The piece-bags are classed as either white or black pieces.

Make some pieces unmakeable, found as loot in the world/rare trades, you still form piece-bags with them.

Make a display case for storing and showing your piece sets.

Move move logic into ChessBoardEntity

Right now it's checked in GUI and done in the messages. The former is sub-par and the latter is all kinds of wrong:

char c = ((WoodChessboardTileEntity)tileEntity).getBoardState()[message.source.y][message.source.x];
char t = ((WoodChessboardTileEntity)tileEntity).getBoardState()[message.target.y][message.target.x];
((WoodChessboardTileEntity)tileEntity).getBoardState()[message.source.y][message.source.x]='.';
((WoodChessboardTileEntity)tileEntity).getBoardState()[message.target.y][message.target.x]=c;
if(c=='n' || c=='N') {
if(t=='.') {
world.playSound(null, pos, ModSounds.placePiece, SoundCategory.BLOCKS, 1F, 1F);
} else {
world.playSound(null, pos, ModSounds.placePieceTake, SoundCategory.BLOCKS, 1F, 1F);
}
} else {
if(t=='.') {
world.playSound(null, pos, ModSounds.slidePiece, SoundCategory.BLOCKS, 1F, 1F);
} else {
world.playSound(null, pos, ModSounds.slidePieceTake, SoundCategory.BLOCKS, 1F, 1F);
}
}
((WoodChessboardTileEntity)tileEntity).notifyClientOfMove();

This could more simply and sanely be done here, and polymorphsm would make the messages get to the correct implementation instead of what I'm about to do till I have the will to fix this ticket...

I hate the current block texture

It's not that it's ugly, though maybe it's a bit busy, it's that it's huge. I'm thinking I won't use a real texture, I'll just go solid colors till I find something I like more? That or find a tiny and good texture.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.