PokerChipRace physics explanations


#44

Also, i have a few questions, for better understanding…

  1. When entity expels droplet - what is initial position of droplet?
  2. When entity very close to wall expels droplet in wall - what is initial position of droplet? what is happened with a droplet?
  3. When one entity very close to other entity expels droplet in last entity - what is happened with a droplet?
  4. When one entity very close to other entity expels droplet in last entity and the radius of a droplet is equal to other entity’s radius - what is happened with a droplet?
  5. Let’s suppose the following situation: my and opponent entities, with equal radiuses, are both moving to a neutral chip, with smaller radius, from the same distance with equal length of velocity vectors. Who will eat them all? In other words: what are the order of inconsistencies processing?
    Picture:
    O -> o <- O
    iam neutral opponent

#45

Hi,

Is the rule “but the engine move it immediately to a valid position (x<800-11.254541)” also applied on collisions between chips ?

Thanks :wink:


#46

Also, i have a few questions, for better understanding…

  1. When entity expels droplet - what is initial position of droplet?
  2. When entity very close to wall expels droplet in wall - what is initial position of droplet? what is happened with a droplet?
  3. When one entity very close to other entity expels droplet in last entity - what is happened with a droplet?

When one entity very close to other entity expels droplet in last
entity and the radius of a droplet is equal to other entity’s radius -
what is happened with a droplet?
5. Let’s suppose the following
situation: my and opponent entities, with equal radiuses, are both
moving to a neutral chip, with smaller radius, from the same distance
with equal length of velocity vectors. Who will eat them all? In other
words: what are the order of inconsistencies processing?
Picture:
O -> o <- O
iam neutral opponent

  1. Initial position is on the “border” of your chip (distance = chip_radius - droplet_radius) in the direction of expulsion
  2. Since the droplet touches the wall, it will be directly eaten by your chip.
  3. Is there even a problem here ? the other entity just absorbs it.
  4. see 2. (but it seems very unlikely to happen) It just bounces off it.
  5. In this very specific case (I mean, it has to happen in a precision of 1/500 of frame), the first chip in the list (the first player) has the priority.

Is the rule “but the engine move it immediately to a valid position (x<800-11.254541)” also applied on collisions between chips ?

No (:


#47

Thx leon_id & loic_mangeonjean1 for answers !

No (:
[/quote]

I was speaking of same size chips. So we use the point in the line that join both centers and adjust it position regarding both radius ? (because distance_C1_C2 != C1_radius + C2_radius)


#48

No, there is no mechanism like that between chips! :wink: I understood what you meant!


#49

So what point should we consider as collision point ?


#50

Why do you need it ? You just need the normal of the collision !


#52

So the droplet is still inside the chip, then, right? How come it is not absorbed either immediately or during the next 1/500th frame substep (if it is still inside)? Is there a specific rule regarding this?
Thanks,


#53

Exactly, a chip cannot eat its own droplet before the droplet hits a wall or another chip/droplet of the same size.


#55

For those who got frustrated by the 500 steps engine, note that a new physics engine is implemented in the PokerChipRace training.


#56

Whatttttttttttttttttttttttttttt :stuck_out_tongue:

How does it works ?


#57

It just compute the exact time for each collision using linear algebra ! There is no more “steps” :wink:


#58

What’s the new position of the entity after expelling a droplet ? Does it keep its original one ?


#59

Yes, an entity doesn’t move when expelling, only the speed is modified.


#60

What happens if an entity consumes another entity, and the growth in area would put its border beyond the bounds of the map? For example. Entity 0 is at Y = 10 and its radius is 8. It consumes another entity which makes its radius 12. Now its upper border is -4. Does the engine immediately move the larger entity somehow?


#61

The remaining entity will be set right next to the edge.
I have published some parts of my simulation on github.


#62

Thanks! This is a very handy reference. Although I noticed that your edge collision detection has a minor bug if the entity is heading toward a corner and would hit both edges. Your code would return a collision with the Y edge, even if it hits the X edge first. Your code is very clear, though. Thank you!


#63

Wow, indeed. Thank you for telling me.
I played about 10 matches and compared the gamestate with my own calculations, without any differences.
That bug seems to be relevant in the rare case, that there is a collision with another chip between both edge collisions.


#64

Hi. I’m trying to build the simulator. In order to simulate a move, I know the speed vector, and I want to know the future position. Is there a way to have the turn duration? Or maybe the speed is given in unit/turn?


#65

Correct.

As a base to improve upon, I suggest your look at simulators for CSB for example, they’ll be a good base to build from.