• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.


This topic is now archived and is closed to further replies.


Pls help with shanghi/mahjongg theories

1 post in this topic

Hello there.. Im working on a shanghi style game...(some people call it mahjongg) Basically you have a pyramid of tiles and you can take 2 matching tiles away at a time. Ok.. so if you know what im talking about.. here''s the problems. #1) I want to be able to guarentee the game is ''able to be won'' if they make the correct moves. This means I can''t just randomly place the tile, but I to semi-randomly place the tiles so it''s a differnt game every time you play. #2) I need to come up with a quick way for the computer to tell you how many ''possible'' moves there are left. It''s a 3-d array for the tiles in x/y/z. Im open for any suggestions..because im pretty stumped. Thanks in advance. Cygor (this msg also posted in the programming discussion group)

Share this post

Link to post
Share on other sites
the first problem (possibility) is quite easy to solve. It's the way you generate the game. You have simply choose randomly the 2 corresponding tiles, and then put them at plan (randomly) in a way they could be taken out, if a player would be on turn. Repeat this, until you drop all tiles. (it's simple reversing of puzzle solution)
There is a small problem, if you want the tiles to get some shape at the end of generation (pyramid, or something...). Because puting tiles randomly may cause you to block a free space for tile ... so while choosing random positions for the tiles you may need to check, if some free space wouldn't be blocked ...

The second thing is kinda worser. I'm not sure, what you mean with "quick"... But, ok, I got some idea.
the game starts -> game plan is generated.
now do run trough full array and for each type of tile (1 dimensional array) store the number of free tyles (i.e. ready to get out) of such type.
"VI" tiles is 1 free
"autumn/winter" is 0 free
"3balls" are 3 free
etc... this is time consuming, but does have to be done just at start.
if you could afford enough memory (and you ver likely could afford it, because it is not really too much), you may either hold pointers type->amount_of_free and either sorted linked list _most_free(type) -> 2nd_most_free(type) -> ...

now number of possible moves is:

Sum of (for all types of tiles) {
while ( num >= 2 ) {
num--; // use temporary variable, not the one from array of course
totalmoves += num;
/* (i.e. 2 free tiles makes 1 move possible
3 free tiles makes 2+1 moves possible
4 free tiles makes 3+2+1 ...
) */
/* if you have the sorted linked list, use it NOW
at the beginning of sum take the "most_of_free" tile type
after this while take the next one
do until you encounter tile type with 1 or less free tiles, than break
(and you have total number of possible moves)

you see, that counting possible moves with this "free tiles" array is quite easy, but the computation of this array is damn expensive, and it changes after each move...
that's true, but not that much.

free_tiles_number (type = the type the player has taken) -= 2; // decrease number of free tiles for this type

and examine closest neighbourhood of taken tiles ... if some tile has been released, increment the free counter for
it. This is quite much faster, than scanning through the full array. (make sure to not recognize "before turn" free tile as "free by turn")
And resort the sorted linked list of course.
This is very likely the fastest possible solution.

send me mail at hellco@upjs.sk, if you got some questions, I do check this board rarely ... (lack of time, sorry)
I hope I got you some ideas... happy coding...

Ped - Peter Helcmanovsky - 7 Gods demo group
First Sight Entertainment - http://members.xoom.com/fseteam

Edited by - Ped on 2/22/00 5:29:25 AM

Share this post

Link to post
Share on other sites