• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Question] Basic Setup for Pokémon in Unity

971
Posts
7
Years
  • Age 21
  • Seen Nov 28, 2022
This is probably going to be ignored and decay at the bottom of the list, but hey-ho!

I've recently started messing with Unity, and it's not turning out so great in terms of basic stuff like camera, sprites and all that. I was wondering if there were any more experienced people with Unity that could help me some of the following stuff to get me started with the actual code:

  • Camera angle and position
  • Sprite angles and positions
  • How objects should be made like a character and have it be able to walk (usually a script that works with a grid)
  • If the above is achieved, how buildings can be modeled (or taken from the internet).
 
971
Posts
7
Years
  • Age 21
  • Seen Nov 28, 2022
That's a lot of questions at a time, a good resource might be brackeys on youtube.
And you might appreciate knowing this exists:

https://github.com/superusercode/PokemonUnity

Video of it in action:

https://www.youtube.com/watch?v=XozaGOtIGys

That's not what I'm looking for as he never made a tutorial or did any explaining that helps setup the basics. I wish he did, though.
And Unity basics itself like setting up a Camera I can already do, I'm just wondering about the perfects angles and positions for a Pokémon game, which I don't think he's ever discussed.
 
320
Posts
14
Years
  • Seen Dec 27, 2021
971
Posts
7
Years
  • Age 21
  • Seen Nov 28, 2022
Well to be fair that would be rather specific for a tutorial, no?

How about the official Unity video tutorials on camera's:

https://www.youtube.com/watch?v=xvyrzwwU1DE

And rm2kdev also has a tutorial series for unity which covers some of the subjects you mentioned:

https://www.youtube.com/watch?v=NNpLsimyu3I&list=PL_4rJ_acBNMH3SExL3yIOzaqj5IP5CJLC

I know how to set up cameras, but not in what angle to make a good-looking 3D game. I haven't dropped "3D" before, which is totally my bad. 2D cameras are easy; right on top. But if I were going that route, I could better make a game with essentials. The official tutorials may come in handy for some future stuff, though. Who knows.
 
320
Posts
14
Years
  • Seen Dec 27, 2021
Ah alright.
What kind of perspective would you like to achieve?
Over the shoulder like Gears of War, right behind the player like Mass Effect perhaps?
Or for a top-down 3d game a 45 degree angle might be best.
Let me know and I'll probably be able to point you towards some resource that will be useful for your needs.
 

TBM_Christopher

Semi-pro Game Dev
448
Posts
14
Years
Camera Angle and Position

I've put a LOT of thought into this, not only for a Pokemon game but for any top-down RPG. The approach I used was one which should take you back to high school math classes. Basically, I started with how much "weight" I wanted each face of a building to have. If you did a flat 45 degree angle, you'd see that your building's height is just as visible as its depth. I figure that a 1/2 ratio of height/depth works pretty well, at least to demonstrate what I'm doing. Remember, an orthographic camera won't scale with distance, so it would give you something which looks more like the GBA and earlier games, while Perspective will get you something resembling NDS and later.
(Ignore the fact that my camera viewport is misdrawn - I caught it and did a goofy thing where I tried to do some math which proved the camera is facing the direction the camera is facing.)

vlelV1x.png

As you can see, the camera and your test building are a part of a right triangle whose sides are factors of 1, 2, and the square root of 5 respectively. The angle marked there, theta(the symbol which kinda looks like a Poke Ball, ironically enough), is the one we're trying to find.

You can use trigonometric functions to find angles given sides of a right triangle. Since we don't really care about the hypotenuse, we can just solve with Tangent. The tangent of our angle, theta, is equal to the ratio of sides we want, 1/2. Pulling out a calculator, we see that the inverse tangent of 0.5 is a little wonky, at about 26.5 degrees. You probably won't notice this rounding error unless you're working with a low resolution for your final game(which admittedly is a real possibility if you're doing a Gen 4-styled project. Use your own discretion).

