Brainstorming Git-Style Development
-
Requirements
NOTE!!
None of this has been validated yet. Just brain-dumping the main outline of the process.
Users would be required to install at least the following:
Software(link) Description GitBash manages pushing and pulling information from the global repo nasher manages unpacking/packing/compiling module locally neverwinter.nim tools for unpacking/packing module resources (required by nasher) nwnsc command line NWScript compiler (required by nasher) Installation
Nasher requires a separate directory outside the
Neverwinter Nights
folder. It uses the resources there to unpack and pack the module/haks and therefore needs to be stored somewhere else.Tools (nasher, gitbash, etc.) should be installed and made available in the PATH environment variable.
Open a PowerShell window or ISE.
cd $home mkdir nasher cd nasher mkdir tools mkdir downloads mkdir Arabel cd downloads wget https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.1/Git-2.41.0-64-bit.exe -OutFile Git-2.41.0-64-bit.exe wget https://github.com/squattingmonk/nasher/releases/download/latest/nasher_windows.zip -OutFile nasher_windows.zip wget https://github.com/niv/neverwinter.nim/releases/latest/download/neverwinter.windows.i386.zip -OutFile neverwinter.windows.i386.zip wget https://github.com/nwneetools/nwnsc/releases/latest/download/nwnsc-win-v1.1.5.zip -OutFile nwnsc-win-v1.1.5.zip cd ..\tools Expand-Archive -Path ..\nwnsc-win-v1.1.5.zip Expand-Archive -Path ..\neverwinter.windows.i386.zip # Nasher has to be different Expand-Archive -Path '..\nasher_windows.zip' Move-Item -Path 'nasher_windows\nasher.exe' -Destination '.\nasher.exe' Remove-Item '.\nasher_windows' -Recurse
Note to self: Need to come up with an "update all the tools" script, also.
Run the Git installer in the downloads folder.
Add
%USERPROFILE%\nasher\tools
to the Windows System PATH or User PATH environment variable (Google is your friend).Development Process
!!WIP!! This is still being developed. !!WIP!!
Note: This assumes a very simplistic approach where everybody is directly using the master branch and not doing any type of pull requests or dev/master/release strategy. This is not ideal, but probably easier for most folks.
You don't have to "check out" or "reserve" the module for work when using a Git-style development process. Everybody works on a local copy and pushes/pulls the contents around between their local repository and the "one true source" (the master branch at "origin" in git terms).
Also, multiple people working on the same item or area will cause conflicts that cannot be resolved. This would have to be coordinated verbally - "Hey, I'm working on area XXX - Interior Blah for the next couple of hours." Conflicts with NWScript files can be dealt with since the files are easily understandable/modifiable.
Conflicts can be reduced by COMMITTING YOUR CHANGES OFTEN. Small incremental changes are easier to deal with, less likely to cause conflicts, and generally promote sanity. The only painful thing is that because Windows is dumb, you must Save and Exit the toolset otherwise the module is locked and cannot be read by nasher.
Storytellers and Builders would have to use this process as well.
All examples below are run in Git Bash.
First Time Setup For Nasher
cd ~/nasher # nasher.cfg file is already in the repo. git clone HTTP://<link to repo here>
Using Git Bash
A typical session of development would look like this (with comments):
cd ~/nasher/Arabel # Update the local repository with any changes from the global repo git pull # Build the module from any changes from upstream nasher install # At this point, you would open the module and do any changes/creation/scripting you like. # Once you are done, "Build module" and Save/Exit the toolset. # Pull any toolset changes into nasher nasher unpack # If any new elements (areas/scripts/etc.) were added, git needs to know. git add -A # Commit changes to the local repo # Descriptive (but short) commit comments (in quotes) are a must. git commit -a -m "Added new area. Changed script abcd_xyz" # Push the changes from the local repo to the remote git push remote
Deployment process
On the server side, building the module is similar to the development process.
Install all the required tools (Deth will handle)
cd ~/nasher # Pull remote changes git pull # Build/install the module nasher install # TBD - error handling? Compile errors, etc.?
Items For Discussion
- Release management with dev/master/release branches?
- Should builders have to submit pull requests?
- Code reviews?
- All users would need their own GitLab accounts. Period.
- Conflict handling.
Updating The Toolchain
WIP - need to figure out how to handle nwnsc that puts it's stupid version number in the file name.
cd $home\nasher\downloads Remove-Item * -Recurse -Force # Git needs to be handled separately. # wget https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.1/Git-2.41.0-64-bit.exe -OutFile Git-2.41.0-64-bit.exe # These always pull the latest versions wget https://github.com/squattingmonk/nasher/releases/download/latest/nasher_windows.zip -OutFile nasher_windows.zip wget https://github.com/niv/neverwinter.nim/releases/latest/download/neverwinter.windows.i386.zip -OutFile neverwinter.windows.i386.zip wget https://github.com/nwneetools/nwnsc/releases/latest/download/nwnsc-win-v1.1.5.zip -OutFile nwnsc-win-v1.1.5.zip cd ..\tools Remove-Item * -Recurse -Force Expand-Archive -Path ..\nwnsc-win-v1.1.5.zip Expand-Archive -Path ..\neverwinter.windows.i386.zip # Nasher has to be different Expand-Archive -Path '..\nasher_windows.zip' Move-Item -Path 'nasher_windows\nasher.exe' -Destination '.\nasher.exe' Remove-Item '.\nasher_windows' -Recurse
- Release management with dev/master/release branches?
-
I have used something similar in the past and it is really, really good. All you need to think about really is if you are changing an area, but maybe github has a solution so you arent able to edit something someone else is working on?
-
@puffy No. NWN files are horrendously complex and have relationships between multiple files in a lot of cases (are, git, gic files, for example). Nested arrays of nested arrays. Trying to merge two people's changes to the same area/item/creature (anything but NSC or 2DA files, really) is not possible.
-
Yes, what I meant is if there is a way to make sure you can't, so that if someone is editing a file its "locked"?
-
@puffy Also no.
-
Here's a couple alternative tools that can make using git on windows a little easier:
-
Github desktop is also an easy way to use github stuff, if all you wanna do is get the latest version, then push your changes.
-
This is the one I'm familiar with, but it's been a decade since I used it lol
-
Case of whatever works for you really, they all do the same thing with different interfaces
-
F folklore moved this topic from Team Lead Forums on