Jump to content
  • Advertisement

Miklas

Member
  • Content count

    11
  • Joined

  • Last visited

Community Reputation

364 Neutral

About Miklas

  • Rank
    Member
  1. Miklas

    Fog of war game logic

    Your question is quite broad, it really depends on your needs. Let's say that you have a data structure holding your level information. If the level is the same for every player, one instance is enough. But if you're saying that different people might see certain stuff, you might want to have an instance for every player, plus a global instance that holds all recent data. If a player sees more, his own instance is updated with the global one.   If you implement the multiple instances, be sure to read/write to the correct one at the correct time. To give an example: in Company of Heroes, path finding is (unfortunately) done on the global instance. This means that I can use this path finding to find out if a certain route is available. (let's say my map shows a bridge in the fog of war. When I give a move order to my troops, I can see if the bridge is available or broken by the path my troops will go, even before they can see the actual area).   Technically speaking, the AI should have the same resources as the humans. However, the fair method makes programming the AI a lot harder: you need to implement certain behaviours (such as "smart scouting"). While if you just give them the full map to see, they know where the resources are without scouting. Because creating a worthy AI is a very hard challenge, AI's are often have access to the global map.
  2. Miklas

    Do I (really) need openGL?

    About the 2D/3D: most 2D/3D related calculations can easily be extended (A 2D vector addition can also be done as a 3D addition with the last element zero) and most API's accept 2D data as well.  This means that you can perfectly use the OpenGL/Direct3D or any abstraction (SDL/SFML/Allegro...) for 2D games and still utilize the power of the GPU. Given that a GPU has a raw processing power that is far beyond a CPU's, even for simple 2D games like platformers I'd recommend using it.   About the "do I need a videocard"; the whole pipeline goes a little like this: Application <-> (optional) Abstraction layer (such as SDL) <-> OpenGL/DirectX <-> Video Drivers <-> Hardware   This means that if there is a video driver that uses the CPU instead of the GPU; then you can run a game without a videocard but given the fact that the CPU has a lot less processing power (but is a lot more flexible) it probably won't be very smooth.   The hardware (GPU's) are there because they offer enormous amounts of power, The drivers are there because every hardware is different and every vendor has their own architectures, (and because of this writing code directly for one GPU architecture is a very bad idea!) The OpenGL/Direct3D api's are there because they standardize calls: you don't want vendors to include their own special features so you have to write your graphics code only once to run on all GPU's that support a certain OpenGL/Direct3D level, The abstraction layers are there because the OpenGL and Direct3D API's are suited for all possible graphics applications and libraries such as SDL make certain applications easier (and often provide other features such as input handling which a graphics API doesn't provide).
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!