00:00
00:00
View Profile Fooliolo
Eh? What you want?

Age 35, Male

Procrastinator

Olympia High School

Washington

Joined on 5/1/05

Level:
11
Exp Points:
1,150 / 1,350
Exp Rank:
56,927
Vote Power:
5.29 votes
Rank:
Police Officer
Global Rank:
17,580
Blams:
379
Saves:
184
B/P Bonus:
10%
Whistle:
Bronze
Medals:
16,462
Supporter:
1y 1d

Comments

When I read all this I'm happy I'm making a simple bullet hell game for christmas in HTML5...

I guess it's too late for a comment, but it here it is anyway:
1 You don't need to check for collision on every frame, doing this 10 times per second looks fine. Knowing start/end positions you can interpolate animation to any frame rate.
2 Use space subdivision and collision groups. For instance divide a game field into squares (or cubes) and only check for collision if both objects belong to same volume. Bullets group should collide with enemies group, but not within each-other. Biggest possible slowdown is checking each object with other. For N objects it yields N*(N-1)/2 complexity and doesn't scale well. The more space volumes you use - the more memory usage, but less collision computations.
3 Simple optimization for most functions is a lookup table with interpolation (linear as the simplest and cheapest to implement). Sacrifice memory for performance.
4 Adobe flash has a built-in collision detection functions (BitmapData HitTest) for visible objects which is pixel-based. Quite fast, especially for objects with complex geometry.
5 Square roots and trigonometric functions can be approximated via Taylor series

P.S. There was a time when I thought like described in the post, same questions and problems. Hope my comment would help somehow.

It has been a long time indeed.

1.) I'm not sure how you can get away with this with critical elements such as enemy bullets, but I'm fine doing this with bonuses combined with a vac system.

2.) Collision groups have already been taken care of long before this blog post. As for subdividing, I thought about subdividing the play area, but the best solution I can manage will require significant investment and an appropriate testing level to determine if it really is better than a single, large area. The solution I'm currently looking at is using a simplified quadtree structure, and allocating all concerned entities of a certain size into up to four spaces represented by their positions. The latter part seems excessive, but it's stupid being inside a large fireball and not die.

3.) Already handled long before this blog post, although none of my collision detection algorithms actually require LUTs. It is possible that I could use additional LUTs to make this faster, but I can't imagine how, and I'm focusing on other things at the moment.

4.) I am aware of this functionality, but is it actually faster than rect vs. rect collision? How does it scale for large entities? Just like point 2, this is best answered with an appropriate testing level and environment, when all the bells and whistles are implemented.

5.) I'm pretty sure the computer is already doing Taylor series of some sort to compute the values, and combine them with LUTs, circumvents the need to calculate trig values during the game. Square roots are a little bit different, but I'd rather compare a*a == b*b rather than sqrt(a) == sqrt(b).

You're alive =o