Author Topic: Trying out MonoAGS (AGS 5 candidate) : journal  (Read 3710 times)

tzachs

  • Local Moderator
  • AGS Baker
  • Mittens Vassal
  • Parking Goat- games that goats like!
    • I can help with translating
    •  
    • tzachs worked on a game that was nominated for an AGS Award!
Re: MonoAGS development log (AGS 5 candidate)
« Reply #40 on: 07 May 2018, 15:38 »
Maybe a NuGet package? So that the thingy can be recompiled by the maintainer(s) and then re-imported on the fly by all the people who use it?
I created a community channel on MyGet for this (currently empty). Everybody can push nuget packages there and pointing visual studio to that channel will help you find MonoAGS specific packages. I plan to make the standalone editor pointing to it by default in its "third party modules" future window.
To point visual studio to that channel, open the Package Manager Settings and create a new package source with this url: https://www.myget.org/F/ags/api/v3/index.json
To push a package to the channel, I think you need to sign in to MyGet and go to this url and then follow instructions: https://www.myget.org/feed/Packages/ags

Quote
On a different note: code-wise, how do you plan on binding an event function (such as : button.OnMouseClick(() => { .../* DO THINGS */ } ) ) from the in-game GUI? I have no trouble believing that the AGS Editor can simply insert some function name in game.agf and simultaneously insert an empty function with the same name in a game script file. It happens while the game is not running. But with Visual Studio, while the .exe is running, will that not be a bit tricky?
Yes, it's very tricky. I had a few (maybe naive, maybe not) thoughts on how to handle it, one is compiling tiny assemblies and side-load them, the other is to use an in editor interpreter, and if all else fails, then we'll fall back to "stop the game -> unload the exe -> recompile -> reload".

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: MonoAGS development log (AGS 5 candidate)
« Reply #41 on: 07 May 2018, 17:31 »
To point visual studio to that channel...
To push a package to the channel...
I don't have a perfect understanding of the packages workflow.
What i I want to  maintain a package? Do I need to have a code repo that builds the latest sources and pushes them onto the channel... and then on the other end I've got the code repo of my project that pulls the channel whenever there is an update?
 

tzachs

  • Local Moderator
  • AGS Baker
  • Mittens Vassal
  • Parking Goat- games that goats like!
    • I can help with translating
    •  
    • tzachs worked on a game that was nominated for an AGS Award!
Re: MonoAGS development log (AGS 5 candidate)
« Reply #42 on: 07 May 2018, 18:57 »
Kind of, yes. As a package maintainer you can either push a package to the feed via command line (so you can integrate it automatically on every change in a CI build in your source code repo, for example) or by browsing and selecting the nuget package manually from the MyGet website. To actually create a nuget package from your library, I think it's just a checkbox somewhere in the build options of the project in visual studio ("create nuget" or something like that) which creates a nuget package every time you build.
On the client side, in visual studio, for example, you'll see there's an update to the package in the solution explorer, and then you can right click -> update. It doesn't update automatically by default, but apparently there's a way to configure it for automatic updates (never tried it myself).

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: MonoAGS development log (AGS 5 candidate)
« Reply #43 on: 07 May 2018, 19:08 »
Since tzachs missed this one...

EDIT 3 : can you explain this piece of code
Add spoiler tag for Hidden:
In Rooms.cs :
Code: Adventure Game Studio
  1.    EmptyStreet = Task.FromResult(Find(state, EmptyStreet.Result));
  2.  

- I don't understand how EmptyStreet is populated after game gets loaded (in other words : how EmptyStreet is not null at the time "onSaveGameLoaded" gts called).
- I don't understand what is ".Result". Is it an "out" variable were find stores its result?
- More generally I don't understand the whole sequence.
    - Where does "Task" come from?
    - What's oldID versus ID? I'm guessing these are the IDs befaore/after load, but then again I fail to visualize the sequence of calls.


First of all we need to clarify the purpose of "static class Rooms". This is something like a game-specific manager class that simply keeps reference of the room-loading Tasks (not just the room themselves), storing them in the distinctly named variables.

