The reason I originally chose Unity is their distribution. I want as many people to have access to my game as possible once it's done. But it's tough because if Unreal can do enough more, it might draw more people to the game. It's a quandary I'm sure many here have battled. Either way I have to learn to code in the native language of the engine I choose.
Well it's up to you really, you could look at the features of both and try and get an idea of what would benefit you more.
That makes sense. I'm still not sure how stuff gets from my code into memory, but I am able to give my "player" stats that can be recalled later by another script, so I know I am doing it.
Without going into a huge rant with traditional code the goal is to turn a text file(source code) into machine code(numbers in memory that act as instructions the CPU can run.) There are different ways of getting to that goal, scripts are basically text files that use the rules of a certain language(C# for example) but other than that they are just text files. The goal is for the game engine to take your script and use some wizardry to make it execute machine instructions at the endpoint.
Pretty much all data the computer is working with is in memory, the CPU reads instructions and executes them. Maybe it reads a number from a spot in memory, adds a number to it, then sets that memory to the resulting number. In scripts you're essentially reserving a space in memory whenever you create a variable. Int i = 3; In most languages that gives you a chunk of memory of size int and sets it to value 3. Code is literally just millions of math instructions modifying memory. When you play a game anything that you can see is currently loaded into memory, any number is a game is either loaded in memory or has to be grabbed from storage before you use it(a very slow process.)
but I know soon I will need to learn to make save points or auto-save. I'm still working on battling and dialog, because without leveling or making choices there's nothing to save.
Everything is essentially broken up into functions in most modern programming languages. Functions being blocks of code that you can "jump to" and run and then jump back when you're finished. Scripts follow the same premise, you might write some code somewhere to save your game data, then you can call that code whenever you get into a situation where you need to save the data. Maybe your character just collided with a save point then he clicked yes on a dialogue box, the dialogue box could call your save code. You can think of code as building blocks.
This makes sense. I feel like whichever language I use, once it clicks I will learn as much about it as I can, as that's how I generally am with things, but I don't want to underestimate my project and wind up having to rewrite everything.
Honestly a lot of this stuff has to be learned by experience, you will end up writing awful code and rewriting things because coding is so deep that you often have to write something before you understand what you could have done better with it. It's like cooking, you can teach anyone the basics of cooking but it takes experience to know how to cut up, cook and season the perfect roast chicken.
Would you say XML is a good way to store things like current Level/HP/MP/Exp/Gold/Inventory? I wanted originally to write the game in a manner in which I can look at one file and read all the stats/player choices etc.
Just pick something and do it and see how it works. A lot of people(myself included) start coding with this attitude of "I have to do everything the best way/efficiently" after awhile you learn that getting the thing working is the basic and most important goal. Unless you have some reason you think multiple files is better, why not shove it all in one file? You can always change it later. As for XML, usually that just depends on your personal taste and what kind of data you're storing. Unity might offer prewritten code you can call that writes files in different formats. XML and JSON are probably the most generally used text formats.
I assume other scripts throughout playing would modify this file, like a int for current gold, or a bool for like didTalkToWizardinCave could be true or false and you can read that file to see what choice the player made. I am not sure if one file is the best place for all of this anymore though. What do you think?
No! Well, not quite anyway. That was what I was trying to get across, you don't want multiple scripts modifying one file, you want the data to -stay- in memory. When you start a new game or load a game you have an int somewhere representing gold amount, you either set this to a starter value or you load that value from storage. When code adjusts your gold amount it is adjusting the number in memory, not a file. It could take 10,000x longer to open a file and read that int, modify it and save it then it would to just keep changing it in memory.
My concern is if I eventually will want to. I know which point in the game I must write by myself to demo, but I will be expanding the project to include more people once it's playable up to a certain level. I want to make sure that once I start growing the project I don't find myself wishing I had chosen differently.
It's good to question but don't let it paralyze you, I can almost guarantee you will not find any feature between both engines that will ever make you want to port the entire thing after you've made any decent amount of content. You'll just work around it.
That's a lot to think about. I never thought about saving whether each chest that's out in the wild has been opened, or whether the character has spoken to an NPC yet or not. I'm going to have to I guess first figure out how to make an NPC that says one thing the first time you speak to them, and then something different every time after that.
It makes sense when you think about it. What if you opened a chest in a map an hour ago, saved your game 5 minutes ago then your game crashed and you had to load it up again. How would it know you opened that chest if it doesn't read it from a file? Anything you don't save to storage is lost when your program ends, just like everything in ram is lost if your computer shuts off. On the bright side you can save data like that pretty cheaply, something like a chest id and a true or false if it is opened. A few MB text file can contain massive levels of information, if its binary you can fit even more.
Do you know what a good resource is to read scripts that do something like this, or to learn what functions I must understand to write this stuff?
Google is the coder's friend, honestly it's hard to find how something works on demand. Often if I don't know how to do something I can spend many hours researching it, prototyping it, looking at games that do something similar. It's part of why knowledge is so powerful in game dev, when you know how to assemble something you can throw it together very quickly in the future. If you don't it's a big chore. Unity related sites will probably help you a lot with specifics, google can help with concepts.