Author Topic: Porting game to MonoAGS  (Read 4479 times)

cat

  • Mittens Baronet
  • AGS Baker
  • Angelica Crosley
    • cat worked on a game that was nominated for an AGS Award!
      cat worked on a game that won an AGS Award!
Re: Porting game to MonoAGS
« Reply #20 on: 21 May 2018, 20:45 »
I pushed fixes to master for both the camera panning issue and the character speaking.
Nice! It's working now :)

Quote
Note that I removed Character.Say, SayAsync should be used instead, that's because the blocking say can't work in all scenarios
Right, better remove it than having a half-broken version.

Quote
Also, I saw that there's a bug with how the fade transition works in your loading screen (instead of fading in the new room, it's fading in the splash screen). Not yet sure what's going on there, it seems more complicated, I will look at it after I finish my current work.
For the mean time, if it bothers you as it bothers me, you can remove the fade transition from the game load event, and move it to after your first (non splash screen) room fades in. Note that this will also reduce the time of the splash screen (by default the fade transition is 1 second fade in and 1 second fade out).
Wow, it's really much quicker that way.

Quote
You can also create a private repository. It costs money on github, but it's free on both VSTS and BitBucket.
Thanks, I'll think about it.

Quote
This is because ICharacter doesn't really contain ChangeRoomAsync, it's composed out of components (like IHasRoomComponent) which contain the actual behaviors.
I understand that, but the whole interface composition will be too complicated for the regular game developer. The documentation needs to have an article where everything you can do with a character is explained in the style of the old AGS doc.

Quote
Quote
Right, I checked again and I see a null reference exception in output. However, the program doesn't crash but nothing else happens and the game is stuck.
Can you describe what changes I need to make to reproduce this? Also, if possible can you share the stacktrace of the null reference exception?
Thanks.
For example, during character creation, I assign an outfit only for left:
IOutfit outfit = await game.Factory.Outfit.LoadOutfitFromFolde rsAsync(_baseFolder, walkLeftFolder: "Walk", speakLeftFolder: "Walk", idleLeftFolder: "Walk");
and then I start the idle animation for down (because I didn't pay attention):
_character.StartAnimation(_character.Outfit[AGSOutfit.Idle].Down);
The problem is, the game gets stuck on the loading screen and the exception is only visible in output.

Quote
An outfit is a collection of directional animations (idle/walk/etc)...
Thanks! It would be great to have a shortcut, like factory.LoadSpriteFromFile or similar. Especially when doing multiple animations manually, it creates lots of code atm. Can I safely reuse a sprite for different frames or should I create/clone a new one?
Oh well :(. I tried creating the animation manually but didn't get it to work, yet. The viewport jumps weirdly and I just have flickering and no proper animation. I need to investigate further.


One more (not exactly MonoAGS) issue I have: I installed the VS Community Edition, which I thought was free? But now VS says that my 30 days trial license will expire in a few days ???

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: Porting game to MonoAGS
« Reply #21 on: 22 May 2018, 14:38 »
One more (not exactly MonoAGS) issue I have: I installed the VS Community Edition, which I thought was free? But now VS says that my 30 days trial license will expire in a few days ???

Sometimes the installer is the same but it's the license that matters. Check in google if there isn't a thing like "get your VS community key" which might lead you to a page where all you have to do is to provide your (any) email address to get the key.
Nowadays most of the time you can even generate a key directly from within VS. Chek ou the "help" or "tools" menu.
« Last Edit: 22 May 2018, 15:22 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: Porting game to MonoAGS
« Reply #22 on: 22 May 2018, 15:00 »
I understand that, but the whole interface composition will be too complicated for the regular game developer. The documentation needs to have an article where everything you can do with a character is explained in the style of the old AGS doc.
The character page has everything you can do with the character in link format, so it's similar to the AGS doc except for the link itself does not to point to the same page. I'm not sure there's an easy way to copy the link contents to the character page, I'll need to get a deeper understanding of how the documentation is auto generated. Hopefully I'll get to that at some point.
I reported the new scenario for the broken search, and they're investigating it, so hopefully it will improve the situation (and interestingly if you search for "*ChangeRoomAsync*" it does work).
Also note that I plan to have the documentation for the interactions available from within the (yet to be written) interaction editor (so each interaction will have a "?" button next to it or something like that).


Quote
Thanks! It would be great to have a shortcut, like factory.LoadSpriteFromFile or similar.
Done ("LoadSprite" and "LoadSpriteAsync").

Quote
Can I safely reuse a sprite for different frames or should I create/clone a new one?
It depends. If you share the sprite it means you also share the sprite's configuration (rotation, scaling, translation offset, pivot, tinting, brightness). In other words, if you use the same sprite on 2 animation frames, and you rotate the sprite in one of the frames it will also rotate it for the other animation frame. If that's what you want, or, if you don't intend to change configurations for individual sprites (and if you intend to port the game from AGS as is without changes, then you don't) you can safely share the sprites. But if you want independent configurations, then use different sprites (but they can still share the same image, which is safe).

Quote
One more (not exactly MonoAGS) issue I have: I installed the VS Community Edition, which I thought was free? But now VS says that my 30 days trial license will expire in a few days ???
It is free, but you need to sign in, see here: https://www.visualstudio.com/vs/support/community-edition-expired-buy-license/

cat

  • Mittens Baronet
  • AGS Baker
  • Angelica Crosley
    • cat worked on a game that was nominated for an AGS Award!
      cat worked on a game that won an AGS Award!
Re: Porting game to MonoAGS
« Reply #23 on: 22 May 2018, 17:19 »
Done ("LoadSprite" and "LoadSpriteAsync").
Already saw it this afternoon and used it in my code - thanks :)

