How do I find generic game logic

0 favourites
  • 5 posts
From the Asset Store
Template for a generic save / load system, fully documented in comments and video
  • I am self-learned in most of the things I do. I seem to love information. I would like to find a book or blog with game logic information. This does not have to be C2 specific but that would be icing on the cake. I have been searching but not finding what I want.

    I would like to know how to write subroutines to accomplish the tasks in many types of game (mostly puzzle types). An example would be say a poker game. Do I need to write code to check for all the possible outcomes (Pair, 3 of a kind, Full house,etc) or is there a simpler way to get the result that would result in less bloat and faster operation. Take this into a more complex game would be like candy crush. The basics of the logic to check for the three or more matches. not only in the current move but in whole grid. I could list more but I think my point is clear.

    I am asking this so I do not come to this forum and ask this type of question with everything I try to make. Hope I have made my question clear. I know I could take a game creation course but am looking to go at my pace and not invest a fortune.

    Thanks

    John

    P.S. If this question would be be better elsewhere please direct and I will remove and repost it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For specific types of game logic, your best bet is google. For example, poker hand evaluation (not a simple algorithm!): https://www.google.com/webhp?sourceid=c ... tion+logic

    There are so many types of games that there is no one source/book/tutorial for all types of programming logic. However, it has almost all been done before, so wikipedia and google are your friends - you just need to know what to look for.

    Basically while you can work through complex logic yourself, it most likely has been done and documented already. There are also usually many many different ways of doing the same thing - here is a classic example https://en.wikipedia.org/wiki/Sorting_algorithm.

  • Thanks, this is the type of thing I am looking for. I had a feeling there would be no short formula. I assumed I would have to write a check routine for everything I am looking for. Not like a simple check that I could apply accross th board so to speak. In the poker example, I assume a top-down (highest hand routine) would be most efficient. Example being if they have a royal flush the other hands could perhaps be skipped.

  • Usually best not to lose too sleep over "best" or "most efficient" methods, unless you run into specific performance issues. Which is rare, considering the computing power available today.

    I would always recommend a method that is easy to understand and makes sense based on your own logic rather than an arcane optimized method that you don't completely understand.

  • thanks again

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)