- Viewing Profile: Posts: Naked Shooter
Community Stats
- Group Members
- Active Posts 14
- Profile Views 1,005
- Member Title Member
- Age Age Unknown
- Birthday Birthday Unknown
-
Gender
Not Telling
User Tools
Contacts
Naked Shooter hasn't added any contacts yet.
Posts I've Made
In Topic: Need to obtain frustum corners coordinates
22 October 2012 - 04:46 AM
In Topic: Problem initializing object
16 September 2012 - 02:53 AM
When you call memset(ret,0,sizeof(WindowsOS)); you might be trashing the vtable. If initialize is not a virtual function, then ret->initialize() doesn't need the vtable to be called, so it doesn't crash. I am curious as to why you used memset to clear that object.
The memset was basically there for no reason, I thought it might help but it didn't..
The solution was to use a 'placement new' like this:
WindowsOS* ret = (WindowsOS*)subsystemStack.allocateAligned(sizeof(WindowsOS), __alignof(WindowsOS)); ret = new (ret) WindowsOS;
This way, we can properly construct an object wile using a pre-allocated chunk of memory to store it.
In Topic: Can't have function prototype with 4 __m128 parameters?
22 July 2012 - 04:39 PM
In Topic: is learning c++ as first and only language a bad way to go?
14 February 2012 - 02:09 PM
Also, once you have an understanding of C++, you can easily switch to Java or C#. You'll have to learn some new concepts maybe, but you'll have a pretty good idea how everything works on the low level. I started with C, then went on to C++, and then Java. My first game was in C++, and I can say that going from C++ to C# (which I've never touched before this semester) was a breeze.
In Topic: Quadtrees for Tower Defense - Target Acquisition
14 February 2012 - 12:41 PM
I'm working on a 2D game on the same vein as Tower Defense games but with a large world, seemless world.
The player(s) will have to react to attacks from different areas of the world and sometimes defend multiple fronts at once.
The problem I have is the idea of hundreds (potentially thousands) of "towers" trying to acquire targets. Also to avoid unnecessary checks when there are no targets within the maximum range. Line-of-Sight is NOT an issue, only whether the target fits within it's range. (some shoot directly forward, some can aim in a cone, etc)
I have been told that Quadtrees might allow me to optimize this system of target acquisition.
Is this true? Are there any articles I should read? Any pitfalls or alternatives?
Additionally, to prevent unnecessary checks, I had the idea that when a hostile unit enters the world, it "activates" all the defenses within a certain radius. And when there are no enemy units around, the defenses shut-down and go into a kind of "sleep" mode. Any thoughts on this?
You can combine both of your above ideas. In a quad tree, you'd often implement a function that takes a volume (usually a rectangle, but you could concievably have a circle or some swept shape), and returns all of the objects that are around that volume by returning the contents of all the nodes with which the circle intersects. So, an enemy can have its own volume (probably a circle with some detection radius), and it might query the tree with that circle to get the list of nearby towers. Then, you can tell those towers to do their thing (is the enemy within range? can we shoot it?...). This would probably give you the efficiency you need.
If you have a dynamic, node-based implementation of the tree, the recursive query function is very simple.
Check this out: http://www.kyleschou...ource-included/
- Home
- » Viewing Profile: Posts: Naked Shooter

Find content