AlexSV's Recent Forum Activity

  • Wow, this kind of blows my mind, honestly. I had read a few things on how to do this and came back to see if any tips had been posted before I got into it, but this example project not only eclipses my math skills but also is written far more beautifully and efficiently than I have ever done. I feel like a caveman on multiple fronts, haha.

    I am looking inside of it now to see what I didn't know that I didn't know. I didn't even know "Pick by Evaluate" existed.

  • End goal is to have the AI begin play overconfident and sloppy and then tighten up over a few lost rounds til it plays perfectly.

    In that case I feel it's better to understand the math and create the perfect play, then engineer mistakes into it.

    Do I like... I dunno, get a math tutor to explain it? Or a professor?

  • Sorry, I know this is an incredibly dense question, but I am struggling big time here and I don't know what else really to do at this point aside from hiring a person smarter than me to tackle this issue.

    So I am creating a game that, at its core, is a 1v1 game of Liar's Dice. For those who need an explaination, two players shake up 5 six sided die in a cup and place them on a table, hidden from each other's view. You may view your own hand, but you may not see the other player's hand. The starting player then wagers how many total dice are presenting a certain pip on the entire table. A wager of "Three 2s" would be claiming "There are at least three dice showing the 2-pip side".

    The next player then must either raise the wager, either by raising the number of wagered dice (Four 2s) or pips (Three 3s), or they may call the other player a Liar to reveal all hands on the table. If the player who calls is correct, then the liar loses a die. If the player who calls is incorrect, then the caller loses a die.

    Play continues until one player loses all of their dice.

    In this game, 1s count as wilds, meaning they represent any face. So a hand of 1, 1, 2, 3, 4 could call "three 3s" in absolute safety since the 1s represent the remaining 3s.

    So here's where I am getting stuck: every article that explains the math of this game just boggles my mind and I have no idea how to break this concept down. I am unsure how to program an AI for the enemy player if I can't understand the probability of the game itself. I struggled with high school math. I struggled with using Pi to calculate the tiles to be exploded in a fighting game I made two years ago.

    I have the player's hand loading into an array and the enemy hand loading into an array. I also have the enemy hand loading into a special array called "known dice" since the enemy player will cheat during the game to gain information they shouldn't normally have, but that's another day's problem for now, although I assume if I build this AI to work off of the "known dice" array now, then it will still work later when I add cheating.

    So Wikipedia breaks it down as "The expected quantity of any face value among a number of unknown dice is one-sixth the total unknown dice. A bid of the expected quantity (or twice the expected value when playing with wilds), rounded down, has a greater than 50% chance of being correct and the highest chance of being exactly correct."

    So this means first I have to take the number of unknown dice and divide it by 6. Then I take the result and double it, then round it down, and this will give a resut of a "probably true" bid if I include the known dice? Basically I need to create a conditional tree for how many unknown dice there are on the table, do that piece of math, and then compare it to what the player has claimed and go from there.... I think?

    Many of these articles are going into these massive formulas that I just can't wrap my head around. This one is basically Latin to me.

    Can anyone offer me some assistance here?

  • If you're using bullets for enemies, couldn't you use the solid behavior on the enemies to keep them from overlapping?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • That is a lot of work on my end and it won't help you learn!

    Look, start with something small.

    Try making an AI that will move towards you or away from you. Use a timer and a random number inside of an instance variable to set AI patterns for your AI.

    Give it a try on your own before you read the next part here. I'll explain it, but you should try at least to figure it out on your own.

    You can do it like this.

    On start of layout -> Start AI Fighter "Random Picker" timer, regular 2 seconds.

    This starts a timer on our AI fighter when the layout begins. This timer repeats because it's regular.

    On "Random Picker" Timer -> set AI_Fighter "Behavior" number to int(random(3))

    Random will set the number randomly between 0 and 1 less than the number you put in, so in this case, randomly from 0 to 2. The int part rounds the number to a whole number. That means it can be 0, 1, or 2.

    Now, make your code do this.

    If "Behavior" is 0, don't simulate control.

    If "Behavior" is 1, simulate control left.

    If "Behavior" is 2, simulate control right.

    This will make an AI that sits still or moves left or right ever 2 seconds.

  • Oh, did you try Layout Scale like peter568 mentioned up above?

  • Well, essentially you have everything you need. Basically, when you are not right clicking, it does the zoom between two objects. When you are right clicking, it only zooms to the crosshair.

    If you're doing the "scroll to" method, you can just set the behavior disabled on the player while you are right clicking and enabled when you aren't.

  • Here, I grabbed some quick screenshots from my own code.

    Ok, so I have a sprite with the solid behavior. I go to that behavior and add a tag, like this. This is done in the properties bar of whatever you added solid to. It could be a sprite, tilemap, tiled background, whatever you need. I tagged my solid "house" in my project.

    Then, we write a piece of code that sets our exceptions for us. In this screenshot, I wanted my player to be able to walk through the house solid, and so I create an action from my player using "set solid collision filter". This action lets you include or exclude, and since I want my player to pass through, I picked "exclude".

    Now my player can walk through any solid tagged as "house".

  • Good to hear! You were destroying the coin as soon as you made it.

  • Right, but if you are holding a button down to move? shouldn't you face that way?

    OK, let me ask a different way. You are using the word "automatically", but I still don't know whaf is making you turn around.

    Are you facing an enemy? Are you looking at the mouse? I don't know what automatic thing you want to do. At this moment I only see that you want to face a direction when you try to move, which is what you're doing already, unless you are using default controls on your player by accident and the code doesn't work. Maybe check and see if default controls are turned on in the behavior?

  • Ok, so looking at the gameplay of the video, I think a simple way to do this might be to do the following...

    Make a crosshair sprite and use "every tick" to set the crosshair at mouse.x and mouse.y.

    Then, add the "scroll-to" behavior to both the player and the crosshair.

    What "scroll-to" does is attempt to center the viewpoint on whatever object it has on it. If you add "scroll-to" to multiple objects, it does a quick version of what oosyrag has described. However, using Scroll To like this means that you can't do little cutscenes where the camera focuses on another object.

    Although oosyrag's version is a bit more complicated, you can do more things with it once you know how.

  • The way you have your code set up to mirror and unmirror the sprite looks correct. That's the way I teach my students to do it. I don't think I quite understand what you're asking.

AlexSV's avatar

AlexSV

Member since 25 Apr, 2019

Twitter
AlexSV has 1 followers

Trophy Case

  • 5-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

7/44
How to earn trophies