If "me" reported about my movement vector, and received the vectors of Enemy and bullets - it seems to me next should be just local math calculations about the vectors crossing... and the results
when you shoot 1 bullet it takes some time until it arrives to the enemy. the server needs to track that bullet and 60 times per second send it to all clients so the can draw the real position of the bullet and also meanwhile the players moved so the server needs also to send the location of all players to the clients so they can draw the new position and each time it needs to check for collision.
why?
making it only text based game is boring let see if such an API can really be a multiplayer solution for simple games.
30 FPS should also be fine if the server can handle it.
Is not enough the calculations that vectors on your image are not crossing, and after time = max(Dist / bullet1.speed, Dist / bullet2.speed) API is replying "API: missed" ?
Is not enough the calculations that vectors on your image are not crossing, and after time = max(Dist / bullet1.speed, Dist / bullet2.speed) API is replying "API: missed" ?
no, because there is a distance between both ships and you cannot send a bullet from location A to location B instantly. it doesnot make any sense to make a game where a bullet has the speed of light ?
Is not enough the calculations that vectors on your image are not crossing, and after time = max(Dist / bullet1.speed, Dist / bullet2.speed) API is replying "API: missed" ?
I think the game logics all are control on the server. Maybe some algorithm or random number together with probabilities already predefined. The client only send request or parameter which will determine the outcome. For eg. The calculation is base on a random number multiply by a "seed" which come from the timestamp of the request sent.
Each object has the movement vector and the speed. Some objects has the life limited by his speed, until coords are out of the scene (bullets).
And network transmission is used only for sending the vector\speed change of each object.
IMHO.
Its not strange because how can you calculate something without know what will happen in 1 second.
If you assume that no players can move after shooting then you can calculate it but normally in a game the player can still move after shooting so how can i calculate if my bullet will hit the enemy in the same second i shoot it?
if it takes 3 seconds to reach the enemy he could be in a different position when shooting the bullet from my ship.
hi I have just finished my latest b4i Game [Space Defender - Ultimate] I have learned a lot new stuff using iSpritekit with this project like using SKEmitters (Particle View) I am also using for the first time iTiled. I am loading different levels with it and get all objects from it and create...