Sign in to follow this  
CarloSpain

Getting lost...

Recommended Posts

Hello, I am making a isometric tile based game. My first step was make the map in ortogonal mode array[y][x] = { {1, 2, 3, 4} {1, 2, 3, 4} {1, 2, 3, 4} {1, 2, 3, 4}}; The next step was convert the ortogonal array in a isometric map, where array[0][0] is the northest point of the iso map. Next, I use a formula, to calculate the distance between char position and array[0][0], and I rest this to the RECT.top, and RECT.bottom (So I get char's tile on top of the screen). Then, I add 640 pixels to RECT.top and RECT.bottom, with this, I get char's tile aligned in vertical position. My next step must be align the char tile in horizontal position, but before do this, I wanna ask something... 1- Am I doing it well? 2- I read that to make smooth scrolling/movement, I must load on memory nine parts of the map (Right, down, left, north, north-east, north-west, south-west, south-east and the map that is being viewed) But I think, this is just for ortogonal maps, but to isometric maps, I think this is very difficult. Can you give me more info about this? 3- When I draw a character into the surface, really this char doesn't move around the surfaces, isn't he? He is always in the center of screen, isn't he? 4- How can I do to send a determined message to the bucle of the program when I click in a determined location in a surface? Can you give me info about this? 5- I want to make the typical window that starts with a "Play game", "Exit", "Options", etc. Is this maked with a simple formulary with VC++? At the moment, the game always starts when you open de .exe, but how can I do to start the game when I push on "Play game"? Thanks you, Sorry for my english, Carlos

Share this post


Link to post
Share on other sites
I'm sorry that I don't have much time at the moment to give any thorough answers but there should be some nice reading among these articles here at gamedev about isometric maps.

Share this post


Link to post
Share on other sites
1. Don't use magical numbers, such as '640'. It's probably the screen width, so use a variabele with an obvious name (in this case, something like screenWidth or such) that holds that value. It'll make your code easier to understand and easier to maintain/modify. Anyway, yeah, a transformation between tile space and screen space is necessary, so you're on the right track.

2. That only applies to very large maps. The same concept can be used for both orthogonal and isometric maps, though. Anyway, how large will your maps be? How much memory will they use? If they're relatively small, then don't even bother with this. It's an optimization technique, not a method to make your terrain scrollable. As for implementing scrolling, see point 3.

3. That depends entirely on where you draw that character. Let me give you some advice: keep movement and rendering apart from each other. When your player moves, let him move, and keep the map and all other objects where they are. However, draw it at a certain offset. You can use the player location as this offset, so the view will always follow the player. It's better to use a separate camera position for this purpose though, so you can customize your camera behaviour more easily.

4. What API's are you using? How are you handling user input? In other words, are you using SDL, or Allegro, or plain Win32?

5. Simply run some menu code first, instead of your game code, and only start the game code when you click on that start button. It can be as simple or as hard as you want. What specifically don't you understand about doing this?


Have you made some games before? If not, then don't you think you should start out with something easier? You're in for a lot of difficulties, judging by your questions, and while that can be educative, it also means there's a good chance that your project will never see daylight - which can be quite demotivating.

Share this post


Link to post
Share on other sites
I do this just for learn, later or before I will program something bigger, and this can give me a good base.

Well, thanks you for the questions, its realy helps me :)

2.- I want to make a big map, so if you can give me more info I will thanks you.
3.- Then... I'm doing wrong this steps?
Quote:

Next, I use a formula, to calculate the distance between char position and array[0][0], and I rest this to the RECT.top, and RECT.bottom (So I get char's tile on top of the screen). Then, I add 640 pixels to RECT.top and RECT.bottom, with this, I get char's tile aligned in vertical position.

My next step must be align the char tile in horizontal position, but before do this, I wanna ask something...

With this, I put the map where character's tile is in the middle of screen...
There is other method to do that the character's tile be in the center? Can you give me more info about characters position?

4.- I just use VC++ with DirectDraw to render the map in surfaces, nothing more :S

Thanks you,
Sorry for my english,
Carlos

Share this post


Link to post
Share on other sites
Actually, I was trying to say that this project may already be too complex for you, for the time being. I'd recommend starting with an orthogonal tilemap, rather than creating an isometric game immediatly. They're similar to each other, but the isometric point of view makes several things more complex, so if you don't have a firm grasp on the basics, it's easy to get lost. Anyway, that's up to you to decide.


2. How big is big? More importantly, how much memory does a map use, tile data and images together? If that's only a few MB, then forget about loading a map in parts. It's only making things more complicated, and it's not really necessary at all.

3. I think so, yes. I first assumed that you were calculating where to draw tiles on-screen, but I see now that you're drawing them relative to the player. As I said before, that can be fine, but it's better to use a camera position instead of the player position. You can then keep this camera position the same as the player position, but whenever you need the camera to focus on something else, you can easily do so. Perhaps this tutorial will clear things up a bit (it talks about OriginX and OriginY, which are essentially the camera position, just with a different name than I prefer).

4. VC++ is a good IDE, but DirectDraw... let's just say it's somewhat outdated, and as you can see, it doesn't handle input for you, so it's not really a very good choice these days. It's better to use a library such as SDL or Allegro, or an engine such as Haaf's Game Engine. These handle much more low-level stuff for you (rendering, input, sound, etc.), so you can start working on your gamecode much earlier.
And if you're not too much C++-obsessed, you can go for Python in combination with PyGame too. It's pretty easy to learn, and you can get results pretty quick.

Share this post


Link to post
Share on other sites
Thanks you for the reply.

I think I can use SDL, because I know a lot of tutorials in my idiom about isometric maps with this api.
What you recommend me? SDL, Allegro, Direct3d...

Thanks,
Carlos

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