23
W I S S E N T E C H N I K L E I D E N S C H A F T www.tugraz.at Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

W I S S E N T E C H N I K L E I D E N S C H A F T

www.tugraz.at

Introduction to the A&SCourse SystemMartin WistauderGraz, 3. Dezember 2019

Page 2: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

2

A&S Course System Introduction

Content

1. Relevant questions

2. Message format examples

Martin WistauderGraz, 3. Dezember 2019

Page 3: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

3

Relevant questions

Relevant questions

Martin WistauderGraz, 3. Dezember 2019

Page 4: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

4

Relevant questions

What is the ”Course System Structure”?

In General

Client-Server architecture built on top of gRPC

Clients request new matches and submit game turns

What does the server do?

Registration management

Match management

Turn simulation

Martin WistauderGraz, 3. Dezember 2019

Page 5: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

5

Relevant questions

What is a rpc?

rpc stands for remote procedure call

Wraps doing a network operation into a function call

Network stuff as ”easy” as calling a function withparameters and return values

Martin WistauderGraz, 3. Dezember 2019

Page 6: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

6

Relevant questions

What is a rpc?

Source: https://www.ibm.com/support/knowledgecenter/ssw_aix_72/commprogramming/rpc_mod.html

Martin WistauderGraz, 3. Dezember 2019

Page 7: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

7

Relevant questions

What is gRPC?

gRPC is googles implementation of remote procedurecalls, available in many languages

Most valuable benefits:

Custom network protocol definitionCustom message definitions (protobuf-based)Network code can be generatedAvailable in many languages

Martin WistauderGraz, 3. Dezember 2019

Page 8: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

8

Relevant questions

What languages does gRPC support?

Documentation at https://grpc.io/docs/

C++, C#, Java, Pyhton, Go, Node.js, PHP, Ruby, Dart,...

Martin WistauderGraz, 3. Dezember 2019

Page 9: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

9

Relevant questions

What do I have to do?

Write a client

All network code will be provided

Program an ”artificial intelligence”

Use your knowledge from this course and beyond

Play the game

Start matches and submit turns

Martin WistauderGraz, 3. Dezember 2019

Page 10: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

10

Relevant questions

How do I build a client?

1. Select an available programming language(everything gRPC supports)

2. Download the protobuf files and compile them intoyour chosen language

The protobuf (.proto) files define the networkcommunication protocolThe protobuf compiler (protoc) will generate thenetwork code

Martin WistauderGraz, 3. Dezember 2019

Page 11: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

11

Relevant questions

How do I communicate with the server?

Server hostnamegameserver.ist.tugraz.at (129.27.202.46)Only reachable inside the TUG-network

Use the TUG-vpn (vpn.tugraz.at) to conncectfrom the outside

Note: Don’t forget to resolve the hostname inside yourprogram or just use it’s IP address

Use the provided remote procedure calls (rpc)Like GetUserToken(AuthPacket) →GetUserTokenResponse

Martin WistauderGraz, 3. Dezember 2019

Page 12: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

12

Relevant questions

How do I play?

Requesting a new match

rpc NewMatch(MatchRequest) → MatchResponse

Submitting a turn

rpc SubmitTurn(TurnRequest) → TurnResponse

Acquiring the current game state

rpc GetGameState(GameStateRequest) →GameStateResponse

Martin WistauderGraz, 3. Dezember 2019

Page 13: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

13

Message format examples

Message format examples

Martin WistauderGraz, 3. Dezember 2019

Page 14: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

14

Message format examples

TurnRequest format

user token: Identifies the user

match token: Identifies the match

game turn: Choose the game you are playing (dab)

Martin WistauderGraz, 3. Dezember 2019

Page 15: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

15

Message format examples

dab.GameTurn format

vertical: If you want to choose a vertical or horizontalcolumn

target column: The selected column in which youwant to fill a gap

target gap: The gap you want to fill

Note: The first column/gap is indexed with 0

Martin WistauderGraz, 3. Dezember 2019

Page 16: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

16

Message format examples

Vertical game turn example

Martin WistauderGraz, 3. Dezember 2019

Page 17: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

17

Message format examples

Horizontal game turn example

Martin WistauderGraz, 3. Dezember 2019

Page 18: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

18

Message format examples

GameStateResponse format

vertical columns: Number of vertical columns

horizontal columns: Number of horizontal columns

vertical lines: Array of characters, which indicate if avertical gap is filled or not (0 if not filled)

horizontal lines: Array of characters, ...

Martin WistauderGraz, 3. Dezember 2019

Page 19: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

19

Message format examples

Vertical lines example

char[ ] vertical lines= [ v0-g0, v1-g0, v2-g0 ]

Martin WistauderGraz, 3. Dezember 2019

Page 20: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

20

Message format examples

Horizontal lines example

char[ ] horizontal lines= [ h0-g0, h0-g1, h1-g0, h1-g1 ]

Martin WistauderGraz, 3. Dezember 2019

Page 21: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

21

Message format examples

How do I report or ask something?

(Preferred) Submit an issue at gitlab.tugraz.at forthe project ’AS Gameserver’

https://gitlab.tugraz.at/836A87A6474BF7E6/

as-gameserver/issues

Post into the newsgroup ”algorithmen”WITH the tag ”[A&S]”

Martin WistauderGraz, 3. Dezember 2019

Page 22: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

22

Message format examples

Where do I find information about the coursesystem?

Look at the course websitehttp://www.ist.tugraz.at/as19.html

Martin WistauderGraz, 3. Dezember 2019

Page 23: Introduction to the A&S Course System · W I S S E N T E C H N I K L E I D E N S C H A F T  Introduction to the A&S Course System Martin Wistauder Graz, 3. Dezember 2019

23

A&S Course System Introduction

Thank you for your attention!

Martin WistauderGraz, 3. Dezember 2019