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

peacemaker

Expert
Licensed User
Longtime User
Really something new and strange :)
Each can build his own interface game.

I like the idea of the game structure, here maybe @aeric 's API framework can help to build the game API...
 

aeric

Expert
Licensed User
Longtime User
Really something new and strange :)
Each can build his own interface game.

I like the idea of the game structure, here maybe @aeric 's API framework can help to build the game API...
Apparently, the game can be play by using Postman.
However, you can build a B4X client app using OkhttpUtils2 (or web frontend) and add some graphical and sound assets.
 

peacemaker

Expert
Licensed User
Longtime User
It is that what is interesting - all the game algorithm is coded in the server app, but all communication with the users is just HTTP "text" API, instead of video frames generation, audio output.
So interface of the user client can be any - text or graphics generated on user's side basing on API replies.
 

ilan

Expert
Licensed User
Longtime User
It is that what is interesting - all the game algorithm is coded, but all communication with the users is just HTTP "text" API, instead of video frames generation, audio output.
ok so let say i have a server running this API and each user can get/post to the API like getting his spaceship position etc.
but if i want now to create a game based on API calls i am not sure i can get 60 api calls per second for each player to get a smooth game feeling.
 

ilan

Expert
Licensed User
Longtime User
ok so let say i have a server running this API and each user can get/post to the API like getting his spaceship position etc.
but if i want now to create a game based on API calls i am not sure i can get 60 api calls per second for each player to get a smooth game feeling.

but i can try it. ?
 

peacemaker

Expert
Licensed User
Longtime User
60 api calls per second for each player to get a smooth game feeling
Why not? API sends you the vector of movement (3D-direction, speed) and you can calculate and generate the video as you need
 

peacemaker

Expert
Licensed User
Longtime User
But it's interesting the API template for games: action one, strategy one, simple single-player 2D game...
DB structure: users, actions, items, enemies, achievements...
 
Last edited:

peacemaker

Expert
Licensed User
Longtime User
but 60 times per second?
The API gives you the targets (coords, points...), but the video process of movement to the coords is on your side, at client code
 

ilan

Expert
Licensed User
Longtime User
The API gives you the targets (coords, points...), but the video process of movement to the coords is on your side, at client code
sure, i understand that. everything that is related to UI is happening on the client side. The server just send/write the coordinates.
 

ilan

Expert
Licensed User
Longtime User
Me: move right hand and taking aim to Enemy23
API: check Me position/Enemy23 position
Me: shoot!
Api: track bullet position / me position / enemy23 position
Me: moving
Enemy23: moving
Bullet: still moving
Api: check bullet position/ check enemy23 position check if hit
Enemey 23: shoot!
Api: check Enemy23 bullet position/check me bullet position/check if hit /check me position /check enemy 23 position
Api: me bullet missed.
....

?
and all this 60 times per second and it its only 2 players. can be very challenging but i want to try it. (already started :) )
 

peacemaker

Expert
Licensed User
Longtime User
Me: move right hand and taking aim to Enemy23
API: check Me position/Enemy23 position
Me: shoot!
Api: track bullet position / me position / enemy23 position
Me: moving
Enemy23: moving
Bullet: still moving
Api: check bullet position/ check enemy23 position check if hit
Enemy23: shoot!
Api: check Enemy23 bullet position/check me bullet position/check if hit /check me position /check enemy 23 position
Api: me bullet missed.

Me: moving
It's local animation, no any network transmission.

Enemy23: moving
it's actually the packet:
API: Enemy23 is moving to coords = X, Y, Z, speed
And all other calculations on client's side.

Bullet: still moving
It's server's local calculation.

Enemy23: shoot!
it's actually the packet:
API: Enemy23 shoot, bullet's way to coords X1, Y2, Z2, speed2
And next just local client's calculations
 

ilan

Expert
Licensed User
Longtime User
It's local animation, no any network transmission.
no that is not true, when you move the server needs to know where u are if not how should it check for collision with the bullets?
i did many apps believe me i know what needs to be checked in background and what is UI.
 

peacemaker

Expert
Licensed User
Longtime User
how should it check for collision with the bullets?
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, without network transmission at this millisecond.
 
Top