jbilcke-hf HF staff commited on
Commit
e66b0b0
·
1 Parent(s): 6a98c79

adding more context to help llama2

Browse files
src/app/games/arizona.ts CHANGED
@@ -40,7 +40,16 @@ const inventory: InventoryItem[] = [
40
  export const game: Game = {
41
  title: "Arizona",
42
  type: "arizona",
43
- engine: "spherical_image",
 
 
 
 
 
 
 
 
 
44
  className: imfell.className,
45
  initialSituation,
46
  initialActionnables,
 
40
  export const game: Game = {
41
  title: "Arizona",
42
  type: "arizona",
43
+ description: [
44
+ "The game is a role playing adventure, set in an old mining town in Arizona.",
45
+ "The player can click around to move to new scenes, find or activate artifacts.",
46
+ "They can also use objects from their inventory.",
47
+ ],
48
+ engines: [
49
+ "cartesian_image",
50
+ "cartesian_video",
51
+ "spherical_image",
52
+ ],
53
  className: imfell.className,
54
  initialSituation,
55
  initialActionnables,
src/app/games/city.ts CHANGED
@@ -56,7 +56,17 @@ const inventory: InventoryItem[] = [
56
  export const game: Game = {
57
  title: "City",
58
  type: "city",
59
- engine: "cartesian_image",
 
 
 
 
 
 
 
 
 
 
60
  className: edu.className,
61
  initialSituation,
62
  initialActionnables,
 
56
  export const game: Game = {
57
  title: "City",
58
  type: "city",
59
+ description: [
60
+ "The game is a city simulator and management game.",
61
+ "The player is the mayor and they can see the city from above, and manage it",
62
+ "The player can click around to activate things related to buildings and city management.",
63
+ "They can also use objects from their inventory.",
64
+ ],
65
+ engines: [
66
+ "cartesian_image",
67
+ "cartesian_video",
68
+ // "spherical_image",
69
+ ],
70
  className: edu.className,
71
  initialSituation,
72
  initialActionnables,
src/app/games/doom.ts CHANGED
@@ -43,7 +43,17 @@ const inventory: InventoryItem[] = [
43
  export const game: Game = {
44
  title: "Doom",
45
  type: "doom",
46
- engine: "cartesian_image",
 
 
 
 
 
 
 
 
 
 
47
  className: orbitron.className,
48
  initialSituation,
49
  initialActionnables,
 
43
  export const game: Game = {
44
  title: "Doom",
45
  type: "doom",
46
+ description: [
47
+ "The game is a futuristic first-person shooter similar to \"Doom\".",
48
+ "Following a mining accident, the player has been called to Mars to explore the US Martian base, but they encounter aliens.",
49
+ "The player can click around to move to new scenes, find or activate artifacts.",
50
+ "They can also use objects from their inventory.",
51
+ ],
52
+ engines: [
53
+ "cartesian_image",
54
+ "cartesian_video",
55
+ "spherical_image",
56
+ ],
57
  className: orbitron.className,
58
  initialSituation,
59
  initialActionnables,
src/app/games/dungeon.ts CHANGED
@@ -83,7 +83,17 @@ const inventory: InventoryItem[] = [
83
  export const game: Game = {
84
  title: "Dungeon",
85
  type: "dungeon",
86
- engine: "cartesian_image",
 
 
 
 
 
 
 
 
 
 
87
  className: amatic.className,
88
  initialSituation,
89
  initialActionnables,
 
83
  export const game: Game = {
84
  title: "Dungeon",
85
  type: "dungeon",
86
+ description: [
87
+ "The game is a role playing adventure set during middle ages.",
88
+ "The player is playing a dwarf, and they explore the inside of a mysterious dungeon.",
89
+ "The player can click around to move to new scenes, find or activate artifacts.",
90
+ "They can also use objects from their inventory.",
91
+ ],
92
+ engines: [
93
+ "cartesian_image",
94
+ "cartesian_video",
95
+ "spherical_image",
96
+ ],
97
  className: amatic.className,
98
  initialSituation,
99
  initialActionnables,
src/app/games/enchanters.ts CHANGED
@@ -49,7 +49,17 @@ const inventory: InventoryItem[] = [
49
  export const game: Game = {
50
  title: "Enchanters",
51
  type: "enchanters",
52
- engine: "spherical_image",
 
 
 
 
 
 
 
 
 
 
53
  className: macondo.className,
54
  initialSituation,
55
  initialActionnables,
 
49
  export const game: Game = {
50
  title: "Enchanters",
51
  type: "enchanters",
52
+ description: [
53
+ "The game is a role playing adventure set during middle ages.",
54
+ "The player is an elfic wizard, and they explore a mysterious castle.",
55
+ "The player can click around to move to new scenes, find or activate artifacts.",
56
+ "They can also use objects from their inventory.",
57
+ ],
58
+ engines: [
59
+ "cartesian_image",
60
+ "cartesian_video",
61
+ "spherical_image",
62
+ ],
63
  className: macondo.className,
64
  initialSituation,
65
  initialActionnables,
src/app/games/flamenco.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { macondo } from "@/lib/fonts"
2
  import { Game } from "./types"
3
  import { InventoryItem } from "../../types"
4
 
@@ -54,8 +54,18 @@ const inventory: InventoryItem[] = [
54
  export const game: Game = {
55
  title: "Sad Flamenco",
56
  type: "flamenco",
57
- engine: "spherical_image",
58
- className: macondo.className,
 
 
 
 
 
 
 
 
 
 
59
  initialSituation,
60
  initialActionnables,
61
  inventory,
 
1
+ import { edu } from "@/lib/fonts"
2
  import { Game } from "./types"
3
  import { InventoryItem } from "../../types"
4
 
 
54
  export const game: Game = {
55
  title: "Sad Flamenco",
56
  type: "flamenco",
57
+ description: [
58
+ "The game is a role playing adventure set in 1920 mexico, inspired by the Grim Fandango game, with mexican, art deco and aztec influences.",
59
+ "The player is Lenny, a travel agent from the world of the dead, who try to find customers to escort safely to heaven.",
60
+ "The player can click around to move to new scenes, find or activate artifacts.",
61
+ "They can also use objects from their inventory.",
62
+ ],
63
+ engines: [
64
+ "cartesian_image",
65
+ "cartesian_video",
66
+ "spherical_image",
67
+ ],
68
+ className: edu.className,
69
  initialSituation,
70
  initialActionnables,
71
  inventory,
src/app/games/index.ts CHANGED
@@ -11,8 +11,9 @@ import { game as pharaoh } from "./pharaoh"
11
  import { game as tensor } from "./tensor"
12
  import { game as nexus } from "./nexus"
13
  import { game as arizona } from "./arizona"
 
14
 
15
- export const games = { arizona, pirates, city, dungeon, doom, vernian, enchanters, flamenco, pharaoh, tensor, nexus}
16
 
17
  export const defaultGame: GameType = "enchanters"
18
 
 
11
  import { game as tensor } from "./tensor"
12
  import { game as nexus } from "./nexus"
13
  import { game as arizona } from "./arizona"
14
+ import { game as trulad } from "./trulad"
15
 
16
+ export const games = { arizona, pirates, city, dungeon, doom, vernian, enchanters, flamenco, pharaoh, tensor, nexus, trulad}
17
 
18
  export const defaultGame: GameType = "enchanters"
19
 
src/app/games/nexus.ts CHANGED
@@ -66,7 +66,17 @@ const inventory: InventoryItem[] = [
66
  export const game: Game = {
67
  title: "Nexus",
68
  type: "nexus",
69
- engine: "spherical_image",
 
 
 
 
 
 
 
 
 
 
70
  className: macondo.className,
71
  initialSituation,
72
  initialActionnables,
 
66
  export const game: Game = {
67
  title: "Nexus",
68
  type: "nexus",
69
+ description: [
70
+ "The game is a role playing adventure set in a futuristic city, with cyberpunk influence.",
71
+ "The player is a detective whose role is to detect robots trying to pass as humans.",
72
+ "The player can click around to move to new scenes, find or activate artifacts.",
73
+ "They can also use objects from their inventory.",
74
+ ],
75
+ engines: [
76
+ "cartesian_image",
77
+ "cartesian_video",
78
+ "spherical_image",
79
+ ],
80
  className: macondo.className,
81
  initialSituation,
82
  initialActionnables,
src/app/games/pharaoh.ts CHANGED
@@ -48,7 +48,17 @@ const inventory: InventoryItem[] = [
48
  export const game: Game = {
49
  title: "Pharaoh",
50
  type: "pharaoh",
51
- engine: "spherical_image",
 
 
 
 
 
 
 
 
 
 
52
  className: macondo.className,
53
  initialSituation,
54
  initialActionnables,
 
48
  export const game: Game = {
49
  title: "Pharaoh",
50
  type: "pharaoh",
51
+ description: [
52
+ "The game is a role playing adventure set in ancient egypt.",
53
+ "The player is Ahmose, a scribe asked by the Pharaoh to investigate ancient ruins about an unknown deity.",
54
+ "The player can click around to move to new scenes, find or activate artifacts.",
55
+ "They can also use objects from their inventory.",
56
+ ],
57
+ engines: [
58
+ "cartesian_image",
59
+ "cartesian_video",
60
+ "spherical_image",
61
+ ],
62
  className: macondo.className,
63
  initialSituation,
64
  initialActionnables,
src/app/games/pirates.ts CHANGED
@@ -114,7 +114,17 @@ const initialSituation = [
114
  export const game: Game = {
115
  title: "Pirates",
116
  type: "pirates",
117
- engine: "cartesian_image",
 
 
 
 
 
 
 
 
 
 
118
  className: lugrasimo.className,
119
  initialSituation,
120
  initialActionnables,
 
114
  export const game: Game = {
115
  title: "Pirates",
116
  type: "pirates",
117
+ description: [
118
+ "The game is a role playing adventure set in the world of pirates.",
119
+ "The player is Guybroom Threepence, a pirate apprentice who try to find the Crystal Monkey treasure by himself.",
120
+ "The player can click around to move to new scenes, find or activate artifacts.",
121
+ "They can also use objects from their inventory.",
122
+ ],
123
+ engines: [
124
+ "cartesian_image",
125
+ "cartesian_video",
126
+ "spherical_image",
127
+ ],
128
  className: lugrasimo.className,
129
  initialSituation,
130
  initialActionnables,
src/app/games/tensor.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { macondo } from "@/lib/fonts"
2
  import { Game } from "./types"
3
  import { InventoryItem } from "../../types"
4
 
@@ -58,8 +58,18 @@ const inventory: InventoryItem[] = [
58
  export const game: Game = {
59
  title: "The Tensor",
60
  type: "tensor",
61
- engine: "spherical_image",
62
- className: macondo.className,
 
 
 
 
 
 
 
 
 
 
63
  initialSituation,
64
  initialActionnables,
65
  inventory,
 
1
+ import { edu } from "@/lib/fonts"
2
  import { Game } from "./types"
3
  import { InventoryItem } from "../../types"
4
 
 
58
  export const game: Game = {
59
  title: "The Tensor",
60
  type: "tensor",
61
+ description: [
62
+ "The game is a role playing adventure set in the world that may be a simulation.",
63
+ "The player is Nua. They are a developer in a software development company in a bland city. By night they are a hacker. They have been contacted by a mysterious online entity called Mad Hatter, who believes the world is a simulation.",
64
+ "The player can click around to move to new scenes, find or activate artifacts.",
65
+ "They can also use objects from their inventory.",
66
+ ],
67
+ engines: [
68
+ "cartesian_image",
69
+ "cartesian_video",
70
+ "spherical_image",
71
+ ],
72
+ className: edu.className,
73
  initialSituation,
74
  initialActionnables,
75
  inventory,
src/app/games/trulad.ts ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { edu } from "@/lib/fonts"
2
+ import { Game } from "./types"
3
+ import { InventoryItem } from "../../types"
4
+
5
+ const initialSituation = [
6
+ `a generic guy enjoying his simple life, waving hello at his neighbors on his way to work`,
7
+ ].join(", ")
8
+
9
+ const initialActionnables = [
10
+ "door",
11
+ "person",
12
+ "food",
13
+ "car",
14
+ "window",
15
+ "floor",
16
+ "sun",
17
+ "computer",
18
+ "plant",
19
+ "sky"
20
+ ]
21
+
22
+ const inventory: InventoryItem[] = [
23
+ ]
24
+
25
+ export const game: Game = {
26
+ title: "The Trulad Show",
27
+ type: "trulad",
28
+ description: [
29
+ "The Trulad Show is a reality TV show about a generic guy called Trulad (usually dressed in a yellow shirt) who lives his normal, daily life",
30
+ "Trulad doesn't know he is filmed as the cameras are hidden.",
31
+ "The player is Director, and can influence the life of Trulad",
32
+ "The player can click around to move to new scenes, camera orientation, trigger events int he life of Trulad.",
33
+ "They can also use objects from their inventory.",
34
+ ],
35
+ engines: [
36
+ "cartesian_video"
37
+ ],
38
+ className: edu.className,
39
+ initialSituation,
40
+ initialActionnables,
41
+ inventory,
42
+ getScenePrompt: (situation?: string) => [
43
+ `documentary`,
44
+ `generic guy`,
45
+ `yellow shirt`,
46
+ situation || initialSituation,
47
+ ]
48
+ }
49
+
src/app/games/types.ts CHANGED
@@ -13,6 +13,7 @@ export type GameType =
13
  | "tensor"
14
  | "nexus"
15
  | "arizona"
 
16
 
17
  export interface Scene {
18
  actionnables: string[]
@@ -22,7 +23,8 @@ export interface Scene {
22
  export interface Game {
23
  title: string
24
  type: GameType
25
- engine: EngineType
 
26
  className: string
27
  initialSituation: string
28
  initialActionnables: string[]
 
13
  | "tensor"
14
  | "nexus"
15
  | "arizona"
16
+ | "trulad"
17
 
18
  export interface Scene {
19
  actionnables: string[]
 
23
  export interface Game {
24
  title: string
25
  type: GameType
26
+ description: string[]
27
+ engines: EngineType[]
28
  className: string
29
  initialSituation: string
30
  initialActionnables: string[]
src/app/games/vernian.ts CHANGED
@@ -68,7 +68,17 @@ const inventory: InventoryItem[] = [
68
  export const game: Game = {
69
  title: "Vernian",
70
  type: "vernian",
71
- engine: "spherical_image",
 
 
 
 
 
 
 
 
 
 
72
  className: imfell.className,
73
  initialSituation,
74
  initialActionnables,
 
68
  export const game: Game = {
69
  title: "Vernian",
70
  type: "vernian",
71
+ description: [
72
+ "The game is a role playing adventure set in the world of Jules Verne adventures, with heavy steampunk inspirations.",
73
+ "The player try to find a treasure on a mysterious island, and they search in Jules Verne's secret cabinet and atelier.",
74
+ "The player can click around to move to new scenes, find or activate artifacts.",
75
+ "They can also use objects from their inventory.",
76
+ ],
77
+ engines: [
78
+ "cartesian_image",
79
+ "cartesian_video",
80
+ "spherical_image",
81
+ ],
82
  className: imfell.className,
83
  initialSituation,
84
  initialActionnables,
src/app/interface/top-menu/index.tsx CHANGED
@@ -67,7 +67,7 @@ export function TopMenu({
67
  <div className="flex flex-row items-center space-x-3 font-mono">
68
  <Label className="flex text-sm">Rendering engine:</Label>
69
  <Select
70
- defaultValue={engine.type}
71
  onValueChange={(value) => { onChangeEngine(value as EngineType) }}>
72
  <SelectTrigger className="w-[300px]">
73
  <SelectValue className="text-sm" placeholder="Type" />
@@ -76,7 +76,16 @@ export function TopMenu({
76
  {Object.entries(engines)
77
  .filter(([_, engine]) => engine.visible)
78
  .map(([key, engine]) =>
79
- <SelectItem key={key} value={key} disabled={!engine.enabled}>{engine.label} ({engine.modelName})</SelectItem>
 
 
 
 
 
 
 
 
 
80
  )}
81
  </SelectContent>
82
  </Select>
 
67
  <div className="flex flex-row items-center space-x-3 font-mono">
68
  <Label className="flex text-sm">Rendering engine:</Label>
69
  <Select
70
+ defaultValue={game.engines.includes(engine.type) ? engine.type : game.engines[0]}
71
  onValueChange={(value) => { onChangeEngine(value as EngineType) }}>
72
  <SelectTrigger className="w-[300px]">
73
  <SelectValue className="text-sm" placeholder="Type" />
 
76
  {Object.entries(engines)
77
  .filter(([_, engine]) => engine.visible)
78
  .map(([key, engine]) =>
79
+ <SelectItem
80
+ key={key}
81
+ value={key}
82
+ disabled={
83
+ !engine.enabled || !game.engines.includes(engine.type)
84
+ }>{
85
+ engine.label
86
+ } ({
87
+ engine.modelName
88
+ })</SelectItem>
89
  )}
90
  </SelectContent>
91
  </Select>
src/app/main.tsx CHANGED
@@ -49,7 +49,8 @@ export default function Main() {
49
  const [game, setGame] = useState<Game>(getGame(gameRef.current))
50
 
51
  const requestedEngine = (searchParams.get('engine') as EngineType) || defaultEngine
52
- const [engine, setEngine] = useState<Engine>(getEngine(requestedEngine))
 
53
 
54
  const requestedDebug = (searchParams.get('debug') === "true")
55
  const [debug, setDebug] = useState<boolean>(requestedDebug)
 
49
  const [game, setGame] = useState<Game>(getGame(gameRef.current))
50
 
51
  const requestedEngine = (searchParams.get('engine') as EngineType) || defaultEngine
52
+ const usableEngine = game.engines.includes(requestedEngine) ? requestedEngine : game.engines[0]
53
+ const [engine, setEngine] = useState<Engine>(getEngine(usableEngine))
54
 
55
  const requestedDebug = (searchParams.get('debug') === "true")
56
  const [debug, setDebug] = useState<boolean>(requestedDebug)
src/app/queries/getActionnables.ts CHANGED
@@ -47,7 +47,7 @@ export const getActionnables = async ({
47
  {
48
  role: "system",
49
  content: [
50
- `You are an API endpoint that can return a list of objects visible in the background image of a role playing game.`,
51
  basePrompt,
52
  `You must list twelve (12) basic names of visible objects (eg. "door", "person", "window", "light", "floor", "knob", "button", "rock", "tree", "parrot", "chest", "glass".. etc) but don't list any word from abstract or immaterial concepts (ig. don't list words like "secret", "danger", "next move", "game" etc)`,
53
  `The answer must be a JSON array, ie. a list of 12 quoted strings.`
 
47
  {
48
  role: "system",
49
  content: [
50
+ `You are an API endpoint that can return a list of objects visible in the background image of a game.`,
51
  basePrompt,
52
  `You must list twelve (12) basic names of visible objects (eg. "door", "person", "window", "light", "floor", "knob", "button", "rock", "tree", "parrot", "chest", "glass".. etc) but don't list any word from abstract or immaterial concepts (ig. don't list words like "secret", "danger", "next move", "game" etc)`,
53
  `The answer must be a JSON array, ie. a list of 12 quoted strings.`
src/app/queries/getBackground.ts CHANGED
@@ -35,7 +35,7 @@ Here is the original scene in which the user was located at first, which will in
35
  {
36
  role: "system",
37
  content: [
38
- `You are the photo director of a role video game.`,
39
  basePrompt,
40
  `You are going to receive new information about the current activity of the player.`,
41
  `Please write in a single sentence a photo caption for the next plausible scene, using a few words for each of those categories: the environment, era, characters, objects, textures, lighting.`,
 
35
  {
36
  role: "system",
37
  content: [
38
+ `You are a photo director.`,
39
  basePrompt,
40
  `You are going to receive new information about the current activity of the player.`,
41
  `Please write in a single sentence a photo caption for the next plausible scene, using a few words for each of those categories: the environment, era, characters, objects, textures, lighting.`,
src/app/queries/getBase.ts CHANGED
@@ -16,6 +16,7 @@ export const getBase = ({
16
  : initialPrompt
17
 
18
  const userSituationPrompt = [
 
19
  `Player is currently in "${currentPrompt}".`,
20
  lastEvent
21
  ].join(" ")
 
16
  : initialPrompt
17
 
18
  const userSituationPrompt = [
19
+ game.description,
20
  `Player is currently in "${currentPrompt}".`,
21
  lastEvent
22
  ].join(" ")
src/app/queries/getDialogue.ts CHANGED
@@ -41,10 +41,10 @@ Here is the original situation, which will inform you about the general game moo
41
  {
42
  role: "system",
43
  content: [
44
- `You are the AI game master of a role video game.`,
45
  `You are going to receive new information about the current whereabouts and action of the player.`,
46
  basePrompt,
47
- `You must imagine a funny response to speak in reaction to what the player did, like in some old point and click video games.`,
48
  `Please only write between 2 to 3 short sentences, please.`,
49
  `Please add a few funny puns and jokes.`,
50
  `But please don't say things like "Well, well, well" or "Ah, the classic combination of" it is annoying.`
 
41
  {
42
  role: "system",
43
  content: [
44
+ `You are an AI game master.`,
45
  `You are going to receive new information about the current whereabouts and action of the player.`,
46
  basePrompt,
47
+ `You must imagine a funny response to speak in reaction to what the player did`,
48
  `Please only write between 2 to 3 short sentences, please.`,
49
  `Please add a few funny puns and jokes.`,
50
  `But please don't say things like "Well, well, well" or "Ah, the classic combination of" it is annoying.`