I have a question about a software design of a game I’am currently working on.
The game is kinda strategic one. The world is divided into rectangle fields and there are different kinds of game objects. Let’s say there is a player, mill, farm and a town.
I wonder, what would be the best way to design the game (in Unity engine) if I know that one of the needs is the ability of the player to plan a move across the game fields, avoiding crossing the fields where is some game structure.
I’m not asking about what algorithm to use - I plan to use A*, my question aims at the design of the game logic itself - right now I have a 2d array of prefabs. I want to add the functionality described above but I don’t know, what is the best way to implement that in Unity engine (what is the usual way this kind of functionality is done in the game software…).
I am familiar with basic programming concepts but I never worked on a game before…
Thanks for the comment. You see, I watched them but I didn’t find the answer there The one that is closest to what I want to do is “Stealth” but when it comes to the crunch, it’s a completely different business…
If you complete those tutorial projects, actually making the games as you go through them, they’ll give you good insight into how to design your game.
Then you can take each part and build it separately: defining the game world, getting movement commands from the player, and making the player character move. If you take each separately, design and implementation options will be more apparent. For example, after working with Unity UI in the tutorials, you’ll have a better idea of how to get movement commands from the player. And after working with Unity’s navigation system, you may decide to use it instead of having to write your own A* implementation.
If you just want something to get started without going through the tutorials, you might be able to find a pre-written framework to buy on the Unity Asset Store.
I’m back, little bit more educated in unity3d, and it looks like I can’t use the navmesh system, because my game terrain changes and it is not possible to handle this with navmesh’s obstacles. So I ask my question again. What would be the right way to do that in unity, supposed I have an array of the game blocks, a player and the target?
Just thought I’d chime in a little here. Granted I’m not a top level programmer or game designer but I’m happy to share what I’ve learned…
Try not to over think the concept you are trying to implement. Take everything down to a very basic level. Instead of thinking of everything in a programming sense, plan everything logically. For example, I am developing a game that sounds like it’s in a similar territory to yours. I spent 3 days doing nothing but writing code to go with my logic. Try and see if you can manage class objects in an intangible environment before actually implementing game objects. Game objects work like standard class objects but are just visually represented. As stated by TonyLi, the tutorials linked to provide the building blocks of these concepts. It is hard to give advice to somebody on how they should implement features because there can be SO many ways to do it. Try getting some code down and when you get stuck, show what you have tried and achieved so far and I’m sure someone will have a solution for your working.