I'm developing a text based game and was wondering if there will be any issues if I were to just write all the text in the code instead of making something like a csv file to read the data from. It won't be as organised, but I was wondering if the game would take more memory or have worse performance if I were to put the game in code instead of a text document or csv file.
Data, as name suggests, are information processed and stored in files or folders by computer, translated into form that is efficient for movement or processing and can be in form of text documents, images, audio clips, etc. Programs are collection of software instructions understandable by CPU.
a file is a named collection of information that is recorded on some kind of storage device, while a document is a type of file that has been created by a particular software application, and can be manipulated by that application (e.g. a word processing document).
The most important difference between My Documents and Application Data is that My Documents is where users store their files, whereas Application Data is where programs store their files.
A file is the common storage unit in a computer, and all programs and data are "written" into a file and "read" from a file. A folder holds one or more files, and a folder can be empty until it is filled.
Some advantages and disadvantages:
Room cave = new Room("Cave", "Long description ...")
.cave.ConnectsTo(passageway)
, cave.Contains(sword)
, ...In terms of memory consumption it's a wash - the strings will be in memory in either case - unless you are writing a huge game in which case a database would be more appropriate with the ability to easily load individual areas of the map and eject ones no longer needed from memory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With