Sign in to follow this  
glhf

Unity Adice for my game project prototype?

Recommended Posts

I have very advanced complex combat system that is too much complex to have on just paper.
I need to prototype it.

So i need to make a grid kindof like chess has.

IM USING UNITY! and will use c#.

I want it to be in 3d too with isometric or 3rd person camera.

But I need help with how i will make the play field.

So how do i make this tile based grid? (guessing its coreect lingo.)

I want each tile to be seen graphically too.

So i need to have a texture for what each tile looks like with a nice border.
then I import the texture to unity and assign it to material.

then i create a plane that i assign this material for.

Then I will have 1 tile so far.

Now what's the best way to create a 3d board tile based grid?

maybe its better to not use plan but instead cube?


ok..
So i want to be able to move my characters from one tile to another by either being able to click on a tile and it moves there or by for example using arrow keys to move one tile ahead.


also, the game i want to make should be multiplayer.
but im newbie at networking.

so i think for the prototype i will just make enemy npc controlled with simple AI?


Also, in unity..
If i have given a name to a file on projects tab like for example a scripts file or a scene file a name..
Is there an easy way to rename it later? because the codes and everything that uses that file will then have the old file name?


Big time thanks to everyone who reply.
This is the best forum.

Share this post


Link to post
Share on other sites
[quote name='glhf' timestamp='1349028832' post='4985430']
I have very advanced complex combat system that is too much complex to have on just paper.
I need to prototype it.
[/quote]
Start of with something you can put on paper. Once you got that working you can think about how to make your idea fit on paper. If you really can't I would suggest you to redesign your idea.
[quote name='glhf' timestamp='1349028832' post='4985430']
So i need to make a grid kindof like chess has.
[/quote]
you should use a 2D array for that.
[quote name='glhf' timestamp='1349028832' post='4985430']
IM USING UNITY! and will use c#.

I want it to be in 3d too with isometric or 3rd person camera.
[/quote]
Well first step is to make it top down with no perspective. The difference between that and isometric 3D is one matrix a checkbox and moving the camera. So I see no reason why you should bother with that before you got your grid working.
[quote name='glhf' timestamp='1349028832' post='4985430']
But I need help with how i will make the play field.

So how do i make this tile based grid? (guessing its coreect lingo.)
[/quote]
You shold take the simple soloution and use ONE plane with ONE texture on top of it. This can be limiting if you want randomized maps or animated tiles. But for now you should just make the game work with one static image.
[quote name='glhf' timestamp='1349028832' post='4985430']
I want each tile to be seen graphically too.

So i need to have a texture for what each tile looks like with a nice border.
then I import the texture to unity and assign it to material.

then i create a plane that i assign this material for.

Then I will have 1 tile so far.
[/quote]
You got plenty of coding to do right now, so don't bother with this quite yet. You'll have plenty of time fiddleling with the right approach later on, but don't waste time on this now.
Edit: your ONE texture should contain several tiles.
[quote name='glhf' timestamp='1349028832' post='4985430']
Now what's the best way to create a 3d board tile based grid?

maybe its better to not use plan but instead cube?
[/quote]
Cube or plane really dosn't matter! The best way to create a 3D grid, is to calculate the mapping between mouse clicks and coordinates in your array. Whether you use planes or boxes or teapots for each tile should not be relevant to your logical grid.
[quote name='glhf' timestamp='1349028832' post='4985430']
ok..
So i want to be able to move my characters from one tile to another by either being able to click on a tile and it moves there or by for example using arrow keys to move one tile ahead.
[/quote]
use on variable to hold a refrence to the selected character. If the variable is empty/null assign it with the next clicked character. Else move the characters logical position to the desired tile, and use a coroutine to animate the movement (with slerp or something).
[quote name='glhf' timestamp='1349028832' post='4985430']
also, the game i want to make should be multiplayer.
but im newbie at networking.

