# NeilRoy

Members

10

102 Neutral

• Rank
Member
1. ## Isometric tile selection

Another idea I had was to do your normal tile check, but start at the top most layer. You do a check like you would on the base layer of your map. Only for each layer above that you obviously take into account the offset of the tiles in the Y direction. So, you start at the top most layer your map supports, and check the tile at your mouse position on that layer, if there is no tile on that layer, than you check the next layer down and continue this until you run into a tile at that position. This seems to make the most sense to me. You could even have a variable that keeps track of the highest layer that a tile exists on so you wouldn't have to check all the possible layers, only the one starting at the highest layer that is being used and working your way down. You could even further optimize this by dividing your map into zones, keeping track of the highest layer used in that zone.
2. ## Isometric tile selection

Ray casting, yeah, that's actually how I came up with the solution. I was thinking along the lines of raycasting, only I had Wolfenstein style games in mind, so I started to think of how I could apply that idea to Isometrics, and that was when I came up with this. It's not exactly ray casting, but... close enough. My original idea was to start at the bottom of a map and walk one tile at a time "up" until you reached the right position, al-la-ray casting, that's when it hit me, why not just compare the drawn tile for the detected position with the mouse pointer... I do like it when there's a good programming problem like this. Edit: Hmmm, I think my "ray casting" from the bottom of the screen may still be the best bet... I still haven't started to program this, I'm too scared to. ;D I probably should though. Edit2: Ahh, I just checked out that link and I see what you mean about wave surfing. I was just thinking about doing just that when I checked that link out and it was similar. I guess I need to learn to check links sooner .
3. ## Isometric tile selection

One idea I have played with was to do a normal detection, then check the tile's position on screen with the position of the mouse pointer and then just "walk" towards the pointer. If the tile is north of where the pointer is located, than check the tile south, then repeat this until you have a match. I figure you wouldn't have to do much more than a couple tests. And of course, if where you're clicking is a valley instead of a mountain, than the mouse pointer would mostly likely be north of the tile detected on the first pass and you would then walk 1 tile at a time north. I haven't implemented this yet, but it seems like it might just be the best bet.
4. ## Isometric tile selection

I've been working on creating an Isometric editor, mainly just to teach myself how to program Isometrics. So far it's been pretty good, I have a workable editor running and am finally done all the code I needed to get basic editor working, I can add in hills, roads etc... like in SimCity 2000. But now that I am ready to start programming it for layers, like being able to create large hills like in SimCity 2000. in the SC2000 editor you can raise the land up so you have really high hills and it automatically adjusts the terrain around it until you have some pretty large hills. I have no problem doing that, but, once they are created, how then would you select the tile at the top of the hill? I have code to select tiles on a normal map consisting of one layer, but once the hills get too high, you're pointing in an area that would be mistaken for a normal tile at the base layer under it with my current code. Here's a screenshot to demonstrate... [img]http://home.cogeco.ca/%7Eno.spam2/SC2000.png[/img] Now how would I know that the tile on the top of this hill was for a location closer to the viewer than the tile that exists behind it at a lower level? I've seen lots of tutorials online but none that cover this subject. Thanks in advance.

Just to update, I compiled my program and this crash ONLY happens under Windows 7 64bit. When I run the same program under Windows XP 32bit it runs fine.

Than you better talk to NeHe because that is straight out of his code, not mine. That is his comments, and this code compiled up fine on Windows XP. It still does if I don't try freeing memory all the textures show up just fine proving something IS being loaded (or I wouldn't see the textures, now would I?). Like i said, I didn't write that code or comment, that was from NeHe's code.
7. ## [done] [Code::Blocks] NewLesson01 to Empty Project

I recommend Taking your project that worked, and deleting some of the code so you have just some basic stuff in there you will use for most any project. Then save it as a template so you can use it to create new projects in the future that are already set up to work properly.
8. ## Dev-c++ examples don't work in Windows 7

I used to use Dev-C++, I highly recommend switching to Code::Blocks. It has an option to import Dev-C++ projects and it looks and feels much the same, only with some features you'll probably like better. Also, Dev-C++ hasn't been worked on in many years. Like Dev-C++, Code::Blocks also uses (or can use) MinGW. With that aside, I have gotten many projects compiled with Dev-C++ and NeHe code with no problems.