• Create Account

# Firetaffer

Member Since 06 Dec 2010
Offline Last Active May 23 2012 11:52 PM

### In Topic: 2D game map WITHOUT tiles.

01 May 2012 - 04:07 AM

Thanks everyone!

How does collision detection work with non-cube 3D models in a complex world in a 3D game? They don't bother checking collision for every little triangle that makes up the 3D model, until such precious is needed. For 2D images, you don't bother checking per-pixel collision until you need such precision. You can check a generic axis-aligned rect first and only if it passes that rect, then you check per-pixel or per-triangle (if you need it).

That's understandable, I read something the other day about how some collision handling is used with the bisection method, until they really need per-pixel precision. Also the editor looks nice, I had been messing around with Tiled before thinking about this and (quite obviously) it was tile based.

Basically, you'd assign some geometric shape to objects in your game, and use a 2d physics engine to handle all the collisions. So, some objects might be a circle, line, rectangle, or other complex polygon.

That snuggle truck game looks like the curves are pretty straight other than the joints.

Like, there's curved ground but it has straight posts above it rotated at different angles. The tops of the mounds are fairly flat. In a html5 game I made I did really simple collision based on bounds of the object's image being drawn (x+width, y+ height), then could stack/rotate them however to make a terrain like that truck game at least. You could easily build a collision framework and draw a nice clean hill graphic on a layer above to make it look pretty. I imagine it would only be faster with a faster language than javascript.

So when you come down to it all the objects are just made up of bounding boxes (or spheres)? That makes sense.

I think I have a decent grasp on how I would achieve this, however on the subject of collision I have a rather silly question: which is how do I tell which side of the object my player has collided with. Even with tiles. What I am doing is checking to see if player.x is within the x boundaries of the object, and the same for y. However I am not too sure on how to tell whether my player is colliding from the top or the left for example, so I don't know which velocity, dx or dy, to stop.

So some pseudocode:
# With each object being a tile.
If player.x > object.left && player.x < object.right
&& player.y > object.top && player.y < object.bottom then
dx, dy = 0, 0
end

I do feel silly for asking this but I guess it's the beginners forum so here I gooooo!

### In Topic: Internet Bandwidth

25 June 2011 - 11:26 PM

I don't mean to be a party pooper, but \$50 for 60GB seems stupidly cheap.

I have to pay \$100 for a 40GB plan, and isn't New Zealand supposed to be a first world country? I have to agree, prices are out of control. I used to live in Singapore where it was unlimited, I thought the whole world was like that, but since moving here it has all changed. And the thing about my internet, I am paying for what was supposed to be a 20GB plan. However Telecom (my provider) gave us double when my family tried to move to another provider. Woopie! Oh, wait, we're still Shit. I hope that something gets done about this, the prices are just plain unfair.

PARTNERS