Trying out MonoAGS (AGS 5 candidate) : journal

Started by Monsieur OUXX, Wed 02/05/2018 14:56:42

Previous topic - Next topic

Monsieur OUXX

I intend on trying to develop a tiny game with monoAGS.
This will be a test run to assert by myself how mature and/or easy-to-use it is. I will post my progress here.
If I succeed, I will try to convert a medium-size AGS game into MonoAGS. again, I will post my progress here.

This sort-of blog is meant to deliver tips to anyone trying to do the same, and maybe be an incentive to start something.

If you wonder why I'm posting this on the AGS forums, then please read this thread and all the other threads about the same topic.


Edit by cat:
MonoAGS Repository
MonoAGS Documentation

EDIT 2 :
Things to add in the "get started" wiki:
Quote
- if you can't build an Android project, it means you might need to install Xamarin (read more in the posts below)
- if you can't build any of the other projects, try these :
    1) make sure you have .Net Core installed (see posts below for links and version). To do so :
       - Open the Windows Command Prompt
       - type this and press return :
         dotnet --info
       - if you get an error message: then it means dotnet core is not installed. Otherwise you get the exact version currently installed.
    OR, if it still doesn't work:
    2) try to delete global.json and then rebuild the solution. This should specifically solve the error "The current .NET SDK does not support targeting .NET Standard 2.0. ..."
- If the solution builds fine but the project won't start, check if you have a message similar to "you cna't trun that type of project". If so, right-click on the actual game project in the solution (asopposed to the other projects : shared libraries and whatnot) and select "Set as Startup Project".
EDIT 3 : those comments are now included in the FAQ : https://tzachshabtay.github.io/MonoAGS/articles/faq.html
 

Crimson Wizard

#1
Hey Monsieur OUXX!

Probably I should have posted this earlier, but since you started this thread, hope you won't mind if I link my own test games on MonoAGS here for the reference (and code example).

An important note: I did not use Editor when making them, because a) I was mostly curious whether it is possible to write a game without using any tool (spoiler: it is), and b) Editor was not ready when I started (not sure if it is now).

My repository with games: https://github.com/ivan-mogilko/MonoAGSGames
(it has central MonoAGS repository as submodule, so you have to init submodule to make them build).

Games are in separate folders:
1) Game. This is the very first game made long time ago. Has a dummy scene with tweened objects simulating driving along the road.

2) LastAndFurious. The port of "Last & Furious" game previously done in AGS.
About 90% complete (no car collisions, no in-game track editing, and AI is glitching sometimes).
On another hand, it has this:
Spoiler

3) AudioMixerGame. Implements an audio mixer system with multiple channels and audio clips, where each channel and clip may be assigned a tag to bind them together. When you start a clip, it chooses a channel depending on the tag. Also, each tag has its separate volume setting.
The purpose of this "game" was prototyping advanced audio system, but later Tzachs implemented his own right in the engine (haven't checked it out yet though).

4) LayerGame. Two rooms, testing parallax effect, camera zooms and zoom trigger zones.
Spoiler


PS. As you may notice, none of my test games actually feature characters or anything adventure-related. The idea was to first test out some basic game elements, and then move to adventure genre mechanics, but I got little too busy, and a little bored, so decided to make a break.

PPS. Should have probably prepared actual runnable games, but there was some issue with compilation output having a tonn of .NET DLLs copied into game folder, so I decided to wait until there is a fix for that.

Monsieur OUXX

#2
Nope! Don't mind at all ^_^

My approach is slightly different from yours : I will want to use the Editor as much as possible.


EDIT (unrelated) : dammit! :-D why do code geniuses like you guys already use expression-bodied members? They aren't even 3 years old! How do you expect people like us to follow? Lol.:= (don't even bother answering that)
 

Crimson Wizard

Quote from: Monsieur OUXX on Wed 02/05/2018 16:40:03
EDIT (unrelated) : dammit! :-D why do code geniuses like you guys already use expression-bodied members? They aren't even 3 years old! How do you expect people like us to follow? Lol.:= (don't even bother answering that)

Did not even know they are called like that. Tzachs told me about these, and since they look kinda cool, I decided to use them also :).

Monsieur OUXX

#4
First experience when opening the .sln on my machine that has VS2017 Community installed (from Unity I believe?) --> It tells me MonoAGS needs the .Net Framework 4.6.1. I'm going to install it but is it really mandatory?

