Since you already using EU4, I would use Blueprints to at least a prototype. It seems that your project would fit well in BP and they are pretty powerful and you can do a lot. For any harder problems or performance issues, you can always step into C++.
My approach lately has been to use google proto buffers for saving and loading to and from disk, and then actually create sqlite db in memory to represent that data during run time, and rest of the system then deals only with that database. By using sqlite for data representation, it gave me quite bit of flexibility and it seems easier to deal with changes. In most case it usually only required small adjustment to query as the needs grew or changed. The actual conversion to and from proto buffers is contain only in one file. And to top it off, by using sqlite (mostly as intermediate format here), it allowed me to add more verification and validation by using sqlite language, like constraints, triggers, etc, so data become even more validate with almost no work on my end.
What about trying to log to a file and at various locations and bits of your program, it may generate large file. Other option is to build with pdb file even in release and then run it under debugger or attach debugger and hopefully when it crashes you may get "decent" stack.
Posted by DoctorGlow
on 30 October 2014 - 02:18 PM
Best way is to forget all the transforms and provide vertex position coordinates in projection space - that is, in range [-1.0, -1.0, 0.0, 1.0] to [1.0,1.0, 1.0, 1.0].
i think i can make that work by making a separate shader that does not have any world transforms, but i am re-using the same shader for many things, how can i set a world matrix to have no effect when it is used?
I think true tests for this would be to "eat your own dog food". IOW, try to make a game with this and see how well it works out, and I mean something more complicated, rather then simple pong or Tic-Tac-Toe. This should give you good insight into your project/library, how well it works, how much changes, custom code you had to do, etc. Once you finish, you can try another different game and then you end up with cool and useful samples code for your perspective customers.
I would try to log as much as I could to a file (flush it out or close the file after each write). Then when it hangs, reboot, and look over the log file. This may give you at least approximate area where it hags.
Operations on volatile variables are not atomic, nor do they establish a proper happens-before relationship for threading. This is according to the relevant standards (C, C++, POSIX, WIN32), and this is the matter of fact for the vast majority of current implementations. Thus, the usage of volatile keyword as a portable synchronization mechanism is discouraged by many C/C++ groups.
Just to clarify here. when you call OnCleanup() method, you said that you are doing this in it: delete this. This will delete that instance of an object which in your case is object at Entity::EntityList[i], but after that you are trying to access member variable with this line: [source lang="cpp"]Entity::EntityList[i]->Type[/source] and then you end-up deleting that object [source lang="cpp"]delete Entity::EntityList[i];[/source] which was already deleted by using delete this, hence you will get undefined behavior here.
If I understand correctly, the Entity was deleted by using delete this inside OnCleanup() method, but have you removed that pointer from the list Entity::EntityList? If you did not, then you have what is called dangling pointer. It underscores what SiCrane was saying about using smart pointer to manage memory and life time of objects.