Quote
Quote
One more (not exactly MonoAGS) issue I have: I installed the VS Community Edition, which I thought was free? But now VS says that my 30 days trial license will expire in a few days ???
It is free, but you need to sign in, see here: https://www.visualstudio.com/vs/support/community-edition-expired-buy-license/
Ah, I thought it might be something like that :-\ Well, can't complain too much about a free product. I assume when the MonoAGS editor is finished, people will not need VS installed, right?

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: Porting game to MonoAGS
« Reply #24 on: 22 May 2018, 17:42 »
Ah, I thought it might be something like that :-\ Well, can't complain too much about a free product. I assume when the MonoAGS editor is finished, people will not need VS installed, right?
Technically, you don't need VS even now. Any IDE/text editor which can compile c# code can be used (in theory, at least).
Once the first version of the MonoAGS editor will be released, you should be able to use any text editor even if it can't compile c# yourself as the editor will be able to compile the code. However, you'll probably still want to use an IDE for debugging purposes.
Then I'll look into the option of bundling the editor with an existing IDE (we previously talked about either MonoDevelop or VS Code as potential candidates), and also of having the editor as an add-in to VS itself (so 3 flavors: standalone, standalone bundled with text editor and debugger, add-in to VS -> hoping it wouldn't be too big a burden, otherwise we'll need to make a choice and cut).

cat

  • Mittens Baronet
  • AGS Baker
  • Angelica Crosley
    • cat worked on a game that was nominated for an AGS Award!
      cat worked on a game that won an AGS Award!
Re: Porting game to MonoAGS
« Reply #25 on: 22 May 2018, 19:03 »
I think an editor without the need to register an account somewhere is a must.

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: Porting game to MonoAGS
« Reply #26 on: 06 Jun 2018, 17:27 »
For example, during character creation, I assign an outfit only for left:
IOutfit outfit = await game.Factory.Outfit.LoadOutfitFromFolde rsAsync(_baseFolder, walkLeftFolder: "Walk", speakLeftFolder: "Walk", idleLeftFolder: "Walk");
and then I start the idle animation for down (because I didn't pay attention):
_character.StartAnimation(_character.Outfit[AGSOutfit.Idle].Down);
The problem is, the game gets stuck on the loading screen and the exception is only visible in output.
This should be fixed now (the game will properly crash with an error message).

Quote
Also, I saw that there's a bug with how the fade transition works in your loading screen (instead of fading in the new room, it's fading in the splash screen). Not yet sure what's going on there, it seems more complicated, I will look at it after I finish my current work.
This should also be fixed now.

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: Porting game to MonoAGS
« Reply #27 on: 12 Sep 2018, 16:50 »
For the record I've completely given up on this. I lost steam while writing Readers in C# for .xml files for rooms, characters, objects, etc.
Not MonoAGS' fault, though. I still think it has great potential. Just not mature enough for the use I want to make of it. If some sort of easy resources loader appeared, mirroring AGS' game.agf file (with sections split into several files) I'd give it another try.
 

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: Porting game to MonoAGS
« Reply #28 on: 12 Sep 2018, 16:57 »
I figured, but thanks for the heads up.
My efforts are currently still targeted at having a functional working editor, and I'll update when I have something to show (going to take a while).