EDIT: after letting VS install the whole shebang itself, after restarting it I get "these projects are not supported" :~(
[imgzoom]https://78.media.tumblr.com/c9f4c572d673d88f3d65f7a83e099f3e/tumblr_p84gtiqtUQ1tsfksfo1_1280.png[/imgzoom]


[imgzoom]https://78.media.tumblr.com/e1f1d1fa64c291f5017bd0e2956bb1c6/tumblr_p84gxvl9HW1tsfksfo1_1280.png[/imgzoom]
 

ChamberOfFear

You probably don't have Xamarin installed. Do you really need to test the mobile platforms? It should be safe to continue and just ignore the projects that didn't load.

tzachs

Hi! And.. Cool! ;-D

A few notes so far:

Editor:

There is no editor to speak of yet. This is what I am currently working on.
Currently the only "editing" component that exists is the inspector, which is currently opened from the game itself.
From the demo game you can click alt+g to open the game view, then select one of the room objects, and edit the properties of that selected object -> only it's not actually changing any code currently, it just changes it for the current game.
Rough timeline:
In my next big code push (coming hopefully in the next week or two), I'm removing the alt+g to open the game view from the game and moving it to the editor, along with a play/pause button and the ability to select/drag/scale/rotate objects directly in the scene when paused -> though still only in the current running game.
After that the next item for the editor will be to generate the needed code for actually modifying the game code.
And then, I'll add a "create new game" button (currently there's only "load game") with one default template (for now) for generating the startup code.
Following that, working on completing up the initial version of the editor and rewriting the save/load game system before releasing an official 0.1 version: a not comprehensive list of issues for that release can be viewed here: https://github.com/tzachshabtay/MonoAGS/milestone/1

Android & IOS:

Like ChamberOfFear said, you'll need Xamarin installed and the android/ios SDKs.
I've posted links with instructions in the main readme in the repo: https://github.com/tzachshabtay/MonoAGS/blob/master/README.md
I haven't written it down in the docs website, though, I'll add it there soon.
If you currently are just developing for desktop, you can indeed ignore those errors.
Also note that IOS is not currently officially supported, it was only partially working the last time I tested it (no sound and incredibly slow on an ipad2, I haven't tested it on a newer device yet, and the editor takes priority so I'm probably not going to add ios support for a while).

General early adopter warnings:

Problems you'll probably encounter:
- Missing features: Save/load is the most striking gaping hole in the engine now. Other than that I think that most of the widely used AGS features are there in one form or another -> let me know otherwise if you're in need of something specific.
- Usability: Well, obviously, as there's no editor, you'll need to write code for everything, including object creation which might not be the most friendly experience around (check out the demo game, or Crimson Wizard's games for examples on how it's done). Also, the API might be different at times than AGS, use the AGS cheatsheet if you can't find something and let me know of any problem that arises.
- Bugs: Might go without saying, but you will encounter bugs -> open issues on github or write to me/here if you prefer, I'll try to assist in any way I can. Note that you can also open an issue on github just to ask a question or start a discussion.
- Changes: The codebase is still getting A LOT of breaking changes, so it's going to be difficult to keep pace with engine updates (Crimson Wizard's games, for example, will not compile with the newest engine version, as there were breaking changes in the last month -> I'll submit a pull request to fix this when I finish with the current editor work I'm doing).
This is optional, but if you want, you can put your code on github or some other source control provider if you prefer, and I'll try to help and submit pull requests when I have a new engine version to make sure your game still compiles and runs as expected. Creating a public repo also has the benefit of allowing me to easily debug issues that you'll report, and it will help future potential users as another sample.

Other than that, I really really appreciate you taking the effort of trying it out, I hope you'll like it, and don't be afraid to ask the silliest questions you can think of and request the tiniest or most epic features imaginable.

Monsieur OUXX

#7
Thanks for all the tips, I'll use them when I reach the next step.

For now, I'm trying to be in the head of a complete beginner : "How do I know what to do when some of the solution's projects don't load? Can I do without them or are they vital?". It's good to know that I don't need Xamarin for the Android project. (maybe adding a little note on that topic in the Wiki would be a good idea?)
However, I'm stil having issues: the AGS.Editor project is still there in the solution and doesn't build. Because of that, the other projects complain that AGS.Editor.dll is missing. I'll give more details tonight when I get home.
 

Crimson Wizard

I cannot build AGS.Editor either, it sais "The current .NET SDK does not support targeting .NET Standard 2.0.  Either target .NET Standard 1.6 or lower, or use a version of the .NET SDK that supports .NET Standard 2.0."
Probably it requires installing very particular SDK?

The only other project that requires Editor.dll is DemoGame (it did not before iirc).

tzachs

Quote from: Monsieur OUXX on Thu 03/05/2018 09:24:09
It's good to know that I don't need Xamarin for the Android project. (maybe adding a little note on that topic in the Wiki would be a good idea?)
You do need Xamarin for the Android project, you don't need the android project for running on desktop. Yes, I'll add that to the docs too, good idea.

