What's The Right Forum...
-
I want to develop a game. Probably use XNA. The game will have a map of the world. I will need to know when the player clicks on a territory. I would need to know how to draw the countries/territories, and I would also need to know when the player clicked on one of them What's the right forum to start asking these questions in? Thanks
If it's not broken, fix it until it is
-
I want to develop a game. Probably use XNA. The game will have a map of the world. I will need to know when the player clicks on a territory. I would need to know how to draw the countries/territories, and I would also need to know when the player clicked on one of them What's the right forum to start asking these questions in? Thanks
If it's not broken, fix it until it is
Probably the forum that fits whatever language you are developing the game with. There isn't a forum specific for XNA here at CP. Maybe Microsoft has forums for XNA, it's been a while since I've played around with XNA. As far as being able to tell where someone is clicking on a map in a game, it can't be any more than checking an event handler for the click and seeing what the coordinates are on the screen.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
I want to develop a game. Probably use XNA. The game will have a map of the world. I will need to know when the player clicks on a territory. I would need to know how to draw the countries/territories, and I would also need to know when the player clicked on one of them What's the right forum to start asking these questions in? Thanks
If it's not broken, fix it until it is
The report of my death was an exaggeration - Mark Twain
Simply Elegant Designs JimmyRopes Designs
Think inside the box! ProActive Secure Systems
I'm on-line therefore I am. JimmyRopes -
I want to develop a game. Probably use XNA. The game will have a map of the world. I will need to know when the player clicks on a territory. I would need to know how to draw the countries/territories, and I would also need to know when the player clicked on one of them What's the right forum to start asking these questions in? Thanks
If it's not broken, fix it until it is
We really don't have a forum for that anymore. I would also like to have a place where I can't only post questions, but also 'brag' a little about my progress. The correct place would officially have been to ask a general question (look up in the menu under 'Quick Answers'. They don't like to have such things here in the Lounge. For your question: Draw your territories as convex polygons. Territories that are concave must be broken down to two or more convex polygons. You can then make a hit test on the polygons of each territory. The hit test works as follows: Define the polygons with 2D vectors that point into the same direction, clockwise or counterclockwise. Then calculate the cross product of each vector of the polygon and the point you want to test (extend each vector to 3D by setting the Z component to 0). The sign of the resulting vector's Z component will tell you wether the tested point lies inside or outside the polygon. The correct sign, positive or negative, will depend on the direction you defined your polygons, but each cross product must result in the same sign, otherwise the point can't be inside the polygon.
At least artificial intelligence already is superior to natural stupidity
-
Probably the forum that fits whatever language you are developing the game with. There isn't a forum specific for XNA here at CP. Maybe Microsoft has forums for XNA, it's been a while since I've played around with XNA. As far as being able to tell where someone is clicking on a map in a game, it can't be any more than checking an event handler for the click and seeing what the coordinates are on the screen.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
I want to develop a game. Probably use XNA. The game will have a map of the world. I will need to know when the player clicks on a territory. I would need to know how to draw the countries/territories, and I would also need to know when the player clicked on one of them What's the right forum to start asking these questions in? Thanks
If it's not broken, fix it until it is
Kevin Marois wrote:
What's the right forum to start asking these questions in?
The "Write my homework assignment for me and make it quick" Forum! :laugh: PS. I know you are serious but I have to poke fun at someone this morning.:rose:
-
I want to develop a game. Probably use XNA. The game will have a map of the world. I will need to know when the player clicks on a territory. I would need to know how to draw the countries/territories, and I would also need to know when the player clicked on one of them What's the right forum to start asking these questions in? Thanks
If it's not broken, fix it until it is
Kevin Your best bet would be the App Hub forums for XNA at http://forums.create.msdn.com/forums/[^] Stack Overflow also provide pretty good XNA support. Be prepared for a lot of frustration getting started......
www.it-workplace.com
"If a man speaks in a forest where there is no woman to hear him, is he still wrong?" -
I want to develop a game. Probably use XNA. The game will have a map of the world. I will need to know when the player clicks on a territory. I would need to know how to draw the countries/territories, and I would also need to know when the player clicked on one of them What's the right forum to start asking these questions in? Thanks
If it's not broken, fix it until it is
Pick a bitmap of a world-map. Give each country a unique color. When the user clicks on the bitmap, request the color of the pixel that has been clicked. Lookup in the dictionary which country the color was mapped to.
Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
-
Pick a bitmap of a world-map. Give each country a unique color. When the user clicks on the bitmap, request the color of the pixel that has been clicked. Lookup in the dictionary which country the color was mapped to.
Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
-
We really don't have a forum for that anymore. I would also like to have a place where I can't only post questions, but also 'brag' a little about my progress. The correct place would officially have been to ask a general question (look up in the menu under 'Quick Answers'. They don't like to have such things here in the Lounge. For your question: Draw your territories as convex polygons. Territories that are concave must be broken down to two or more convex polygons. You can then make a hit test on the polygons of each territory. The hit test works as follows: Define the polygons with 2D vectors that point into the same direction, clockwise or counterclockwise. Then calculate the cross product of each vector of the polygon and the point you want to test (extend each vector to 3D by setting the Z component to 0). The sign of the resulting vector's Z component will tell you wether the tested point lies inside or outside the polygon. The correct sign, positive or negative, will depend on the direction you defined your polygons, but each cross product must result in the same sign, otherwise the point can't be inside the polygon.
At least artificial intelligence already is superior to natural stupidity
Useful to know, but yoou seldom have to roll your geometry classes any more.
-
Useful to know, but yoou seldom have to roll your geometry classes any more.
Really? Did you ever look at what kind of code you find in a pixel shader or a vertex shader? With a little thinking you can use the same data structures to render the polygons and perform the hit test on the GPU.
At least artificial intelligence already is superior to natural stupidity
-
Really? Did you ever look at what kind of code you find in a pixel shader or a vertex shader? With a little thinking you can use the same data structures to render the polygons and perform the hit test on the GPU.
At least artificial intelligence already is superior to natural stupidity
CDP1802 wrote:
you can use the same data structures to render the polygons and perform the hit test on the GPU.
Exactly, like I said, you seldom have to roll your own.
-
Pick a bitmap of a world-map. Give each country a unique color. When the user clicks on the bitmap, request the color of the pixel that has been clicked. Lookup in the dictionary which country the color was mapped to.
Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
That is a great answer. Very practical for many purposes.
-
Probably the forum that fits whatever language you are developing the game with. There isn't a forum specific for XNA here at CP. Maybe Microsoft has forums for XNA, it's been a while since I've played around with XNA. As far as being able to tell where someone is clicking on a map in a game, it can't be any more than checking an event handler for the click and seeing what the coordinates are on the screen.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
Actually, in XNA, you don't get event handlers if you're not mixing it with WPF/WinForms/whatever, so that's more complicated than that. And yes, there is an official XNA forum to discuss and get help: http://forums.create.msdn.com/forums/[^]
'As programmers go, I'm fairly social. Which still means I'm a borderline sociopath by normal standards.' Jeff Atwood 'I'm French! Why do you think I've got this outrrrrageous accent?' Monty Python and the Holy Grail
-
CDP1802 wrote:
you can use the same data structures to render the polygons and perform the hit test on the GPU.
Exactly, like I said, you seldom have to roll your own.
So how do you learn? Of course, there are many full featured engines out there, that doesn't mean one shouldn't learn at least partly how they work.
'As programmers go, I'm fairly social. Which still means I'm a borderline sociopath by normal standards.' Jeff Atwood 'I'm French! Why do you think I've got this outrrrrageous accent?' Monty Python and the Holy Grail
-
Kevin Your best bet would be the App Hub forums for XNA at http://forums.create.msdn.com/forums/[^] Stack Overflow also provide pretty good XNA support. Be prepared for a lot of frustration getting started......
www.it-workplace.com
"If a man speaks in a forest where there is no woman to hear him, is he still wrong?"Andrew Wiles wrote:
Stack Overflow also provide pretty good XNA support.
And gamedev.stackexchange.com[^] too.
'As programmers go, I'm fairly social. Which still means I'm a borderline sociopath by normal standards.' Jeff Atwood 'I'm French! Why do you think I've got this outrrrrageous accent?' Monty Python and the Holy Grail
-
Pick a bitmap of a world-map. Give each country a unique color. When the user clicks on the bitmap, request the color of the pixel that has been clicked. Lookup in the dictionary which country the color was mapped to.
Bastard Programmer from Hell :suss: if you can't read my code, try converting it here[^]
That might be a very good or a terrible solution, depending on the scale of the map ;) I would add that you would probably use two bitmaps: one to display a nice looking map, and one with flat colors to do the hit-testing.
'As programmers go, I'm fairly social. Which still means I'm a borderline sociopath by normal standards.' Jeff Atwood 'I'm French! Why do you think I've got this outrrrrageous accent?' Monty Python and the Holy Grail
-
That might be a very good or a terrible solution, depending on the scale of the map ;) I would add that you would probably use two bitmaps: one to display a nice looking map, and one with flat colors to do the hit-testing.
'As programmers go, I'm fairly social. Which still means I'm a borderline sociopath by normal standards.' Jeff Atwood 'I'm French! Why do you think I've got this outrrrrageous accent?' Monty Python and the Holy Grail
-
Do you all guys have too much memory and don't know what to do with it?
At least artificial intelligence already is superior to natural stupidity
My PC has 16GB yes ;p I've started my post by saying this using bitmaps could be a terrible idea, it all depends on the project (design, hardware target, etc...).
'As programmers go, I'm fairly social. Which still means I'm a borderline sociopath by normal standards.' Jeff Atwood 'I'm French! Why do you think I've got this outrrrrageous accent?' Monty Python and the Holy Grail
-
CDP1802 wrote:
you can use the same data structures to render the polygons and perform the hit test on the GPU.
Exactly, like I said, you seldom have to roll your own.