Original Post
Hello guys :) Yeah another collision problem :/ I'm writing a small document, before starting to code somehintg, where i'm checking if i can handle some easy things . For exemple , if i can know what to draw on the screen, or if my enetites will be able to interact with each other, or if my input will be recived by the correct entities ect ... So far, i've run into one problem . I'm making a 2D rpg tile-based, i want movement to be per pixel and not per tile . That raise the problem of collision data . What is the best way to store this ? ( i want something easy to make ( for each tile ) and fast to parse when i will be checking if any entities has collide with something else ). Also, the per/pixel thing gave me another problem . Let's say i got a pnj somewhere on the map, and the door near him, if the npj send a "action" request, how will i know if he is near the door, so he will open it, or if another pnj has came in front of him and the door, so in taht case, my first pnj will just "talk" or something with the 2nd pnj . ( i think it will heavily rely on the way i will store collision data ) Thx by advance . EDIT : Ok let's reconsider the problem . A few info on my game : - I use tile for the really basic terrain ( sand, grass, floor, and wall maybe ) . I wont use anything like small tile for montain or so, as there wont be a "world map" on my game. - Every other object will be considered as a unique entitie (a door,a house from outside, a carpet, a monster, a npc, a plyer ect ... ) I use 32*32 tile, but in memory each tile is divided into 4 16*16 tile . So i think i will just assign a number a this small tile, to make the collision ( easier than real pixel-perfect thing ). But i dont see how i will do for entities, i really need per-pixel movement and collision ( its for a A-RPG ). Should i build a array ( 1 number for exery pixel of the texture ) and use taht for collision ? If i do taht i see one problem . For exemple, the texture of a monster . Part of it will be some alpha channel, so easily set to "free" in the array, but then i must have an aera for the "leg" or whatever, for collision detection with other entities , and other part will be something " hitable", for exemple an arrow should be able to hit it . But how can i do taht ? it seems boring to do for every monster, and memory/time-consuming, isnt it? I think i'm lost somewhere :p [Edited by - Ey-Lord on December 21, 2005 10:33:25 AM]