Advertisement Jump to content
  • Advertisement

keyforge

Member
  • Content Count

    33
  • Joined

  • Last visited

Community Reputation

112 Neutral

About keyforge

  • Rank
    Member
  1. In my code when a level loads or the game starts I load all models in a list into graphics memory. Each level might have different models so to save VRAM I only load used models for that level and unload the rest. My models are stored in a list in a data file. Each model has a reference (file name, ID, etc.) to a material data file, vertex data file, all the stuff you want exported from your modeling software could go here. I have a map that maps the filenames to an ID for easy reference. This creates a library where you could ask for the correct model at render time and draw it using only an integer ID. The ID is a pointer of sorts to the graphics engine. I use an entity component system so one of my components is GraphicsComponent and simply stores an integer ID to the graphics engine. At draw time, the physics code is asked for the model position and orientation and then the graphics engine transforms it and renders the ID stored in the GraphicsComponent. I send a message to the graphics engine containing the ID, and the graphics engine looks up the ID in the model library and draws the assosiated data in the proper way. You will need to make something to load the different types of models and store the data properly, but that's easy enough. The way you render the model doesn't matter to the rest of the engine, as the rest of the engine sees it only as an integer ID. You could store each model as a vertex buffer internally, or you could store the model as a vertex array, the engine will never know and will never need to know.   Valve does something similar in the Source Engine. When you create a prop which is basically a model attached to a bounding box, you assign it a model by file name which I assume internally is linked to an integer ID. The model is a special type of file which has the vertex data and material data encoded either by reference or by raw data, I'm not sure but I'm assuming the latter. When you go to assign the model itself to the prop, you get to scroll through a list of available models which is their model library. You could even store some physics data with the material for things like bullet penetration, just as long as you delegate the proper data to the proper subsystem at initialization.
  2. Ok, thanks for taking your time to reply to my questions.
  3. Alright. So when you're planning what kind of things do you write out and plan? Sorry for so many questions, I'm very motivated to learn the ways of proper game development!
  4. Could you suggest any tools for planning to me if you have any? I've just been using a notebook and drawing out hierarchy diagrams and method lists.
  5. I'd say it's more of a gut feeling, maybe that just comes with inexperience though. I feel like my code is messy (not my actual style as I'm careful with that, but the design) compared to other people's I've observed and I always feel like the code I'm writing is bad and not proper design, but again I think that may be my inexperience with actually writing my own code. Another question I have is how do I really plan a project? Past attempts were in a notebook and ended up looking ugly and unorganized. I'd love to be able to plan my projects and then implement them with a clean style and not get overwhelmed. And I'm not using a version control system as this is pretty much one of my first projects I'm actually writing myself, and I'm not planning to really release it but it's more of a learning experience for me. Do you have any suggestions on a good version control software?
  6. Hi again, Thank you for answering my question. I'll start planning a game and build my game's framework for my specific game. And I now realize entry point was a bad choice of words lol. The specific game I'm making is a 2D top-down space shooter game similar to asteroids but with some other things like AI and upgrades. I realize my mistake is probably that I've been spending most of my time studying other people's frameworks rather than building my own and experimenting. I've been studying C++ for about 2 years and other game engines for about a year as a hobby but I still haven't created anything notable. Thanks again!
  7. Hello, I've recently been stuck on writing a good, clean, and reusable application entry point for my program. Basically, what I've been doing is have a class called Game that is extended by a class called [GameNameHere]Game, which overrides Init, Loop, and Cleanup methods as needed. I also have a class called StateManager which holds a list of states and updates the top state. It also provides an interface for changing game states. I feel like this is a mess. The class game also holds an SFML window instance, but I want a Game instance to represent a single viewport and you should be able to create multiple of them for something like a level editor, etc. I could really use a code example for a good entry point, so if anyone has any please let me know. It's the part of my project I'm really stuck on.
  8. Hello, I'm currently working on a project and it's using OO, which I'm comfortable with to an extent, and I'm wondering what is the best practice- to keep your abstract classes declaration and implementation in separate files (ex. IGameState.hpp, IGameState.cpp), or just keep it in the header file. Also, if anyone has any good articles on OO design, please post them here. Thanks!
  9. keyforge

    What are you working on? v2

    Hello! My current project I'm working on is with C++ and using SFML for windowing, networking, and events, sounds, and using OpenGL for rendering (SFML's back end is OpenGL). I'm also using Box2D for physics. It's a 2D sidescroller/platformer engine for a shooting action game with a storyline and scripted scenes and events (like hl2), with gameplay like Mojang's Cobalt. I've been working on for about 6 months. The project is coming along nicely and I don't really have anything to show for it right now. I can get a nice framerate of 60 FPS while rendering a lot of fancy graphics effects (particles, explosions, etc). I'll try to get a screenshot or something here eventually. Right now I have the renderer, audio, system, and input modules setup and working nicely. My current goal is to setup the scripting module with Lua. Your project looks nice!
  10. Isn't DirectX free? Also there's OpenGL, which I prefer to DirectX. You might be interested in a game engine like Unreal or Source.
  11. What language are you working with? I know a few 2D Game engines but most of them are in C++, C#, or Java. (Or Lua!) [/quote] Well i do prerfer C++even Lua isnt that bad, but not Java, sorry if i am going to say this, but you know which language do you think is going to pull off for the project i had in mind? [/quote] The language doesn't matter as long as you know how to use it! http://fifengine.net/ is a nice looking engine for C++ (I've never used it personally) and http://love2d.org/ is good for Lua. What graphics style are you going for?
  12. What language are you working with? I know a few 2D Game engines but most of them are in C++, C#, or Java. (Or Lua!)
  13. keyforge

    Game 'Resource Manager' Design

    SFML's resource classes already take care of loading the resource into memory, what I want is something to take care of all of the resources after they are loaded that can be globally accessed. Would this eliminate the need for a resource loader and locator?
  14. keyforge

    Game 'Resource Manager' Design

    Every type of resource goes in a ResourceHolder; you can also have a series of tables. What you don't do is have an abstract system of resource managers, because every resource loads differently. Some load themselves, and others are loaded from within some kind of table. SFML has a series of tables already implemented for some of its resource types. Most of the time, you will be able to store loaded resources in a table, like the one in my code sample, (i don't call everything a manager because that is just a lazy naming convention). You will have to extend the resource table class to cater for the differences between individual resource types. [/quote] Sorry, but I'm still slightly confused. I understand that the table stores all the resources and resourceholder wraps around a specific resource, but I'm not sure how you would Load each resource since they have different methods for loading.
  15. keyforge

    Game 'Resource Manager' Design

    So basically it's like what I was doing with a wrapper layer around the resource type? Sorry I'm a little confused, I'm not sure if there's anything I missed there. Would I still create other classes like ImageManager, etc.?
  • 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!