The rooms, as objects, are also stored in the IGameState object (if you check its definition you'll see "Rooms" list).

IGameState is a "main" holder of rooms that keeps them in memory. I am not sure for what purpose, but guess there are built-in mechanics that process that list of rooms in IGameState by default.
And "static class Rooms" is just your own custom management system, for convenience.

I am also not sure how and where, but supposedly IGameState recreates all rooms in its list when it restores save, out of data written in a save file.
What you see in "onSaveGameLoaded" function, is a restoration of references inside this custom class "Rooms" after save is loaded.
Basically what it does, it creates a new Task in a already complete state using Task.FromResult API (Quote from doc: Creates a System.Threading.Tasks.Task that's completed successfully with the specified result.), and puts a new room object from IGameState, with ID identical to an old room object (that became no longer valid after loading the save).

Task is a generic (actually, there is a non-generic and generic kind), which has "result type" as a parameter, so yes, task.Result is an actual object, set by completed task process.
« Last Edit: 07 May 2018, 19:20 by Crimson Wizard »

cat

  • Mittens Baronet
  • AGS Baker
  • Now investigating MonoAGS
    • cat worked on a game that was nominated for an AGS Award!
      cat worked on a game that won an AGS Award!
Re: MonoAGS development log (AGS 5 candidate)
« Reply #44 on: 07 May 2018, 20:49 »
Before anything else, I want to say the following:
I took a somewhat deep look at the code and documentation yesterday. I have to say, I'm absolutely blown away by what you have achieved already, tzachs! It seems to be an almost feature complete new version of AGS in a clean coding style and thoroughly documented. Amazing what you have done so far all on your own.

And here I am back with more questions :P
  • What do I have to do to run the unit tests? Is there some additional stuff I need to install? I get the message "No test is available in D:\Daten\MonoAGS\MonoAGS\Source\Tests\bin\Debug\Tests.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again."
  • What files do I need to deploy of a game? Everything from DemoQuest.Desktop\bin\Release except .pdb?

About the code that needs to be manually written and the absence of actual puzzles in the demo :
I agree, there need to be templates instead of needing to copy stuff from the demo game.

Quote
So I'd suggest creating a separate library project in the solution with those features (the first of them being "rotating cursor", but I can give more examples : "scrolling inventory"). This library could then be included in each template (Sierra, 9-verb...).
I fully agree. I was surprised to see that RotatingCursorScheme is part of the engine when it should actually be more a built on top thing.

Basically what it does, it creates a new Task in a already complete state using Task.FromResult API (Quote from doc: Creates a System.Threading.Tasks.Task that's completed successfully with the specified result.), and puts a new room object from IGameState, with ID identical to an old room object (that became no longer valid after loading the save).
So, it's something similar to a promise?

tzachs

  • Local Moderator
  • AGS Baker
  • Mittens Vassal
  • Parking Goat- games that goats like!
    • I can help with translating
    •  
    • tzachs worked on a game that was nominated for an AGS Award!
Re: MonoAGS development log (AGS 5 candidate)
« Reply #45 on: 07 May 2018, 21:39 »
IGameState is a "main" holder of rooms that keeps them in memory. I am not sure for what purpose, but guess there are built-in mechanics that process that list of rooms in IGameState by default.
And "static class Rooms" is just your own custom management system, for convenience.

I am also not sure how and where, but supposedly IGameState recreates all rooms in its list when it restores save, out of data written in a save file.
Right, IGameState is the object that gets saved and loaded from the file, so basically everything that can change is part of the game's state, including the rooms. All variables that are created outside of game state (like if you simply do "int i = 5" instead of "int i = state.GlobalVariables.Ints.GetValue("MyVariable", 5)") will not be saved by default and it's your responsibility to load it after loading a game.

Crimson Wizard's explanation was spot on, note that this convenience Rooms game specific class will be automatically generated by the engine, including that boilerplate code of restoring the references after game load.

Quote
I took a somewhat deep look at the code and documentation yesterday. I have to say, I'm absolutely blown away by what you have achieved already, tzachs! It seems to be an almost feature complete new version of AGS in a clean coding style and thoroughly documented. Amazing what you have done so far all on your own.
Thanks! ;-D

Quote
What do I have to do to run the unit tests? Is there some additional stuff I need to install? I get the message "No test is available in D:\Daten\MonoAGS\MonoAGS\Source\Tests\bin\Debug\Tests.dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again."
"To run the unit tests, please install the NUnit 2 Test Adapter (available from Visual Studio, tools menu -> Extensions and Updates... -> Online)." (from the readme)

Quote
What files do I need to deploy of a game? Everything from DemoQuest.Desktop\bin\Release except .pdb?
If you just want to deploy for Windows, then yes.
To deploy for Mac & Linux, the executable itself will not be recognized by default. So you can either add a small shell script just with "mono mygame.exe", and request for users to install mono, or create a self-contained mono application like we mentioned before. Like I said, I haven't tried it yet, but this is the link with instructions: http://www.mono-project.com/docs/tools+libraries/tools/mkbundle/
To deploy for Android, see here: https://docs.microsoft.com/en-us/xamarin/android/deploy-test/publishing/

Quote
I agree, there need to be templates instead of needing to copy stuff from the demo game.
Yes, this will be part of the editor. Copying code is just a temporary thing for now.

Quote
I fully agree. I was surprised to see that RotatingCursorScheme is part of the engine when it should actually be more a built on top thing.
It's part of the engine in the sense that's in the same dll, but it's definitely a built on top thing, it's a layer above everything else with nothing depending on it, and it will be no trouble to move it to a template project once the editor is ready.

Quote
So, it's something similar to a promise?
Yes, Task is c# equivalent of a promise, and it powers async/await in c# the same way a promise powers async/await in javascript.

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: MonoAGS development log (AGS 5 candidate)
« Reply #46 on: 07 May 2018, 23:08 »
I've created my new local branch but I fail to publish it to the remote repo. I'm only offered to "push" it and even then I get this :
Quote
Error encountered while pushing branch to the remote repository: Git failed with a fatal error.
fatal: Could not read from remote repository.
It used to prompt me for my github credentials but now it doesn't anymore. I'm not sure if it's because they're accepted (and cached somewhere) and the problem comes after, or if that's the problem.
I've tried to do the push using the git command line but I cannot make heads or tails of all that command line crap (I make nightmares where Unix laughs at me because I'm not wearing pants). I can't even go past the simple line git remote set-url origin username:password@github.com/tzachshabtay/MonoAGS.git as shown here. It tells me that it's not a valid git location. I don't know if/where I should put https.

==========

In the meatime I'm adding my "middleware" library project to the solution. I've first had to install the ".Net Core templates" extension to my VS 2017 Community I had to go to the Visual Studio Installer and check ".Net Core Cross platform workload". Then I've added a ".Net Core library" project tot he solution. I've decided to call it "FakeAGS" :=

I'm in the process of creating the feed : https://www.myget.org/feed/Packages/fakeags
I'm reading this : https://weblogs.asp.net/bsimser/automatically-publishing-nuget-packages-from-github

What's annoying me right now is a design question : I'd like to keep my "FakeAGS" in the MonoAGS solution, to benefit from neighbour sources/autocompletion and easy testing, but if I understand correctly it has to be in an entirely different solution/repo to benefit from MyHub's auto build and push. Correct?

==============

I want to create a copy of "Demo" to create a variation of it for my own test purposes. I don't understand if that's the right way to do. After I copy and paste the "Demo" folder and its contents, and rename that copy "Demo2", Visual Studio seems to ignore it. How am I supposed to proceed anyway? Is it like "one instance of MonoAGS = one game" or "one instance of MonoAGS = several potential games"?

==============

EDIT : this bit solved. Since I didn't find how to simply force a Restore Packages, I closed the solution, deleted the .nuget folder, then re-opened it. Then I got the migration report, where, without surprise, the mobile projects were not imported properly (no Xamarin). I cleaned the solution and rebuilt it. It worked.
Quote
Is it absolutely necessary to build the mobile versions every time? Here is why I'm asking: I don't know how I've done it, but yesterday I've managed to build and run the desktop version without having Xamarin installed. But today I do a rebuild and it won't restore the packages unless the Android project builds properly (therefore, the build fails). And for that, I would need Xamarin. So I'm trying to exclude the Android project from the build, but... I'm totally lost : where has the Configuration Manager gone? What the hell is that new "configure tasks" bullshit? ;-D
Add spoiler tag for Hidden:
Code: Adventure Game Studio
  1. 1>------ Build started: Project: AGS.API, Configuration: Debug|AnyCPU ------
  2. C:\Program Files\dotnet\sdk\2.1.200\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(327,5): error : Assets file 'F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\AGS.API\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
  3. C:\Program Files\dotnet\sdk\2.1.200\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(167,5): error : Assets file 'F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\AGS.API\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
  4. 2>------ Build started: Project: AGS.Engine, Configuration: Debug|AnyCPU ------
  5. C:\Program Files\dotnet\sdk\2.1.200\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(327,5): error : Assets file 'F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\Engine\AGS.Engine\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
  6. C:\Program Files\dotnet\sdk\2.1.200\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(167,5): error : Assets file 'F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\Engine\AGS.Engine\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
  7. 3>------ Build started: Project: AGS.Engine.Desktop, Configuration: Debug|AnyCPU ------
  8. 4>------ Build started: Project: AGS.Editor, Configuration: Debug|AnyCPU ------
  9. C:\Program Files\dotnet\sdk\2.1.200\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(327,5): error : Assets file 'F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\Editor\AGS.Editor\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
  10. C:\Program Files\dotnet\sdk\2.1.200\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(167,5): error : Assets file 'F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\Editor\AGS.Editor\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
  11. C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Autofac". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
  12. F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\Engine\AGS.Engine.Desktop\CSC : error CS0006: Metadata file 'F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\AGS.API\bin\Debug\netstandard2.0\AGS.API.dll' could not be found
  13. F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\Engine\AGS.Engine.Desktop\CSC : error CS0006: Metadata file 'F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\Engine\AGS.Engine\bin\Debug\netstandard2.0\AGS.Engine.dll' could not be found
  14. 5>------ Build started: Project: DemoQuest.Desktop, Configuration: Debug|AnyCPU ------
  15. C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "GuiLabs.Undo". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
  16. F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\Demo\DemoQuest.Desktop\CSC : error CS0006: Metadata file 'F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\AGS.API\bin\Debug\netstandard2.0\AGS.API.dll' could not be found
  17. F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\Demo\DemoQuest.Desktop\CSC : error CS0006: Metadata file 'F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\Editor\AGS.Editor\bin\Debug\netstandard2.0\AGS.Editor.dll' could not be found
  18. F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\Demo\DemoQuest.Desktop\CSC : error CS0006: Metadata file 'F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\Engine\AGS.Engine.Desktop\bin\Debug\AGS.Engine.Desktop.dll' could not be found
  19. F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\Demo\DemoQuest.Desktop\CSC : error CS0006: Metadata file 'F:\Users\GQHH9006\Mes Documents\Mes textes\prog\MonoAGS_git\Source\Engine\AGS.Engine\bin\Debug\netstandard2.0\AGS.Engine.dll' could not be found
  20. ========== Build: 0 succeeded, 5 failed, 0 up-to-date, 0 skipped ==========
  21.  
« Last Edit: 08 May 2018, 01:20 by Monsieur OUXX »
 

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: MonoAGS development log (AGS 5 candidate)
« Reply #47 on: 08 May 2018, 01:47 »
I want to create a copy of "Demo" to create a variation of it for my own test purposes. I don't understand if that's the right way to do. After I copy and paste the "Demo" folder and its contents, and rename that copy "Demo2", Visual Studio seems to ignore it. How am I supposed to proceed anyway? Is it like "one instance of MonoAGS = one game" or "one instance of MonoAGS = several potential games"?

What do you mean by "Visual Studio ignore it"? Is the new project added in solution, or you only copied folder on disk? When you build, do you build particulary that new project, rebuild all, or else? Before you try to run it, did you set "active project" in the solution tree?

I feel like this is rather a question of using VS. MonoAGS games are no different from any other project or solutions. You may have any number of game projects in one solution. This is what I have in my repository btw.

Also, you do not even have to have engine sources in your solution. You may create a solution only for game projects, and supply prebuilt MonoAGS DLLs for them, setting up the References in project settings. That is probably how regular users will be using MonoAGS after its released (because they would not want to modify engine by mistake).




What's annoying me right now is a design question : I'd like to keep my "FakeAGS" in the MonoAGS solution, to benefit from neighbour sources/autocompletion and easy testing, but if I understand correctly it has to be in an entirely different solution/repo to benefit from MyHub's auto build and push. Correct?

Did not understand the part about "MyHub's auto build and push", probably that has something to do with NuGet? will ignore that for now.

If I understood correctly, what you are going to do is not supposed to become a part of MonoAGS source, but a separate thing for which you just want to have engine source nearby?

In such case the best way IMHO is to create a new blank repository for your project, and include MonoAGS source as submodule.
Again, you may check my games repository, the VS solution there includes both my games AND MonoAGS, but MonoAGS comes as a submodule directly from tzach's repo, and even if I change something there by mistake I won't be able to occasionally push it back to his (it simply won't let me).

Submodule also lets you precisely control the version of code you are using. I.e. if tzachs pushes breaking changes to MonoAGS, your submodule may still refer to older version until you are ready to upgrade.

Git submodules are actually great thing to link various project sources (libraries etc) together without actually copying all of them into one place. They may require a bit of patience to learn to work with, but that's totally worth it.
« Last Edit: 08 May 2018, 03:23 by Crimson Wizard »

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: MonoAGS development log (AGS 5 candidate)
« Reply #48 on: 08 May 2018, 12:33 »
I feel like this is rather a question of using VS.
Yes and no. It is, because for some reson the "build manager" had disappeared from the VS GUI until I managed to build the solution at least once. It was making me very confused.
So now that it's back, I can enable or disable the building of individual projects inside the solution. that's where my understanding of MonoAGS was insufficient. I wasn't sure if MonoAGS was referenced in the game as a separate, pre-built DLL, or if the game was built directly on top of MonoAGS (the whole thing being built as a single project). Now it seems obvious but yesterday it was way past midnight (roll)



Did not understand the part about "MyHub's auto build and push", probably that has something to do with NuGet?
Yes. The whole purpose of NuGet is that it connects to your GitHub sources and builds the DLL project by itself, making it available online. then on the other end you have another project that needs that DLL, but instead of being physically present and referenced in your project, you reference a "NuGet" package that gets re-downloaded when needed (when the DLL has been modified). You can see it as a DLL being hosted in the cloud.


If I understood correctly, what you are going to do is not supposed to become a part of MonoAGS source,
yes because I feel like its lifespan will be short (until the rest of MonoAGS arrives) and that its coding quality will not meet the standards of MonoAGS.

In such case the best way IMHO is to create a new blank repository for your project, and include MonoAGS source as submodule.
Yes, now that I understand that MonoAGS is just a DLL, that's the way to go. Or at least, it should be when MonoAGS becomes stable.
I'm still hesitating because part of my work will be to extract hard-coded things from the demo game and turn them into some sort of generic library to simplify some tasks, and I feel like tzachs might want to get some of that back for MonoAGS. If it's a separate repo, it might be a pain to recover and integrate that code. Damn.

I didn't know about submodules though. I'll read more about them. Maybe they're the solution to my questionnings. Thanks!
« Last Edit: 08 May 2018, 12:35 by Monsieur OUXX »
 

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: MonoAGS development log (AGS 5 candidate)
« Reply #49 on: 08 May 2018, 13:20 »
I'm still hesitating because part of my work will be to extract hard-coded things from the demo game and turn them into some sort of generic library to simplify some tasks, and I feel like tzachs might want to get some of that back for MonoAGS. If it's a separate repo, it might be a pain to recover and integrate that code.

So, you also want to make changes to DemoGame in MonoAGS repository?

There actually may be following solution:

1) Create a fork of MonoAGS on github; not just a local clone on your computer, but full repository (unles you already did that).
Keep that fork clear from any unnecessary things, like test games, etc, only stuff required to sync with tzach's MonoAGS.

2) Create a completely separate repository for your "template" project. That repository should only have your own project, plus include your fork of MonoAGS (not tzach's) as a submodule.

When you work, and want to modify DemoGame, you do this:

* create a branch , e.g. "demogame-refactor" in the MonoAGS fork.
* in the Template repo, your submodule of MonoAGS should link to that "demogame-refactor" branch.
Now, whenever you make changes to DemoGame code itself, you may actually commit these changes in this special branch, and push to your remote on GitHub.
After you complete some stage, you go to GitHub, and suggest this branch as a pull request from your fork into main MonoAGS repository. That will bring the changes you made to DemoGame (and only them) to the main MonoAGS.

Sorry if that is confusing, I may later expand the explanation (with pictures :tongue:) when have more spare time.
« Last Edit: 08 May 2018, 13:23 by Crimson Wizard »

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: MonoAGS development log (AGS 5 candidate)
« Reply #50 on: 08 May 2018, 13:43 »
That's pretty clear; even though each additional step from me actually starting to code makes me lose a little bit of steam ;) But that's not your problem, only mine.

Is there an easy way to create the submodule? First of all: should it be done on the github online gui or locally in my repo (with the .gitmodules file?). Then : how should I proceed? Create the subfolder first? Run a git command that actually does it?
 

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: MonoAGS development log (AGS 5 candidate)
« Reply #51 on: 08 May 2018, 14:05 »
Is there an easy way to create the submodule? First of all: should it be done on the github online gui or locally in my repo (with the .gitmodules file?). Then : how should I proceed? Create the subfolder first? Run a git command that actually does it?

Submodule is a part of repository configuration, and so should be created locally. Submodule registration (and every other update of it) will become a "change" which should then be staged, commited and pushed as any other change in the source.

You only need to create subfolder yourself if you are going to put submodule inside nested folders. The last subfolder is always created by git. In other words, if you want submodule as a folder in root of your repository, you do not need to create anything on your own.

What OS you are working on, and do you use any GUI program to work with git? On Windows I am using mainly GitExtensions, which let me avoid using console most of times. (There may be others)
I do not remember git commands by heart, but there is documentation: https://git-scm.com/docs/git-submodule
Also, the documentation for creating .gitmodules file which is submodule configuration: https://git-scm.com/docs/gitmodules

IIRC to work with submodule changes you need to simply enter the submodule directory. Submodule has its own commits, separate from your "main" repository contents (because submodule is a clone of another repo). So if you are making changes to submodule code, you need to:
1) first commit and push changes in submodule.
2) then make commit in the parent repository, which will include "submodule update". This will record the fact that your repo now links to the newest commit in submodule.

