Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 18 Mar 2013
Offline Last Active Today, 12:48 PM

#5298123 General questions about game engines and frameworks

Posted by EarthBanana on 26 June 2016 - 11:35 AM

OpenGL and DirectX are low level APIs that give you indirect access to the GPU and allow you to draw things to the screen using hardware.


SFML has 5 modules: system, window, audio, networking, and graphics. The graphics module uses OpenGL to draw things, and the window module creates an OpenGL context. The other 3 modules, as far as I know, do not use OpenGL.


So to answer the second part of your question - SFML and SDL are not substitutes for OpenGL/DirectX - they do provide a set of functions/classes that wrap OpenGL to try to make it a bit easier to use. You can, with both SFML and SDL, use your own OpenGL code in conjunction with theirs and their documentation shows exactly how to do this.


You cannot use Direct3D with SFML/SDL - though you could probably use it with SFML if you only use the audio, networking, and system modules.


EDIT: Also - SFML is a good framework to use if your wanting to learn to build your own engine in my opinion. It will take care of a lot of details to get you up and running - and as you learn you can disable modules replacing them with your own code if you would like - or with other libraries specific for the task at hand. For example - you could start with having SFML load your images from file, then later change that out with stb_image or devIL if you like.

#5297785 Programming Game Outputs to control physical objects

Posted by EarthBanana on 23 June 2016 - 10:04 PM

If your asking if its possible to have the game be on a pc and then control lights or other devices based on the pc game, yes it is possible. I would suggest, as mentioned above, looking in to getting a micro-controller and then either get a blue-tooth chip or wifi chip for it and have your game connect to the micro-controller through that. Wifi is probably the easiest - there are lots of microcontrollers that come with wifi built in (some arduinos, raspberri pis, intel edison, etc).


If using wifi you would connect the microcontroller to the network and then open up a socket on the microcontroller on some port of your choosing and connect to that from the pc game. Then come up with some data format so that you can send commands/information to the microcontroller through the open socket. The microcontroller would then control the physical devices based on those commands.


To open the socket and control physical devices from the microcontroller you would need to write code which will execute on the microcontroller. How to do this is highly dependent on the microcontroller - for arduino you can use the arduino IDE which will cross compile c++ code and transfer the executable to the arduino through a USB connection to the computer. Most microcontrollers will have some IDE of this nature - that allow you to develop on the PC, cross compile, and transfer the executable to the microcontroller. Many will even allow you to debug the executable remotely from your PC.


I hope this helps.

#5295388 Ranking System Help

Posted by EarthBanana on 06 June 2016 - 05:17 PM

It seems a lot of people like to "design" games, and then code them based on this design. IE come up with a detailed ranking system before ever writing a line of code.

I would suggest that you code the very basics of your idea first - because in the process of coding you will likely stumble upon problems and solutions that you never would have by formulating some design on paper.

Once you have something working you can mutate and evolve that thing to something that is fun and when you have problems like "boosting" and such you qill have some tangible code to edit to fix the problem.

Otherwise you will spend a lot of time trying to solve problems that may never exist, and waste a lot of time writing needless code.

#5295201 how to make game with directx,opengl

Posted by EarthBanana on 05 June 2016 - 11:11 PM

For ogl I really enjoyed these tutorials:




They really helped with the basics on how to set things up - provided me with a starting point.

#5295190 Quaternion camera problem

Posted by EarthBanana on 05 June 2016 - 09:50 PM

If you have a quaternion representing the camera's rotation and you are trying to get the "pitch" angle, or the angle the camera's target vector is above the world space horizon, the easiest way I can think of is to get a rotation matrix from the quaternion (well documented on how to do this) and get the target vector from there.


I believe the target vector will end up being this:

vec3 target_vec(const quaternion & quat)
        return vec3(
        2*(quat.x*quat.z + quat.y*quat.w), 
        2*(quat.y*quat.z - quat.x*quat.w), 
        1 - 2*(quat.x*quat.x + quat.y*quat.y));

