Jump to content
  • Advertisement

gcsaba2

Member
  • Content Count

    168
  • Joined

  • Last visited

Community Reputation

217 Neutral

About gcsaba2

  • Rank
    Member
  1. gcsaba2

    Isometic in OpenGL

    You're right, I didn't rotate maps in SimCity either. Or in Tropico. But I could imlement that, seems like something easy to do. In my game I will have a labyrinth where people can go around and shoot each other. There are also going to be NPCs that can also be shot. I'll add doors and special items, and that's it, so nothing too complicated. I'm not sure if having an arrow above the character is a good idea. I want to have an element of surprise, which the player can avoid if he's careful.
  2. gcsaba2

    Isometic in OpenGL

    Making the walls transparent seems to be a good idea, I could implement that. I thought of the rotating thingie cause I seem to remember it in a lot of games. But you're right, they're true 3D games like Warcraft 3, that's why they have rotation.
  3. Hi, I'm just making an isometric game in OpenGL. It's 2D so I mainly use OpenGL for 3D effects like a rotating cube, everything else is 2D. I'm having a labyrinth, with walls and corridors. The walls, for example, are simple pictures like this: This is all nice, but now I'm thinking that maybe it would be nice to have an option to rotate the map. I don't want to rotate so that it would be a FPS game, the view would still be from the top, but for example, if someone is hiding behind a wall, I just need to rotate the camera and see him. For this I would probably have to use 3D quads instead of the 2D images I have right now. OK, so my question would be, how difficult it is to implement this? I've already tried placing cubes next to each other, and found it almost impossible to do, since I have to calculate the Z axis etc. Is there some "easy" way to do this? Also this would mean I would have to have 3D models of all the players and monsters etc?
  4. gcsaba2

    Transparent images - HOW?

    Quote:Original post by HopeDagger Here's what you want to do: Write a simple function to convert all 'pink' pixels to an alpha value of zero. Something like this will do: *** Source Snippet Removed *** Now that the proper alpha values are set overtop the 'pink' pixels, you can now enable alpha testing, which will prevent the pixels with a lower alpha value from being drawn: *** Source Snippet Removed *** Hope that helps. That works great! Thanks! There are still some minor problems with converting the code to Java but I think this will really do it for me [grin]
  5. Hello, I have been trying to make an image transparent for the last 5 hours and it simple doesn't work! I've been looking all over the Internet, read NeHe's tutorial and some other examples how to use blending... I've even talked over IRC where a guy told me a way that would work 100%... but it didn't work... So could someone please explain this to me step-by-step? Please don't say just "use blending" or "use alpha channels" cause I've tried all that and it didn't work. What I actually want is this: I have a simple image, let's say something like this: I want the pink color to be transparent. I actually want to use many pictures like this, and they will all contain pink and I want them to be transparent as well. Simply said, I want to establish pink as a transparent color and not think about it anymore. I don't want to blend it 50% or something, I want it to be 100% transparent. I've tried using a PNG image like the one I posted here. It has alpha channel which says that pink is 100% transparent. For example, if you see the tree's background as white, then it means your browser has already translated the pink color into transparent. OK so I've tried not using blending and using a simple image like this, and it didn't work... I tried using blending, and setting the clearColor to be pink (255,0,255) I tried setting glColor3f(1.0f, 0.0f, 1.0f) this didn't work either. In some cases the image was not transparent at all. In some cases it was blended so-so. In some cases it was not visible at all. In one case I managed to make pink a transparent color, but then I used another image which contained blue and other colors, and it immediately failed. I tried using glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) glBlendFunc(GL_SRC_ALPHA, GL_ONE) glBlendFunc(GL_SRC_ALPHA, GL_ZERO) and lots of other combinations... So can someone explain this to me how this works? Perhaps a very, very simple program which just loads 1 image and makes it transparent? Thanks, Csaba
  6. Runescape has 3 million players spread over 100 servers if I'm not mistaken. Are you sure you don't want to start with something simpler? ;)
  7. gcsaba2

    How to handle huge maps?

    That idea about putting the IO in a separate thread is interesting, I would never had thought of it myself. [grin] The problem with updating the screen is that I don't do it in the way most games do (drawing as many times as possible, using 100% of the CPU), but instead I do updates only when necessary. For example, when a unit moves, or the map gets scrolled, only then is the map redrawn. This way the game uses 100% of the CPU only for a few seconds and then it returns to 5-10%, so it should be ideal when you're doing something in the background (scan for viruses) and you want to kill time. At least that's the idea... [wink] So I cannot really do updating on a frame basis, it would have to be immediate. How much would cutting the image into really small segments (50x50) help? This would solve the immediate feeling when the player scrolls only a few pixels, but I guess it would take longer when I need to read in an entire screen.
  8. Hi, I am making a hexagonal game, but instead of using small images and then paint the hexes, I want to use real map images that I will draw on the background, and then I'll draw the hex borders, units and decorations on it. The problem is my map is going to be quite large, about 10x15 meters. Each image will be 24 bit, so obviously I can't keep them all in the memory. Since the player will mostly watch the part of the map that will belong to him, I decided to cut the image into segments and then load the images I need, while keep the rest on the disk. Let's say a segment is 500x500 pixels, then I would be needing 4 segments on an average screen resolution. But what next? If the player scrolls to some other part of the screen, then I cannot allow that he has to wait a few seconds until the images get loaded. I guess I could also load the "surrounding" images, then I'd have around 20 images in memory, while the majority of images won't be loaded. Anyway, I am looking for ideas how to do this in the most optimal way. Reading images from the disk takes about 1/4 of a second, which can (perhaps) get ignored by the player in case he jumps to a remote part of the map, but if he scrolls up 20 pixels he shouldn't experience anything.
  9. OK I wrote a procedure using something similar to your validative solution. What you wrote would make a huge X across the map, so I had to change a few things. Here's the complete procedure: public void drawLOS(int x, int y, int range) { // x,y - position of the unit // range - how far he sees // lx,ly - iterating through the matrix // ox,oy - absolute distance from (x,y) for (int ly=0; ly<w; ly++) { for (int lx=0; lx<h; lx++) { int ox = Math.abs(x - lx); int oy = Math.abs(y - ly); if ( (ox <= range) && (oy <= range - (ox + (ly>=y?1:0))/2) ) { matrix[ly*w+lx] = DESERT; // gets lit up } else { matrix[ly*w+lx] = FOG_OF_WAR; // fog of war } } } } Thanks for your help [wink] This probably works in O(width*height) right?
  10. gcsaba2

    [java] javagaming.org

    yeah it works now :)
  11. I hope we'll see beta-screenshots [grin] Will there be any other way to purchase the game except via downloading it from your site?
  12. I hope we'll see beta-screenshots [grin] Will there be any other way to purchase the game except via downloading it from your site?
  13. Well I'm using a matrix so I can of course detect the fields like (x-1,y), (x-2,y) etc. but I want the range of sight to be flexible, so if I set it to 5 then it has to recursively light up every field inside the distance of 5. I can have each field to have a bool and then I don't need to use a set. Still, I would be calling this for every unit. There can be more than one units on a field. So if there are 10 units on the same field I would be calculating the same thing over and over. OK, I guess I could add a new field to every unit called LOSCalculated, and then I iterate through all the units, and check if there already is a unit on the same field which has LOSCalculated == true, and if it does then don't do anything. But is there a better way to do this?
  14. I ama bout to write a procedure which will detect which fields are visible to the player, and then have the rest of the fields get covered with the fog of war. The player sees the fields controlled by him, plus those that are seen by his units. So if I have a unit that has a range of sight 1 it is easy cause I only need to mark the neighboring fields. But what if I have a range of sight 2 like on this picture: The obvious way I was thinking is this: have a set of integer pairs that hold the X and Y coordinates. In the begining the set is empty. Then I add all the fields controlled by me. Then I call for each unit a recursive function which marks fields, reduces the depth and then moves to the neighboring field, until depth == 0. I can add the fields all the time because this is a set and there won't be duplicates. I can also check if the field is already in the set, and if it is then don't do anything. Finally, I paint all the fields not in the set as black, while the rest get drawn. But I would be calling this procedure whenever I'm drawing out the map. Allocating a set, iterating through a potentially large map, then through all of the player's units could take a long time. So I was wondering if there's a more efficient way to do this?
  15. gcsaba2

    [java] eclipse 3.1 out

    Ah, it supports Java 5
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!