Answer the question
In order to leave comments, you need to log in
Not standard moves in the game on Unity. How to prescribe their logic correctly?
I am doing a project for self-study (ready-made code is not needed). I don’t understand how to build the logic of game moves correctly and how to work with such moves. I watched chess and hexes on github - it's close, but it seemed to me that it doesn't fit.
I threw the animation as it should be - here you can clearly see what and how. Well, you can see it in the picture too.
The playing field consists of curved lines with dots on which the player and the opponent can walk. We throw a cube. For example, 5 fell out. We can look like a certain number of cells from 1 to 5 in any direction of the line of our field.
Such playing fields will be different, you can create them by hand, placing objects on the stage with triggers (although it is not clear how to control the players then), or you can generate them (here it is also not clear how, there is no such dependence as in chess or hex fields) .
Advise what I need to find, in which direction to dig in general? ..
Answer the question
In order to leave comments, you need to log in
It's not entirely clear what the problem is. True logic is one in which there are no errors. And you can look for an error only if it is clear exactly what you want to do, that is, what is the goal . If you are boring, then you can be sent to the very beginning and asked to define the goal from the point of view of game design, that is, what feelings do you want to evoke in the player and why in this way. In any case, you need to start from the goal, so goal setting is very important.
If you're stuck between level design and procedural level generation, it's best to use your hands, because you can get creative with creating levels and thus make the game more interesting. And in procedural generation, although it is more complicated, pieces are usually used that do not contradict logic too much (i.e., are created by hand), but still inevitably bring their share of contradictions. That is, if you generate, then you need to think about how the elements from which you generate can be combined in an interesting way, and what can go wrong in order to try to avoid this.
If the question is about how to make a graph, then whatever. For example, points are array element objects. And each such object can contain several indexes of other elements, which will mean a connection with other points in the same array.
If the question is about the curvature of lines in an arbitrary graph, then here you can either draw manually, which, as was said, allows you to make interesting levels, or some bezier curves.
If the question is about control on the graph, then it is the same - mouse or finger, that is, click / tap. Also note that there is no hover on mobile devices, so right now your game is essentially limited to PC only. Keyboard arrows can be done easily, but in the case of 5 links, there simply won't be enough keys, that is, from time to time the player will need a mouse. You can also use the numbers on the keyboard, then the connections themselves will need to be visually numbered.
If the question is about how bots will walk in an arbitrary graph, then these are all kinds of pathfinding algorithms, of which the most classical (and the basis for others) is A* (Astar).
Going back to game design, you don't have a display of the rolled number of moves on the screen, i.e. it needs to be felt. Is this the interest? Also pay attention to the dice itself. If it is not in the game, then this is a big omission, in my opinion. Make a cool dice so that it rolls straight across the screen, and so that the player cannot fully guess what will fall out - perhaps this will become a key moment in your game, and moves and so on are just complementary mechanics. In general, it all depends on the goal.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question