Then just take the angle between the target vector and a vector representing the horizon - ie the same target vector except with z = 0 (assuming z is your world's vertical coordinate).

#5294844 2D Tile Engine, should I change my current Design.

Posted by EarthBanana on 03 June 2016 - 01:28 PM

Others prefer to set things up more generic, hoping/expecting not to ever rewrite.

And then, after programming for a few years, they realize that it will never happen and and stop coding that way

#5241472 Has anyone got a feeling of this when you were starting as game developer?

Posted by EarthBanana on 20 July 2015 - 01:28 AM

Im already on my 20s.
Brain keeps developing until 25.


Oh man... Im 26


Its all over

#5240196 Help in creating a game engine.

Posted by EarthBanana on 14 July 2015 - 12:04 AM

I'm going to take the opposite approach and yes. If you have a team who have some knowledge of 3D art and programming. And you are making a BASIC 3D game engine. Then yes. It doesn't have to be able to render every type of 3D game. It just needs to render and run one type of 3D game. For emphasis, BASIC 3D game engine.


+1 for this - I would like to agree here.


A lot of people argue to not create a game engine but use an available one - this is great advice if your trying to just make a game. But for me, making a game wasn't/isn't enough and I set out to make my own 3d game engine. I have been working on it now for over 2 years by myself, and it can do a lot of cool stuff I think. I havn't worked on it full time - and there are lots of 3 to 4 week periods where I didn't even touch the code.


Its by far not the best, and would not even be competitive with the best. It lacks in tools and features, and you can't make any game in the world with it. But...


It has been one of the most rewarding projects I have ever set out on and I have learned so much that I would have never learned had I not taken on the project. It is really great when you see stuff come to life that you have invested so much time and energy in.


So, understand that you can make a game engine, but that it likely won't be comparable to most available engines. But you can do it, and you can make games with that engine. Depending on how many you are working with, how experienced you guys are, how much time you will have to work, and a lot of other things, I think it could be done in a year.


You need to concretely define your requirements.


Follow this advice - lay out a list of basic features that you will need, decide on a genre that you want the engine to make games for, figure out what targets you want to support. Start getting triangles drawn to the screen.

#5239316 Best Game Launcher

Posted by EarthBanana on 09 July 2015 - 01:43 PM

I vote Qt - I don't know of anything better for cross platform GUI dev especially if your already familiar with c++

#5238394 Logic behind grid terrain

Posted by EarthBanana on 04 July 2015 - 07:07 PM

I wouldn't really match up tile for tile on your terrain unless you have a per tile terrain system (ie like your 2d tiled rpgs where maps are made out of tile sets) which it sounds like you dont. If you just want to map a single textured quad to fit under all of your tiles just make the quad bounds match up in world space to your data structure bounds.


If your data structure is 1 by 1 tiles, then the whole thing is 64 by 64 in your world space coords, which means you need to figure out how to make your textured quad 64 by 64. Also your quad's center should be at 32, 32.


It depends on what libraries you are using on how you could do this. In my engine (c++) for example I would do something like

Entity * ent = engine->createResource<Entity>("terrain");
RenderComp * rcomp = ent->create<RenderComp>();

rcomp->setMaterialID(0 /*submesh index*/, engine->resource<Material>("terrainmat")->id());

uint tformid = engine->currentScene()->add(ent, 
    fvec3(32.0f,32.0f,0.0f), // position in world coords 
    fquat(), // orientation 
    fvec3(64.0f, 64.0f, 1.0f) // scaling (64 times 1)

But what your using should have some sort of facility to translate and scale the quad geometry in the scene.

#5232579 graphics programming with C++

Posted by EarthBanana on 03 June 2015 - 10:22 AM

OP - have you heard of handmade hero?




This guy is a very talented and experienced programmer and goes through game creation with no external libraries at all - it is aimed at those of us who are curious about what sorts of "magic" are happening behind the scenes at the low level

#5203805 Looking for a good way to make games in C/C++ on linux for cross-platform

Posted by EarthBanana on 12 January 2015 - 06:08 PM

Although you will need additional libraries for other features such as file searching, etc.


lol You will need additional libraries, like OpenGL in order to load the shaders that you might write, and to give those shaders anything to possibly draw

#5203804 Weird framerate drop

Posted by EarthBanana on 12 January 2015 - 06:00 PM

Any time I have had weird frame rate drops like this is has been either because my program was sending stuff to the GPU to render in some format it didnt like (for instance mapping to GPU vetex buffer with some parameters set incorrectly) or because im allocating/deallocating memory in a bad way


With java I know it does all of the allocation and de-allocation for you - so I'm not sure how you could go and check something like this. Possibly run without doing certain things and see if you still have the issue.

#5203634 Whats the task of the programmer in this video game?

Posted by EarthBanana on 12 January 2015 - 03:40 AM

This would take a very long time to implement even using tools such as Unity or GameMaker..


One project that is kind of similar (in the sense that it uses 2d background painted images) is a project launched in a kickstarter campaign which aims to create another "infinity engine" style game. The link is here:




This project, which perhaps is a bit larger in scope than what your thinking, has taken a lot of very good programmers, artists, tools developers, etc over a couple years to build. They are using Unity with 2D graphic backgrounds for all of their game areas.


I'm not trying to discourage, just try to get yourself some well defined realistic bounds. For example, write a plan of creating one small dungeon with this art style etc.. If you keep your goals smaller then you can always expand on them if all goes well. But when developing games, there are always these random things that make stuff take a long time compared to what you though it would take.


Good luck!

#5203601 Getting Visual Studio and Dreamspark

Posted by EarthBanana on 11 January 2015 - 08:31 PM

It really doesn't matter what you download - you will be able to build a c++ executable as long as it has the build tools. All the other stuff is extra - doesn't hurt you but it will be a long time before you ever really care about any of it.


This is actually where my biggest problem with VS comes in - it is a really nice tool for debugging - and I don't have any complaints about its compiler - but I will say that it really seems to aim at making you think building a c++ program is more complicated than it is. I really feel like there are a lot of programmers today that wouldn't have a clue on how to use the command line compiler - that is if there was no IDE they would be at a loss on how to build their program.


I highly recommend you take your time and learn how to use the VS command line build tool without the IDE - im not saying always do this.. but if you take the time and learn how it works and what it is doing it will really save you a lot of time down the road. It will especially be a lot easier for you to figure out things like linker errors and such.


I see a lot of posts around the internet which basically show VS linker error printouts and people clueless on how to fix them.. This really comes from a lack of understanding in what a compiler is actually doing.


Just my two cents