Think of it as of modifying two repositories while having both in same place.
« Last Edit: 08 May 2018, 14:16 by Crimson Wizard »

tzachs

  • Local Moderator
  • AGS Baker
  • Mittens Vassal
  • Parking Goat- games that goats like!
    • I can help with translating
    •  
    • tzachs worked on a game that was nominated for an AGS Award!
Re: MonoAGS development log (AGS 5 candidate)
« Reply #52 on: 08 May 2018, 14:49 »
I've created my new local branch but I fail to publish it to the remote repo.
So it sounds like you didn't create a remote repo. You can create a a remote repo from the console by doing "git remote add" or directly from github by clicking on the branches drop-down and then click on "create new branch". However you can't do this from my repository as you don't have permissions. That's why, as CW said, you need to fork first.
Also, as you're console-phobic (like me, btw) you can do it without using the console:
1. Click the fork button on my repository to create your own repository.
2. Create a new remote branch on your repository from the branches drop-down in Github.
3. Clone that remote branch directly from Visual Studio's Team Explorer. You can also commit and push directly from visual studio, no console or third party GUI required (at least not for the basics).

Quote
Then I've added a ".Net Core library" project tot he solution.
I don't think that would work (I don't know if mono will be able to run a dot net core project). What you want is to create a DotNet Standard library -> this then works with both  mono and dotnet core.

