|
![]() |
#1 |
Rookie
Join Date: Oct 2019
Location: Italy
Age: 59
Posts: 7
![]() |
![]()
Hi
![]() as my first post, I have quite a lot of things to tell. First of all thanks to all the people who contributed and mantained Angband over the years. I met the V Angband code around the 3.x versions, on my glorious Amiga. I planned in the past to do great solo things in Angband development, but you know what is the end of great individual plans, moreover if one don't knows at all what a rogue-like game is ![]() In these days I'm sick at home, so I started again to play with Angband source code with a more realistic approach... I setup a dev environment on my Win PC (Mingw/Cygwin, CodeBlocks, local SVN), forked my copy on GitHub, subscribed the Forum and checked the IRC channel. I'm experienced in C/C++ and other languages development, I like O.O. programming, code organization and refactoring. I hope I can contribute on the last two themes, if I will not be completely distracted again by future life and work events. BTW, over the years I had no advancement in undestanding what a rogue-like game is ![]() Sorry for the long OT introduction. Turning back to the subject, I took a look at the game initialization and datafiles parsing. I had to write down a list/map of all this stuffs, because I got lost several times wandering the code: I don't know if what follows is a concern on not, debated or less, and if someone is working on this. IMO, a few points:
Ok, it is more than enough. Thank you for following me until here ![]() ![]() If any of the previous points is of interest, I need some help to clear up minor doubts and eventually submit the changes. Anyway, I had my fun and pleasure in exploring the always interesting and challenging Angband code, and in letting you know ![]() Hugs, Marco. |
![]() |
![]() |
![]() |
#2 | ||||
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,641
Donated: $60
![]() |
Interesting post, and you make some good points. Since becoming maintainer most of the work I have done on datafile parsing has been adding new stuff to parse. I have done a little re-organisation here and there, but have mainly been adding to your diagram rather than simplifying it
![]() Anything I say below is from my limited understanding; comment from takkaria and other devs might invalidate some of it. Now, my comments: Quote:
Quote:
Quote:
Quote:
Thinking about this has been very helpful for me - I hope it has helped you a bit too.
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
||||
![]() |
![]() |
![]() |
#3 | |||
Rookie
Join Date: Oct 2019
Location: Italy
Age: 59
Posts: 7
![]() |
Thanks a lot Nick.
Quote:
![]() Quote:
![]() Got it! ![]() Quote:
![]() All your other explanations have also been very helpful to me! Now it's time for me to contiune writing some code, I suppose... |
|||
![]() |
![]() |
![]() |
#4 |
Knight
Join Date: Jan 2017
Posts: 862
![]() |
|
![]() |
![]() |
![]() |
#5 |
Rookie
Join Date: Oct 2019
Location: Italy
Age: 59
Posts: 7
![]() |
|
![]() |
![]() |
![]() |
#6 |
Rookie
Join Date: Oct 2019
Location: Italy
Age: 59
Posts: 7
![]() |
Just to let you know it, I made a commit in my angband branch for the first step of refactoring datafile parsers organization. I think that who is interested can explore the changes on my GitHub branch (MarcoAngband), or I have to do a merge request?
Beyond the .c/.h modifications, the makefiles are yet to be updated. I can try to do this. As you can see I also have a new signature ![]() ![]()
__________________
/* * Don't let the perfect be the enemy of the good */ |
![]() |
![]() |
![]() |
#7 | |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,641
Donated: $60
![]() |
Quote:
When you've done that, you can either make a pull request, or just mentio it here and I can pull your code in directly.
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
|
![]() |
![]() |
![]() |
#8 |
Prophet
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,968
Donated: $40
![]() |
I also suggest stsrting with an unmodified branch, and rename the files you started from so we can see your changes. Right now, it is very hard to figure out what you have done.
$ git mv monster-init.c init-monster.c ... $ git commit $ git checkout init-monster.c .... |
![]() |
![]() |
![]() |
#9 | ||
Rookie
Join Date: Oct 2019
Location: Italy
Age: 59
Posts: 7
![]() |
Quote:
I had already chosen to separate this refactoring in two phases, the first to reorganize the code between the source files (2^ and 4^ bullet of my original post), with minimal changes to the code, and the second to review the activation of the parsers by the init modules (1^ and 3^ bullet). But the first phase is quite tricky. Quote:
In this first phase, I need to mv two sourcefiles (mon_ & obj_init.c), deleting the respective .h, and create three others new init-xxx.c, then copy the code of some file_parsers in the new destinations and delete it from the old. In this process, some other changes are required, and I will do my best to keep them at the minimum, even if my editor discards the whitespaces at EOL. I plan to keep only one single init.h, the same way there is only a single cmds.h. I would like to incorporate hint.h into store.h and then delete it, but this is not strictly necessary. How can I do all that? It's not only a matter of bare git commands syntax knowledge, but how I can use them to better clarify what I'm doing. Maybe I missed some guidelines, my fault. I can undo my current commit and restart anew? I can mv and rm in a single pass the above files, then issue one commit? Then I can create the new files, move the code, modify the makefiles and finally issue another commit? I think I can group the commits in a single pull request.
__________________
/* * Don't let the perfect be the enemy of the good */ Last edited by Marco; November 7, 2019 at 02:15. |
||
![]() |
![]() |
![]() |
#10 | ||
Rookie
Join Date: Oct 2019
Location: Italy
Age: 59
Posts: 7
![]() |
Quote:
I searched all the configure/make files for occurences of sourcefile names, and I found only two of them worthy of attention, Makefile.src and Makefile.inc, but I'm not sure which one (or both) to change, following what you outline. Quote:
The idea of maintaining a local SVN to track changes locally and committing only the final result on GitHub was not so good, or maybe not good at all. I guess I can work directly on my local (PC) copy of my branch.
__________________
/* * Don't let the perfect be the enemy of the good */ |
||
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Just checking - starting a new game won't affect a saved game with another char? | Petoften | Vanilla | 1 | July 11, 2018 10:15 |
Commit c06af23: error in refactoring | PowerWyrm | Development | 1 | October 16, 2016 00:25 |
Commit 878cd0d: error in refactoring | PowerWyrm | Development | 1 | October 12, 2016 22:55 |
[3.5-dev] Monster opening/bashing refactoring | PowerWyrm | Vanilla | 3 | June 27, 2013 13:19 |
[3.5-dev] Store refactoring | PowerWyrm | Vanilla | 5 | May 27, 2013 14:25 |