Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About mavvie

  • Rank
  1. mavvie

    Applying A* pathfinding

    Ok, that makes sense enough. Come to think about it, using local steering systems makes it easier to account for other mobile units! Just a quick question, what do you think the best way to send this data to the individual agent is? Would you recommend a std::vector of navmesh pointers, or is there a better way? Thanks!
  2. mavvie

    Applying A* pathfinding

    Ok, I may end up using recast to make navmeshes en masse, but for now I just need to implement the logistics of it. I'm thinking that the navmesh will be of triangles, and I will run an A* algorithm based off the center of each triangle to get the basic path. However, I think it'd be most effective to add a lower level of navigation, but I don't know how. I don't want it to blindly walk to the center of each navmesh, because that's basically making it a waypoint graph. If the unit needs to get to a destination in the same nav triangle that's easy, but how do I get a unit to intelligently take the shortest path without burning all kinds of performance? Example shown in image. Green and Red are start and destination, black lines form triangles (navmesh), beige lines represent shortest path.
  3. Good day everyone, Im using c++ btw: I've just finished and cleaned all the bugs out of a 3D graphics engine (vbo's and textures holy cow the bugs) and have a simple little function that loads models, textures, and unit information. I won't bore you with details, but for the AI I have a "radius" of each unit. Basically, the unit will take up that much space, and there must be free space, if not the unit will either be pushed out of the way, or push others out of the way. Now, the problem: for A* pathfinding, a 2D grid of open/closed values is necessary. what are your thoughts on making different grids per unit, because all units have different radii? Or should I make a different grid per 0.1 difference in radii? Like, a grid for 0.1,0.2,0.3...1.2,1.3, etc? Thanks for any replies!
  4. Hey all, I've written a few games 3D with the most basic AI (enemies that head straight toward you), and had no trouble (yay vector math ) Now I'm interested in writing a real-time strategy game, similar to starcraft and command and conquer. I am confident in coding good macro AI (build orders, unit production, etc), but I am curious as to the best way for movement is. In a game, you select a unit (hehe gluUnProject ftw) then tell it to move/attack a certain location. What is the best way to do this? Here are my thoughts, any input is appreciated: 1. Check the line between pos and dest for obstructions 2. Flood-fill the obstruction to get all the coords of the obstructing object 3. Move pos around the end of obstruction that will result in the least distance travelled 4. Store this position in a waypoint array 5. Rinse and repeat until pos is as close to dest as possible 6. Move pos to each point in the waypoint array I'm thinking that it should test ~10 different routes and determine which one's the fastest; vector<vector<waypoint>> routes; float minDistance=10000;int minIndex=-1; for(i=0;i<routes.size;i++) { if(distance(routes.at(i))<minDistance) { minDistance = distance(routes.at(i)); minIndex=i; } } etc. Any ideas or links to tutorials on this subject are greatly appreciated
  5. mavvie

    while loops

    jonbonazza's answer doesn't load properly, so here's what your program should look like: [color="#1C2837"]#include <iostream>[color="#1C2837"]using namespace std; int test=0; int main() [color="#1C2837"]{ int rows=0; [color="#1C2837"]int columns=0; [color="#1C2837"]char theChar; [color="#1C2837"]int i=0; [color="#1C2837"]int j=0; [color="#1C2837"]cout << "How many rows? "; [color="#1C2837"]cin >> rows; [color="#1C2837"]cout << "How many columns? "; [color="#1C2837"]cin >> columns; [color="#1C2837"]cout << "What character? "; [color="#1C2837"]cin >> theChar; [color="#1C2837"]while (i<rows) [color="#1C2837"]{ [color="#1C2837"]i++; //get rid of the cout here, redo the while() expression. makes it simpler. [color="#1C2837"]while(j<columns) [color="#1C2837"]{ [color="#1C2837"]j++; [color="#1C2837"]cout << theChar; [color="#1C2837"]} [color="#1C2837"]cout << endl; j=0; //this is the new line that fixes your problem<br style="color: rgb(28, 40, 55); font-size: 13px; line-height: 16px; text-align: left; background-color: rgb(250, 251, 252); ">[color="#1C2837"]} [color="#1C2837"]cin >> test; [color="#1C2837"]return 0; [color="#1C2837"]}
  6. mavvie

    c++ unresolved external symbol help

    i run into this problem A LOT. (every project) and there's a bit of troubleshooting i do to fix it. try renaming your WinMain function to _tWinMain. if that doesn't work, in the project properties -> Linker -> Advanced, set the property "Entry Point" to WinMain. (if you have to use this method, beware: it may not allocate memory to any global variables)
  7. mavvie

    Opengl VAO and VBO's crash program

    I had this problem too. Use GLEW or GLEE to load in the OpenGL functions > version 1.1. if you use glew, you #include the .h, add the .c to the project, call glewInit(); after setting up your pixel format, and then use the newer OpenGL functionality. I'm responsible for 4-5 posts on this forum going through the same issue, figure i should give back to the community
  8. Hey everyone, I have a program that I am writing in OpenGL and am attempting to add "buttons", but I don't want to use the Windows controls for simplicity. I want to use the GDI to render 2D text using functions like DrawTextEx(), TextOut(), etc. I can do this fine using HDC's and HBITMAP's, but how do i capture the contents of the HDC and then carry the bitmap over to the OpenGL side of things for texture mapping? Is there a wgl function for this? Any help is appreciated, Thanks
  9. Thanks for the reply. In hindsight, I realize that I have no real purpose for "merging" images. However I would like advice on how I should render 2D text to the screen. I'm currently using glutBitmapCharacter() but I don't want to use GLUT at all because it makes installation more complicated. Basically I have 2 questions: What is the best way to display an RGB bitmap on the screen (2D rendering/glRasterPos2f() )? What is the best way to display 2D text on the screen, that doesn't involve GLUT. Thanks, Tyler Boyd
  10. Hey Guys, I'm working in OpenGL and the technique that I'm using to draw a HUD is I render the world using Perspective view then switch back over to orthographic where I can draw 2D texture-mapped images. The question I'm having is what is the best way to work with bitmaps to manipulate them per-frame? What I would like to do is use the Windows GDI (with HDC's and HBITMAPS) to take certain images and merge (SRCAND, etc) stuff together to get what I want the final result to be. Basically how can I transfer the contents of a device context over to an OpenGL texture-map? Is it efficient or would I be better off to do it all within OpenGL? Anyone know any good commands for bitmap alteration in OpenGL? Thanks a ton, Tyler Boyd
  11. mavvie

    Learned C++... Now what?

    i'm not super qualified, but the way i learned graphics and game programming is taking it all on at once, at a lower level. For 2D Games I used the Windows GDI, and that was it. Everything was coded on top of classes and Windows until I became confident in 2D graphics (created like 3-4 games from Pong to Brickbreaker to a top-down shooter). Then I entered the realm of OpenGL (notice that I've never mentioned ANY library. No Allegro, SDL, SFML, etc) and very slowly learned the techniques of 3D programming. Pros of this method: -Once you finish, you have a deep understanding of game development, if not also game designing. -No worrying about which library to use, why a certain library has bugs, etc. Cons: -You can "get stuck" because it is very complicated -Libraries are way faster to learn, and much simpler -Takes so long it's not funny. I've been working with OpenGL for 2 months now and I'm only understanding 3D physics/collision detection now Pick whichever you like, but if you aren't a very fast learner I'd have to recommend using a library from my experiences.
  12. mavvie

    Timer Class in game engine

    Question: Is anything wrong with using Windows Timers (SetTimer()) for periodic function calls as well as using time.h's clock_t types? What other functionality do those classes add?
  13. mavvie

    Just starting...

    Dude you don't need to develop Xbox360 games until you have a very solid and practical understanding of 3D graphics and 3D gaming. Work on making simple PC games like Pong, then simple 3D worlds like minecraft/moving around in 3D space, then work on more advanced things like physics and collision detection/reaction. Then once you have a full game engine it will be very easy to port over to Xbox.
  14. mavvie

    Projects For Beginners To Do

    A personal favourite of mine (yes, favo/u/rite, I'm Canadian xD) is a base converter- input the number in decimal (base 10) and then ask for a base to switch to (2-9 and then 16) So say: INPUT A NUMBER-- 14 INPUT A BASE TO CHANGE TO (VALID BASES ARE FROM 2-9 AND 16): 2 14 IN BASE 2 IS 1110 INPUT A NUMBER--105 etc As far as game programming goes, I'd have to say make pong. Really simple and you can make the second paddle controlled by an unbeatable computer xD
  15. mavvie

    OpenGL VBO beginner's problem

    You, sir, are a saviour. Now my program is, well....running not properly (I'll sort it out) but thanks now it actually renders! My pixel format code/rendering context was after glewInit and the VBO stuff, so moving it to the top fixed it.
  • 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!