jeudi 29 janvier 2015

How to generate random levels on this balance game

I'm trying to make a game with this mechanics: http://ift.tt/IBUwPr


I've been stuck for a couple of days on the generation of the levels. Probably some of you can guide me on how to approach this problem.


The game consists in placing objects of different weights on the sides of one or more balances, and the user has to determine which object is the heaviest using its logic.


The problem is that i'm not beeing able to place all the objects on the balances in a way that there is a 100% determinable solution. With this i mean that there may be some cases that regardless how much logic you have, you will never be able to determine which object is the heaviest.


One thing that i've been trying is to place randomly the objects on the balances but with some "rules". This rules are not currently enough to always have determinable levels.


Examples of the rules that i've tried are:


1) the heaviest object is always alone 2) the heaviest object cannot be less heavy than the sum of the weights of the objects on the other side of its balance, it can only have less or equal weight. etc


After trying a lot, i'm realizing that i must take into account the configuration of the other balances in order to know how to place the objects. The rules mentioned before only sees the objects on the current balance and not the others.


Can you please help me with this problem? Thank you!


Regards.





Aucun commentaire:

Enregistrer un commentaire