angular-rpg
angular-rpg copied to clipboard
Fixed encounters missing in spreadsheet
I'm submitting a...
[x] bug report [ ] feature request
Seems like the game state is initialized from some spreadsheet, and the initial state read from this spreadsheet contains only 5 fixed encounters: sewer-kobolds, sewer-kobolds-elite, world-plains-snakes, fortress-guard, fortress-wizard.
However, the map contains additional encounters, such as goblinArchers
. Since they don't appear in the game state, you get an exception in the console when you go to the relevant map square.
Thanks for reporting this, I don't think I've really documented the game data spreadsheet anywhere. There's a lot going on here so let me talk about two things:
Missing encounters
This project is originally based on a coffeescript game demo called E.B.U.R.P. that had much more content. I stripped away all of the game code, converted the maps to a standard (Tiled
) format, and kept the sprites/sounds.
The reason there are missing encounters is that I never got around to re-implementing them. Because the maps were ported, they still have bits that used to be wired up to the old game engine.
In order to fix the problem, you'd want to add a new encounter to the spreadsheet, clear your game save and reload. I think I put in a debug flag like ?debug
that you can put on the end of the URL to force it to sync with the Google sheet every time the app loads, but it's been a long time so I'm not sure if it still works.
Motivation behind the Google Spreadsheet
The idea behind the "game data" spreadsheet is that when making a game, designers need to quickly tweak values, and when those values are in a codebase it puts the developer between the designer and making changes.
I would eventually like to remove the dependency on Google Sheets, but it works as a GREAT way for easily tweaking game items/values/encounters/classes. Building a data editor UI is pretty involved, so using Google Sheets gets a badass editor with full undo/redo/formulas/validation/etc for almost free.
If you're curious, all of that data is imported into the game via the game-data
reducers, actions, etc in models/game-data
. It uses a library called TableTop
to interact with Google sheets, and the spreadsheet itself is just a "published" sheet whose ID is stored in game-data.model.ts
It turns out the sheet was not shared publicly... 😓 so I shared it: https://docs.google.com/spreadsheets/d/1LXSRyupQanOYeZv-h7lgSwaAzB-TxwfDPFJyZqnaewc/edit#gid=0
Forking the game spreadsheet
If you wanted to have your own custom game with its own encounters and whatnot, you could make a copy of that spreadsheet, "publish" it to get a shareable URL, then set it in the game (currently game.component.ts
) like this:
this.store.dispatch(new GameDataFetchAction("YOUR_CUSTOM_SHEET_ID"));
If you're not radically deviating from the existing setup, I'd be happy to allow you to edit the main spreadsheet.
Cool, thank you so much for the detailed explanation!
I just created a fork and added the goblin-archers
fixed encounter. Can you please have a look and let me know if it looks legit?
https://docs.google.com/spreadsheets/d/1X9mW5_zshqJcK8abrlmEAT6jbkM0HwMtd_1_cEPwA3I/edit#gid=1428526564
Yeah, that looks right. 👍
The enemies
column is a string of 1-n enemies (I think the combat map only has nine slots?) separated by a |
pipe. So as long as the items you're referencing between the pipes correspond to some entry with a matching id
in another table, it should be good to go.
The message
column is also a |
delimited array. If you specify pipes in a message they should show up one after another as a prompt when combat starts.
You'll probably need to update the map file to change that metadata as well. If you're unfamiliar, the editor used is free and is called Tiled
: http://www.mapeditor.org/
You can open up the goblin fortress file (src/assets/maps/fortress2.tmx
) in Tiled, or you can edit it in any code editor.
The version I have looks like this:
Hopefully, you can drop most of that metadata (because it will be fetched from the spreadsheet) and the result should look more like this:
The other thing that might be useful to know is how the icons are mapped. All the sprites have a source file name in src/art/sprites/**/*.png
. The files inside that hierarchy should have unique names (i.e. no items/wand.png
and weapons/wand.png
) therefore files are referenced only by their name. This means you can look in that art folder and find an image you want and just use the filename to reference it in the spreadsheet.