• 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.
Sign in to follow this  
Followers 0
glhf

Unity
Adice for my game project prototype?

10 posts in this topic

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.
0

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
1

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.
0

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
2

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.
1

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]
0

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.
0

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
0

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..
0

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
1

Share this post


Link to post
Share on other sites
Awesome!!
thanks so much this makes everything so much easier for me!!
[img]http://public.gamedev.net//public/style_emoticons/default/wub.png[/img]
0

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  
Followers 0

  • Similar Content

    • By ilovegames
      Are you ready to become the best truck driver?
      If the answer is yes then this game is for you!
      Various loads of cargo need to be delivered safely. Be careful or things might get broken.
      Your driving skills and accuracy will be tested in practice.
      Get in your truck and go!
      TruckDriverSteepRoadSetup.exe
    • By ilovegames
      OffRoad4x4: Max Speed

      If you passionately adore speed and cars, and most of all dream about tearing around in a large and powerful jeep, this game was made for you. First locate the finish line on the map to complete the level. Map or no map, you have to navigate the terrain like a pro. But you aren’t limited to performing tasks in the game as you are free to explore the area just enjoying the machine and the beautiful scenery.

       
       
      OffRoad4x4MaxSpeedSetup.exe
    • By TeoMakao
      Hello there!
      I am Theo and I am looking for an evil minion/partner in crime to help me with making games. Currently I am working on my first "official" game, which is point&click 2D adventure in Unity with Fungus extension, and I will need some help with that. More about the project and future goals in private.
      I need somebody who:
      - First and foremost is interested in making games, but since you are on this forum... yeah.
      - Is a 2D artist(amateur will do, but must be willing to improve)
      - Has at least some grasp around Unity(or is willing to learn)
      - Has at least some grasp around Fungus extension for Unity(or is willing to learn)
      - Is interested in talking about various concepts of imaginary worlds/characters(I need somebody to help me developing my universe and talking to myself proves inefficient)
      And optionally:
      - Is interested in fantasy worlds
      - Is interested in mythology
      - Is interested in sci-fi worlds
      - Is interested in talking about interesting ideas, even if they are completly abstract
      I am offering up to 50% of any profit made, depending on how engaged you'll be.
      This is the first time I am looking for someone to work with me by forums, so if I chose wrong place to announce I am sorry.
      If you are interested in working with me - feel free to PM.
      I do not expect you to sacrifice all the time for the project. For now it's pretty lightweighted.
    • By RobbyT15
      I'm a front end web developer trying to get into game development and I was hoping that someone has a project they would like some assistance on.  I've mostly done tutorials in Unity and made a couple games, roll-a-ball, space shooter, but would like to get more experience.  If anyone is willing to give me a chance, please reply to this message or shoot me an email at robbyt15@bmail.com.
    • By dhanrajsinh24
      I've recently made Fidget Spinner Unity Template which is available in most online stores. Buy and learn 2D game development with it or make your own reskin of the game.
      https://www.gamegorillaz.com/index.php/catalog/product/view/id/2779/s/fidget-spinner-unity-template/
      https://www.codester.com/items/4439/fidget-spinner-unity-template
  • Popular Now