T
Taddio
Guest
I need to know if this is is a sound principle, and if there's potential wallbumps ahead before I start doing the maths ans coding. A picture is worth a thousand words, so lets start with a visual of what I need
Basically: top down game, where the view is blocked by an obj_wall.
I only ever used this sort of maths to draw light, so that's kind of my only starting point. Obviously not going to be the same functions, tho, so tell me if this is sound if I just used those same player/wall_corners coordinates to make a triangle and then try to loop through all the triangles using point_in_triangle() to populate a visible_enemies list? Also, Ive been thinking about how to actually get the number of triangle, is there some obscure functions that I should look into, or just make my own counter and forget about trying to make my life easier?
Point in triangle will return ALL ids if I don't use it with an instance variable, but with an object's name, right?
If so, I think this sounds like it would work, but also sounds kind of innefficient in a case where multiple instances would need to run this just to set their AI state.
Do you have tips or cues when you need to get the id of the instances in your field of view? Very curious about this, and also doing my homeworks before I get to dive into it. I would rather it be as efficient as possible since this is probably need to run often (step or every few frames at most) with a couples of instances, and going to be the basics to set the AI state
Basically: top down game, where the view is blocked by an obj_wall.
I only ever used this sort of maths to draw light, so that's kind of my only starting point. Obviously not going to be the same functions, tho, so tell me if this is sound if I just used those same player/wall_corners coordinates to make a triangle and then try to loop through all the triangles using point_in_triangle() to populate a visible_enemies list? Also, Ive been thinking about how to actually get the number of triangle, is there some obscure functions that I should look into, or just make my own counter and forget about trying to make my life easier?
Point in triangle will return ALL ids if I don't use it with an instance variable, but with an object's name, right?
If so, I think this sounds like it would work, but also sounds kind of innefficient in a case where multiple instances would need to run this just to set their AI state.
Do you have tips or cues when you need to get the id of the instances in your field of view? Very curious about this, and also doing my homeworks before I get to dive into it. I would rather it be as efficient as possible since this is probably need to run often (step or every few frames at most) with a couples of instances, and going to be the basics to set the AI state