Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

  • Days Won


Gnollrunner last won the day on August 2

Gnollrunner had the most liked content!

Community Reputation

79 Neutral

About Gnollrunner

  • Rank

Personal Information

  • Role
  • Interests

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. That's kind of a dilemma for me. I really don't need or want to implement animation software, lighting etc. Ideally I would use half an existing existing engine. However what I'm doing requires that I have my own mesh format, at least for terrain, and also I need to have exact control over how things are rendered to support a large world model. I also have to have tight control over the collision system. So I think I'm stuck coding most things myself. However I guess I can use outside stand alone tools.
  2. I'm actually working on my own engine but it's not because I really want too. I always fear that at some point during the life of the project, an off the shelf game engine is going cause me to hit some wall. I would probably take the chance if I was working on something more generic, but since my needs are highly specialized I think just staring out with Unity or Unreal is going to be like trying to pound a square peg in a round hole. It could possible work but I feel that the end game might suffer somewhat. I would be happy to be proven wrong, but it seems like I could waste a lot of effort and then find out I was right.
  3. Gnollrunner

    about DirectX SDK

    I don't remember off hand but a quick google turned up this page: https://blogs.msdn.microsoft.com/vcblog/2017/04/11/directx-game-development-with-c-in-visual-studio/
  4. Gnollrunner

    about DirectX SDK

    I'm using VS 2017 and programming in DX11. This is the top of my main window file (ignore CDLString.h and CDLGameTimeer) . I basically took it from this tutorial: https://www.3dgep.com/introduction-to-directx-11/ // System includes #include <assert.h> #include <Windows.h> #include <windowsx.h> // DirectX includes #include <d3d11.h> #include <d3dcompiler.h> #include <DirectXMath.h> #include <DirectXColors.h> // STL includes #include <algorithm> #include <iostream> #include <string> //#include "resource.h" #include "CDLString.h" #include "CDLGameTimer.h" // Link library dependencies #pragma comment(lib, "d3d11.lib") #pragma comment(lib, "dxgi.lib") #pragma comment(lib, "d3dcompiler.lib") #pragma comment(lib, "winmm.lib") Also on Visual Studio 2017 there are DirectX templates when you create your project.
  5. Gnollrunner

    about DirectX SDK

    Actually I believe you don't have to download it any more. It comes with they system. Just download the latest version of Visual Studio and you should be good.
  6. Exactly ... I believe with almost every C++ compiler you can call a member through null pointer, like this...... reinterpret_cast<CMyClass *>(0)->MyMemberFunction(a,b,c); It generally works fine and even may have some use. you can say "if (this==0)" in your code. As long as your don't reference through your null pointer your program will happily run. In fact to make it fail the compiler would have to put in extra code, so for performance reasons they don't. I think Microsoft famously used this in some of their system code and people were screaming at them for it
  7. Gnollrunner

    MS C++ annoying data alignment.

    I think perhaps you are misunderstanding a couple things. First B always includes A. In memory the layout will be A followed by B tacked on the bottom so even in g++ B is in fact 8 byte aligned. The only thing that isn't 8 byte aligned is the member of B (i.e. b) because it doesn't have to be. Had it been a double the compiler would have 8 byte aligned it. I'm not sure why MS C++ does it otherwise. It seems like a waste of memory. This will be especially true of there are a lot of levels of inheritance. I'm wondering if there is a compiler switch somewhere. As for new char[1], that's a different issue. It is legal for the "new" to align it by one if it wants, but I believe new has to be a single function because you can overload it and therefore it has to align to the most conservative alignment. On the other hand, it gets passed the size so it could make some decision if that size is less than the most conservative alignment for a specific architecture. In any case you can write your own new and even write it on a per class basis so there are a lot of things you can do if you want to. The other thing is new and delete has to know the size of objects and in the case of arrays this has to be explicitly stored somewhere. This is generally done before the object in memory and that number itself has to be aligned which can result in alignment of the memory that follows..... whew!...... a lot of variables All this being said, in my experience system allocated memory is always aligned conservatively just to keep things simple, but again that is not really related to the internal memory layout of a given class.
  8. Gnollrunner

    How to calculate this vector?

    At first I was confused by the question because your picture kind of looks like a 3D right angle corner. In any case here's how I might do it: Take the cross product of (a1.b1.C1) and a2,b2,c2) and normalize the result. This will give you a vector that you can rotate stuff around. From that vector and the rotation angle you wish to use, in your case that would be Max(Angle, 80), you could build a quaternion or alternatively a matrix that you can use to rotate any points. So for instance if you fed your point (a1,b1,c1) though your matrix or quaternion you would get (x,y,z), assuming they are the same distance from your rotation axis. There are libraries for matrices and quaternions available, but if you need to know how to build your own I cam post some minimal code.
  9. Gnollrunner

    People really have no ideas on game development.

    /|\ | | This!
  10. Gnollrunner

    MS C++ annoying data alignment.

    Actually you can't get B without A, only A without B, and with no multiple inheritance, casting either way will not move pointers.
  11. Gnollrunner

    MS C++ annoying data alignment.

    First off I don't want 1 byte alignment. That can kill performance on some processors. I think x86 allows it but it used to give a performance hit for fetches and stores if you did this. Not sure if that's still true. Other processors would crash and throw a bus error. You can always find corner cases where not padding between a base and derived class might cause a problem in some odd code. I'm just not sure any of those cases are actually guaranteed to work by the C++ standard to begin with. I would personalty rather have it pack data by it's "natural" alignment. Also your example doesn't let you subclass and override functions. It's not really the same thing. In any case I restructured the code and put the two members together (at the cost of a bit of versatility) and my tests runs went from 47 to 38 MB memory usage. That's nothing to scoff at. Thanks a lot! At least this gives me some verification that it's probably not a C++ language standard issue.
  12. Gnollrunner

    MS C++ annoying data alignment.

    This would wipe out half a class, and if it had a vtable that would be gone too. I would say this is highly illegal to begin with. The only place where this should be done is when 'this' is actually A and not some child of A, but then who knows. Maybe they are trying to guard against this kind of abuse. The result is to make objects bigger than they should be however, which seems like a bad trade off. Casting B to A is at most a pointer shift and if you aren't using multiple inheritance, it's a NOP, as far as the computer goes. I still don't see a good reason why the compiler can't align stuff efficiently.
  13. Gnollrunner

    MS C++ annoying data alignment.

    Here's the point I was trying to make #include "stdafx.h" #include <stdio.h> class Base { public: int a; virtual ~Base() {} }; class Derived : public Base { public: int b; }; class Base_And_Derived { public: int a; virtual ~Base_And_Derived() {} int b; }; int main() { printf("sizeof(Base) = %d\n",(int) sizeof(Base)); printf("sizeof(Derived) = %d\n",(int) sizeof(Derived)); printf("sizeof(Base_And_Derived) = %d\n",(int) sizeof(Base_And_Derived)); return 1; } This outputs: sizeof(Base) = 16 sizeof(Derived) = 24 sizeof(Base_And_Derived) = 16 Press any key to continue . . . I don't see why the compiler can't align the data the same why it would if you put both members in the base class.
  14. Gnollrunner

    SCIENCE (biatch!) for Big Games!

    You're right, tetrahedron's don't subdivide into an octree, but prisms do. In fact I think cube like shapes and prism like shapes are the only ones that work. You can create prisms around a sphere by starting out with an icosahedron and extruding it outward. Each of the 20 separate prisms is the root of an octree. The way I do it, I have separate voxels and walls so it's kind of like a 3D spacial mesh that's all connected. From there you can build terrain using a marching algorithm and if you set up your data structures the right way, you don't have to put together the triangles. They are built already formed into a mesh without going up and down the octrees. However as I said, with chunking and level transmissions it gets somewhat more complex.
  15. In my expert opinion, it's Russian ..... Actually I like to colors in the last 3 pics. I'm trying to get some ideas myself, on what style of visuals I want to have.
  • 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!