Quote
I'm in the process of creating the feed : https://www.myget.org/feed/Packages/fakeags
I wasn't proposing that you'd create your own feed, but rather push your package(s) to the community feed I created already. Each feed can host multiple packages, so having all AGS-related packages in one feed will make it easier for people to find stuff. The editor will show packages from that community feed so that's where you'd want to push your package.

Quote
I'm reading this : https://weblogs.asp.net/bsimser/automatically-publishing-nuget-packages-from-github

What's annoying me right now is a design question : I'd like to keep my "FakeAGS" in the MonoAGS solution, to benefit from neighbour sources/autocompletion and easy testing, but if I understand correctly it has to be in an entirely different solution/repo to benefit from MyHub's auto build and push. Correct?
I think if you publish your nuspec (that's the file that's created when you build your project for nuget) then (if I understand correctly) MyGet will pick it up for your nuget so it might work.
Btw, I just tried it on MonoAGS without having a nuspec, and it seemed to create a package per project. I'll need to create a nuspec to have multiple projects in the same package.

EDIT:
Quote
I'm still hesitating because part of my work will be to extract hard-coded things from the demo game and turn them into some sort of generic library to simplify some tasks, and I feel like tzachs might want to get some of that back for MonoAGS. If it's a separate repo, it might be a pain to recover and integrate that code. Damn.
As long as your repository is public (and with a permissive license) it's not going to be a problem for me to take your code if I need it, so don't worry about it.
« Last Edit: 08 May 2018, 14:51 by tzachs »