so i think for the prototype i will just make enemy npc controlled with simple AI?
[/quote]
Figure out a way two people can play the game on one computer. You can always play with AI, but AI is NOT simple! At least not if your game concept can't be written on paper ;)
[quote name='glhf' timestamp='1349028832' post='4985430']
Also, in unity..
If i have given a name to a file on projects tab like for example a scripts file or a scene file a name..
Is there an easy way to rename it later? because the codes and everything that uses that file will then have the old file name?
[/quote]
Yes Unity takes care of the file name - don't change it from explorer - and Mono Develop or Visual Studio have ways of automatically renaming variables and classes. I think it's on F2 - otherwise just right clcik the variable or class name you want to change, and select rename/refactor in the menu.
[quote name='glhf' timestamp='1349028832' post='4985430']
Big time thanks to everyone who reply.
This is the best forum.
[/quote]
Hope this is usefull Edited by VildNinja

Share this post


Link to post
Share on other sites
[quote name='VildNinja' timestamp='1349037246' post='4985479']
[quote name='glhf' timestamp='1349028832' post='4985430']
So i need to make a grid kindof like chess has.
[/quote]
you should use a 2D array for that.[/quote]

What do you mean?


[quote name='VildNinja' timestamp='1349037246' post='4985479']
[quote name='glhf' timestamp='1349028832' post='4985430']
But I need help with how i will make the play field.

So how do i make this tile based grid? (guessing its coreect lingo.)
[/quote]
You shold take the simple soloution and use ONE plane with ONE texture on top of it. This can be limiting if you want randomized maps or animated tiles. But for now you should just make the game work with one static image.

[quote name='glhf' timestamp='1349028832' post='4985430']
I want each tile to be seen graphically too.

So i need to have a texture for what each tile looks like with a nice border.
then I import the texture to unity and assign it to material.

then i create a plane that i assign this material for.

Then I will have 1 tile so far.
[/quote]
You got plenty of coding to do right now, so don't bother with this quite yet. You'll have plenty of time fiddleling with the right approach later on, but don't waste time on this now.
Edit: your ONE texture should contain several tiles.
[/quote]

True.. this is good advice but is it really so much more work to make many planes next to eachother? isnt it possible in some kind of loop?
I dont know yet how big playing field i want or how big each tile should be... that is another thig i must test in this prototype.. so it must be easy to edit how big map and how big tiles.


[quote name='VildNinja' timestamp='1349037246' post='4985479']
[quote name='glhf' timestamp='1349028832' post='4985430']
ok..
So i want to be able to move my characters from one tile to another by either being able to click on a tile and it moves there or by for example using arrow keys to move one tile ahead.
[/quote]
use on variable to hold a refrence to the selected character. If the variable is empty/null assign it with the next clicked character. Else move the characters logical position to the desired tile, and use a coroutine to animate the movement (with slerp or something).
[/quote]
I don't really understand your directions.. sorry [img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img]
I know what variable and reference is but I don't understand... if I am standing on a tile how can i click somewhere so it moves to a nother tile? so if i click somewhere that the game can see i clicked within a grid tile (how can i make a grid? i have board to looks like a grid but its just texture that code doesnt know is a grid?



[quote name='VildNinja' timestamp='1349037246' post='4985479']
[quote name='glhf' timestamp='1349028832' post='4985430']
Also, in unity..
If i have given a name to a file on projects tab like for example a scripts file or a scene file a name..
Is there an easy way to rename it later? because the codes and everything that uses that file will then have the old file name?
[/quote]
Yes Unity takes care of the file name - don't change it from explorer - and Mono Develop or Visual Studio have ways of automatically renaming variables and classes. I think it's on F2 - otherwise just right clcik the variable or class name you want to change, and select rename/refactor in the menu.
[/quote]

I dont get option to rename scene or script files inside from unity projects view.

Share this post


Link to post
Share on other sites
[quote name='glhf' timestamp='1349038666' post='4985483']
[quote name='VildNinja' timestamp='1349037246' post='4985479']
[quote name='glhf' timestamp='1349028832' post='4985430']
So i need to make a grid kindof like chess has.
[/quote]
you should use a 2D array for that.[/quote]

What do you mean?
[/quote]

Lets see, What i'd do is to:

