R0J0hound's Recent Forum Activity

  • Here's one way here using detector sprites:

    For just a rectangle you can get away with having only 1 detector, I used 3 to handle crevices.

  • Sounds like this maybe?

  • Game develop actually was made a little after construct classic, before c2. The interface does look similar, but I don't think it's a ripoff. Mainly since it's author said he wasn't aware about construct when he first was making it.

    I've tried it a time or two, but it didn't really capture my interest. I didn't find the interface to be as intuitive as construct's, and it seemed that the event system requires you to be more verbose. It does have some interesting features though.

    You won't really get a lot of people saying they use it asking on this forum. Ask on their forum and you'll get a different response.

  • One more:

  • mercuryus

    Updated it with a small change and now it takes about a second less time. Now instead of loop{save->minimax->restore} it does save->loop{minimax->peek}->discard.

    With algorithmic code like this you can implement it in JavaScript and get a 10x speed increase.

  • Depending on what movement behavior the target uses they can have an expresion to get velocityX and velocityY, or Speed and angleOfMotion. You can convert the latter to vx,vy with:

    vx = speed * cos(angleOfMotion)

    vy = speed * sin(angleOfMotion)

  • mercuryus

    Well I finally took a crack at it and it appears to be working. I wanted to go for a simpler game so I went for checkers instead of chess, and even then I didn't add all the rules. Mainly it lacks kinging and any winning conditions.

    https://dl.dropboxusercontent.com/u/542 ... imax2.capx

    Not exactly simple but it only has 85 events total. The minimax algo takes up about 12 of them. The rest are for things such as generating move lists, moving pieces and saving and loading the board state from a stack.

    It is a tad slow on my machine with 8.5 seconds for a minimax depth of 3. Rest assured it isn't the function object that is slowing it down. The main culprit is the save and restore functions and the generate moves function in the minimax function. It can be made faster i'm sure, but I'm done with it right now.

    -cheers

  • Vx and vy are the x and y velocities of the target.

    Instead of atan2(y,x) you can use angle(0,0,x,y)

  • spacedoubt

    Haha, quite an idea but it hasn't given as much pain as that printer did.

    newt

    Interesting, but I couldn't use anything from the imac with that. Maybe the flatscreen but it's hardwired in and I don't like the imac case that much. Interesting stuff to mess with none the less.

  • AnD4D

    Are the objects created and destroyed at runtime?

    You could do this if the first 4 instances are controllable and the last 4 are ghost.

    Sprite Boolean "ghost" is set

    --- sprite set x to sprite(sprite.iid-4).x+400

    Or if you just want each instance with ghost set to be at an offset you could do

    Global otherx=0

    Repeat 4 times

    ---Sprite is ghost

    ---pick sprite instance loopindex

    ------set otherx to sprite.x

    ---sprite is not ghost

    ---pick sprite instance loopindex

    ------sprite set x to otherx+400

    Of course with that example there are 8 instances.

  • What have you done so far? First would be a way to score the board, so the algo can know what is good or bad. One simple idea would be to add 1 for each white piece and -1 for each black. So then you could loop over all the possible player moves and pick the move with the best score for that player. You could look more moves ahead so the cpu chooses a better move, but the computation time will exponentially increase.

    You can actually impliment the algorithm exactly like in wikipedia. The tricky bit will be generating the list of moves from the game state. I did a chess game and didn't get to ai since I'd need to vastly rewrite it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Impressive. I should log in more...

    Maybe if I write an automation script to log me in everyday. But why stop there, I could also make it reply to a random topic with some random Chinese proverbs. Either that or pm newt everyday with a random name of a cheese and see if I can sway his eating habits...