The last step is the one that I neglected to show in my awful little doodle - since you're pointing your camera downwards, place your camera at (0,0,0), and then rotate it about the x-axis to 26.5 degrees.

Alternatively, you can use some scripting to define this ratio and set your camera using a facing vector which you'd normalize at runtime, but if you don't plan on adjusting your camera angles while the game is running(I can only remember Heartgold and Soulsilver doing this at the lighthouse in Olivine City), the method I outlined should suffice.

Sprite angles and positions
This really depends on how you're doing the sprites to begin with. I think Unity's 2d sprite renderer makes it so you wouldn't have to worry about this, provided you have a canvas which draws the sprites. I'd make an empty gameobject with whatever the necessary sprite components are as well as 3d physics components, then simply draw the sprites on a canvas afterward.

Player and NPC behaviors
Make them as you would for a 3d game. Just don't use a 3d object as your character's graphics, instead using whatever Unity uses for rendering sprites.

Buildings and models
Making your own? Learn Blender. I've been working with it for the past month now, and have gotten satisfactory results. It has the benefit of being free, and it's fairly thoroughly documented. The interface is a little bizarre, but you can't argue with that price.

Want official ones? Models Resource. They've been doing a fairly good job ripping the models from the NDS and 3DS Pokemon games, and the character meshes are weighted(though not rigged), so you can use Unity's built-in animator for it(I posted a while back a quick browser demo where I took Calem from X/Y and animated him in a box. I might still have it so I'll come back and edit this post if I find it) Edit: I found the post in which I shared a gif of it in the early stages before I animated the arms and a link to the demo, but since removed the actual demo. Sorry about that.
 
Last edited:
971
Posts
7
Years
  • Age 21
  • Seen Nov 28, 2022
Camera Angle and Position

I've put a LOT of thought into this, not only for a Pokemon game but for any top-down RPG. The approach I used was one which should take you back to high school math classes. Basically, I started with how much "weight" I wanted each face of a building to have. If you did a flat 45 degree angle, you'd see that your building's height is just as visible as its depth. I figure that a 1/2 ratio of height/depth works pretty well, at least to demonstrate what I'm doing. Remember, an orthographic camera won't scale with distance, so it would give you something which looks more like the GBA and earlier games, while Perspective will get you something resembling NDS and later.
(Ignore the fact that my camera viewport is misdrawn - I caught it and did a goofy thing where I tried to do some math which proved the camera is facing the direction the camera is facing.)

vlelV1x.png

As you can see, the camera and your test building..........

Thanks a lot for putting so much effort into explaining this; it will really help me out a lot in the future. Although you didn't take into consideration that I could still be in highschool:), I can either believe you on your word for this one or learn this stuff for exact angles myself to be able to use it in the future. It's quite complicated for all that I actually wanted :). As for my other questions, most of them are answered. Thanks, once again!

A new question I've had for a while: I need a tileset that fits the way I'd want to map (or at least test basic stuff with for now), which is shown in this video.
If anyone would have a tileset that's pretty top-down (which I think fits the best) but is still detailed, I would also be very interested in that.
As for the camera angle in this video: Could this view be recreated with 45 degrees or 75 degrees, or should I use something like you calculated? It's quite confusing to me, but I already said that :).
 
Last edited:
320
Posts
14
Years
  • Seen Dec 27, 2021
If anyone would have a tileset that's pretty top-down (which I think fits the best) but is still detailed, I would also be very interested in that..

Well that really depends, do you want a graphics style similar to the ds pokemon games, or something else entirely?

You can always check out http://opengameart.org/
 
971
Posts
7
Years
  • Age 21
  • Seen Nov 28, 2022
Well that really depends, do you want a graphics style similar to the ds pokemon games, or something else entirely?

You can always check out http://opengameart.org/

I'm interested in recreating the DS style, gen 4 and 5. That may not be original, but it's still something hardly any people do. The problem with the tileset is that they're not top-down, because you never see it as top-down. 3D things are to be ignored for top-down, I'm moreso looking for tiles like mountains and roads, simply because I only need a very, very basic square map to test stuff with.
 