1) Create a empty game object, name it LevelGrid or something, attach an empty C# script to it, give that script a public member gameobject variable called tile (This can then be set from the editor). create a prefab from the single tile you've created, attach it to the LevelGrids script instance and then use the instantiate method to create new tiles from the scripts init method, set whatever parameters (material, position, size, etc) for each tile as you create it. (can be done in a loop), store the tiles in a array, vector or arraylist. (This works fine for a fairly small grid, if you're making a big grid you might want to merge several tiles into a single object for performance reasons)

2) To detect which tile is clicked do you can use the raycast method in the physics class with the ray you get from: ray = yourCamera.ScreenPointToRay (Input.mousePosition); Make sure your tiles have a collider attached to them.

If you make your grid as one big tile with a grid texture (or if you're merging tiles) you can still use the raycast to get the point on the grid that was clicked on and then divide that by your tile width and height to get the tiles position in a 2D array. Edited by SimonForsman

Share this post


Link to post
Share on other sites
[quote name='SimonForsman' timestamp='1349075131' post='4985660']
[quote name='glhf' timestamp='1349038666' post='4985483']
[quote name='VildNinja' timestamp='1349037246' post='4985479']
[quote name='glhf' timestamp='1349028832' post='4985430']
So i need to make a grid kindof like chess has.
[/quote]
you should use a 2D array for that.[/quote]

What do you mean?
[/quote]
...
If you make your grid as one big tile with a grid texture (or if you're merging tiles) you can still use the raycast to get the point on the grid that was clicked on and then divide that by your tile width and height to get the tiles position in a 2D array.
[/quote]
Yes that is the approach I would use. That way you can always decide to remove the texture from the big grid, and add your own cubes or tiles as a graphical overlay. But use the single simple plane to maintain the relation between your 2D array and world/input space.

[quote name='glhf' timestamp='1349038666' post='4985483']
I dont get option to rename scene or script files inside from unity projects view.
[/quote]
Yes you do. If you click the name twice you can rename it.

[quote name='glhf' timestamp='1349038666' post='4985483']
True.. this is good advice but is it really so much more work to make many planes next to eachother? isnt it possible in some kind of loop?
I dont know yet how big playing field i want or how big each tile should be... that is another thig i must test in this prototype.. so it must be easy to edit how big map and how big tiles.
[/quote]
Yes you can easily write two loops that can instantiate a number of tiles in the scene.
[source lang="csharp"]int width = 10;
int height = 10;
Tile[][] tiles = new Tile[width][height];
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
Instantiate(tilePrefab, new Vector3(x, 0, y), Quarternion.identity);
}
}[/source]
[quote name='glhf' timestamp='1349038666' post='4985483']
I don't really understand your directions.. sorry
I know what variable and reference is but I don't understand... if I am standing on a tile how can i click somewhere so it moves to a nother tile? so if i click somewhere that the game can see i clicked within a grid tile (how can i make a grid? i have board to looks like a grid but its just texture that code doesnt know is a grid?
[/quote]
Get a ray from the camera towards the mouse position. Get the x and z coordinates where y hits zero, and cast x and z to integers and plot them into your array (tiles[x][z]). If your characters should walk around like humans, you'll probably need some path finding (A*). If your characters move around like chess pieces you should just use slerp or lerp to move them between the two tiles with a coroutine.

Share this post


Link to post
Share on other sites
Thanks you both!
I think I know now what I need to create map.

[quote name='VildNinja' timestamp='1349090996' post='4985717']
[quote name='glhf' timestamp='1349038666' post='4985483']
I dont get option to rename scene or script files inside from unity projects view.
[/quote]
Yes you do. If you click the name twice you can rename it.
[/quote]