cat

  • Mittens Baronet
  • AGS Baker
  • Angelica Crosley
    • cat worked on a game that was nominated for an AGS Award!
      cat worked on a game that won an AGS Award!
Re: Porting game to MonoAGS
« Reply #29 on: 13 Sep 2018, 10:12 »
For the record I've NOT given up on this, it's just a matter of time. I hope I'll find some time soon for setting up an account and getting my VS running again. I know it's not difficult, but I hate having to bother with this kind of stuff.

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: Porting game to MonoAGS
« Reply #30 on: 13 Sep 2018, 15:46 »
Cool!
Depending on how desperate you are to avoid setting up an account (and how adventurous you are), you can try using another IDE.
MonoDevelop is free and open source and no registration is needed.
VSCode is another free and open source and no registration is needed, but you might need to work harder to make it work there (as it's general purpose, not c# specific like MonoDevelop, so you'll need to install a bunch of plugins and configure stuff).

Eventually I'll get to try those out myself (I have used MonoDevelop on Linux, actually, but did not try on Windows) and probably add a small tutorial for setting those up (if needed).

cat

  • Mittens Baronet
  • AGS Baker
  • Angelica Crosley
    • cat worked on a game that was nominated for an AGS Award!
      cat worked on a game that won an AGS Award!
Re: Porting game to MonoAGS
« Reply #31 on: 13 Sep 2018, 19:06 »
Quoting the MonoDevelop homepage
Quote
MonoDevelop for Windows is available from source only
Please refer to the building guide for more information about how to install and configure your MonoDevelop.
The Prerequisites for building under Windows require Visual Studio with F# enabled :P

Why on earth can't they just provide a Windows installer?

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: Porting game to MonoAGS
« Reply #32 on: 13 Sep 2018, 19:30 »
8-0
Facepalm.
Sorry, they had packages for linux and I assumed they would have an installer/downloadable for windows.

Why on earth can't they just provide a Windows installer?
Yeah, this is bizarre ???. I'm guessing everybody just uses VS on Windows and their main audience is mac & linux, but still...
I opened an issue on their repo: https://github.com/mono/monodevelop/issues/5961

cat

  • Mittens Baronet
  • AGS Baker
  • Angelica Crosley
    • cat worked on a game that was nominated for an AGS Award!
      cat worked on a game that won an AGS Award!
Re: Porting game to MonoAGS
« Reply #33 on: 13 Sep 2018, 19:51 »
Yeah, I mean building it myself is cumbersome enough but then also requiring VS is just weird. Since I don't do C# any more, I think I don't even have VS on my work PC.
Let's see if someone reacts to your issue. But I guess I'll get VS to run sooner or (more likely) later anyway.

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: Porting game to MonoAGS
« Reply #34 on: 13 Sep 2018, 20:10 »
Sorry, they had packages for linux and I assumed they would have an installer/downloadable for windows.

Why on earth can't they just provide a Windows installer?
Yeah, this is bizarre ???. I'm guessing everybody just uses VS on Windows and their main audience is mac & linux, but still...
I opened an issue on their repo: https://github.com/mono/monodevelop/issues/5961

Lol, this looks like Linux users are trolling Windows users by not requiring to build from source on Linux and requiring to do so on Windows on contrary. Maybe they are angry on Microsoft for some reason?

cat

  • Mittens Baronet
  • AGS Baker
  • Angelica Crosley
    • cat worked on a game that was nominated for an AGS Award!
      cat worked on a game that won an AGS Award!
Re: Porting game to MonoAGS
« Reply #35 on: 14 Sep 2018, 11:25 »
In the meantime, I tried SharpDevelop, but this seems to be too old, it can't even load the projects.

