Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [WIP] Dice game maker  (Read 4619 times)

0 Members and 1 Guest are viewing this topic.

R23MJ

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
[WIP] Dice game maker
« on: February 14, 2017, 04:46:55 am »
Where I Got the Idea
(click to show/hide)

How to play Liar's/Pirate's Dice (This is really the only thing you need to read before downloading):
(click to show/hide)

Liar's Dice is working!!! Download here:
Download(mediafire): ~810kb compressed (.zip)

Okayyy... So, What is it?
    The (Really) Brief Synopsis
    My Dice-whatever-you-wanna-call-it is essentially a Lua framework. I use Sol2 -- an amazing C++ <-> Lua binding library -- add a "Dice" class, some network classes, some animations/images, Dear ImGui, throw it all into the compiler, down a cup of coffee, take a few breaks to go outside and shovel some snow, and BOOM!: you can make dice games in Lua.

    So now that you have a really vague idea of what this actually does/is, I'll try to explain some more. Explaining things has never really been my strong suit, so strap in and I'll just take you down code-snippet lane.

    The Part Where I Show You Something Useful/Just Code

Sol2 stuff
(click to show/hide)

Dear ImGui stuff
(click to show/hide)

Okay, okay. Enough Talk, Where do I Download it?
    Unfortunately, it is in a horrible state to distribute, I'm not gonna do that yet. I'm going to clean it up a bit, and optimize it (*cough* *cough* Client class) then dice games shall once again rule the world (I don't think they ever did, but lets pretend). Hopefully in a couple days I can release the kraken (get it), and you can enjoy some dice games. I also wanna setup this spare RasPi of mine as a server, so everyone can try their hands at liar's dice, and not just download a useless framework.

I know there will be at least 1 person -- hopefully -- who will be interested in looking at the Liar's Dice Lua file to learn how the Framework will work, and feel. So here it is, keep in mind this is in dire need of being cleaned up, not just the Lua, the C++ too. I made a Player class, which is fine, but I feel it is needless garbage, and will without a doubt be removed before I release this. Without farther ado, the files:
(click to show/hide)

Ehhem.. screenshots.
    So, I am not artist, and I didn't make the dice texture either, I just modified some things and made it into a texture, so it's not pretty. I mean, it's actually just five dice and a menu. But the h*** with it: here are some screenies.

Client View:


Server View:


Nice, nice. But What All Could I Do with this?
    Everything is exposed to Lua, you could even write AI Code for offline mode play, Admittedly, I attempted to and failed miserably, and decided to stick to something I know how to do. AI's are no joke man. Here is a list of things I have thought of, but this is definitely not the exhaustive list.

Features(?):
  • Automatically run functions (Init(), Update(), Close())
  • A Debug() function, press F2 at any point to do whatever
  • Create, roll, and get the value of dice.
  • Communicate with a server, server tools to manage it
  • Lists folders in "Games" directory, game folders should include "server.lua" for servertools, and "run.lua" for the client.
  • Very extendable: possible to make AI, for offline play, possible to make rating (ELO?) system, and store data server side.

Finally, the end
    It seriously took me about two hours to write this, but strangely, I enjoyed it. I hope I touched on everything, and explained well enough what this is. If not, feel free to ask questions. I can't say how often I will be checking this, I will probably come back to talk about updates, and possibly a few times while I'm supposed to be paying attention in school. Last message: if you read all of this, you are a true trooper, and thanks for that.
« Last Edit: February 19, 2017, 01:35:04 am by R23MJ »

R23MJ

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: [WIP] Dice game maker
« Reply #1 on: February 17, 2017, 02:07:27 am »
Hello again! I have updated the application, I am looking forward to seeing some feedback on the project.

Change log
(click to show/hide)

The server tools still need a little work, but by the next build they will be included. I was just too excited to sit on the AI any longer. It is fairly basic, and not a very good implementation for an AI (feel free to modify it, found at the bottom of the 'run.lua' in 'res/games/Pirate's Dice').

Well, I won't go on and on like the last post, so here is the DL link. I do not have a github setup yet, and I'm not sure if I want to share the code until everything is final.

Download(mediafire): ~810kb compressed (.zip)
« Last Edit: February 19, 2017, 01:28:31 am by R23MJ »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: [WIP] Dice game maker
« Reply #2 on: February 18, 2017, 04:09:09 pm »
Just gave it a try! Totally remember this game from PotC and if I remember correctly, I once even lookup the rules as well.

You probably should post the game rules at the top of the thread and include the instructions somehow in the game.
Why can one not bid on 1s?
You should show a message when the opponent has made their move and possibly show what the bid.

Quite nice to see your integration of Sol2 and Imgui. Guess you've been following Elias' development of Re:creation?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

R23MJ

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: [WIP] Dice game maker
« Reply #3 on: February 18, 2017, 09:22:12 pm »
First of all, thank you for trying it! I know it's not much. You are right though, I didn't clarify too much, I guess I was too excited. You seemed to have figured it out, but for others who try it, the first box is the quantity (Number of dice) the second box is the face (the side) so selecting 2 and 3 would bid 2 3s.
I will be updating the main post.

Quote from: eXpl0it3r
Why can one not bid on 1s?
You should show a message when the opponent has made their move and possibly show what the bid.
Ones are wilds, something else I forgot to mention. Adding a message is definitely needed, along with other visuals.

I am very very anxiously awaiting Re:Creation. Elias is making a phenomenal game.

R23MJ

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: [WIP] Dice game maker
« Reply #4 on: February 19, 2017, 01:32:32 am »
I updated the main post, added the download link to it, and I also moved the rules for Liar's Dice closer to the top. This is a mini-project I was working on when I got bored of my main project, so I will continue to update it until it is more of something and less GUI scattered across a screen with a couple dice floating in the middle. After that updates will slow down, and hopefully I can reveal my main project shortly.