Games Build A Cross Platform Client for this New REST-API-Based Space Game!

ilan

Expert
Licensed User
Longtime User
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

just an example

1703754602730.png


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.
 

ilan

Expert
Licensed User
Longtime User
I think you guys are going far out of topic.
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.
 

peacemaker

Expert
Licensed User
Longtime User
server needs to track that bullet
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" ?
 

aeric

Expert
Licensed User
Longtime User
The OP is talking about a client app. We can use B4X to create a cross platform client easily that consume the API using Okhttputils2.

If you have the same idea, you can also build your own server but instead of mining for aluminum, the game is for shooting enemies.
 

ilan

Expert
Licensed User
Longtime User
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 ?
 

aeric

Expert
Licensed User
Longtime User
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.
 

peacemaker

Expert
Licensed User
Longtime User
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.
 

ilan

Expert
Licensed User
Longtime User
Strange reply if to note that i mentioned the exact time calculation based on distance you mention
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.
 

peacemaker

Expert
Licensed User
Longtime User
what will happen in 1 second

Position2 = Position1 + bullet.speed * 1 second.

OK, i stop discussion :) i did not do the action games. Just one simple multiplayer game without "active actions".

 
Last edited:

ilan

Expert
Licensed User
Longtime User
Position2 = Position1 + bullet.speed * 1 second.
i am not talking about the bullet position i am talking about the enemy position

here is an example game so you get the idea what i mean:
 
Top