cat

  • Mittens Baronet
  • AGS Baker
  • Now investigating MonoAGS
    • cat worked on a game that was nominated for an AGS Award!
      cat worked on a game that won an AGS Award!
Re: MonoAGS development log (AGS 5 candidate)
« Reply #53 on: 08 May 2018, 20:34 »
"To run the unit tests, please install the NUnit 2 Test Adapter (available from Visual Studio, tools menu -> Extensions and Updates... -> Online)." (from the readme)
Oh, I completely missed that readme. I just read the github.io documentation. Maybe you should add the info about test runner also to the "Getting Started" section there.
Anyway, tests are running now.

About that git/submodule thing:
I plan to port one of my games to MonoAGS for fun. How should I handle this in Git? Create a new repository somewhere else for the game and then include it in the solution? Or should I do this submodule thing?

tzachs

  • Local Moderator
  • AGS Baker
  • Mittens Vassal
  • Parking Goat- games that goats like!
    • I can help with translating
    •  
    • tzachs worked on a game that was nominated for an AGS Award!
Re: MonoAGS development log (AGS 5 candidate)
« Reply #54 on: 08 May 2018, 20:54 »
Oh, I completely missed that readme. I just read the github.io documentation. Maybe you should add the info about test runner also to the "Getting Started" section there.
Anyway, tests are running now.
Maybe, the thing is though that the github.io documentation is intended for game developers and the readme is intended for MonoAGS developers. Running the tests is not something that game developers should really care about, which is why I didn't put it there.

About that git/submodule thing:
I plan to port one of my games to MonoAGS for fun. How should I handle this in Git? Create a new repository somewhere else for the game and then include it in the solution? Or should I do this submodule thing?
You can do both. I think that the main advantage of the submodule is that it allows you to more easily update to a new version (or to restore to an older version), and easier to see which version you're actually running against. The disadvantage is that it's another tool that you need to learn and occasionally shout WTF at (it is part of git, after all, being intuitive was not part of its original goal).
Note that if you do the submodule thing, it's not instead of creating a repository for your game, it's about how you link from your game repo to MonoAGS.

cat

  • Mittens Baronet
  • AGS Baker
  • Now investigating MonoAGS
    • cat worked on a game that was nominated for an AGS Award!
      cat worked on a game that won an AGS Award!
Re: MonoAGS development log (AGS 5 candidate)
« Reply #55 on: 08 May 2018, 21:05 »
Running the tests is not something that game developers should really care about
Au contraire! Especially for developing templates/modules or non-adventure games testing would be very helpful. Maybe not running the engine tests, but the DemoQuest could provide some examples for actual gameplay tests.

Quote
About that git/submodule thing:
I plan to port one of my games to MonoAGS for fun. How should I handle this in Git? Create a new repository somewhere else for the game and then include it in the solution? Or should I do this submodule thing?
You can do both. I think that the main advantage of the submodule is that it allows you to more easily update to a new version (or to restore to an older version), and easier to see which version you're actually running against. The disadvantage is that it's another tool that you need to learn and occasionally shout WTF at (it is part of git, after all, being intuitive was not part of its original goal).
Note that if you do the submodule thing, it's not instead of creating a repository for your game, it's about how you link from your game repo to MonoAGS.
I WTF git everytime I need to do anything else besides the regular branch/commit/push/tag. Maybe I'll give it a try nonetheless.

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: MonoAGS development log (AGS 5 candidate)
« Reply #56 on: 08 May 2018, 23:38 »
Obsolete talk : @tzachs I did not create a remote repo since I cloned and branched from your repo. But since then I've changed strategy (with my own repo embedding MonoAGS as a submodule). In the future you should think of a way to allow contributions, though (EDIT: that you have already, when you explained how to do a pull request in your CONTRIBUTION file).

