Re: Checking for enemies in BGT

2019-02-28 Thread AudioGames . net Forum — Developers room : ricardo0922 via Audiogames-reflector


  


Re: Checking for enemies in BGT

I think I'm going to definitely implement both of these suggestions. Post 2: The idea of sorting by distance may be a little complex but it could be done. Once its sorted, the attacking functions should be very easy to write since the sorting will occur in the background. However, Iron Cross's idea would add realism to the game and it would let us search through less stuff. Thanks for the answers. I'll try both and see what happens.

URL: https://forum.audiogames.net/post/415101/#p415101




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking for enemies in BGT

2019-02-28 Thread AudioGames . net Forum — Developers room : ironcross32 via Audiogames-reflector


  


Re: Checking for enemies in BGT

I'm kind of thinking out loud since I've never coded a game, but I think I'm OK with concepts, just bad at the execution of said concepts. Let's say every weapon has a reach, for a gun, the distance would be the max number of positions the bullet would travel before disintegrating. For melee weapons, it would be the number of positions relative to the player the weapon could reach in its swing. So now you have as a minimum, the player's position when they fired or swung, and the max reach of the weapon to search. also, most weapons are not going to hit things behind the player, unless you're talking about splash damage from a rocket launcher, or explosive damage from a bomb. SO the search parameters just got downgraded to a radius. So now you have to decide how complex you want to simulate things, do you want to have melee weapons travel in an arc? If so, let's say the player is on the map and basically exists on the array at 25,25. His weapon might swing through 26 to 24 in the first array dimension, and 25 to 29 on the second, so now you have like an arc to search through. Or weapons could just directly search through a line straight out from the swing. But you now have search parameters so you're not combing through the entire array.

URL: https://forum.audiogames.net/post/415095/#p415095




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Checking for enemies in BGT

2019-02-28 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector


  


Re: Checking for enemies in BGT

If you're only searching through the array when an attack is active, the CPU cost shouldn't be too noticeable.If you wanted to try something more complicated, you could sort the enemies based on distance, with enemies swapping positions if one overtakes the other. That'd almost certainly be more trouble than it's worth, though.

URL: https://forum.audiogames.net/post/415092/#p415092




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Checking for enemies in BGT

2019-02-28 Thread AudioGames . net Forum — Developers room : ricardo0922 via Audiogames-reflector


  


Checking for enemies in BGT

Hi,I'm working on implementing a few very simple killable objects in my BGT test files that I will call, for the sake of simplicity and portability, enemies. I have functions that can determine distances between two points and whatnot, but I don't know how to tell the game what enemy is closest. For example, if I want to shoot at something off to my right, I will rotate in that direction to face it and shoot at it. A distance formula will run to see how far I was from the object and act accordingly. Simple enough. What I don't know how to implement is helping the game aim and kill the right object. I will have my enemies in a 2D Array, unless there's a better way. I don't want to constantly search through the array to find the closest enemy to my position as a method of finding what I'm shooting at, because that'll take too much CPU time. Is there another way to do this? If I have multiple enemies on the map, I need the game to know what enemy I'm aiming at. So thanks for any assistance.

URL: https://forum.audiogames.net/post/415085/#p415085




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector