CQUI_Community-Edition icon indicating copy to clipboard operation
CQUI_Community-Edition copied to clipboard

"How to contribute" for dummies...

Open AlexandreDecan opened this issue 6 years ago • 14 comments

Previous CQUI was abandonned notably because not so many people were involved in its development (and it wasn't easy to start contributing to the project).

I really would like to contribute to the mod. Even if I'm not fluent with the involved languages, I think that many issues can be addressed despite of that. The problem is "I don't know how to contribute". Not that I don't know how to use Github, but I don't know how to set a development environment for this mod. RTFM is probably a good answer, but I don't have the time to (1) find and (2) read a lot of (perhaps outdated) documentation on this topic. I believe I'm not alone in that case, and I think it could be interesting to provide some "CQUI contributions for dummies" guideline.

This should ideally include:

  1. Links (or a full "tutorial" if you have time) to explain how we can set a development environment for Civilization 6 (I use to play on Windows, but I use to develop on Linux, so the platform is not a big deal).
  2. What kind of help do you expect from people? Do you want them to test the latest snapshot to find bugs? Do you want them to fix identified bugs, or to implement new functionnalities? As a proxy for that, you could perhaps add labels to some issues ("need help", "easy to fix", "easy to address", ....)
  3. Share your experience in some PR, and add links to them in the readme (or in any "how to contribute" resource). Your experience is probably the most valuable thing we can learn from. Please share it ;-)

Finally, I think it could be interesting to add some information on the Steam page for this mod explaining the development status (ie. can the current version be used to play the game?). First, I think that many players won't come to Github to get this information and will be happy to read it on Steam, and secondly, this will prevent many annoying comments on Steam ;-)

AlexandreDecan avatar Oct 23 '17 14:10 AlexandreDecan

I'm not a contributor to CQUI (yet), but I wondered about the same. While we wait, here's a good starter for the SQL part at least: https://forums.civfanatics.com/threads/tutorial-modding-with-sqllite-studio-pc.608352/ Note that azurency added a checklist of work to be done in a comment of the previous issue. It also contains some initial judgement like easy to fix etc. I kinda won't start looking into those unless I know no one else is working on them, though. @Azurency If you have no need of further developers, I'd also start testing stuff as soon as I see commits to the Fall branch

Timmeey86 avatar Oct 23 '17 18:10 Timmeey86

Yes, we'll need more contributors for sure. I'm going to focus on updating the mod first before maybe creating a wiki how to contribute or something like that, I'll keep you updated here.

In the previous repository, Chaorace already labeled some issues easy but maybe I will change it to what GitHub seems to be pushing forward good first issue.

Just some quick answer to your points @AlexandreDecan :

  1. It's just simple Lua files and xml files, I personally use my favorite code editor (VSCode) on my Mac and test things out on windows, it's important however to test on windows because the Mac OS/Linux versions sometime do not behave the same way.
  2. We want everything ;) Fix identified bug should be a priority, but there's plenty of stuff to do, 100 issues to have fun with.
  3. Well there's nothing so deep, maybe some recommendations, Chaorace made a nice wiki in the old repository here https://github.com/CQUI-Org/cqui/wiki/How-to-contribute-to-CQUI and I still stick to its recommendations and coding style

What you can do now For now if you know what you're doing when merging files, you can fork and start by merging some of the files I labelled as "easy" in #152 maybe look at what Sparrow is doing in #155 but tell us so we don't all work on the same things

Azurency avatar Oct 23 '17 22:10 Azurency

https://github.com/CQUI-Org/cqui/wiki/How-to-contribute-to-CQUI seems to be a valuable starting point. I'll try to install Civ6 SDK asap and play with it. Thank you! I'll keep you informed before I try to address an issue.

AlexandreDecan avatar Oct 24 '17 08:10 AlexandreDecan

You don't even need the SDK. I did all my code for CQUI in plain good old Notepad++ (and I did plenty). Testing is the "worst" part, very time consuming, especially when trying to compensate for the stupid bugs Firaxis introduces deep within their codebase and NEVER fixes (and they did plenty). So, if you want to contribute LUA (the huge majority of any UI mod), stick with excellent, free Notepad++.

ricanuck avatar Oct 24 '17 17:10 ricanuck

I'm used to Atom, so the editor is not an issue ;-) Considering what you said about the SDK, I hope there are other ways to test a mod, otherwise this is going to be very time consuming. Wasn't FireTuner specifically designed for this purpose? According to the description, it is supposed to ease development and debugging without having to restart the game again and again...

AlexandreDecan avatar Oct 24 '17 18:10 AlexandreDecan

As far as I know, you cannot reload lua files while in game (which would be exactly what we UI modders need). I.e. Paradox games let you do just that through the in-game console, so you change the UI code, reload that specific lua file, and test... it's a breeze. Firaxis, on the other hand, well... it's not Paradox... by far. That's why I said you don't need the SDK. Nothing wrong with having it installed, on the other hand, if you go on to test other things (like map scripts).

ricanuck avatar Oct 25 '17 01:10 ricanuck

Ok, I now understand why you spoke about a "very time consuming part" ;-)

AlexandreDecan avatar Oct 25 '17 06:10 AlexandreDecan

Although Firetuner helps with pinpointing Lua erros faster, so install it and play with it. With time, you will "know" where to find your lua errors just by judging the behavior of your new code, but that comes with time, so just try the SDK and see if it helps you or not.

ricanuck avatar Oct 25 '17 16:10 ricanuck

Just found a somewhat relevant post on Steam that may help you guys save some time:

http://steamcommunity.com/app/289070/discussions/0/340412122414285707/#c340412122414417560

It is a post explaining which file to replace of one of the startup videos (the one with dev/publisher/AMD crap) with a 1 second video of only black. Someone also has a google drive link to just such a replacement video. Should save some time if you are loading over and over...

BlackSmokeDMax avatar Oct 25 '17 17:10 BlackSmokeDMax

There's hot reload for Lua context files. And the mod is reloaded when you load a game, so no need to restart (or only if there's some nasty caching sometime that needs to be reset).

Azurency avatar Oct 25 '17 18:10 Azurency

@ricanuck I just changed a button size in governmentscreen.lua and opened the Government Panel again ingame => the button displayed a different size than before I changed the file, without restarting Civ 6 and without leaving the active game.

Timmeey86 avatar Oct 25 '17 19:10 Timmeey86

really? that's good news. didn't work like that before... maybe they added some modding functionality in the last 2 patches? That would be a big positive for the last patch (after the Summer fiasco, especially). Will try it out soon, maybe that will push me over the fence and make me return to the modding scene after all...

ricanuck avatar Oct 25 '17 19:10 ricanuck

Ive also found certain .lua will load instantly but others require a reload off the saved game (not completely quitting the game). Most UI changes can be edited and seen instantly apart from Localization text and icons

sparrow8332 avatar Oct 25 '17 21:10 sparrow8332

It's because if you want the hot reload to work as you want, you have to use these functions :

ContextPtr:SetInitHandler(... to get the cached values);
ContextPtr:SetShutdown(... to set cached values);
LuaEvents.GameDebug_Return.Add( ... to restore the cached values);

-- And here are the functions that add values to the cache context :
LuaEvents.GameDebug_GetValues( ... )
LuaEvents.GameDebug_AddValues( ... )

Azurency avatar Oct 25 '17 21:10 Azurency