Jump to content
  • Advertisement

JohnHurt

Member
  • Content Count

    252
  • Joined

  • Last visited

Everything posted by JohnHurt

  1. JohnHurt

    For you who wants more time for your projects!

    I'd say that the topic behind this thread is a rather good case study for the benefits of going outside and doing other things every now and then. ;)
  2. Been a while since I did any MFC but if I remember correctly you implement the OnIdle() method in your App (or Doc or View, not sure which) and stick your rendering loop in there. OnIdle should get called whenever there is spare CPU time available, so should work pretty much all the time ;)
  3. JohnHurt

    2D parallax...

    Rather than passing in the layer system to the renderer, I would do it the other way round. Renderers shouldn't really need to know about high level scenegraph details, they just draw stuff ;) Think what would happen if you wanted to re-use your renderer for another project that didn't have the same type of scene management.
  4. JohnHurt

    2D parallax...

    In my 2D engine (which is a while ago now), I had a scene manager which kept tiles and objects in seperate layers. These layers could be moved, updated and rendered seperately. To set the scroll speed of each layer you just set a "scroll factor" for it, which is basically just a number you multiply the current camera position by. So a layer with a factor of 1 will move at normal speed, 0.5 will move half as fast, 0 will be stationary etc. You could also have layers in front move faster, and also get layers to move the opposite way if you want to. With a bit of extra work you could also have layers auto-scroll, that way you can simulate clouds moving past in the background.
  5. not sure I understand this line: if (((sp.Angle - target_angle)) > Math.PI) should you not replace Math.PI with something close to zero? I assume your ship is turning towards the target angle. What language are you using? Is there a reason to be dynamically 'new'ing vectors each frame? I would also suggest working on you vector class a bit more, so that you can directly add them together, rather than adding on a component basis.
  6. JohnHurt

    Function pointers in a GUI?

    I use functors in my GUI system (alongside a message handling system too). Functors are C++ classes which behave like functions: class cFunctor { public: void operator()(/* ... parameter list ... */) { /* function body */ }; }; You can pass these classes around like any other class, declare them like a class, and them call them like a function: cFunctor myfunc; // declare myFunc(); // call
  7. I spent months of my life trying to solve this particular headache. The solution I found was to do as MARS_999 suggests and to just pad your sprite cells with a bit of a border. The simplest solutions are often the best. A secondary cause of this problem comes if you are rendering to a viewport which is of different dimensions to your screen, i.e. and 800x600 viewport area and a 1024x768 screen. I got round this (and was able to develop a resolution independent GUI system), by implementing a "virtual pixel" system, whereby the pixels you render to are transformed into screen pixels before rendering.
  8. JohnHurt

    Flickering Screen After Exiting

    Sounds like a driver issue to me. Not used Vista very much, but I gather that the drivers for it are still in their infancy.
  9. JohnHurt

    beginner help needed!!!!!!

    Learning ASM as a start seems a little odd to me. I'm a software engineer by education and a game programmer by profession and I have literally never touched ASM. C++ is the language of choice in the industry still although steps are being made toward C#. As you are completely new I would advise you to check out something like Blitz Basic - it's easy to learn as is geared towards producing games. QBasic is going back a bit! I haven't used that since 1993!
  10. JohnHurt

    Career in Gaming

    Hi, It's definitely possible. I've just finished a Software Engineering degree and have been offered a job as a game programmer in a pretty large game studio here in England. I was pretty lucky I think (since I don't even have my results yet!), but as long as you have a decent demo and lots of passion, you can get there. Good luck!
  11. JohnHurt

    Need help beginning with C++

    I learned fairly quickly from this book after trying and failing from numerous others. I suppose it depends on the style of writing you prefer (personally I can't abide those Dummies-style books where the author forces his humour on you). I found learning C++ relatively painless, but I was already familiar with a lot of programming constructs from using Basic. I learnt the basics of C++ in around 3 months. But learning a language is insignificant compared to what goes with it. The language itself is simply a tool to be used. The real meat of learning to programming is concerned with algorithms, design patterns, architecture etc. This is why most university courses (in the UK at least) don't teach you much programming - you're left to teach yourself.
  12. Brilliant, that works a treat! My colour properties have colour selection controls now too! Thanks a million.
  13. I'm trying to bind a class to a PropertyGrid control so that I can change its attributes. Specifically, I'm making a simple particle system editor. I have the class bound to the control and all the properties are showing up. The problem is that only the properties defined as String are enabled, the other properties are greyed out and read-only. Here's the code for the class: public ref class cParticleDef { private: String^ fEmissionRate; Boolean^ bCanStretch; public: [Category("Configuration")] [Description("Rate of emission")] property String^ EmissionRate { String ^ get() { return fEmissionRate; } void set(String ^ value) { fEmissionRate = value; } }; [Category("Appearance")] [Description("Sets whether the particles can stretch along velocity vector")] property Boolean^ CanStretch { Boolean ^ get() { return bCanStretch; } void set(Boolean ^ value) { bCanStretch = value; } }; }; Also, the boolean property doesn't produce a drop-down control in the PropertyGrid. I'm very new to managed code and .net, so it's probably something really stupid, so I'd appreciate a fresh pair of eyes!
  14. Ah, that could be it. Will have a crack at that later on this week and report back.
  15. Hi, I'm trying to write a tool for my game in C++ .net. It's a simple windows form app but I'm trying to access classes which are defined in my game engine code. The game engine is in a Win32 static library project. I've set up the engine library as a dependency of the Windows Form app, but I'm getting 4 linker errors when I try and declare an instance of a class from inside the engine library. 1>particle_ed.obj : error LNK2028: unresolved token (0A00000F) "public: __clrcall cMesh::~cMesh(void)" (??1cMesh@@$$FQAM@XZ) referenced in function "private: void __clrcall particle_ed::Form1::Form1_Load(class System::Object ^,class System::EventArgs ^)" (?Form1_Load@Form1@particle_ed@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z) 1>particle_ed.obj : error LNK2028: unresolved token (0A000010) "public: __clrcall cMesh::cMesh(void)" (??0cMesh@@$$FQAM@XZ) referenced in function "private: void __clrcall particle_ed::Form1::Form1_Load(class System::Object ^,class System::EventArgs ^)" (?Form1_Load@Form1@particle_ed@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z) 1>particle_ed.obj : error LNK2019: unresolved external symbol "public: __clrcall cMesh::~cMesh(void)" (??1cMesh@@$$FQAM@XZ) referenced in function "private: void __clrcall particle_ed::Form1::Form1_Load(class System::Object ^,class System::EventArgs ^)" (?Form1_Load@Form1@particle_ed@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z) 1>particle_ed.obj : error LNK2019: unresolved external symbol "public: __clrcall cMesh::cMesh(void)" (??0cMesh@@$$FQAM@XZ) referenced in function "private: void __clrcall particle_ed::Form1::Form1_Load(class System::Object ^,class System::EventArgs ^)" (?Form1_Load@Form1@particle_ed@@$$FA$AAMXP$AAVObject@System@@P$AAVEventArgs@4@@Z)
  16. JohnHurt

    Screen dimensions in world space

    Thanks HellRaiZer, that seems to do the trick. I was trying to project the screen quad into world coordinates at the origin.
  17. I'm working on a game project at the moment. My camera is fixed at a set z value away from the play area, which is a plane set at the origin. I need a way to figure out the world coordinates of the edges of my screen in this set up. Any help would be greatly appreciated.
  18. JohnHurt

    Screen dimensions in world space

    Does the window Z coordinate relate to the Z distance from the screen? And if so, how do I find this value accurately, projecting a screen coordinate a distance of 150 units into the world?
  19. JohnHurt

    Screen dimensions in world space

    Hi, I have tried something like this. However, it is the window Z coordinate I can't quite understand. My front and back clip planes are at 5.0f and 5000.0f respectively, and my camera is (0, 0, 150) looking at the origin, with Y as its up vector. I have arrived at approximately 0.9677 as a value for the window Z through trial and error. I've tried using glReadPixels() on the depth buffer at the point I want to measure to try to get an accurate depth value, but since I'm not actually drawing anything yet, it just returns 1. I have a very narrow FOV on my projection matrix - not sure if that's a problem - it's currently set at 9.4. The reason for this is that it's a top down game and I don't want very much perspective distortion.
  20. Hi Guys, Does anyone know if it's possible to print out all the source files in a Visual Studio 2005 project with one click? I've been searching for a batch print button for ages and can't seem to find one. I'm sure it must be in there somewhere, but the help system seem quite useless. Plus I can't install any other program to do this as I'll be doing the printing on college PCs. I refuse to print off 93 source files individually! Ta very much.
  21. Hi guys, I'm pretty new to LUA and the way it works is making my head hurt, so go easy on me! I'm trying to integrate LUA scripting into my game engine, and it's going pretty well up to now. I have objects load their definitions from XML files, and a lua script name is given for object events (in this case, what happens when the object dies). I have two game objects, a ship and a rock. Each object has a seperate LUA file ascociated with it (ship_explode.lua and rock_explode.lua). Inside each file is a function called onGarbage() which tells each object how to die. The problem is that when I create seperate threads for these two scripts, the function definition in the file which was loaded last overwrites the one in the other thread and I end up with two object executing the same function call from 2 independent threads. How do you go about created 2 distinct threads that can call their own version of the function?
  22. JohnHurt

    Same function name in 2 lua threads?

    Thanks. I'm a bit clearer on this now. I've redesigned it now so that each object can have a named function attached rather than a script file. So for instance when a rock dies it calls "large_rock_on_garbage()" instead of the global garbage() function. This is part of my final year uni project and I've been working on it solidly for the past 3 weeks, so my brain is a bit frazzled to say the least!
  23. JohnHurt

    Same function name in 2 lua threads?

    I'm looking for something on the C side really. Something that can be set when my script manager loads a script and creates a new thread. Surely it must be possible for each thread to call its own version of a function?
  24. JohnHurt

    Same function name in 2 lua threads?

    Anyone any thoughts on this? I found some information regarding replacing the LUA_GLOBALSINDEX table with one for each thread. But my understanding of how this works is failing me for the time being!
  25. JohnHurt

    Engine Diagnostic

    I get 32 fps (vsync is off), seems pretty low for what's happening on screen (are you capping the framerate at all?) GeForce 7600gt AMD Athlon64 3700+ WinXP SP2 [EDIT] Running it again and pressing random keys I stumbled upon movement controls (WASD) and I see there is a fairly large amount of polygon activity there. Silly me! The terrain looks pretty random and screwy though, is that intentional? Also, it wasn't textured. [Edited by - JohnHurt on November 30, 2006 4:53:44 AM]
  • 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!