• Create Account

RulerOfNothing

Member Since 08 Nov 2011
Offline Last Active Jun 27 2016 04:14 AM

#5208484Is root of something is distributive?

Posted by on 03 February 2015 - 04:57 PM

You are correct: sqrt(a*b)=sqrt(a)*sqrt(b), but sqrt(a+b)!=sqrt(a)+sqrt(b) (except where a or b are zero).

#5205680How to figure out if something is in the area of a circle?

Posted by on 20 January 2015 - 08:34 PM

If you want to determine whether a point (tx,ty) is within a circle with its centre at (x,y) then you need to determine whether (x-tx)2 + (y-ty)2 is less than r squared (where r is the radius of the circle or what you are referring to as the range)

#5151322Partitioning an A* 400x400 map every frame

Posted by on 03 May 2014 - 08:33 PM

One obvious question here is how often the map changes. When you check for passability, does this take into account mobile objects? If not, you could probably get away with only updating the partitions whenever the stationary objects on the map change (probably just building construction/destruction, but maybe terrain modification if you are planning on including something like that)

#5150873Preparing before i indulge myself into Game Development!

Posted by on 02 May 2014 - 01:40 AM

It is not necessary to use C++ to write games, and it is more than possible to write games with C# or Java. If you already have experience in using those languages I would recommend using them for your early game projects over learning C++. For graphics I would recommend using SFML if you are going to use C++ or C#.

Posted by on 16 April 2014 - 09:44 PM

Well, if you're drawing a triangle list, you need 3 vertices for each triangle. You want to use D3DPT_TRIANGLESTRIP here instead and swap the 1st and 2nd vertex.

#5147498Star system generation for 4X games

Posted by on 16 April 2014 - 06:52 PM

Thanks for those links Stainless and jefferytitan. I will take a good look at all of them over the next few days and then hopefully start work on my 4X game.

#5146632What beginner langauge is better for a smooth 2d platforming game?

Posted by on 12 April 2014 - 09:16 PM

When you say you are a beginner at programming, what language do you have knowledge in?

#5145543Strange array overflow (aka WTF I missing here?)

Posted by on 08 April 2014 - 09:36 PM

If TILE_SIZE is 7, then the loop goes from j=0 to j=6. When j is equal to 6, it tries to push past[j/2] onto verts. Since past has a length of TILE_SIZE/2 or 3, its valid indices go from 0 to 2. I am not sure at the moment how to fix this though.

Posted by on 27 February 2013 - 05:28 AM

I think the problem here is that your delete function gets rid of the associated node data, so this happens:

1. Program decides to delete s.
2. Program deletes s and its associated node n.
3. Program tries to get the next member of n, but can't because that node has been deleted and can no longer be assumed to hold valid data.

How I would solve this is by moving the line n=n->next; to immediately after the program extracts the element from n, so that n will always be valid when you extract the next member from it.

#5028564iterator list corrupted (with alt-F4 only)

Posted by on 04 February 2013 - 12:49 AM

In response to the people asking about how suliman is handling WM_CLOSE messages, presumably the HGE engine he is using is taking care of that (or maybe it isn't). Suliman, I think in order to better reason about your code, you might want to put it up so we can have a look at it. You could also try asking for help on the HGE engine forums here.

#5028209Understanding Bitmap's

Posted by on 02 February 2013 - 07:44 PM

One important thing to keep in mind about windows bitmaps is that the bitmap data is padded so that each row takes up a number of bytes that is a multiple of 4 (and that this padding occurs at the end of the row).

#5026335'Continue' statement usage?

Posted by on 28 January 2013 - 06:07 AM

The problem here is that you are using = instead of == (unless this was a typo), so that materials[material].index[meshes].uses = false will actually evaluate to the expression on the right-hand side of the equals sign. This means that the if statement's condition will never evaluate as true and so the continue statement won't be executed.

#5025606'.' in filepaths

Posted by on 25 January 2013 - 06:00 PM

Preliminary testing appears to support the statement that "file" and "file." are interchangeable on modern Windows (in fact, when I made a file called "file." it simply got rid of the period) I cannot say anything definitive about Linux and OSX though.

#5020931Removing two objects at once failure

Posted by on 12 January 2013 - 08:29 PM

From the documentation of the ArrayList:
Note that this implementation is not synchronized. If multiple threads access an ArrayList instance concurrently, and at least one of the threads modifies the list structurally, it must be synchronized externally. (A structural modification is any operation that adds or deletes one or more elements, or explicitly resizes the backing array; merely setting the value of an element is not a structural modification.)
This means that you'll have to prevent two threads from accessing the ArrayList at the same time; this could be accomplished by having a wrapper of the ArrayList that queues up addition and deletion operations, or by eschewing the use of multiple threads entirely (although you may have a good reason for going threaded)

#5019747Starting my first hobby game... [QUESTION]

Posted by on 09 January 2013 - 09:13 PM

There are no problems with using Java to make a 2D platformer (as far as I know), so my recommendation would be that you stick with Java since you are comfortable with it and know a lot about that language.

PARTNERS