Mind Calamity

Members
  • Content count

    23
  • Joined

  • Last visited

Community Reputation

134 Neutral

About Mind Calamity

  • Rank
    Member
  1. I've kinda solved this myself by adapting the Camera::setDirection code from OGRE to work for my need:   Now I have the following code: Vector3 boneDir = getBoneWorldOrientation(mEntity, mHips) * Vector3::UNIT_Z; //mDirection; Vector3 dir = mCameraTrans->_getDerivedDirection(); Vector3 zAdjustVec = dir; zAdjustVec.normalise(); Quaternion targetWorldOrientation; Vector3 xVec = Vector3::UNIT_Y.crossProduct(zAdjustVec); xVec.normalise(); Vector3 yVec = zAdjustVec.crossProduct(xVec); yVec.normalise(); targetWorldOrientation.FromAxes(xVec, yVec, zAdjustVec); // mTransform is basically the SceneNode of the character, I'm multiplying the target orientation with it's inverse orientation to get it to parent/character-space. mHips->_setDerivedOrientation(mTransform->_getDerivedOrientation().Inverse() * targetWorldOrientation); The above code was taken from OgreCamera.cpp, the setDirection function, the part with the fixed yaw axis. Now, that works... Sorta, I now get this problem at near-90 degree pitch, the orientation kind of flips to the other side, I've made another video to showcase this:   https://www.youtube.com/watch?v=6bdFhW_vtUs   Any ideas on how to fix this ?
  2. Hello, so I'm having a problem making my character look down. I'm using the OGRE3D as my rendering engine, and the math facilities it provides. What I need to do is basically determine the amount of pitch needed to get the bone to the same direction as my crosshair/camera direction. // mDirection is the direction of the character Vector3 boneDir = getBoneWorldOrientation(mEntity, mHips) * mDirection; // This is the direction of the crosshair Vector3 dir = mCameraTrans->_getDerivedDirection(); Quaternion rot = boneDir.getRotationTo(dir); // The code below has been taken from the sinbad character controller and adapted to pitch, instead of yaw Real pitchToGoal = rot.getPitch().valueDegrees(); Real pitchAtSpeed = pitchToGoal / Ogre::Math::Abs(pitchToGoal) * timeSinceLastUpdate * 100.0f; if (pitchToGoal < 0) pitchToGoal = std::min<Real>(0, std::max<Real>(pitchToGoal, pitchAtSpeed)); //yawToGoal = Math::Clamp<Real>(yawToGoal, yawAtSpeed, 0); else if (pitchToGoal > 0) pitchToGoal = std::max<Real>(0, std::min<Real>(pitchToGoal, pitchAtSpeed)); //yawToGoal = Math::Clamp<Real>(yawToGoal, 0, yawAtSpeed); mHips->pitch(Degree(pitchToGoal)); The above code has been adapted from multiple sources and somewhat works, but only on one axis. I know I'm probably doing some horrible things to the math related to this, so I appreciate any tips and pointers. :)   Unfortunately I'm not that good with Vector/Quaternion math, and I get the following bug: Here's a YouTube video showasing the problem (I didn't find a way to embed it into the post): https://www.youtube.com/watch?v=IwUpzEE3uwI It seems to work properly on +Z, it's shaking a bit on -Z, and it just continues to rotate on +X/-X.   I also posted on the OGRE3D forums, and am mirroring the post here to increase my chance of a reply.   For any future Googlers that happen to stumble upon this post, here's the link just in case: http://ogre3d.org/forums/viewtopic.php?f=2&t=78213   Note to moderators: If you think the Math and Physics is more appropriate, please move it there.
  3. Can't seem to bind a class - Compile errors.

    That was such a stupid mistake on my part. Sorry about that. :)   I tried so many different ways to bind it, and I tried removing "const" on one of them, and I still got the same result, but this time that was the problem. :)   Thanks for the quick reply.
  4. Hello, I've been struggling with registering/binding my class with AngelScript for the past few days, and I've went over the documentation a fair amount of times, but I haven't figured out the problem. I have a class like this:   class ENGINE_EXPORT GameObject : public Object { friend class Level; public: GameObject(uint32 id, String name, bool isStatic = false); int addRef(); int release(); protected: ~GameObject(); Level* mCreator; int mRefCount; };   And I'm registering it like this: void bindGameObject(asIScriptEngine* engine) { int r; r = engine->RegisterObjectType("GameObject", 0, asOBJ_REF); r = engine->RegisterObjectBehaviour("GameObject", asBEHAVE_ADDREF, "void f()", asMETHOD(GameObject, addRef), asCALL_THISCALL); assert( r >= 0 ); r = engine->RegisterObjectBehaviour("GameObject", asBEHAVE_RELEASE, "void f()", asMETHOD(GameObject, release), asCALL_THISCALL); assert( r >= 0 ); r = engine->RegisterObjectMethod("GameObject", "const string& getName()", asMETHOD(GameObject, getName), asCALL_THISCALL); assert( r >= 0 ); }     The game objects are created by a class "Level" which is registered like so: void bindLevel(asIScriptEngine* engine) { engine->RegisterObjectType("Level", 0, asOBJ_REF | asOBJ_NOHANDLE); int r = engine->RegisterObjectMethod("Level", "void createSky()", asMETHOD(Level, createSky), asCALL_THISCALL); assert( r >= 0 ); r = engine->RegisterObjectMethod("Level", "const string& getName()", asMETHOD(Level, getName), asCALL_THISCALL); assert( r >= 0 ); //r = engine->RegisterObjectMethod("Level", "bool getGameObject(const string &in, GameObject &out)", asMETHODPR(Level, getGameObject, (const String&, GameObject&), bool), asCALL_THISCALL); assert (r >= 0); r = engine->RegisterObjectMethod("Level", "const GameObject @+ getGameObject(const string &in name)", asMETHOD(Level, getGameObject), asCALL_THISCALL); assert( r >= 0 ); // int r = engine->RegisterObjectMethod("") }   The problem is with the getGameObject function, it's declared on the C++ like this: // String is just a typedef of std::string. GameObject* getGameObject(const String& name);   And in my actual script I have this: void testGet() { GameObject@ obj = level.getGameObject("CamObj"); }   But I get "Error Compiling void testGet()".   Any ideas as to where my problem is ? (Sorry for the spammy code)   BTW - The addRef and release functions are taken from the Game sample, as is the way of registering.
  5. Unity Beginning Game Development Path - Need Opinions

    [quote name='Slig Commando' timestamp='1334377401' post='4931112'] [quote name='Suspense' timestamp='1333601665' post='4928382'] You're years away from needing to worry about the few milliseconds that C++ might gain you. You should be worried about the hours you'll waste dealing with C++ features that are easier or complete non-issues in other languages. [/quote] You don't waste hours working with c++ if you learn it. It is also a much more elegant language if used properly, and cannot only save you "milliseconds" if used correctly, but can save you much more than that by being low enough to skip a lot of unneeded steps. [/quote] Agreed, those hours "wasted" on C++ will be hours gained on game development in the months to come, with every hour you "waste" dealing with C++ problems you gain knowledge, you research and you may even stumble upon stuff that make you think in ways you never would have thought if you did everything by the book. Also, I may be weird, but sometimes I get enjoyment from dealing with C++ problems, at least the end result gives me more a feeling of satisfaction like nothing else can. If you learn C++ you will gain enough knowledge to do programming in mostly any major language used for the purpose of game development, as they are all quite similar (also majorly different at some points), but all in all C/C++ is the core of all game development, and whatever you do you will probably run into it one day no matter how much you try to avoid it. But enough about that. Your plan looks good overall, also about the audio, you are likely to use SDL/SFML for that, so you would be all set for graphics and all the other stuff too, you can use both SDL and SFML components without having a window created by them, meaning - you can have audio in your text-based RPG.
  6. Wipeout/F-Zero-like Dynamics ?

    Sorry for the late update guys, but I started developing the game I had imagined a few months ago, at the time this thread was created, and even though I wanted it to be like Wipeout I missed an important fact which was probably the main reason I opened this thread - in Wipeout you can't turn your vehicle more than 70-90 degrees sideways, thus, obviously removing your ability to turn back, which means that the above post about the curve was exactly what I needed at the time, but for now I have no way of turning back as I've used Bullet Vehicle to get to this point and I think I'm going to finish it before trying out new gameplay mechanics. Weird thing is I realized this only after playing the demo of TurboFly3D for Android, which is pretty similar to Wipeout. And, yeah high speed racing is pretty tough to pull out with regular physics simulation, I started having problems turning when going 400+ KM/h, but all-in-all I think I'll manage. Thanks for all your tips and suggestions guys, I appreciate it. BTW - Before starting the bullet vehicle thing I developed another vehicle which calculated only collisions with bullet, and I handled most of the dynamics, like turning and stuff, so I guess in a few weeks/months I will give this method a try.
  7. Wipeout/F-Zero-like Dynamics ?

    Thanks guys, I'll start coding for real tomorrow, and as this is a project that I'm likely to use for a school competition so I think I'll make the code public. Also, I did try with the raycast vehicle (but for a real car, not antigravity crafts), and I didn't get far with the tuning as I couldn't get it to properly corner (it "cornered" faster then it actually went). I'll give the invisible wheels suggestion a shot (and make the suspension looser to get that hovery/floaty effect). I'll see if I can do something that's not a hack for the tilting problem. Also Tunneling is a great problem in fast-paced games, so CCD will do some good. I'm always open to more suggestions, feel free to drop them if you have any! [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
  8. Hi, guys! I'm trying to do a game like F-Zero/Wipeout, and I have no idea where to start on the physics/game dynamics, I tried with Bullet and applying force/impulse while a key is pressed. That sort of worked, but it's far from playable, so I'm thinking of abandoning Bullet for a collision detection-only library (like Minimal OGRE Collision) (or using only Bullet's collision-detection facilities) and coding my own dynamics, now trouble is - I have no idea how to actually make the dynamics I mean that hovery effect Wipeout has, or smooth turning around corners and tilting the craft among others... So what I need is hints and tips on:[list] [*]Keeping the craft hovering (but not a static Y-only hover - see video below) [*]Tilting the craft while turning and making the turns smooth [*]Any other information about making the gameplay dynamics Wipeout-like [/list] This is the first time I'm doing something like this so any help is much appreciated. Here's what I'd like the gameplay to be like: [media]http://www.youtube.com/watch?v=PnCn3yra2jQ[/media] Any help is greatly appreciated! I will post a video and code from my Bullet progress later. [url="http://www.ogre3d.org/forums/viewtopic.php?f=2&t=68936&p=451029#p451029"]OGRE Forums mirror[/url] - just in case anyone needs something like this in the future and stumbles upon this.
  9. Spectrum Analysis with SFML

    [quote name='__sprite' timestamp='1321805677' post='4885905'] I think FFTW is also prohibitively expensive for a commercial (non-GPL) license (several thousand dollars - I can't remember the exact figure). [/quote] I somehow missed that important fact... FFTW is GPL... Well, back to figuring out how to use FFTReal. If anyone has experience with it or any other FFT library please, do post. Update: it seems that the Qt spectrum demo uses FFTReal, so that's going to be my subject of research for now.
  10. As I already said in the description, feel free to suggest free/opensource (or at least free for commercial use) libraries that preferably offer functions such as FMOD's getSpectrum(), or BASS' GetChannelData() (+ BASS_DATA_FFT2048). I've tried BASS and FMOD, and their spectrum retrieval functions work perfectly, but the problem is my application is going to be commercial, and I literally have no budget. The quote below is from [url="http://www.sfml-dev.org/forum/viewtopic.php?p=41911#41911"]my original post on the SFML forums[/url]. [quote] So, I've been trying to make an application that needs spectrum analysis, and not paying $200+ (or 6000 in the case of FMOD), so after a bit of researching I concluded that SFML will probably be the best choice for me, so now the problem is: How ? I have no idea how to do it, all I know is I need to implement the FFT algorithm and use it with the sound buffer samples, or so I read in a thread similar to mine, to be precise it said: [quote]1. Get playing offset 2. Get small amount of samples starting from that offset 3. Use FFT on those samples 4. Visualize [/quote] Does anyone have any idea how to do that ? I've been thinking of using FFTW for FFT, but it's C, which I don't really like, and it seems like it's pretty tricky to compile with VS, I also found [url="http://ldesoras.free.fr/prod.html"]FFTReal[/url], which is C++, but I still have no idea how to use it, as it has no tutorials, nor documentation, so yeah... I'm open to suggestions, also if anyone is going to suggest another library, I need it to be free for commercial use.[/quote]
  11. Which language to use

    [quote name='ram090' timestamp='1321729742' post='4885682'] Thanks for that, so you've learned DirectX i assume, what version are you up to and have you implemented any into OGRE. I am not up with DX but it seems there are ever increasing additions to it for example (and i am just reading this from the docs) , tessellation, multithreading for multi cpus, shaders etc.. How much of this is copyable from sorces or do you have to start from scratch and read the DX SDK docs, somebody must already have examples online etc... How much of the OGRE engine do you think you know, it's a lot of code, are you able to have it run like say the crysis engine.. [/quote] No, I haven't used Direct3D, or OpenGL directly, but through OGRE. If you want to just make a game that looks good, and don't want to spend years developing your own game engine/framework that will meet the graphical standards that Crysis and it's engine have set, then I suggest you either use Unreal Engine through UDK, or Cry Engine which is free for non-commercial use as of late. As for how much I know OGRE, well I can't really say, as you can't really know a library 100% unless you are the sole developer, and as tons of people contribute code to OGRE every day, it always has more to offer, and more and more people are making libraries specifically for it, so if you ask me how much of OGRE I can utilize in an application for the moment is probably around 10-15 %, and that's pretty much a lot. I don't see a reason why you'd need to learn DirectX if you're going to be using an already-established rendering engine such as OGRE, or even a complete game engine, you won't ever need to know anything about the DirectX or OpenGL APIs, as that's handled by OGRE's Render Systems, and on the forums you can also find that you can utilize native OpenGL/DirectX code to work inside an OGRE application, but I don't see any specific reason you'd need to do that, unless you're migrating from native code to a rendering engine. As for your question about tessellation, and shaders - OGRE supports Cg, HLSL (DirectX), GLSL (OpenGL), and ASM shaders (I think), also a DirectX 11 render system is under development, it's usable but not fully complete. There's a lot of cool stuff done with OGRE, and even more that are currently under development, check [url="http://www.ogre3d.org/forums/viewforum.php?f=11"]this forum[/url], and [url="http://www.ogre3d.org/forums/viewtopic.php?f=1&t=67351"]this thread[/url] for a glance of what it can do, download the SDK, or source and compile the samples to get a hands-on experience of what OGRE is like.
  12. Which language to use

    Well the people before me gave you advice on programming languages, now, I'm going to try to give you advice on rendering engines. I was searching for a way to make a game a few years ago and found out that the best way to develop one was through learning C++ and either using an already established game/rendering engine, or to write one on your own, I chose the former, and thus started trying out different game and rendering engines, among the ones I tried were Panda, OGRE, Irrlicht, Crystalspace and a dozen more. From testing them out I discarded Crystalspace, Panda and the other engines, as they were either not well-documented, or the examples were too buggy for me to put 2 and 2 together at the time, OGRE and Irrlicht stood out, Irrlicht for the speed and simplicity, and OGRE for that + the beautiful demos, the huge friendly community, and the awesome wiki, among other things. I stuck with it, and learnt C++, a bit of linear algebra, the fun (sometimes hard), 3D/Graphical way. So that about sums up my experience with OGRE and other engines, and that concludes my opinion/answer to your question. Also, wrappers for OGRE are available for .NET/C# - MOGRE (Managed OGRE), there are a bunch of other wrappers under active development for a lot of languages, including Lua, Python and Java (there might be more). I hate .NET, and anything above 20 MB that needs to be installed with my application, so I advise you to write native C++ rather than using .NET. Whatever it offers, an open-source library offers it too, probably faster, all that without any big downloads for your users. BTW - The lowest compiler version I've seen professional developers use is VC++ 8 (2005), I think even the latest 2011 games use it.
  13. MP3 Licensing

    Thanks for the reply, that's exactly what I was thinking, but I posted here to make sure of it. Now I notice that this thread is in "Your Announcements" when it should be in "The Business and Law of Game Development", I don't know if I posted it here by mistake, or a moderator moved it, but in any case it's in the wrong forum... reported.
  14. MP3 Licensing

    So, whatever audio library I choose to use, FMOD, BASS, irrKlang, etc... They all seem to "require" the same thing for MP3s, a license, so, since my game is to be a no-budget, (probably) non-commercial game, it doesn't make any sense for me to just burn $2500, and I got the idea to convert the files to .ogg. If I do so, will I be infringing the MP3 license ?
  15. Getting a license for anime game development

    [quote name='Tom Sloper' timestamp='1315253091' post='4857940'] [quote name='Dev-san' timestamp='1315251010' post='4857933'] [quote name='Tom Sloper'] 1. That isn't what I was saying. I was saying "don't sound like a clueless high school kid when you call." 2. Being a high school kid is indeed a barrier. But if you are entrepreneurial enough (and if you have an adult to sign contracts for you) and if you approach this in a businesslike manner, you might be able to pull this off. [/quote] Well, for the time being that's pretty much impossible, I guess I must wait until I finish high school, thanks for the input though, I appreciate it, my point of view is still just baseless talk [/quote] You're giving up. Shucks! I was all set to coach you in how not to sound clueless. Never mind, then... [/quote] I'm not giving up, but as it is, I have no way of getting that license, the point is my parents would probably never sign anything, so I'm thinking of waiting until I'm 18, 1/2 years from now, and then I won't need their signature. It's not like I have a choice, given the circumstances. That offer for coaching... sounds tempting [img]http://public.gamedev.net/public/style_emoticons/default/rolleyes.gif[/img]