Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Maps
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

Eric Coleman
Gladiator

USA
811 Posts

Posted - Jun 04 2004 :  07:38:40 AM  Show Profile  Visit Eric Coleman's Homepage  Reply with Quote
Well, if you want 50 different hotspots on the map, then you'll have to use at least 51 different unique colors, one for every state and one for when the user clicks out of bounds. A 24bit color image will have its color count reduced on a system that isn't using 24 or 32 bit color modes. You have to worry about when the user's monitor is in 16, 15, or 8 bit color because you can't be 100% sure that the 51 colors that you picked will remain unique. What could happen is that two similar colors will be approximated to be the same color. Even though windows does have a standard color pallette, it's hardly ever used because windows generally adapts to the current active application.

The only time you should use the color-pick method is when you have total control over the color depth of the system, which is generally when you program a game in fullscreen with directx. The color pick method is popular with isometric and hex tile games because you can use extremly different colors becuase you only need 5 of them, and you can also be certain of the color depth of the system. Even in 8bit color mode, you have control of the pallette.

Go to Top of Page

masterbooda
Swordmaster

277 Posts

Posted - Jun 04 2004 :  09:16:54 AM  Show Profile  Visit masterbooda's Homepage  Reply with Quote
Ok, I was thinking Color Pallette, not Bit depth, but I guess the bit depth could be considered the pallete also.... but the region is the most compatible method, except it is much harder, but you can I guess make another program on your system that will create the regions according to the color of the states, and then save it to disk and have the map program load it.... That would be the way I go, let the computer do all the work with the regions....

A problem with the regions is I was using them to do sprite collision, and there is a big problem with memory leaks, but even after fixing that, the fix cause them to be really slow.... so checking 50 regions on a slow computer with every pass of the loop, might slow the app down quite a bit...

I would suggest making the maps colors complient with 8bit mode, that way you can cover all of your bases.... because even in 8bit color depth you will have enough colors to represent all 50 states.... just make sure you use colors that will be displayed at an 8 bit resolution...If someone cannot run anything but 16 colors then there is something wrong... because even your oldest cards can run at least 256 colors...

DaBooda out..

DaBooda Team is back: http://dabooda.789mb.com/
Go to Top of Page

Sr. Guapo
Swordmaster

USA
272 Posts

Posted - Jun 04 2004 :  11:42:39 AM  Show Profile  Reply with Quote
You could make a lookup table by looping through all the colors on your own computer and save it to disk , then you would just have to reference the file in the actual application. The file may be fairly large though...

I would recommend the regions, they seem to be the most compatible, and they aren't hard to use, it just takes a little up front time to punch in all the numbers...

Edited by - Sr. Guapo on Jun 04 2004 11:43:38 AM
Go to Top of Page

masterbooda
Swordmaster

277 Posts

Posted - Jun 04 2004 :  1:42:28 PM  Show Profile  Visit masterbooda's Homepage  Reply with Quote
Ok I will let the color thing go...lol.... but I thought of another way, although not best, but easy, was to do the map virtually. What I mean is set up an array that represents all the pixels and just have the number of the state for each pixel.... of course this will be overbearing on the memory, and in essence is a dumb idea... but I just thought that maybe somebody could get some use out of it...

DaBooda out...

DaBooda Team is back: http://dabooda.789mb.com/
Go to Top of Page

VBBR
Moderator

Brazil
617 Posts

Posted - Jun 04 2004 :  2:02:02 PM  Show Profile  Reply with Quote
It isn't that hard to define the areas, just a matter of creating a procedure that takes the mouse position on click and sets a new line. Then a spacebar hit or something would close it.

(see, I'm at 247 posts now... whats the next ranking name again? Hum I guess I will discover 3 posts from now... )

Whatever. Who knows...
Go to Top of Page

masterbooda
Swordmaster

277 Posts

Posted - Jun 04 2004 :  2:10:22 PM  Show Profile  Visit masterbooda's Homepage  Reply with Quote
I would use the click and drag method..... but that is just my 2cents.... anymore 2cents and this site will be rich...

(god, I have to wait to 250 to go up in rank......lol.... oh and post away VBBR, post away and god speed)

DaBooda out...


DaBooda Team is back: http://dabooda.789mb.com/
Go to Top of Page

Sr. Guapo
Swordmaster

USA
272 Posts

Posted - Jun 04 2004 :  2:10:49 PM  Show Profile  Reply with Quote
This isn't going to be in a tight game loop or something is it? If not, the speed issues with the regions that masterbooda mentioned wouldn't really matter. If it is, however, I would recommend using an array/lookup table that stores all the pixels, like masterbooda suggested...

PS - VBBR, Guessing from Eric, it is a "gladiator". Sounds cool...
Go to Top of Page

VBBR
Moderator

Brazil
617 Posts

Posted - Jun 04 2004 :  2:45:14 PM  Show Profile  Reply with Quote
I won't be a Gladiator... As Eric said once, his rank name is always "gladiator" just because he wants. As he is an admin, he can edit the rank names manually. So he put "gladiator" on his because this is the name of a game he was working on. Indeed his rank name would be "administrator" if he didn't edit it (like Peter).

Whatever. Who knows...
Go to Top of Page

masterbooda
Swordmaster

277 Posts

Posted - Jun 04 2004 :  2:59:15 PM  Show Profile  Visit masterbooda's Homepage  Reply with Quote
I think eric should change his rank name to BigPappa.... but of course that would be what I would change it too.... I wonder what the next rank after warrior is, and am wondering if another debug session is in order to achieve that rank..... just kidding sr. guapo...lol

There is one good use for the array/lookup tables, that is when you are creating a graphic editing program... I used this method when I was manually resizing images for a game, its 10 times faster than grabbing each pixel value from the picture box when you are manipulating it.. This way you grab the image info once, do whatever it is you are doing to it, then update the image with the new values..

DaBooda out...

DaBooda Team is back: http://dabooda.789mb.com/
Go to Top of Page

Peter
Administrator

Canada
67 Posts

Posted - Jun 04 2004 :  3:18:25 PM  Show Profile  Visit Peter's Homepage  Reply with Quote
Yeah, regions are the way to go. You know, they dont even really have to be completely exact, you can probably use a dozen lines or so to approximate the area around each state. It wont be perfect but it really will be "good enough".

To speed things up you can use a rectangle based collision system to get an approximate area of where the user clicked, which would narrow things down to maybe 2 or 3 states and then use the polygon collision detection to further refine the solution. That would work best.

I bet you guys really wish you lived in Canada now, we only have a few provinces to worry about ;)

Talos Studios - VoodooVB - VB Gamer

Go to Top of Page

Peter
Administrator

Canada
67 Posts

Posted - Jun 04 2004 :  3:20:54 PM  Show Profile  Visit Peter's Homepage  Reply with Quote
You know, it escaped me that we even could change our Administrator tag. I wouldnt know what to change it to though, I'm seriously bad at that sort of stuff.

I always liked the VVB ranking system we had with its hidden surprises. You could go from Code Monkey to Arseclown and back with a few posts ;)

Talos Studios - VoodooVB - VB Gamer

Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.19 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.