320
Posts
14
Years
  • Seen Dec 27, 2021
Well It's possible with Spiky's map editor to rip buildings and textures from DPPTHGSS maps in the original resolution. That might be what you're looking for.

Otherwise I would suggest using Kyledove's DPPT tiles.
 
971
Posts
7
Years
  • Age 21
  • Seen Nov 28, 2022
Well It's possible with Spiky's map editor to rip buildings and textures from DPPTHGSS maps in the original resolution. That might be what you're looking for.

Otherwise I would suggest using Kyledove's DPPT tiles.

With all respect, but I don't consider that "top-down".
 

TBM_Christopher

Semi-pro Game Dev
448
Posts
14
Years
Thanks a lot for putting so much effort into explaining this; it will really help me out a lot in the future. Although you didn't take into consideration that I could still be in highschool:), I can either believe you on your word for this one or learn this stuff for exact angles myself to be able to use it in the future. It's quite complicated for all that I actually wanted :). As for my other questions, most of them are answered. Thanks, once again!
Haha, no worries! Sorry to assume! Just keep an eye out for trig functions in your math classes; they're surprisingly useful in game dev! All you'd need for your purposes is to find the ratio of height to width then take the inverse tangent of that on a calculator. That'll give you the desired camera angle in degrees. Otherwise, you can use
Code:
transform.rotation = Quaternion.LookRotation(new Vector3(0,-y,z).normalize();

in a script's awake function, which should make your camera face the proper angle using vectors.

As for the camera angle in this video: Could this view be recreated with 45 degrees or 75 degrees, or should I use something like you calculated? It's quite confusing to me, but I already said that :).
I admittedly have very little idea when it comes to this map. My gut instinct would be to try 30 or 60 degrees and then eyeball it from there. Or just download the source, since the creator of that video seems to have a project file available to download, and pick it apart for yourself!
 
320
Posts
14
Years
  • Seen Dec 27, 2021
With all respect, but I don't consider that "top-down".

Huh? Those types of graphics are definitely top-down as far as I know.
What do you consider top-down graphics to be then? You mentioned wanting to create something like Gen 4 or 5, I respond with a way to get those exact graphics and you don't consider that to be "top-down".
I genuinely want to help out people on this forum as much as I can, but I feel like you should be more clear with you actually want here :P
 
Last edited:

TBM_Christopher

Semi-pro Game Dev
448
Posts
14
Years
Huh? Those types of graphics are definitely top-down as far as I know.
What do you consider top-down graphics to be then? You mentioned wanting to create something like Gen 4 or 5, I respond with a way to get those exact graphics and you don't consider that to be "top-down".
I genuinely want to help out people on this forum as much as I can, but I feel like you should be more clear with you actually want here :P

The real issue is that we're talking about two different sets of terminology - top-down in this case isn't referring to the 3/4ths view that a regular tileset has, but from an absolutely straight down perspective(like a geographical map). For a 3d model you'd want that rather than a tileset like you're used to for RMXP, as those tilesets are made to be viewed two-dimensionally.
 
320
Posts
14
Years
  • Seen Dec 27, 2021
The real issue is that we're talking about two different sets of terminology - top-down in this case isn't referring to the 3/4ths view that a regular tileset has, but from an absolutely straight down perspective(like a geographical map). For a 3d model you'd want that rather than a tileset like you're used to for RMXP, as those tilesets are made to be viewed two-dimensionally.

I was aware of that. And that would be perfectly possible for ground and road tiles.
Also I mentioned a way to rip these graphics from the DPPTHGSS games, which do exactly what you describe, they use tiled textures which they project onto a 3D map.
 

TBM_Christopher

Semi-pro Game Dev
448
Posts
14
Years
Whoops - I'd only skimmed and seen your recommendation to check Kyledove's tiles, which were drawn with that 3/4ths view to resemble 4th generation Pokemon tiles. Using the rips from Gen 4/5 would definitely be the easiest option.
 
Back
Top