Framework for computer-mediated board games

  • Continuing the discussion from Gaming board games:

    @OffByOne said:

    @HardwareGeek said:
    TBH, though, I'm almost as interested in writing a framework as I am in making an actual game. I've made a couple of attempts, but abandoned them before I got very far; it's a lot of work, and life and stuff tends to get in the way.

    Maybe you could post some details (preferred language, OS/platform(s) you want it to run on, features the framework should have, ...) in Coding Help and see if anyone is interested in collaborating?

    What I have in mind is a framework that provides the resources for an arbitrary game, and uses configuration files (no programming needed) to use those resources for a specific game implementation. There is a framework called FlexibleRules, written as a Ph.D. thesis, that does a lot of what I have in mind. In fact, it was the inspiration for a lot of my ideas. However, it is written in Java (strike 1), and I find the game-creation interface more than a little clunky and awkward to use (strike 2). The example games also look like, as Blakey would say, fried ass, although this may be just because they are intended as proof-of-concept examples, not polished games. IIRC, it uses XML for its configuration files.

    Think of a game like Monopoly® — you have a game board, pieces that move around the board, dice, cards, money and you have actions (get money, pay money, draw a card, do what the card says, move to another space on the board, etc.) that trigger according to dice rolls, piece location, card drawn or other rules. FlexibleRules supports all of these (I think; it's been a while since I looked at it in any detail), as well as having multiple pieces for each player that can move in player-directed paths (constrained by the rules, of course). One of the example games is Chinese checkers; with suitable rules, games like regular checkers, backgammon or chess1 should be possible.

    Games using all or any subset of these features can be implemented. A game could be implemented using just a cards, or just dice (or other visual representation of a random number generator, such as a roulette wheel), where the board would play no role other than a visual representation of the playing surface. One might even implement an adventure game by having actions that trigger as the player moves around the board as the central feature of the game.

    The framework should support both face-to-face and remote play. Some games require that some information, such as the cards in a player's hand, be hidden from other players. Practically, this probably means supporting play over a network, with each player using (probably) a mobile device for his/her private display. This wouldn't be necessary for games that don't require secret information, nor for 1-on-1 play against the computer.

    Whew, that's a lot. I think FlexibleRules supports most, if not all, of this already, except the networking. It could probably be adapted2 to be the basis of this framework, but it's a bit crude and clunky. At least part of it is. The rule construction interface isn't terrible. It's a bit complex, but it has to be; it's where most of what makes a game Monopoly®, checkers, poker, backgammon, or whatever, happens.

    FlexibleRules's interface for defining the visual aspects of the game, to the limited extent I've tried it, sucks putrefied ■■■■■■■ ■■■■■■■. That's something that would definitely need to be improved if FlexibleRules were to be used as part of the framework. Somebody suggested using Tabletop Simulator for the visual part of the framework. It's a bit overkill; it has features I didn't even think I might need or want, but why not? Using it would at least allow FlexibleRules's interface to be consigned to the fiery death it so richly deserves.

    For implementation, I was thinking C#, with Mono for cross-platform compatibility. I know exactly nothing about programming for mobile, so that's an area I'd definitely need help with.

    I have no idea when, if ever, I'll get around to doing this on my own. If anybody else is interested in helping, though, it's a lot more likely to actually happen.

    1 I do not propose that the game engine should be sophisticated enough to be an opponent in chess or backgammon, but it should be possible to code the rules for using the game as a virtual chessboard, with the game understanding how the various pieces can move. For simpler games, especially ones largely determined by chance, the game engine can be an opponent.

    2 Except GPL3. 😱 It would probably be necessary to implement something like it from scratch in a way that doesn't infringe their copyright.

  • I thought we already had tabletop simulator?

    Anyway, I thought about doing this a couple years ago as well, and just got bored of the idea. I'm starting to consider parts of it again, now, since this is exactly the type of thing hololens will excel at, but I'll probably just make a card game if I do that.

    Info that may help: If you use C#, Xamarin is how you'll end up getting it on mobile, and that isn't cheap. Apart from that, it shouldn't be too bad. You could easily use Monogame (my preference) or Unity. Monogame is basically Microsoft's old XNA, but it runs on OpenGL or DirectX as needed. The biggest difficulty with a good crossplatform app is that you'll need to design a UI per platform, or look like a total moron.

  • Tabletop Simulator is strictly presentation level. It doesn't implement rules and such.

  • @Magus said:

    Xamarin is how you'll end up getting it on mobile, and that isn't cheap.

    Hm, this is something I'd be doing for fun and learning, with no expectation of ever making a penny from it. "Isn't cheap" is "isn't happening."

    Browser based? But then you have to have a web server to run the game. Build a simple server into the game framework. Would work for local network, but a problem for play over then Internet. That's a feature that could be added later.

    Any other suggestions? Is this even interesting enough to bother?

  • If you want networked support, I'd definitely go for a client/server stack from the start. Personal/shared/common/observer play areas are probably achievable from the rules engine level.

    The client could be a browser or a dedicated client, or a mix. Not sure if browser gives the ideal experience for this, though it is pretty powerful especially if most of your key layout is game-specific anyway.

  • kills Dumbledore

    Reading this, I was reminded of and the previous chapters in the same miniseries. He mentions Inform7 as a DSL that's used for writing rules

  • @HardwareGeek said:

    Hm, this is something I'd be doing for fun and learning, with no expectation of ever making a penny from it. "Isn't cheap" is "isn't happening."

    Figured, and thought you'd want to know as early as possible. Interestingly, with Monogame, all you'd need for it to work on Windows phones and tablets is a developer license, which is incredibly cheap iirc... It's only iOS and Android that need Xamarin.

    I haven't gotten to network stuff yet for my fighter, which I need to think about some time in the next year, probably, but it will be much easier for you than it will be for me, because latency is okay in your case.

  • I think this might already exist, inc. rules:

    It's open source, and appears to be java.
    I have no idea of its actual capabilities, it's just a thing I know exists from reading about it in passing.

  • So it's software that renders a table.

    I mean... I hate to say it, but it falls under putting something on a table and taking a picture.

  • It's slightly more complex than that... it can simulate a bunch of other things such as cards, card shuffling, card hands (that other players can't see), hidden spots on a table where you can put things where only you can see.... I've seen it used to hide the Cylon cards for BattleStar Galactica, for example.

    ...but still, it doesn't implement the actual rules for any games. Everything you see on the Steam workshop consists of cards, boards, and pieces you need to play various games.

Log in to reply

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.