RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Chess Game Event?

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 86
It's Jepherz Bitch
Hey Everyone,  I was just wondering if one of you had an idea of how to make a chess game event?

thx

EDIT: To be more specific... the player chooses what piece he wants to move and then moves it around... After he's done moving it, the "computer" plays, then the player can pick another piece and move it, etc. etc.
« Last Edit: June 26, 2008, 10:07:58 PM by Jepherz »

**
Rep:
Level 85
Hmm ...

I'd need a ton of variables, the computer's actions would be really hard,  the way I'm previsioning it. This is making an AI in events ... sure, it would be simple (and time consuming) to make the moves for the computer, but It needs some way to process your movements and react based on those.

 A script would be easier I think.

I could make a "one player chess" ... lol. I can't script very well.



*
? ? ? ? ? ? ? ? ? The nice kind of alien~
Rep:
Level 92
Martian - Occasionally kind
The biggest problem is creating the AI.
The most common way to create a chess AI is by using minimax game trees with alpha-beta pruning.
There is no easy way to implement this with events and performance is a big issue.
The slowness of Ruby is also of consideration. It might so slow that creating a solid chess AI is infeasible.
It should be possible to create a chess AI strong enough to beat the average person.
Creating the chess AI is significantly easier with scripting than with eventing. The AI should most definitely be scripted

As for the rules of chess itself. I would personally prefer scripting them. The solution would be more elegant and structures that would ease the creation are already implemented. I think that the rules could be evented fairly nice. Nice enough that a strong eventer/weak scripter could get a better result by eventing the rules. (Yes, this is not the case with the AI)

So far I have only discussed the functionality (the behind-the-scene stuff) where one part should definitely be scripted and the other preferable be scripted, but what about the visualization?
This really depends on how you want it to work out in the game.
I would in most situations prefer the pieces being events so the mapper easily can move them around and arrange them accordingly.
Naturally you would have to think about communication between the various parts. It could be an event which goes like this:
Code: [Select]
@> Call Common Event: PlayerInput
@> Script: $chess.compute_input(1)
@> Script: $chess.process_ai
@> Script: $chess.compute_input(2)
Where the common event gets the response from what the player wants and stores it. Could be in a variable, could be through the script.
The $chess.compute_input(1) changes the chess accordingly to the player 1 input while making sure all rules are withheld.
$chess.process_ai process the AI and stores the choice in the same way the PlayerInput common event does.
The $chess.compute_input(2) changes the chess accordingly to the player 2 input while making sure all rules are withheld. (Yes, this would support 2 players with a simple change. Call Common Event: PlayerInput2 instead of $chess.process_ai)

This is just an example and a sort of pseudo-event code.
I hope I didn't totally confuse you but instead managed to highlight certain aspects of what you want.

P.s. I assumed that you wanted a general applicable framework. If you only want a few special scenarios the situation might be different.

*hugs*
 - Zeriab