Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

165 Neutral

About trentfaris242

  • Rank
  1. trentfaris242

    Best design for "dynamic configuration"?

    This has been a really great thread. Thanks so much for the input, everyone!
  2. trentfaris242

    blender multi-texture to opengl

    So what would you advise for serious work? I have written a class which reorders all the vertices and the texels in .obj file to be compatible with the GLDrawElements() call. And now I faced this problem with multiple texturing, what are other guys using?     I have the same problem in my engine. Early on when developing it I recognized that this would be a problem, but I've put it off until later. I'll work on it as soon as someone gives me a definitive "you should use X". Until then I'll keep scraping by. 
  3. trentfaris242

    Best design for "dynamic configuration"?

    I think you and Norman Barrows really helped me to see what might be the best solution in this case. I think I'm on the right track, but I definitely see the benefit in splitting up the ConfigurationManager into lower-level modules to be passed around. For example, I might create a ScreenResolution module that holds the width, height, and fullscreen values while a Graphics module might hold information about AO and shadows. This way each module can get the piece of the ConfigurationManager it needs without having access to the whole module itself.   You also mentioned that I shouldn't be polling the settings to see if anything has changed. Having gone back through my code I see that I'm actually doing this about half the time (like in GUI and Input), but other modules are simply being updated when they need to be (like the window). I'll see if I can't change this and have it uniformly update "on demand" throughout my code.
  4. Hey all,   I'm working on a game engine, and I'm trying to decide the best way to implement configuration/settings/options. Right now, I'm saving these settings to a configuration.ini file. When the engine starts up, I read this information from the file and store it in memory inside a ConfigurationManager class. When the engine shuts down, the settings in memory are written back to the file.   But now comes the part that I'm struggling with. Tons of modules in my engine need access to this information. Input, GUI, camera, etc. all need to know things like window width and height, is it fullscreen, are there shadows, etc. In order to accomplish this, right now I'm simply passing a pointer to the ConfigurationManager around like it's a whore to all the modules that need it, and I'm referencing those configuration settings whenever I need to so that if the settings ever change in real time, the modules update correctly.   As an example, the engine boots up with screen resolution 1280x720, so the GUI creates a orthographic projection with those dimensions. Later we change the settings in real time to 1920x1080. Because the GUI has a pointer to the ConfigurationManager, it can appropriately update this projection with the right width/height.   This may be the best way to approach it, but this seems really sloppy. Are there best practices for approaching this sort of issue?
  5. trentfaris242

    Derived Class Constructor from DLL

    Thanks for the advice! I may have to research this some more, but my intentions for the project may never lead me there.
  6. trentfaris242

    Derived Class Constructor from DLL

    This was exactly the problem. I was forgetting to export the class so that the linker could access it.   Don't worry, this project is completely academic with the purpose of simply trying to learn more. I'm not trying to make a product to release or anything like that. Thanks for the help!
  7. Hey all,   I'm new to creating DLL's in C++. My project is to create a game engine API (not a game) porting some code from another project I did, and then building a small demo on top of this API. Anyways, I'm having trouble with polymorphism where the base class is located in the DLL and the derived class in the implementing program. Let me show some code to explain. class Base { public: Base(const int x); protected: int x; }; Base::Base(const int x) { this->x = x; } class Derived : public Base { public: Derived(const int x); }; Derived::Derived(const int x) : Base(x) {} This is pretty standard polymorphism, as I understand it. However, in this case the Base class is located in a DLL, and the program implementing the DLL creates the Derived class. This behavior gives me the classic "LNK2019 ..." linker error. Am I missing some piece of information about polymorphism across DLLs?
  8. trentfaris242

    Bullet BoxShape landing...oddly

    Hey all,   I started working with Bullet today, and for my first little test to try and get my feet wet, I decided to make some cubes and drop them and see what happens. I read through the "Hello World" project on the Bullet Wiki, and I believe I've implemented most of the code correctly, but the cubes often land on edges after bouncing and don't seem to be under the full effects of gravity once they "land". Here's what the end result looks like: [spoiler] [/spoiler]   The cube on the right has landed correctly, but all other cubes have landed on edges and refuse to "fall flat", so to speak.   Here's my very simple code: [spoiler] // Create a broadphase to use broadphase = new btDbvtBroadphase(); // Create a collision configuration to be used by the collision dispatcher collisionConfiguration = new btDefaultCollisionConfiguration(); dispatcher = new btCollisionDispatcher(collisionConfiguration); // Set the collision algorithm to use btGImpactCollisionAlgorithm::registerAlgorithm(dispatcher); // Create a solver solver = new btSequentialImpulseConstraintSolver(); // Initialize the dynamics world dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher, broadphase, solver, collisionConfiguration); // Set gravity dynamicsWorld->setGravity(btVector3(0, -9.8, 0)); // Set the plane collision shape planeShape = new btStaticPlaneShape(btVector3(0, 1, 0), 1); // Set the crate collision shape crateShape = new btBoxShape(btVector3(0.375, 0.375, 0.375)); ---------------------------------------------------------------------------------------------------- // Create the rigid body associated with the mesh btDefaultMotionState* planeMotionState = new btDefaultMotionState(btTransform(btQuaternion(0, 0, 0, 1), btVector3(0, -1, 0))); btRigidBody::btRigidBodyConstructionInfo planeRigidBodyCI(0, planeMotionState, physicsManager->getPlaneShape(), btVector3(0, 0, 0)); planeRigidBody = new btRigidBody(planeRigidBodyCI); // Add the plane rigid body to the dynamics world physicsManager->getDynamicsWorld()->addRigidBody(planeRigidBody); ---------------------------------------------------------------------------------------------------- btDefaultMotionState* crateMotionState = new btDefaultMotionState(btTransform(btQuaternion(0, 0, 0, 1), btVector3(x, 50, z))); btScalar mass = 1.0f; btVector3 crateInertia(0, 0, 0); physicsManager->getCrateShape()->calculateLocalInertia(mass, crateInertia); btRigidBody::btRigidBodyConstructionInfo crateRigidBodyCI(mass, crateMotionState, physicsManager->getCrateShape(), crateInertia); crateRigidBodyCI.m_restitution = 0.75f; crateRigidBodyCI.m_friction = 1.0f; btRigidBody* crateRigidBody = new btRigidBody(crateRigidBodyCI); physicsManager->getDynamicsWorld()->addRigidBody(crateRigidBody);  [/spoiler]   After each simulation step, I update the objects translation and rotation according to the bTransform's origin and rotation (which returns a bQuaternion). I do have one idea as to what may be the problem. When I translate my object in 3D space, I set the rotational matrix using Euler angles instead of quaternions. Would there be any sort of issue grabbing the quaternion rotations and plugging them into Euler rotations (I feel like there would be, but I'm new to this )? If anyone has any ideas as to what I might be doing wrong, the advice is much appreciated! Thanks!   UPDATE: My lack of knowledge regarding quaternions was my downfall! After changing my 3D rotational transform function to using quaternions, I cast the bQuaternion as a glm::quat and I now have cubes that land "flat". This change to quaternions seems to have affected my lighting system somehow, and I will need to investigate, but all is well with the Bullet issue I was having!
  9. Hey all, I've started using Assimp in my project, and I've run into an odd issue. I've got a simple textured cube I've created in Blender and exported to OBJ/MTL format. Here they are (pretty short): cube.obj [SPOILER]# Blender v2.75 (sub 0) OBJ File: ''# www.blender.orgmtllib cube.mtlo Cubev 0.500000 -0.500000 -0.500000v 0.500000 -0.500000 0.500000v -0.500000 -0.500000 0.500000v -0.500000 -0.500000 -0.500000v 0.500000 0.500000 -0.499999v 0.499999 0.500000 0.500000v -0.500000 0.500000 0.500000v -0.500000 0.500000 -0.500000vt 0.000000 0.000000vt 1.000000 0.000000vt 1.000000 1.000000vt 0.000000 1.000000vn 0.000000 -1.000000 0.000000vn 0.000000 1.000000 0.000000vn 1.000000 0.000000 0.000000vn -0.000000 0.000000 1.000000vn -1.000000 -0.000000 -0.000000vn 0.000000 0.000000 -1.000000usemtl Material.001s offf 1/1/1 2/2/1 3/3/1f 8/2/2 7/3/2 6/4/2f 5/2/3 6/3/3 2/4/3f 6/2/4 7/3/4 3/4/4f 7/2/5 8/3/5 4/4/5f 1/2/6 4/3/6 8/4/6f 4/4/1 1/1/1 3/3/1f 5/1/2 8/2/2 6/4/2f 1/1/3 5/2/3 2/4/3f 2/1/4 6/2/4 3/4/4f 3/1/5 7/2/5 4/4/5f 5/1/6 1/2/6 8/4/6 [/SPOILER] crate.png [SPOILER]# Blender MTL File: 'None'# Material Count: 1newmtl Material.001Ns 96.078431Ka 0.000000 0.000000 0.000000Kd 0.640000 0.640000 0.640000Ks 0.500000 0.500000 0.500000Ni 1.000000d 1.000000illum 2map_Kd crate.png [/SPOILER] When I call the ReadFile function on the OBJ file, I am calling with 2 flags: aiProcess_Triangulate and aiProcess_JoinIdenticalVertices. The scene seems to be properly created from this call. I can get the vertices, UVs, normals, and indices correctly and render them just fine. The issue is with the materials. When I call scene->mNumMaterials it returns 2 even though I only have 1 texture used in this mesh. The first loads the texture successfully, but then the second is some "ghost" material (or one that I'm unaware of), and it is throwing my mesh off. Am I missing some flags that should be present or operating with some false assumptions that are causing me to have issues? If anyone could help me understand more about what's going on here that would be great! Thanks! UPDATE: Using a workaround (basically just ignoring the first material), I can get it to work perfectly fine, but that still leaves my original question. Every time Assimp creates a scene it seems to generate a material at index 0 that is NULL. In other words, if my OBJ has 2 materials in it, the mesh will have 3, but the first will always be NULL. Does anyone know the reasoning behind this?
  10.   My background is very heavy in Java, so you may need to correct me on some of this.   Why do I want a Manager interface? All the individual managers (render, input, network, physics, etc.) are stored and managed by the BuddyEngine class, and some need to interact with each other (input and render, for example). From an OOP standpoint, isn't having an interface, or an abstract class in C++, that stores references to the engine the best way to achieve this while still keeping high cohesion and low coupling? The engine could simply store the individual managers having been upcasted to a Manager. If the InputManager needs to interact with the RenderManager, it can simply call (RenderManager*) getEngine().getRenderManager(). Is this required? Well, no, I don't NEED the Manager interface, but if I want reusable code, having a Manager class that all individual managers derive from helps me achieve that, right?   Again, I'm new to C++ and obviously trying to use some of my previous Java knowledge here. I understand that it may not work, which is why I'm here for help. 
  11. I literally just discovered this and came back here to update it. I'm new to C++ and this is something I'm having to get used to. Dependencies don't seem to flow as nicely, and as "OOP-y", as imports do in Java, which is what I'm used to.   Thanks for the verification!
  12. Hey all,   I recently started developing my own game engine (just for fun), but I've run into a really weird error when implementing abstract classes. To help you all understand the issue I'm having, I've attached a simply UML diagram of how my game engine currently works (subject to change).   [spoiler][/spoiler]   This is a pretty simple design. My engine initializes and keeps track of several different modules or components called managers. Each individual manager needs access to some of the same types of information, so I thought it'd be easiest to create an abstract class that they all derive from. The abstract class contains a constructor, an init() function (this is the abstract function that all managers should override), a reference to the manager, and a reference to the engine.   I'm using Visual Studio 2013, and in the viewport I see no errors of any kind. I'm pretty sure I've implemented this correctly, but when I try to compile, I get a slew of different kinds of errors (mostly syntax) that reference "blank" spots in the code.   Here's the full list of errors: [spoiler][/spoiler]   If you reference these areas of the code, they all point to the beginning of a line, and their description makes little sense in the context. The 3 main headers that are receiving these errors are BuddyEngine.h, Manager.h, and RenderManager.h. I'll post the code for you to see. These are all pretty simple implementations.   BuddyEngine.h [spoiler] #pragma once #ifndef BUDDYENGINE_H #define BUDDYENGINE_H #include "RenderManager.h" //#include "InputComponent.h" //#include "SoundComponent.h" class BuddyEngine { public: BuddyEngine(int argc, char **argv); RenderManager& getRenderManager(); static BuddyEngine& getInstance(); private: RenderManager* renderManager; static BuddyEngine* instance; }; #endif [/spoiler]   Manager.h [spoiler] #pragma once #ifndef MANAGER_H #define MANAGER_H #include "BuddyEngine.h" class Manager { public: Manager(BuddyEngine* engine, int argc, char **argv); BuddyEngine& getBuddyEngine(); static Manager& getInstance(); private: BuddyEngine* buddyEngine; static Manager* instance; virtual bool init(int argc, char **argv) = 0; }; #endif [/spoiler]   RenderManager.h [spoiler] #pragma once #ifndef RENDERMANAGER_H #define RENDERMANAGER_H #include "Manager.h" #include "WorldRender.h" class RenderManager : public Manager { public: RenderManager(BuddyEngine* engine, int argc, char **argv) : Manager(engine, argc, argv) {} GLFWwindow& getWindow(); WorldRender& getWorldRender(); private: GLFWwindow* window; WorldRender* worldRender; virtual bool init(int argc, char **argv); static void render(); }; #endif [/spoiler]   I hate having to post lots of code for help, but I'm afraid I've hit a brick wall with this ghost of an issue. If anyone has any ideas of what could be causing these errors, please let me know. If you need me to post the implementations of these functions (.cpp files), I can do that as well. Thanks for reading!
  13. trentfaris242

    Where to start?

    Thanks for responding so quickly! I'll try to address some of the things you said.         This is exactly right. I'm very familiar with programming in the large and would like to implement the same kind of design here. I know the specific modules that need to be created, and I believe I know how I can appropriately abstract those modules from each other. This is the approach I have when facing the game engine, for example. We want low cohesion, so each of the modules are more or less independent from each other.         It's funny you mention this. They teach in schools that having this kind of abstraction is a good thing in theory, but then in every software industry you find that it can lead to all kinds of mutability issues as well.       The technical aspect of creating a game engine from scratch is not a fantasy to me. I've done enough of it before to know most of the intricacies involved, though not all. As far as an ideological reason goes, I like being able to really know what's going on. While it is definitely harder and much more time consuming (though time isn't an issue to me), being able to know every part of what is going on is extremely desirable for me. I don't feel like I really get this with a pre-made game engine, especially if that engine can't meet all of my needs.   Being able to make my own game engine also means that if at any time I need to make drastic changes to the game, or scrap it completely and start over, I have the general template and know-how to do that quickly.       I'm not quite sure how my post gave you this impression, but I'm fairly caught up on what all is needed, though maybe not every part. I know that it will need the following components: rendering, sound, network, scripting, spacial analysis, process synchronization, and AI. There are possibly other components missing, and I look forward to learning about these other components and implementing them as well, but the main bulk of the components I understand, at least relatively well. Again, I'm no expert, but I think I have enough to get me going without having to ask many fundamental questions.   I'm really thankful for your comments on documentation. I've started some, but I have a hard time motivating myself to document something I know will end up changing in the future. I think the best place for me to start would be the client engine. I'll begin by implementing a basic rendering component and extend from there. As the engine becomes more and more fleshed out it may become easier to see what step to do next.   Again, thanks a lot for your comment!
  14. trentfaris242

    Where to start?

    Hey all,   I'm new here at gamedev.net. I'm having some trouble finding some resources on where to start it all. Game development is a huge undertaking, so huge that I find myself looking at all the tasks ahead of me and asking myself "Where should I begin?"   Background A little background goes a long way, so here's mine. I've always loved video games and wanted to develop them myself, either as a career or as a hobby. I worked on some side projects here and there to try and improve my knowledge. I did some work on a remake of Minecraft that was being worked on a few years ago called Spout, though that project came to a halt. I have 2 bachelors degrees: Computer Science and Pure Mathematics. Part of my CS coursework included a graphics course focused around OpenGL in C++, and for my senior project I did a small Android game that was a remake of the classic SNES game Advance Wars. Like so many with dreams of developing games, I ended up stuck in a commercial software developer position feeling like I'm not living out my life's dream. So that's why I'm here.   Technically speaking, I have a good foundation under me, but I know I have a long way to go. I've already taken a look at a lot of the articles here on gamedev.net, and I really look forward to reading more. I'm not really looking for information on how to break into the gaming industry, because I'm not even sure that's something I want to do yet. I have an idea for a game that I've wanted to make for a long time, but, again, I'm having trouble finding out where to start.   Description This is a big project. One I've wanted to do for a very long time. I'd like to do this project in C++. My professional training has very minimal C++ involved, but I'm at a point in my career where languages are simply abstractions, and picking up new ones is relatively easy. I don't want to get into the actual game specifics right now, but I know that I want to develop it "from scratch". I want to create my own game engine and build this game on top of it. I know that this game will need to have networking capability, but I'm unsure yet if I want it to be peer-to-peer or dedicated servers. I know that I will need to develop both a client application and a server application. I also know that I will need to do most of the artwork/modeling/animations myself.   Here's where I know I stand in terms of technical tasks to be done: Documentation Client engine Server engine Modeling/Animations   I'm sure I've probably left out some tasks from that list right now, but I think I've covered the big ones. Now that you've read a novel, I think you're ready for my question: what tasks should be completed first? Should I document everything first in the form of what I want the game to be like and then develop around that? Or, if my idea is not 100% fleshed out (and it isn't), should I start to focus on the technical tasks first? If so, which? Barring none of those things, if I needed to visualize my idea more should I start with the artwork and modeling?   I realize these questions are kind of arbitrary, but I'm new to this. Most of the other "where to begin" threads I've seen on these forums are from people with little to no technical experience at all. I have the technical experience to begin working, but I don't know where to start. Generally, where should one ultimately start when developing a game (taking into account the information provided) and where should one progress from there? Any advice given would be immensely helpful, and hopefully I can be a positive figure on these forums in the future.    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!