Slide 1

Slide 1 text

What we can learn from game developers?

Slide 2

Slide 2 text

There will be no code

Slide 3

Slide 3 text

Main problems in games • Performance • Performance • Performance

Slide 4

Slide 4 text

Solutions • Intrusive lists • Better CPU cache utilisation • Makes structures look „weird” • Entity-Component-System • Try to manage data independently form logic • Separate of concerns • Datagram protocols • Connection-less communication • Loosing package isn’t a problem

Slide 5

Slide 5 text

Intrusive lists are completely pointless for our case So I will not get into details

Slide 6

Slide 6 text

Entity-Component-System • Component - collection of data • Should be small • Contain no logic • Entity - collection of Components • In general sense - common ID for the components • System - logic over Components • Contain logic • Modifies one or more components • Do not care about Entities • Listen on events in log

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Live

Slide 9

Slide 9 text

Live Fluffy

Slide 10

Slide 10 text

Live Fluffy Placeable

Slide 11

Slide 11 text

Live Fluffy Placeable Mobile

Slide 12

Slide 12 text

Live Fluffy Placeable Mobile Jumpy

Slide 13

Slide 13 text

Live Fluffy Placeable Mobile Feedable Jumpy

Slide 14

Slide 14 text

Live Fluffy Placeable Mobile Weight Feedable Jumpy

Slide 15

Slide 15 text

Live Fluffy Placeable Mobile Edible Weight Feedable Jumpy

Slide 16

Slide 16 text

Live Fluffy Placeable Mobile Edible Weight Feedable Jumpy

Slide 17

Slide 17 text

Placeable Mobile Jumpy Weight Jumping

Slide 18

Slide 18 text

Placeable Mobile Jumpy Weight Jumping Moving

Slide 19

Slide 19 text

Placeable Mobile Jumpy Weight Jumping Placeable Mobile Moving Weight

Slide 20

Slide 20 text

„Real example” Electronic Medical Record system

Slide 21

Slide 21 text

Entity-Component • Patient • Name (first name, last name) • Vitals (pulse, body temp., etc.) • Illness • Practitioner • Name • Authentication • License

Slide 22

Slide 22 text

Systems • Authentication • Authorisation • Vitals measurement • Morgue

Slide 23

Slide 23 text

Pros • Adding features to entities is simple • Making snake jumpy is as simple as adding component to it • Removing features is simple • Making rabbit immovable is as simple as removing component from it • You can dynamically add features to entities • Less edge cases, as system is not aware of the entities that do not contain given components

Slide 24

Slide 24 text

Cons • Eventually consistent • Systems tends to grow and touch a lot of components at once • Unexplored technique in webdev land

Slide 25

Slide 25 text

QUIC

Slide 26

Slide 26 text

TCP - pros • Nice when you can keep connection open • Quality of Service • Guarantee of delivery • TLS

Slide 27

Slide 27 text

TCP - cons • No multihoming (at least in IPv4) • One missing package will delay all next messages until delivered • Three-way handshake

Slide 28

Slide 28 text

Hello, would you like to hear a TCP joke? Yes, I'd like to hear a TCP joke. OK, I'll tell you a TCP joke. OK, I'll hear a TCP joke. Are you ready to hear a TCP joke? Yes, I am ready to hear a TCP joke. OK, I'm about to send the TCP joke. It will last 10 seconds, it has two characters, it does not have a setting, it ends with a punchline. OK, I'm ready to hear the TCP joke that will last 10 seconds, has two characters, does not have a setting and will end with a punchline. I'm sorry, your connection has timed out... ...Hello, would you like to hear a TCP joke?

Slide 29

Slide 29 text

UDP • Connectionless • No delivery guarantees • No QoS • No congestion negotiation - can cause package drops

Slide 30

Slide 30 text

QUIC • Implementing TCP guarantees on top of UDP • Still connectionless • Encrypted • No three way handshake • Multihoming • Implemented in user space • Non-blocking on missing packages

Slide 31

Slide 31 text

HTTP 3 = HTTP 2 over QUIC • Multi-network connections handled via multihoming • Faster delivery, even better than via HTTP 2 push • Encryption „reusage” • Less traffic when establishing encryption suite

Slide 32

Slide 32 text

–George Santayana Those who cannot remember the past are condemned to repeat it.

Slide 33

Slide 33 text

FIN @hauleth

Slide 34

Slide 34 text

Questions?