• Content count

  • Joined

  • Last visited

Community Reputation

167 Neutral

About TheShadow344

  • Rank

Personal Information

  1. Hi all. I'm looking for an equation for a cone along an arbitrary axis and I've run a few Google searches, but haven't come across much except for: "Let V be the vertex, A be a unit vector in the direction of the axis of rotation, and B,C be unit vectors such that A,B,C are mutually orthogonal. Let theta be the angle between the cone and the axis. To get to an arbitrary point on the cone, we start at P, travel a length of s along the axis (where s is an arbitrary real number), and then travel a distance of s*sin(theta) in any direction perpendicular to the axis. An arbitrary direction perpendicular to A has the form B*cos(t) + C*sin(t), where t runs from 0 to 2?. Putting this together gives us a parametrization of: P + s * A + s * sin(theta) * (B * cos(t) + C * sin(t))." I'm not sure how this fits into what I'd like to do though. Specifically, I'm attempting to find a way to construct a cone such that its vertex is at point [i]p[/i] = (p[sub]x[/sub],p[sub]y[/sub],p[sub]z[/sub]) and the cone runs tangent to a sphere with origin [i]o[/i] = (s[sub]x[/sub],s[sub]y[/sub],s[sub]z[/sub]) and radius [i]r[/i]. In other words, I want the cone to run along the axis defined by the vector [i]o[/i] - [i]p[/i], with height equal to the length of said vector and its base have radius [i]r[/i]. This is not homework. I'm going to use the cone to construct a circle on a plane that intersects with the cone. I know that the conic section formed by the cone-plane intersection will not be a perfect circle - I'm just interested in an approximation. Thanks in advance.
  2. MS3D Viewer Control (Visual C#)

    Hi all. I am in the process of putting the finishing touches on a Milkshape3D viewer control for Visual C# and am looking for suggestions on features to add / improve. Its primary use is for game tools (such as editors). More information (including a feature list) regarding the control can be found [url=""]here[/url]. This is something I plan on releasing (soon) so that people can use it in their own projects, so any kind of feedback is greatly appreciated. Alternatively, you may also donate MS3D files for testing purposes (I'm a programmer, not an artist, so my collection is pretty sparse). Thanks!
  3. Attack balancing in an action game.

    I faced a similar problem to yours in designing combat rules for the project I'm currently working on, so I'll provide you with the solution that I came up with. Feel free to modify it to suit your own needs or discard it entirely... Most attacks, in addition to damage output, accuracy modifier, elemental attribute, etc., are given a particular set of "battle effects". Such effects include... INTERRUPT - Interrupts the attacks of any enemies hit by the attack. BREAK - Breaks the defensive stance of any enemies hit by the attack. ... among others. Each battle effect can be LVL 1 - 3; obviously, the higher the level the better the effect. For example, a simple slash might have INTERRUPT LVL1, while a more powerful slash might have INTERRUPT LVL2 and BREAK LVL1. The next step involves giving game entities (players and enemies) a resistance value to the above battle effects. For example, a small insect monster will likely have a low resistance to these effects (making it easy to interrupt their attacks or break their defense), while a heavily-armored knight will likely have a high resistance to these effects. The rule I used is that if the enemy's resistance level is greater than or equal to the attack's battle effect level, the effect is negated (for example, if the knight has a INTERRUPT resistance of 2, then the knight cannot be affected by INTERRUPT LVL1 or LVL2 (just LVL3)). Thus, entities have resistance levels from 0 (no resistance) up to 3 (full resistance). Generally speaking, most of the "light" (low-moderate damage, moderate-high speed) attacks have low battle effect levels while most of the "heavy" (moderate-high damage, low-moderate speed) attacks have high battle effect levels. The only problem that arises is that with this system the "light" characters won't be able to interrupt most of the attacks that "heavy" characters use (making an effective frontal assault extremely difficult to pull off). Then again, the "light" characters are given more advanced evasive capabilities that make counter-attacks a more effective option in combat. Hope that gave you a couple ideas.
  4. 2D Iso Mmorpg Maker?

    If MMORPGs were that easy to make, everyone would have made one by now. More than likely (read: I'm absolutely certain), the software that you are looking for does not exist. However, RPG Maker, while having no support for MMORPGs, is a good start if you just want to make a simple, single-player, 2D RPG.
  5. sdl errors

    The problem lies in line 30 (if you look at your error information)... if ( MyEvent.type == SDL_Quit) Since SDL_Quit is a function (you use it later in your code on line 34), the compiler thinks you are trying to compare an integer type (MyEvent.type) with a function (hence the "no conversion from 'void (__cdecl *)(void)' to 'int'" error). On line 30, change "SDL_Quit" to "SDL_QUIT" (which is an integer constant defined in sdl.h). That will get rid of the errors.
  6. Classes and particle engine

    If you're going to be doing a lot of insertion / removal of particles from the vector, I'd suggest using the std::list instead, whose insertion and removal algorithms run in constant time. You're going to be iterating through all of the particles anyway, so random access isn't required. Here's why I think the std::list is better suited for the particle engine... Once the particle emitter expires, you don't want to remove all the particles right away - you usually want to have the particles continue one last cycle. Terminating the particle emitter will terminate all particles once their life-energy reaches zero. If you use a std::vector, you have two options: remove the particle on the spot, or use an if-condition in the render loop of the particle to check if its life-energy is zero (and if it is, don't render it). The first option is an expensive operation, and the second option forces you to check whether or not the particle has expired EVERY CYCLE (the time it takes for a simple if-condition to execute isn't great on its own, but it adds up once you have 1000+ particles). With the std::list, removing the particle on the spot is done in constant time, so the second option isn't even worth considering in this case. Just my two cents... Feel free to debate my methods - there is obviously more than one way to implement this.
  7. Pointer to member functions of a class

    Could always check this out... Function Pointer Tutorials It helped me out a lot when dealing with function pointers and all of their different usage cases.
  8. Are you using C or C++? If you're using C++, then why don't you use std::list? Otherwise, if you're only doing it for learning purposes, take a look at templates (specifically "class templates"), which would allow you to, as you put it, "virtualize" your data for multiple data types. If you're using C, I don't know how to solve your problem. Someone else more experienced with C will have to point you in the right direction.
  9. NeHe OpenGL issue

    You have included glaux.h, right? Do you even have glaux.h (look in your "include" directory)?
  10. New to Game Programming

    Even if you can get 3DS Max or Maya at a reduced price, I would strongly suggest you check out some of the open-source / free modelling tools out there first (such as Blender, as someone already mentioned)... I've been using Blender for about five months now for all my modelling needs and it works fine. 3DS Max has a lot of powerful features (and that justifies its $3500 price tag), but, chances are, in the beginning stages of modelling, you won't use them. At least with Blender, you have a chance to learn the basics without making a monetary investment. I've also used Milkshape 3D as well, and it only costs $25 US for the final product. After a while, if you decide that you need all of those extra features, then get a trial version of 3DS Max first. Just my two cents.
  11. OpenGL clear up a few things please

    Have you been following the NeHe tutorials? They have nearly 50 tutorials on various OpenGL rendering practices and tricks, though for stuff like "user entry" you'll have to look elsewhere. EDIT: Beaten to it.
  12. Bounty Hunters in RPGs

    I would think that it would be a little cliche, but then again most broad personality archetypes could be considered cliche. Consider fleshing out the character a little more... Why does he donate this money to the orphanage? Is it out of complete generousity (an extremely boring case) or is it because he is an orphan himself (cliche, but more exciting than the alternative)? Or maybe it's to ease the guilt of abandoning his own child / family. If this bounty hunter is going to appear in your story more than once and could be considered a main character, be sure to give him some depth to keep it interesting. Perhaps he admires the hero's quest and, after each encounter, gives him some solid advice for the journey ahead. Just my two cents.
  13. RPG design

    In relation to item management systems... Item Management Systems - a great article that I based my own item management system off of. An RPG Built in One Week and source code. You might be able to get some structural ideas for your code from the source code, even if you don't use Python. Hope this helps.
  14. Class dependency problem (c++)

    You could prototype the class... ClassA.h #ifndef CLASSA_H #define CLASSA_H class ClassB; // Class prototype class ClassA { private: /* Your data */ ClassB InstanceOfClassB; /* ... */ }; #endif ClassB.h #ifndef CLASSB_H #define CLASSB_H class ClassA; // Class prototype class ClassB { private: /* Your data */ ClassA InstanceOfClassA; /* ... */ }; #endif However, this won't work if you need to store the class in a container of some sort such as std::vector or boost::scoped_ptr, which require completely defined types. If that is the case, then someone else will need to help you with that. EDIT - Performed a little fix. Now you just have to include the header files in the implementation like ToohrVyk said.
  15. OpenGL only 1 render function?

    One way to solve the complex IF / ELSE cases is to use std::stack to hold different game-states. For example, create a structure like so... // Function pointer typedefs typedef bool (*UPDATE_FUNCTION)(); // Pointer to a bool function typedef void (*RENDER_FUNCTION)(); // Pointer to a void function struct GameState { UPDATE_FUNCTION Update; RENDER_FUNCTION Render; }; Then, say you have an update and a render routine for a START game-state, say START_Update() and START_Render()... #include <stack> // Used to hold game-states std::stack<GameState> StateStack; // Your functions bool START_Update() { return(true); } void START_Render() { /* Your rendering code here */ } // Create new game state GameState NewState; NewState.Update = START_Update; NewState.Render = START_Render; // Add new game-state to stack StateStack.push(NewState); Then, in your main game loop, you do something like this... while(GameRunning) { if(! { GameRunning = false; }; } This probably goes WAY beyond what you were asking, but it eliminates the messy game loop and it is one way for developers to handle their "complex code". And, as Simian Man already said, you can use OpenGL calls in any function (even in your update routines, but that's just bad practice - you should keep your update and render code separate). NOTE - If there are any errors in the code I provided, please point them out. EDIT - It would seem my post had barely anything to do with your question. Still, something to look at after you solve your other problems.