Up-to-date talk : @tzachs : I'm giving up on MyGet for now because it is out of my reach. I'm doing what CW suggested : a submodule. I've created two repos : one for FakeAGS (where I have a submodule to MonoAGS) and one for "DemoQuest2" (where I have two submodules : one to MonoAGS and one to FakeAGS -- side note: I don't know if it is necessary to have both or if MonoAGS is implicitly included when I include FakeAGS).
« Last Edit: 09 May 2018, 00:23 by Monsieur OUXX »
 

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: MonoAGS development log (AGS 5 candidate)
« Reply #57 on: 08 May 2018, 23:53 »
I did not create a remote repo since I cloned and branched your repo. But since then I've changed strategy (with my own repo embedding MonoAGS as a submodule). In the future you should think of a way to allow contributions, though.

There is already a way to do contributions to any github project, it's called "pull requests", and it requires to fork original repository to your own remote repository on github.

https://help.github.com/articles/about-pull-requests/

How does this work in short: you push changes to your remote, then go to your page on github and press "new pull request" button. There you choose name of your branch that contains changes and name of tzach's branch where you'd like to push them, then enter some description (optional). When you submit the form, tzachs will have your request appear as a new "issue" thread (sort of).
« Last Edit: 09 May 2018, 00:12 by Crimson Wizard »

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: MonoAGS development log (AGS 5 candidate)
« Reply #58 on: 09 May 2018, 00:24 »
Yup sorry : I updated my post since.

New question: how would I add a reference to a project present in a submodule? Do I add a reference to the Assembly, or do I add a reference to the Project (VS lets us do both)? In both cases, should I just browse to the corresponding submodule subfolder (and point to the .vsproj file in one case or .dll file in the other case)?
« Last Edit: 09 May 2018, 01:00 by Monsieur OUXX »
 

tzachs

  • Local Moderator
  • AGS Baker
  • Mittens Vassal
  • Parking Goat- games that goats like!
    • I can help with translating
    •  
    • tzachs worked on a game that was nominated for an AGS Award!
Re: MonoAGS development log (AGS 5 candidate)
« Reply #59 on: 09 May 2018, 02:40 »
You can do both, but I would recommend on adding a reference to the project. You can have MonoAGS projects as part of your solution, and then you don't need to browse to the sub folder when adding a project reference, it would appear in your list of projects.
If you add a reference to a dll however, then yes, you'll need to browse to the location of the dll file.

The advantage of adding a project reference (and having it in your solution), is that if you change the code to your version of MonoAGS and then run your project, it will automatically compile both.