Synchronizing AI NPCs on a multiplayer game - multiplayer

I've started developing a small multiplayer racing game, obviously we're using all the player prediction, dead reckoninng and lag compensation techniques that Half Life, Quake and Unreal use - however we plan on having dozens of AI cars in the game as well.
Initially we decided to simply send a random seed to all clients and they will calculate AI positions, etc - however, we've reached the following problem:
All clients receive a seed to run AI cars
Clients only receive movement updates for players within their line of sight
Player A hits an NPC car
Player B enters player A's frame
Now since player B didn't receive player A's movement, he'll assume the AI car is still moving as it should, and wouldn't calculate in the fact that player A hit one of those cars...
So long story short - how can you synchronize AI units that were affected by players?

Presumably, your server is aware of any collisions. In that case, simply notify all your clients of collision results--essentially re-seeding the AI on the clients, at the point of the collision, with the new directions, velocities, RNG seeds, etc.

Related

about bounded boxes of objects

i'm trying to compose a dataset for the detection of soccer players, ball etc.. in a soccer game, i'm using alexeyAB Darknet framework,
So in the labeling phase in each image there are at least 8 players a ball and other stuff, at some point it is logical to think about the fact that i will have enough instances per player, but not enough for the ball and the goalkeeper for example,
so can i only marking bounded boxes the ball and other things avoiding to do it with the players to not waste time?
If you are training the model on your own dataset, I would recommend limiting the number of labels/classes in your data to what you seek. For example if you only want your model to see balls, goal-posts and Not players, simply keep the classes as balls and goal-posts. (This reminds me of a classification problem where 0 stands for balls and 1 stands for goal-post). P.S you mentioned object detection and Not Localization, which is the purpose of the YOLO models.

Game maker studio Visual bug

I have an issue where when I use the physics system to have collision between the character and the wall, the Sprite will SOMETIMES vibrate when you hold to move into the wall. As an additional thing as they may be related, if I turn up the player's speed value they're able to glitch through the walls. Right now the collision system I have is really basic, so there isn't much coding but here's related info.
Wall's density is set to 0 while player is .1
Room has physics enabled but has no set gravity
I have a drag and drop collision event with only a comment in it.
https://docs.yoyogames.com/source/dadiospice/001_advanced%20use/more%20about%20objects/physics.html
Restitution: In physics, restitution is defined as "the return of an object or system to its original state after elastic deformation", but as the fixtures in the GameMaker: Studio are really rigid bodies and cannot be deformed, restitution is really a way of saying how "bouncy" the fixture is. This setting will affect how much an object "bounces" when it collides with other objects and is co-dependant on other forces that act on the instance like gravity and friction.
That could be ansver to "vibrations". Else you may tru to create code which will check if object is trying to move towards obstacle and stop its movement to prevent built-in physics from causing any problems.
wall skipping: This is usual behavior of built-in game-maker collisions. main problem is that game-maker "teleports" objects "by speed in its direction", which means that when speed is greater than size of any object, game-maker collision system may fail.

how to create water like they did in LIMBO game using the cocos2d and box2d?

I have seen this before, and making my research i've discovered that if you create allot of circles objects in box2d, then apply a color, then blur it and at the end sharp it a little bit ( same stile like "Where is my water" game created by disney ).
But of course in a game like limbo, with a huge world this is extremely expensive.
Since i have seen this in a few games over the internet i still trying to understand how can i build this with box2d ? ( the games over the internet where/are created with in flash, and i want to do it in cocos2d for the iOS platform )
a few examples about how the water works, for those that didn't played the Limbo game:
1.A box will flow on the water, the box will enter in the water only half of it and half of the box will will remain above the water. If an object (like: the player ) will falls above it the box will have the end of the titanic, it will sink.
2.A rock will sink.
3.The player, well i guess here will be different choices.
4.A boat, for the bout i know a bool should do the trick BOOL canSink; but again how should i make that water effect ? balancing the object on it, an bouncing if the object falls in the water, and for sinking a slower velocity ?
It may look like allot of questions,but at the end is only the " How to create the water effect in box2d?"
I guess you're looking for buoyancy effects, here you have a couple of interesting resources.-
http://www.iforce2d.net/b2dtut/buoyancy
http://personal.boristhebrave.com/project/b2buoyancycontroller/demo
As for the water waves effect, you can take a look at.-
http://www.sideroller.com/wck/?f=6
http://www.cocos2d-iphone.org/forum/topic/25494
Hope it helps.

Collision Hit Boxes for 2D fighting game. Tools?

I'm in the process of developing a 2D fighting game in the same style as Capcom's Street Fighter Alpha for the iPhone. For collision detection, I'm thinking about creating several hit boxes per sprite frame in an animation and checking for collisions between them in the main game loop. Are there any tools for creating hit boxes on sprites and generating this metadata (say in a .plist or .xml)?
How have other 2D fighting games developed by the cocos2d iPhone community handled collision detection and the generation of useful metadata?
Thanks for the forthcoming responses.
In a fighting game, collision detection is actually not performed (or should not be performed, that is).
What you would want to do is determine the distance of Player A from Player B when Player A performs an "attack". Player A's attacks are "static":
High Punch = 64px reach
Low Punch = 54px reach
Mid Punch = 45px reach
High Kick = 64px reach
etc, etc, etc
You would then determine, based on the attack performed and the distance to Player B, and the current state of Player B - whether the attack "landed", was "blocked" or "missed" (High Kick Attack against Crouched Enemy is "miss", while Low Kick Attach with Crouched Enemy NOT in Block is a "hit").
It's a series of "rules" - if the two players are within a specific distance of each other, and the states of each player are correct for the attack, then the attacker "lands", or the defender "blocks" or the attacker "misses".

how to calculate time interval between player move and AI move

Hii,
I want to calculate time taken by the player for making his move. My player can pick his coin and make his move to a box(like in chess). If my player pick his coin early but make his move very lately, then how to calculate time between AI and player move
One option is to reset/abort the move action if it is not finished after a certain amount of time, say 5 secs or whatever is reasonable to your game.