Quote from: Crimson Wizard on Thu 03/05/2018 12:26:24
I cannot build AGS.Editor either, it sais "The current .NET SDK does not support targeting .NET Standard 2.0.  Either target .NET Standard 1.6 or lower, or use a version of the .NET SDK that supports .NET Standard 2.0."
Probably it requires installing very particular SDK?
It requires the .net core 2.0 sdk. It should be installed automatically with the latest VS2017 update. If it didn't install for some reason, you can get it from here: https://www.microsoft.com/net/download/windows/build
You can verify which version you have installed by running from console: `dotnet --info`.

Quote from: Crimson Wizard on Thu 03/05/2018 12:26:24
The only other project that requires Editor.dll is DemoGame (it did not before iirc).
Yes, that's a temporary thing, in the current version I'm working on I removed that dependency.

Crimson Wizard

I've already had .NET 2.0 installed, and I installed most recent version again, but it still gives same error.

Upon quick investigation, the error points to the file called "Microsoft.NET.TargetFrameworkInference.targets". This file has following inside:
Code: xml

  <PropertyGroup  Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard' And '$(NETStandardMaximumVersionExclusive)' == ''">
    <NETStandardMaximumVersionExclusive>1.7</NETStandardMaximumVersionExclusive>
    <NETStandardMaximumVersionHumanReadable>1.6</NETStandardMaximumVersionHumanReadable>
  </PropertyGroup>

  <Target Name="_CheckForUnsupportedNETStandardVersion" BeforeTargets="_CheckForInvalidConfigurationAndPlatform;Restore;CollectPackageReferences"
          Condition="'$(TargetFrameworkIdentifier)' == '.NETStandard' And '$(NETStandardMaximumVersionExclusive)' != ''">

    <NETSdkError Condition="'$(_TargetFrameworkVersionWithoutV)' >= '$(NETStandardMaximumVersionExclusive)'"
                 ResourceName="UnsupportedTargetFrameworkVersion"
                 FormatArguments=".NET Standard;$(_TargetFrameworkVersionWithoutV);$(NETStandardMaximumVersionHumanReadable)"
      />    
  </Target>


For some reason NETStandardMaximumVersionExclusive is still 1.7.

ChamberOfFear

#11
I noticed the same thing when I was trying last night. I had to install the exact version of dotnet Core that was specified in the global.json, that is v2.0.2. If I tried any other version, higher or lower, for instance v2.1.105 it wouldn't work.

EDIT: I'm not by my computer right now, but I think runinng the command `dotnet --version` on the command line while in the project folder output an error message about the global.json file, if I was using a dotnet version that wasn't supported by the project.

Monsieur OUXX

Quote from: ChamberOfFear on Thu 03/05/2018 13:39:44
the exact version of dotnet Core that was specified in the global.json, that is v2.0.2.

Well it's not available for download >:( https://www.microsoft.com/net/download/all
Any other way? I'll try from within VS.
 

ChamberOfFear

Quote from: Monsieur OUXX on Thu 03/05/2018 14:45:59
Well it's not available for download >:( https://www.microsoft.com/net/download/all
Any other way? I'll try from within VS.

https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.2-sdk-download.md

You could also just wait for tzachs to fix it. I don't think it's supposed to have a strict requirement to a specific version of dotnet core

tzachs

That's very weird, it doesn't reproduce on my linux machine (using version 2.1.104).
Can you try deleting the global.json file and try again?
If it doesn't work, then you can either download that specific version from the link ChamberOfFear posted (and 'un-delete' global.json), or wait for me to get to a windows machine (tonight) and I'll try to reproduce it from there.

ChamberOfFear

Deleting global.json works.

The console output looks like this when I run without the correct version installed
Code: ags

$ dotnet run
The specified SDK version [2.0.2] from global.json [E:\Programming\MonoAGS\global.json] not found; install specified SDK version

tzachs

Great! Thanks for verifying.

Quote
The console output looks like this when I run without the correct version installed

Yeah, that's what it should do, it makes sense, I was surprised that it didn't give me this error on the linux machine. But I think that was because it's not about which dotnet version is the active one, but whether it's installed on the machine at all, and I guess it is installed on my machine so it didn't yell at me even though I installed a newer version, it simply ignored it and used the older one.

cat

Interesting! I've added links to the repo and doc in the first post.

Monsieur OUXX

Deleting global.json worked. I'm now able to build the solution. Now I'm taking a deep breath and continuing ;)
I should let you know that I downloaded Godot alongside MonoAGS, though <-- that's to maintain pressure and suspense ;)
 

tzachs

Quote from: Monsieur OUXX on Thu 03/05/2018 21:00:38
I should let you know that I downloaded Godot alongside MonoAGS, though <-- that's to maintain pressure and suspense ;)
haha, game on!
Are you using Escoria? https://github.com/godotengine/escoria
Because that would make things even more interesting.

SMF spam blocked by CleanTalk