Skip to content

Instantly share code, notes, and snippets.

@jh0l
Last active May 22, 2020 11:41
Show Gist options
  • Save jh0l/02b8eaa23ad684cff7f3c7fd93cae7cc to your computer and use it in GitHub Desktop.
Save jh0l/02b8eaa23ad684cff7f3c7fd93cae7cc to your computer and use it in GitHub Desktop.
discussion on the file save format to use for APT lab Friday 19:30
F
RYYU
RBBB
BLLL
RRUU
RYBL
.
..
...
....
.....
.....
.....
.....
.....
.....
.......
.
..
...
....
.....
.....
.....
.....
.....
.....
.......
0
Jessiah anthony Malik
23
Rob William Tirtasentana
30
YUBRYLRBYRULBYRUBYRLBUYUYBLRBLBLRYRYRUYBURYBULBURYLRUBYRLBY
RBYURULBYRLBLRURY
@Jacob-Mango
Copy link

how does this sound?

begin game #this is a comment
	currentPlayer 0 #max two players, 0 is first in the save game list, 1 is second
end game
begin player
	name Jessiah anthony Malik
	score 10
end player
begin player
	name Rob William Tirtasentana
	score 100
end player

@Jacob-Mango
Copy link

Jacob-Mango commented May 1, 2020

players.save

1st line determines which player's turn it currently is (int)
2nd line is the 1st players name (string)
3rd line is the 1st players score (int)
4th line is the 2nd players name (string
5th line is the 2nd players score (int)

players.save

0
Jessiah anthony Malik
23
Rob William Tirtasentana
30

@jh0l
Copy link
Author

jh0l commented May 1, 2020

players.save

1st line determines which player's turn it currently is (int)
2nd line is the 1st players name (string)
3rd line is the 1st players score (int)
4th line is the 2nd players name (string
5th line is the 2nd players score (int)

players.save

0
Jessiah anthony Malik
23
Rob William Tirtasentana
30

Yep this is good I'll update the spec

@jh0l
Copy link
Author

jh0l commented May 1, 2020

I kinda feel like the mosaics should be merged with the players file, a bit unnecessary to separate the two

@Jacob-Mango
Copy link

This is being changed to this instead of reading from folders

For each save:

{saveName}-factories.save
{saveName}-mosaic.save
{saveName}-tilebag_boxlid.save
{saveName}-players.save

The persistent save:

persistentGame-factories.save
persistentGame-mosaic.save
persistentGame-tilebag_boxlid.save
persistentGame-players.save

@Jacob-Mango
Copy link

Jack Harry Hollis-London
20:57

We should be using any random behaviour after shuffling the tilebag

20:57
*should not be using rng behaviour

20:58
and the tilebag should only be shuffle at the start of a new game

20:58
the tilebag is only filled from the box lid again once the tilebag is empty

20:59
and it is filled in order, no shuffling happens when tilebag is refilled

21:00
To move from a tilefactory to a players floor line we can use turn 6

@Jacob-Mango
Copy link

Everything is FIFO

@mattrwalters
Copy link

Fill each factory in order from 1 to 5. Eg. Fill 1 completely then continue.
Always right to left.
Place in broken tile command is 6.
Bag and Lid are FIFO, doesnt matter how its implemented as long as it processes in that order.
Do not shuffle during testing. The seed is not neccessary for sharing tests.
The file format "persistent-*.save" where * represents all save types is reserved. No save game can be called persistent in a test case.
Saving is in the following format, "save {saveName}" then once saved all 4 files are saved with that string appended to them eg.
{saveName}-factories.save
{saveName}-mosaic.save
{saveName}-tilebag_boxlid.save
{saveName}-players.save
Commands are designated in the format the same as the assignment specification where "turn 3 L 3" is a valid turn. All tiles must be capital.
Menu items (number is command) 1. New Game; 2. Load Game; 3. Credits; 4. Quit;
Commands for "load" and "save".

@jh0l
Copy link
Author

jh0l commented May 15, 2020

Always right to left.

Would this not be left to right?

Commands for "load" and "save".

I was under the impression there is no need for a load gamecommand as loading is done from the main menu

@CameronvanRoon
Copy link

Matt is mostly correct, however, as jh0l points out:

We always read LEFT TO RIGHT
We save with "save [saveName]"
Load game is handled explicitly from the main menu. Selection "2"
No need to load from mid-game.

Also note, each test contains 3 files:
A saved game starting state.
A file of input commands
A saved game state for the expected output - Probably just append with .output to make this clear.

Input command file example:

2
[nameOfTestFile]
turn 3 R 3
turn 0 Y 6
save [nameOfTestFile]

@jh0l
Copy link
Author

jh0l commented May 15, 2020

more clarification:
when there is no room to place a tile in the floor line, they should not linger on the floor line, they should be immediately placed in the box lid in FIFO order.

@mattrwalters
Copy link

Oop sorry everyone was fairly tired when I wrote that. As stated above I should have said left to right, and there is no need for a load command. Again, sorry about the confusion.

@mattrwalters
Copy link

Regarding the following.

Also note, each test contains 3 files:
A saved game starting state.
A file of input commands
A saved game state for the expected output - Probably just append with .output to make this clear

Should we change our implementation of the save state to be a single file instead of how we have it with multiple files now. I believe this was decided in the original meeting regarding saves that we would store the save over multiple files How we have it now will this cause a reduction in marks?

@jh0l
Copy link
Author

jh0l commented May 17, 2020 via email

@jh0l
Copy link
Author

jh0l commented May 22, 2020

for scoring on the wall, when we're counting adjacent linked tiles next to a tile that is being placed on a wall, are we placing each tile on the wall before the next one is counted, or are we only counting tiles on the wall from previous rounds when counting adjacent linked tiles next to a tile that is being placed on a wall?

@jh0l
Copy link
Author

jh0l commented May 22, 2020

@CameronvanRoon
Copy link

for scoring on the wall, when we're counting adjacent linked tiles next to a tile that is being placed on a wall, are we placing each tile on the wall before the next one is counted, or are we only counting tiles on the wall from previous rounds when counting adjacent linked tiles next to a tile that is being placed on a wall?

My understanding (could be wrong) was that tiles are placed on wall one at a time, beginning from the top row of the storage rows, going down. Thus, scores would be based on the time of placement. Therefore, you would score for a tile in the same turn only if it was above it on the storage rows.

@CameronvanRoon
Copy link

From the rules:

Go through your pattern lines from top to bottom. Move the rightmost tile of each complete line to the space of the same color in the corresponding line of your wall. Each time you move a tile, score points immediately (see Scoring).

@jh0l
Copy link
Author

jh0l commented May 22, 2020

alright cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment