Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

189 Neutral

About Funkapotamus

  • Rank
  1. Funkapotamus

    Dealing with (annoying) people (and their code)

    @lefthandman: This sounds a lot like my experience with other programmers in college. Only your peers seem a lot more knowledgeable- probably because my fellow students mostly stayed out of the contest coding scene. Contests aside, I have noticed that programmers these days are developing a competitive nature about them. Venturing out on a limb here, I would guess this is because programmers tend to be nerdy. Thus, they have little to socially 'show off' outside of of their programming prowess. I'm guilty of this to an extent; I'm just not a douche about it. The worst thing for me to deal with was the fact that professors and other students gave them praise for their arrogance- thinking that these guys had so much raw knowledge. Of course, this only fueled their behavior, and the cycle continued. Theories aside, I'll tell you how I dealt with it: I ignored them. I ignored them, continued to teach myself game programming, and let them agonize over their big-o notation ego-parties. The result? I've been a professional game programmer since college. They have either become Java codemonkeys (nothing against Java- I love it, but don't ever get to use it!), or they are unemployed due to not being able to program on a professional level. So my advice is to ignore them. Don't remove yourself from the social scene however. Just ignore them when they start exhibiting bad behavior. I guess I'd treat it like training a dog without negative reinforcement.
  2. There's nothing wrong with using the keyword 'this' in the circumstance you describe. It's difficult to tell with the given information. I did notice one thing however: Your length may change each iteration. Did you perhaps mean "this.arr.length" instead of "this.arr.length"?
  3. Quote:Original post by Wyrframe Castle Crashers is a side-scrolling beat'em'up, like GoldenAxe, River City Ransom, Double Dragon, et al. ahlex; this means you are essentially working with 3D, not 2D. There is an X coordinate which maps naturally to the X screen coordinate, a Y coordinate which maps to near/far on the combat "stage", and a Z coordinate which maps to vertical distance off the "floor" of the combat "stage". Thus; movement is done in the XY plane as normal, and when you jump your Z coordinate will vary with altitude. When drawing, of course, you can use pure-2D graphics because Y and Z are parallel once projected into screen space. There is no Z axis in games like Golden Axe and Castle Crashers. The Y axis serves as a measure of depth into the screen, and as height from a given depth. Collision is considered vs. objects within a certain threshold of your Y translation. Jumping is a temporary offset on the Y axis and does not effect your character's Y translation in regards to collision. Thus, the further your depth, the higher your Y translation. Likewise, the higher you jump, the higher your Y translation.
  4. You see, ahlex, all you need to do is implement a quaternion-tree system. This left-first translation system provides a functional solution that doesn't result in that nasty static quad-tree gimbal lock other systems are known for. Don't forget to use reinterpret_cast on your vectors too, that speeds up movement in multiple directions.
  5. I suspect your game is running sluggish due to transparency settings of the image. Look into the transparency returned in image.getColorModel().getTransparency() when you change your image format. Your flicker can probably be fixed by poking around Component.Update(Graphics g) and Component.Repaint(). If I recall, the window will catch movement events and attempt to redraw itself. However, since you're manually setting the graphics each frame, it's left to you to do the redrawing as well. I should warn: It has been a while since I did anything game related with Java. Or rather, anything with Java at all. Though the specifics may be off, I'm pretty sure that I'm pointing you in the right direction.
  6. Funkapotamus

    Legality of recreating MTG:O

    In that case, wouldn't the blame simply be shifted from the card game developer, to the party that created the plugin? If someone makes a Half-Life mod that spoofs Halo, then Valve wouldn't get in trouble. I suppose that's why makers of such tools offer disclaimers and license agreements. Such that you can use their app and tools to create whatever you like, so long as you're not stepping on something else's toes.
  7. Funkapotamus

    Legality of recreating MTG:O

    Hey cool, Sloper replied to me. Thanks for the replies- though I think some of you were taking too many liberties with your assumptions. I only post as a means to cover my butt. I'd rather not suggest somebody do a project that would get them in a world of trouble. However, it seems that as long as things are kept on a purely academic level, there's no harm.
  8. I'm sure discussion about the legality of recreating video games or other intellectual content has been brought up ad infinitum. I apologize if this is old news, however, I believe this is a special case. The game, as the title suggests is Magic: The Gathering. The goal would be to recreate the online version of the table-top card game. Now, right there is the special case: we're dealing with two entities: 1) MTG - The card game 2) MTG:O - The computer game I know for certain that recreating board games is in fact legal. Just so long as certain conditions are met. For example, the board game Settlers of Catan has been recreated with no ill legal troubles. Microsoft's Settlers of Catan Online: http://zone.msn.com/en/catanonline/default.htm Freeware: http://www.jsettlers.com/ The conditions are something along the lines of: -No intellectual content can be used (pictures/descriptions) -No terminology can be used (must rename game pieces) If MTG were simply a card game (which I'm perhaps incorrectly considering a "board game"), I would feel confident suggesting someone attempt to recreate it. However, because it has an online portion, I am on curious legal ground. For the record: This would be a non-for-profit project I'm suggesting to an old friend- to challenge some of his bright students with. I'm assuming they'd want to distribute the finished project in some way.
  9. This post is a continuation of the wonderful thread started by C-Junkie found here: http://www.gamedev.net/community/forums/topic.asp?topic_id=284259 Thanks to that thread, I was able to get SDL_ttf up and running. However, I was disappointed by the method's speed. Creating, binding, blitting, and freeing a new OpenGL texture for each string of output was hurting framerate. So, I combined it with the good old .bmp font/display list method. This will load a .ttf font using SDL_ttf, and make a 512x512 pixel texture that contains every character from ascii value 32 to 128. It then builds display lists for each character so you can render text just like you would via the traditional .bmp font method. See a picture of it here. Code: const int OFFSET = 32; const int MAX_ASCII = 128; TTF_Init(); TTF_Font* font = TTF_OpenFont("arial.ttf", 40); // it's best to set the width to the size of the font specified above float charWidth = 40; // make the height a little bit higher since we'll be auto aligning letters that go above/below the baseline and they may trail over float charHeight = 50; // characters are very small. it's best to make the font large and scale it down rather than make it small and blow it up float textureWidth = 512; float textureHeight = 512; /* create letters */ // set letter color to white SDL_Color color = { 255, 255, 255, 255 }; // create glyphs, from ' ' (space) to '~' (tilde) std::vector<SDL_Surface*> glyphCache; for(int i = OFFSET; i < MAX_ASCII; i++) glyphCache.push_back(TTF_RenderGlyph_Blended(font, i, color)); /* create destination surface */ SDL_Surface* destination = SDL_CreateRGBSurface(SDL_SWSURFACE, (int)textureWidth, (int)textureHeight, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000); /* blit glyphs onto destination */ SDL_Rect glyphRect; int row = 0; // 10 chars per row int col = 0; for(int i = OFFSET; i < MAX_ASCII; i++) { int minx, maxx, miny, maxy, advance; TTF_GlyphMetrics(font, i, &minx, &maxx, &miny, &maxy, &advance); glyphRect.x = (int)(col * charWidth); glyphRect.y = (int)(row * charHeight + TTF_FontAscent(font) - maxy); SDL_BlitSurface(glyphCache[i - OFFSET], 0, destination, &glyphRect); if(col >= 10) { col = 0; row++; } else col++; } /* create texture */ glGenTextures(1, &textureId); glBindTexture(GL_TEXTURE_2D, textureId); glTexImage2D(GL_TEXTURE_2D, 0, 4, (int)textureWidth, (int)textureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, destination->pixels); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); /* create display lists */ GLuint* chars = new GLuint[MAX_ASCII]; int* charWidths = new int[MAX_ASCII]; row = 0; col = 0; for(int i = 0; i < MAX_ASCII; i++) { int id = glGenLists(1); chars = id; int minx, maxx, miny, maxy, advance; TTF_GlyphMetrics(font, i + OFFSET, &minx, &maxx, &miny, &maxy, &advance); float minX = charWidth * col / textureWidth; float maxX = (advance) / textureWidth + minX; float minY = charHeight / textureHeight * row; float maxY = minY + charHeight / textureHeight; charWidths = advance; glNewList(id, GL_COMPILE); glBegin(GL_QUADS); glTexCoord2f(minX, maxY); glVertex2f(0.0f, 0.0f); glTexCoord2f(maxX, maxY); glVertex2f(advance, 0.0f); glTexCoord2f(maxX, minY); glVertex2f(advance, charHeight); glTexCoord2f(minX, minY); glVertex2f(0.0f, charHeight); glEnd(); glTranslatef(advance + 1, 0.0f, 0.0f); glEndList(); if(col >= 10) { col = 0; row++; } else col++; } /* free/kill everything */ for(unsigned int i = 0; i < glyphCache.size(); i++) SDL_FreeSurface(glyphCache); SDL_FreeSurface(destination); TTF_Quit(); /* .... */ /* Get the char's list */ GLuint getList(char c) { return chars[c - OFFSET]; } /* ... */ /* Usage */ string msg = "Do a barrel roll!"; for(unsigned int i = 0; i < msg.length(); i++) glCallList(getList(msg.c_str())); You'll note I store the width of each character in "int* charWidths". Using this information, it'd be very easy to display text that's centered at a given position, or left/right justified.
  10. Funkapotamus

    (flower blooming) done...code inside

    Googling "draw ellipse opengl" brings up the answer... Or, you could draw a circle (also very easily googled) and scale one axis.
  11. Funkapotamus

    Best field of view (FOV) for 2D polygon games

    This will make an OpenGL unit on the plane Z = -256 equal one pixel. It also makes it so vertex(-screenWidth, -screenHeight, -256) is the bottom left of your window, and vertex(screenwidth, screenHeight, -256) is the upper right of your window. glViewport(0, 0, screenWidth, screenHeight); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(-screenWidth / 64.0f, screenWidth / 64.0f, -screenHeight / 64.0f, screenHeight / 64.0f, 8, 65536); glMatrixMode(GL_MODELVIEW); So, if you wanted to draw a 100x100 pixel quad: glTranslatef(0.0f, 0.0f, -256.0f); glBegin(GL_QUADS); glVertex(-50.0f, -50.0f, 0.0f); glVertex(50.0f, -50.0f, 0.0f); glVertex(50.0f, 50.0f, 0.0f); glVertex(-50.0f, 50.0f, 0.0f); glEnd(); Using Gradius as an example, the ship would be drawn at vertex(shipX, shipY, -256), the hud would be drawn in ortho mode, and the 3d background would be drawn at Z = -500 or so.
  12. There's some .dll's you need to add to your "c:\program files\jreX.X.X\bin folder". They should be located in the LWJGL zip file It also couldn't hurt to move the LWJGL jars into "c:\program files\jreX.X.X\lib\ext". It might not be necessary, though I don't know how Netbeans adds external libraries. In Eclipse you don't have to move the jars. (psst! Eclipse > Netbeans! :)
  13. Funkapotamus

    Help with texture mapping [newbie]

    Don't forget to enable textures!: glEnable(GL_TEXTURE_2D) I've forgotten to do that many times to great and embarrassing frustration.
  14. Funkapotamus

    Lua with C++

    What does "print the name of all the functions that have the document" mean? Can you rephrase the question? Are you looking for a simple hello world tutorial for newer lua versions? It's pretty simple: // 5.1 setup lua_State* lua = luaL_newstate(); luaL_openlibs(lua); // open file char* file = "test.lua"; luaL_loadfile(lua, file); // execute lua_pcall (lua, 0, LUA_MULTRET, 0); // close lua_close(lua);
  15. Funkapotamus

    Operation G.H. (Get Hired)

    Note: This is long. I'm pouring my thoughts out here to those who might gain insight from them. If you want the main point of the post, just scroll to the last few paragraphs where I ask my questions. Last night I ate Chinese food, and of course, I had a fortune cookie. My fortune said I "should consult others before partaking in any unusual activities". For a while, I strained my brain to figure out what sort of "unusual activities" I might find myself in. Game development has been on my mind recently, and well, I figured that it could constitute an unusual activity. So, here I am consulting with others... To put it bluntly, I want a job in the game industry as a programmer. Soon, I will graduate from college with a degree in CompSci and Geology. (Well, it's actually "Management Computer Systems", but for all job-related purposes it can be considered computer science.) Long ago I realized that my degree wasn't perfect for game development... something that Digipen or Full Sail would be better suited for. However, I also know that actions speak louder than words, and if you can somehow prove to an employer you're worthy, it doesn't matter what degree you have. This is why, for the past three years, I've programmed little games and demos in my spare time. Using OpenGL I've done shaders, 2D, 3D, particle systems, fluid dynamics, etc... you name it and I've got a small demo. There's one small problem though: thus far I've done everything in Java. I'll pause for a moment so those in the peanut gallery can laugh... *pause* For the record, I'm extremely badass at c++ as well- the problem is proving such to an employer. This brings me to my next thought: Game companies love 'mods'. I.E. A Half-Life mod. Last year I was at a job fair. Ravensoft was there, and their recruiters' ears pricked when someone mentioned "mod". Am I to understand that this is the best way to prove one's worth? I can understand the reasoning. Mods are too large to be created by one person. A mod requires multiple people working together- and a team player is ultimately what a company looks for. I write because I'm about to reveal a 25 page document to a small group of people which lays out the development of a small Half-Life 2 mod. The mod will be extremely small (not multiplayer, and only 2-3 maps) and very polished. The goal is to exhibit coding expertise and teamwork abilities. My internal codename for the mod is "Operation G.H.", which of course stands for Operation Get Hired. The idea is to plunk down a nice portfolio containing the mod in an effort to well.... get hired! I'm attempting to emulate the "final project" a college such as Digipen or Full Sail would use. Am I right to go forth with this? Should I be looking in a different direction? Project completion and success is not a concern of mine- after 3 years of coding and researching I'm confident my game plan will result in the mod's successful completion. Of course, nobody can guarantee that an employer will be receptive of the project, but if anyone has any suggestions I'd very much like to hear. Thanks!
  • 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!