I'm not
directly answering your question here... so my apologies. I'm just throwing in my 2 cents:
How do you create a save file for a game, that is not a separate file? |
Are you talking about a
save file? Or a data file?
IE... a user's saved game vs. something like level data.
If you mean the former, you can't really. Your options are an external file, modifying the executable file, or doing something "hidden" like making registry entries. (Note: 2 of those 3 approaches are absolutely horrible and you should not do them -- just use a file)
If you mean the latter (a data file) then resources are an option... but a bad one. External files allow for more flexibility and do not require you to recompile the program whenever you change them. Plus, the entire exe is loaded into memory before it's run and if you have a ton of resources that don't all need to be loaded immediately, it's kind of wasteful.
As for how to actually make resources with C::B... I couldn't tell you. Sorry. =(
Also note that the interface for accessing resources is typically not portable. So if you try to make an .rc file and access the resources with WinAPI function... then your program becomes Windows-only.
My problem is that it is very easy to modify the text file, |
That's a good thing. It's kind of the whole point of using text files. They're human readable so you can go in and modify them without having to mess with code.
If you are worried about people cheating by going in and changing the level data or whatever... you can throw in some basic encryption. But who cares if people want to cheat? Let them.
If that makes it more fun for them, that's good, right? (Unless it's like some online thing where it screws other people... but I'm assuming that's not the case here)
and it is annoying to have to copy and paste several files if you want to use a copy of the game. |
Put it all in a .zip or something. You should probably be doing that anyway even if it's just the exe. zips are a fraction of the size so they're more reasonable to distribute.
Anyone will know what to do with a zipped game if you give it to them: unzip it and run the exe file. Doesn't get much simpler.
I have a feeling that it may be to do with resource files, but I'm not exactly sure [..] whether you can modify them dynamically. |
You can't. Resources get compiled into the executable binary (ie: the exe file). Modifying them would result in modifying the exe itself, which is generally a very bad idea.