Nothing happen when I double click it :(
And if I right click I get this menu without rename option :(
[img]http://i50.tinypic.com/ieibgj.jpg[/img]

Share this post


Link to post
Share on other sites
Oh, actually..
I wonder how to make the map semi random generated.
SEMI!

So for example.. if i want to have 2 bomb tiles..
But I don't want them spawned same tiles every map.
But I don't want them spawned just anywhere.

How can I do it so the bombs randomly spawn on a few pre determined tiles?

I could also use this for making the map tiles look nicer by for example having those green vegetable veins growing on some of the stone tiles.
They dont affect game except make it look nicer when all tiles dont look the same.

I guess all this is too hard to do with a single plane and texture?
So I need to do this somehow implement this into loop of single cube tiles.

Share this post


Link to post
Share on other sites
I have an idea..
If you don't use any loop tomake a grid of tiles..

you just place them next to eachother manually..
and then you can make a tile "special" so for exampkle:

OOOO
OX OX
OOOO

So you have manually placed those tiles.. they all look the same.. but the X are programmed differently.
The bomb tile will be randomly placed on one of those X tiles.

What do you think about this?

What is best way in your opinion?


edit:
Acutally I could do the same thing if I make it 1 plane and 1 texture too..
so thats probably better..

edit2: [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]
How can i draw lines in the plane so i can visually see borders between each grid?


edit3:

here u can see what i done so far:

[img]http://i50.tinypic.com/x53y28.jpg[/img] Edited by glhf

Share this post


Link to post
Share on other sites
Also, one more question about spawning units..

I dowloaded a free character from mixamo..
How do I spawn in to the game?

I placed him on the scene but maybe I shouldn't?

How can I place him with code on a specific tile?
You already explained how I can find tiles on the plane but then how do i place the unit there?

Should I instantiate or something? Or move him there on awake of the game?
Should I have alrady created the character so it's in the hierarchy or just have it in the projects folder?
Because if I don't have it already created in hierarchy (added to the scene so you can see him)..
Then I have to scale him or else he is too small.

I think I can handle the rest after I know how to do all this..
I think I can figure out later after i know how to spawn the unit how to move him around form tile to tile..
but its spawning it that i dont know..

Share this post


Link to post
Share on other sites
That is a lot of questions. rather than answering them all, I'll tell you how I would approach this type of game.[list=1]
[*]You need a grid. I would not place the tiles manually, since that would make it difficult to determine which tiles are connected to which. I would start out with a 2D array of Tile, where Tile is an enum of tile types:
Edit: aparently <= breaks the code block. So I use (less or equal)..

[source lang="csharp"]public enum Tile {DIRT, ROCK, WATER, BOMB};

public GameObject dirtPrefab;
public GameObject rockPrefab;
public GameObject waterPrefab;
public GameObject bombPrefab;

Tile[][] map = {
{ DIRT, DIRT, ROCK, DIRT, DIRT },
{ DIRT, DIRT, ROCK, DIRT, DIRT },
{ DIRT, WATER, BOMB, WATER, DIRT },
{ DIRT, DIRT, BOMB, DIRT, DIRT },
{ DIRT, WATER, BOMB, WATER, DIRT },
{ DIRT, DIRT, ROCK, DIRT, DIRT },
{ DIRT, DIRT, ROCK, DIRT, DIRT }
}

int bombLocations = 3;
int bombsToBePlaced = 1;

void Start()
{
for (int x = 0; x < map.Length; x++) {
for (int y = 0; y < map[x].Length; y++) {
switch (map[x][y]) {
case Tile.DIRT:
Instantiate(dirtPrefab, new Vector3(x, 0, y), Quarternion.identity);
break;
case Tile.ROCK:
Instantiate(rockPrefab, new Vector3(x, 0, y), Quarternion.identity);
break;
case Tile.WATER:
Instantiate(waterPrefab, new Vector3(x, 0, y), Quarternion.identity);
break;
case Tile.BOMB:
if (Random.Range(0.001f, bombLocations) (less or equal) bombsToBePlaced)
{
Instantiate(bombPrefab, new Vector3(x, 0, y), Quarternion.identity);
bombsToBePlaced--;
}
else
{
Instantiate(dirtPrefab, new Vector3(x, 0, y), Quarternion.identity);
}
bombLocations--;
break;
}
}
}
}
[/source]
[*]In the editor you should create a Prefab for each tile type you want, and add them to into the script. The prefabs should be no more than 1x1 in x and z. Now you'll get a map where one bomb is randomly placed on one of the three bomb locations.
[*]Next step is to be able to click a tile. Since your tiles are axis aligned on x and z in y = 0, you can easily where the player clicks in your grid:

[source lang="csharp"]if (Input.GetMouseButtonDown(0))
{
Vector3 pos = Camera.main.transform.position;
Vector3 dir = Camera.main.ScreenToWorldPoint(
new Vector3(Input.mousePosition.x, Input.mousePosition.y, 1)) - pos;
float scale = pos.y / dir.y;
Vector3 point = pos - dir * scale;
int x = Mathf.RoundToInt(point.x);
int y = Mathf.RoundToInt(point.z);
print("x: " + x + " y: " + y);
}
[/source]
[*]To import the 3D model you should drag it to the scene, create it as a prefab, scale it to the desired size, apply and remove it from the scene, and finally instanciate it from a script.
[*]I don't have time to talk about movement now, but I think this should be enough to get you started [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
[/list]
Edit: split up source block, since it didn't show entire code Edited by VildNinja

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Announcements

  • Forum Statistics

    • Total Topics
      628403
    • Total Posts
      2982477
  • Similar Content

    • By JM-KinematicSoup
      Unity has put up an official release of EditorXR (formerly EditorVR). 
      https://labs.unity.com/article/editorxr-and-scenefusion-update
      If you haven't tried it lately, you should. This release is actually very good,
       
    • By JM-KinematicSoup
      Hello everyone,
      I'm looking for some input. We created a tool called Scene Fusion to enable real-time collaboration while doing gamedev in Unity. In effect, it will replicate any scene changes one person performs for everyone else connected to the session. It works well, and we as well as our customers using it notice a drastic speedup getting work done, especially when building large complex levels.
      One limitation we have is that we can't support every single plugin and asset out there, so what we opted to do is provide an API that allows game developers to do that work as required.
      My question is: How many if you out there actually end up having to modify an external plugin/tool in order to get it to work with your project?
    • By toadvine
      I'd like to start building a 2D game, very small, just pixel art. I know python/javascript/tiny bit of HTML and I've started learning C++. I'm a long way from starting officially, I've just been making mini-projects to practice & drawing up concept art/gameplay storyboards. I'm just wondering if I'm off with the C++ for the game's programming, or if I should know certain things before starting.
      The game would be very small, I just want to get started trying out some actual work before college.
      Some other info: I'm working by myself on this, and going into game design/programming next year for college. I'm a high school student with a few years of experience just working by myself making small projects, drawing up stuff, so I really don't know much and I'd appreciate any tips.
      Thanks a bunch!
    • By Daerst

      SWARMED is a Zombie-themed RPG / RTS currently in development using Unity 3D. We love Dwarf Fortress (though we have no illusions that SWARMED will reach the same level of complexity), roguelikes, old-school point & click RPGs and real-time strategy games. We aim to cross genre-borders here and there and give some twists to the old Martinis every gamer has been drinking since the 1980s, metaphorically.
      Single player, 3D graphics and adjustable top-down camera - old-school RPG / RTS feeling Take control of a core group of survivors after the outbreak Encounter Zombies that are a real threat, no machine-gun massacre. Don't get swarmed! Build a safe zone anywhere with a highly flexible build system: campsite, lighthouse, school, or fence a whole village Grant asylum to other survivors that you meet and make them a part of your community Achieve sustainability in your safe zone and go on supply runs with your survivors
      Development
      The core team of recently founded indie studio Three Eyed Games currently consists of one writer, two artists and two programmers, based in Germany. We are in our mid-20s with professional experience in developing interactive 3D applications with Unity.
      SWARMED will feature both a 'free-play mode' and a campaign with mid-sized maps that leads the player through a story while explaining the gameplay and introducing him / her to the survivors: a core group a few 'hero' characters the player starts with (each one a detailed character with backstory, hopes and dreams), and more 'heroes' (total not more than 20, probably less) that the player can meet on the journey. In addition, randomly generated NPCs (less detailed and not directly controllable, similar to the way Dwarf Fortress handles its dwarves) can join your safe zone – if you let them.
      We plan to release a few 'Origin' prototypes that showcase individual gameplay systems and meanwhile give a gentle introduction to the characters you will meet in the game. Origin I, showcasing the build system and many fundamental elements like character controls and interactions, is finished and will be released soon. Next up, we're working on the dialog system to be presented in Origin II. Get in touch and we will provide more details and a playable version.
      We want you!
      We seriously think you should join the fun! We are looking for:
      Level Designers / Environment Artists, preferably with experience in Unity and procedural asset creation. Design and build maps with interesting visuals and proper pacing. 3D Artists. Our shacks, items and the dead guys' faces could use some plastic surgery. Can you do that? Writers. We have a bunch of characters to detail and a story to write ahead of us. Game Designers. We have a rough game design sketched out that needs improvement and completion. We need a balanced combat system, trees for constructions, workshops and character skills etc. PR & Community Managers, preferably with web development experience. We want to build a community around the game, and we need you to plan and manage this (with the help of the rest of the team, of course). 2D Artists / UX Designers, preferably with Unity UI experience. Our menus still look pretty dull, and we don't like that. We also need concept art for characters and iconic game moments to define their look and feel. Coders. If you know your way around Unity and C#, there are lots of challenging things to be done. You will work closely together with the two programmers already on the team to get going quickly. Please drop me a message or contact info@three-eyed-games.com
    • By sveta_itseez3D
      itSeez3D, a leading developer of mobile 3d scanning software, announced today a new SDK for its automatic 3D avatar generation technology, Avatar SDK for Unity. The Avatar SDK for Unity is a robust plug-n-play toolset which enables developers and creatives to integrate realistic user-generated 3D avatars into their Unity-based applications. SDK users can allow players to create their own avatars in the application or integrate the SDK into their own production processes for character design and animation.
      “Virtual avatars have recently become increasingly popular, especially in sports games and social VR apps. With the advance of VR and AR, the demand to get humans into the digital world is only increasing”, said Victor Erukhimov, itSeez3D CEO. “Our new Avatar SDK for Unity makes it super-easy to bring the avatar technology into any Unity-based game or VR/AR experience. With the Avatar SDK for Unity now every developer can bring face scanning technology into their games and allow players to create their own personalized in-game avatars, making the gameplay much more exciting and immersive.”
      Key features of the Avatar SDK for Unity:
      Automatic generation of a color 3D face model from a single selfie photo in 5-10 seconds (!). Works best with selfies, but can be used with any portrait photo.
      Shape and texture of the head model are unique for each person, synthesized with a deep learning algorithm crafted by computer vision experts
      Head models support runtime blendshape facial animations (45 different expressions)
      Generated 3D heads include eyes, mouth, and teeth
      Algorithms synthesize 3D meshes in mid-poly resolution, ~12k vertices, and ~24k triangles
      Six predefined hairstyles with hair-recoloring feature (many more available on request)
      Avatar generation API can be used in design-time and in run-time, which means you can allow users to create their own avatars in your game
      Cloud version is cross-platform, and offline version currently works on PCs with 64-bit Windows (support for more platforms is coming soon)
      Well-documented samples showcasing the functionality.
       
      Availability
      The Avatar SDK for Unity is offered in two modes - “Cloud” and “Offline”. The “Cloud” version is available at http://avatarsdk.com/ and the “Offline” version is available by request at support@itseez3d.com.
      ###
      About itSeez3D
      At itSeez3D, we are working on the computer vision technology that turns mobile devices into powerful 3D scanners. itSeez3D has developed the world's first mobile 3D scanning application that allows to create high-resolution photorealistic 3D models of people's' faces, bodies and objects. The application is available for iOS and Windows OS mobile devices powered with 3D cameras. In 2016 the company introduced Avatar SDK that creates a realistic 3D model of a face from a single selfie photo. To learn more about itSeez3D scanning software and 3D avatar creation technology, please visit www.itseez3d.com and www.avatarsdk.com.

      View full story
  • Popular Now