View Single Post
Old November 2, 2019, 16:33   #3
Marco
Rookie
 
Marco's Avatar
 
Join Date: Oct 2019
Location: Italy
Age: 59
Posts: 7
Marco is on a distinguished road
Thanks a lot Nick.


Quote:
Originally Posted by Nick View Post
As far as I can see, this leaves the modules for non-datafile game data, and combines all the datafile data into the arrays module. This seems like a good idea, and also suggests to me that some of the non-datafile stuff should make its way into datafiles (messages is one I've long wanted to do, but it is a big job).
You explained it more more clearly than I thought BTW messages is really a big job!


Quote:
Originally Posted by Nick View Post
Originally all the parsing was in one file (well, two, but that's another story), and breaking it up as far as it currently is was probably a good idea. However, I think having init as a prefix (so init-obj rather than obj-init) is a decent plan. It's probably not a good idea to break up completely into one init file per datafile; object.txt, ego_item.txt and artifact.txt, for example, have enough things used in common (arrays of flags, etc) that it probably makes sense to keep them all in one file.
Yes, I can remember the old init1.c and init2.c . A good trade off IMO could be having a few files, just renaming obj-init and mon-init and adding the siblings for player, dungeon&stores, and the game as a whole (or misc stuffs).


Quote:
Originally Posted by Nick View Post
That seems completely sensible and much simpler.
Got it!


Quote:
Originally Posted by Nick View Post
So maybe datafile.c should contain just the file handling stuff, and the grab_*() functions could be moved to another file - init-util.c, maybe, if we're using init-*.c for intialisation files?
It seems to me like a good solution, if it is good for you and the other developers also. However, I have to admit that it is not strictly necessary, at least as a first step. We could start with the first three bullet of my original post, and see the result. Sorry, I'm always tempted to reorganize things a little too much, and someone once told to me that the "best" is enemy of the good.

All your other explanations have also been very helpful to me! Now it's time for me to contiune writing some code, I suppose...
Marco is offline   Reply With Quote