cat

  • Mittens Baronet
  • AGS Baker
  • Angelica Crosley
    • cat worked on a game that was nominated for an AGS Award!
      cat worked on a game that won an AGS Award!
Re: Porting game to MonoAGS
« Reply #36 on: 15 Sep 2018, 19:52 »
I've set up an account and can run VS again now.
When I now pull the latest master, I get a few error messages:
Code: Adventure Game Studio
  1. Error   CS0535  'GameStarter' does not implement interface member 'IGameStarter.Settings
  2. Error   CS0117  'AGSGame' does not contain a definition for 'CreateEmpty'
  3. Error   CS0117  'AGSGameSettings' does not contain a definition for 'DefaultSpeechFont'
  4. Error   CS0117  'AGSGameSettings' does not contain a definition for 'DefaultTextFont'  
  5. Error   CS0117  'AGSGameSettings' does not contain a definition for 'DefaultSpeechFont'
  6. Error   CS0117  'AGSGameSettings' does not contain a definition for 'CurrentSkin'      
  7.  

What do I have to change? Are there release notes or something?

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: Porting game to MonoAGS
« Reply #37 on: 15 Sep 2018, 22:18 »
There are no official release notes, yet, I'm afraid (I haven't technically released anything yet). My current plan is to have a functional editor (which like I said, gonna take a while) and then release a v0.1 and start making organized releases and release notes from there on (I'm guessing that's the point the project will start looking more interesting to people).

You can however look at the list of the merged pull requests (I make sure to create pull requests for everything, so it should have all of the changes): https://github.com/tzachshabtay/MonoAGS/pulls?q=is%3Apr+is%3Aclosed
Each PR in itself has a list of commits which you can browse (some are more detailed than others...).
Though currently I haven't (unfortunately) made any efforts in listing breaking changes.

The errors you get are because of 2 breaking changes:
1. Made changes to how a game is started, this is to allow having 2 games that live side by side (as the editor is in itself a game which hosts your game).
2. Moved some defaults into their own class, which you can access from game.Settings.Defaults.

You can follow the structure in the demo game to make this changes: https://github.com/tzachshabtay/MonoAGS/blob/master/Source/Demo/DemoQuest/Program.cs

The relevant lines with changes are: 10, 17, 28-30, 44-51.

And if you're interesting in examining the commits that made these changes:
https://github.com/tzachshabtay/MonoAGS/commit/f58e4bfc633a225b26b77e50601ecc4af8d2a8cf
https://github.com/tzachshabtay/MonoAGS/commit/84050bcb7d49e6a0a8d9b14f22fe7f5a266959ca#diff-f3b30bc060275a41bac549848c305912

Let me know if you're having problems, I can make the changes for you.



cat

  • Mittens Baronet
  • AGS Baker
  • Angelica Crosley
    • cat worked on a game that was nominated for an AGS Award!
      cat worked on a game that won an AGS Award!
Re: Porting game to MonoAGS
« Reply #38 on: 16 Sep 2018, 09:56 »
Right, I got the program and the usage of dependency injection fixed. I can start the game and as a nice surprise, the custom font is now working (that didn't work before).

There are still other issues (that already were there before), but now that I can compile again, I'll have a look at them one after each other.

Oh, and I like the new point syntax and deconstruction. Gotta get used to the new language features :)
« Last Edit: 16 Sep 2018, 09:59 by cat »

cat

  • Mittens Baronet
  • AGS Baker
  • Angelica Crosley
    • cat worked on a game that was nominated for an AGS Award!
      cat worked on a game that won an AGS Award!
Re: Porting game to MonoAGS
« Reply #39 on: 16 Sep 2018, 10:46 »
Whoops, looks like I have the slot-machine version of adventure gaming. When I run the game from VS, I get randomly one of the following results:
  • The game runs just fine
  • It is stuck on loading screen
  • I get a "System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'" in OpenGLBackend line 30 (public void ClearScreen() => GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);)
    Add spoiler tag for Hidden:
    System.AccessViolationException
      HResult=0x80004003
      Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
      Source=<Cannot evaluate the exception source>
      StackTrace:
    <Cannot evaluate the exception stack trace>