AGS Development > Other Engine & Editor Development

Porting game to MonoAGS

(1/21) > >>

cat:
Hi!
I want to port Cornelius Cat from AGS to MonoAGS. It is a fairly short game and has neither save/load nor translations, which is not available in MonoAGS, yet.
I thought I'd create a new thread for this, now that there is a separate board, to keep things organised.

I'm currently trying to set up the basic game structure (using mostly the Demo game and a bit of CW's games) and already have the first questions:

Is a player character needed, because it is loaded before the splash screen?

The splash screen (loadSplashScreen) has nothing to do with the Splash asset, right? It is the AGSSplashScreen from the engine but there does not seem to be documentation for it?

Crimson Wizard:

--- Quote from: cat on 13 May 2018, 21:12 ---Is a player character needed, because it is loaded before the splash screen?

--- End quote ---

No, you may make a game without characters at all (none of my games have any).
Changing rooms is done using Game.State.ChangeRoomAsync(room), so it is not directly related to character's going there, unlike AGS.

I am not sure how player character's position is synchronized with changing the room, haven't investigated that yet. Probably you may set Game.State.Player, but idk if it changes room automatically after the character.

tzachs:

--- Quote from: cat on 13 May 2018, 21:12 ---The splash screen (loadSplashScreen) has nothing to do with the Splash asset, right? It is the AGSSplashScreen from the engine but there does not seem to be documentation for it?

--- End quote ---
What do you mean by "splash asset"?
Yes, sorry, the splash screen is not currently documented, and is very basic for now. It's basically a blank room with a loading text that tweens its scaling until you tell it to move to another room.
You can change the text by setting the "LoadingText" property.
You can change the font/text color/outline/shadow/etc by setting the "TextConfig" property.
And when you call the load function on the splash screen you get back a reference to your room so you can set a background or add more stuff to the room (like any other room).
Here's an example which changes the text, changes it to a blue color and adds a background image:


--- Code: C# ---var mySplashScreen = new AGSSplashScreen();mySplashScreen.LoadingText = "My Loading Text";mySplashScreen.TextConfig = new AGSTextConfig(brush: game.Factory.Graphics.Brushes.LoadSolidBrush(Colors.Blue));var room = mySplashScreen.Load(game);room.Background = myBackgroundImage;await game.State.ChangeRoomAsync(room); ...//Load stuff here... await game.State.ChangeRoomAsync(firstGameRoom); 

--- Quote ---I am not sure how player character's position is synchronized with changing the room, haven't investigated that yet. Probably you may set Game.State.Player, but idk if it changes room automatically after the character.

--- End quote ---
If you change the player character's room it automatically changes the room in the game state as well, so the behavior matches what you expect when you change the player's position in AGS, but like CW said, you don't need to have a player character as you can just change the room in the state (which won't move the player character to that room). I think I set the player first because at the beginning I had the exact AGS behavior so the player was mandatory, but at some point I changed it.

cat:
Thanks for the explanation

--- Quote from: tzachs on 14 May 2018, 00:44 ---What do you mean by "splash asset"?

--- End quote ---
In the assets folder->rooms there is a splash screen, but I don't think it is ever used.

One reason for this thread is to point out stuff that is either confusing in the demo game, needs more documentation or should be improved.


Monsieur OUXX:
Itis ndeed not used, however that's not the important thing about the Splashscree room.
the important thing is that it has a different structure from the other rooms. It is designed to have an unpredictable framerate, which means that onRepeatelyExecute and the tweens update are called manually from this room's loading function itself.
If you don't feel too confortable with that weird room, I'd say that you may skip the splash screen altogether and just go directly to an actual room. It will take a few seconds to load, but for a small game it's no big deal.


Navigation

[0] Message Index

[#] Next page

Go to full version