Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

125 Neutral

About snufkin

  • Rank
  1. Hi!   I've started writing a game engine for PC (initially Linux only) for fun and giggles, and would appreciate some feedback on the design I've chosen. I've started writing some simple functionality (C++, OpenGL), but I think it's time to hear what you guys have to say. I've written a game (ish) for Android using OpenGL, but it turned out to be such spaghetti that I abandoned the project before I was even close to a releasable product. I found this article, and that's what I'm trying to achieve in my current engine.   As you can see in the sloppy UML diagram below, I've not really implemented much at all (empty classes aren't even created yet).     I have a couple of questions on how to proceed accordingly to the article I linked previously. HiminbjorgRoot is obviously the heart of the engine. This is the class that every game will inherit in order to create a game. In order to drive the game forward, is it "OK" for HiminbjorgRoot to keep an reference to each one of the Core* and *Manager objects and simply call their respective update methods, or does that go againt the principle of avoiding unnecessary coupling? Should the root class instead spam update messages on the bus?   I also wonder how each 3D model gets rendered to the screen. More specifically, I wan't to know about the relationship between the SceneManager and the RenderManager. Does the RenderManager keep a reference to every mesh (which then is sent to my non-existing draw() function in CoreDraw) or do the entities themselves in SceneManager listen on the message bus for a draw message, and then call CoreDraw->draw()?   The above questions are my main concern right now. I have a ton of questions, but they can wait until I've read your replies.
  2. PS. Sorry for the unformatted text. When I posted this thread the newlines were there, but when I posted the it they disappear. I'm unable to edit my post too.
  3. Hello! I'm writing a game for Android using OpenGL ES 3.0, but can't figure out how to calculate a proper bounding box for my objects. The "main menu" consists of a couple of three-dimensional cubes. To find out what cube the user presses, I calculate a ray and check if any of the cubes intersect the ray using their bounding box (a sphere, represented by the cubes' positions and radiuses). However, now I want to switch from cubes to three-dimensional rectangles. Since I can't use a sphere to properly represent the rectangle, I need a new way to calculate the intersection of the ray and the (potential) rectangle. To add to my problem even more, the rectangles are rotating, making the width varying, so I can't use a static bounding box either. What I'm thinking of doing is transforming the vertices on the CPU every time the user touches the screen. Then when I have the same vertices as OpenGL is drawing, I calculate the triangles and their corresponding normals and test each and every triangle to see if anyone intersects the ray. Am I thinking properly, or is there an even simpler solution? I know that this intersection testing is heavy on the resources, but since I only have three rectangles on screen at the same time, I just have to check 36 triangles whenever the user touches the screen. Thanks!
  4. A little about myself: I've programmed a couple of tiled 2D RPGs already, using SDL. I'm also familiar with some "advanced" math, like transformation matrices and what not.   On to the problem, then!   I want to create an isometric 2D RPG game, but I have no idea where to start. I'm familiar with the concept as such, but I have no experience whatsoever with the implementation. For instance, SDL has a function called SDL_BlitSurface() that blits rectangles, that I've used to copy the texture onto the map. How I'd do the same with an isometric tile, however, I cannot fathom.   So, where do I begin? I've searched for both tutorials and actual code, but found nothing that left me any wiser.
  5. Hello!   I'm currently writing my first proper 2D game (integrated in a custom built engine) using C++ and SDL. I have a question about how to script certain events though. The engine itself is state based.   My game state is made up like this: class PlayState : State { private: Camera* camera; Player* player; Map* map; } In turn, the map is primarily a manager of tiles (Tile*** tiles; which get initiated in accordance with the map file).   Now to the problem! When I step on, let's say tile [25][100], I would like the game to change to a certain state (declared either in the map file or in some script). What's the best way to do this?   PlayState holds a pointer to the engine, and it would be possible for it to pass a ChangeStateEvent to it, but then I have clutter the map file with both info about what event to send and possibly a parameter to the same (i.e. ChangeStateEvent, Cutcene(cutscene nr 725)). Instead I was thinking about having some kind of script trigger every time I step onto a new tile and check if the tile is a trigger tile. If so, the script will handle everything necessary to view the cutscene.   So, what do you suggest? Is scripting the way to go, or am I completely off?   PS I own all of the code myself (and the game art is all Creative Commons licensed), and wouldn't mind sharing it if necessary (it'll most likely cause a headache for the more advanced game devs though).
  • 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!