Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Crimson Wizard

#601
Quote from: eri0o on Sat 04/02/2023 12:33:21This sounds like a good idea, but just to try to figure out how is the "video sprite" size specified, does it uses the video resolution or is the dynamic sprite something we would create separately with whatever size and pass the dynamic sprite pointer to it? (VideoPlayback* vp = vcIntro.Play(dyn_spr);)

There is also a question of ownership. If user passes a dynamic sprite to the Play function, that means that the user also owns the sprite. This means that user may delete the sprite or edit it anytime by accessing its DrawingSurface. That may cause conflicts with what video is trying to do. For that reason I'd consider an alternative method of passing width and height into Play function, and let video object create its own sprite.

Quote from: eri0o on Sat 04/02/2023 12:33:21About the decoding, somehow the frame has to be set at the beginning or at the end of the game frame, so the contents of the dynamic sprite is predictable so people can assign it to things.

The decoding must happen on a separate thread to not unnecessarily load up or block the game's thread. Also, the video playback may work with its own fps setting, not necessarily matching the game's fps.

The solution I could come up with at this point is to implement a back-buffer mechanism for this sprite. That means that instead of having 1 bitmap (or texture), the sprite has 2 associated bitmaps (or textures). One of them is considered to be sync with the game, and another is the one that video decoder writes to. Upon entering a game frame update, these bitmaps switch: a previous back-buffer becomes an active sprite's surface, and the previous active surface becomes back-buffer, that a video decoder will write to when necessary.
#602
Quote from: rongel on Sat 04/02/2023 16:28:00I noticed a possible new issue with the latest RC version with the idle animation delay. I have set it to 2 in the editor, but when I start a new game, it's actually 7 for some reason. I can manually change it to 2 with the IdleAnimationDelay command, and the idle animation plays like it should.

I think this issue is with the new version, but I'm not 100 % sure about it. There's always a possibility that it's my doing. Can someone else confirm this?

This probably is related to the change in 3.6.0 where you can have an explicitly set idle delay. The old version was making idle delay equal to the animation delay + 5, and this is where 5 comes from, likely.

The question is, is your game built as 3.6.0 and run as a new game, or have you built it with 3.5.1 previously and restoring an older save made in 3.5.1?
#603
EDIT: 3.6.0.42 is re-released, to include one extra fix, please scroll few posts below for details.
#604
Quote from: eri0o on Sat 04/02/2023 14:47:12Uhm, do the builtin types (Character, Object, ...) also have this type name? And say, a built-in type from a plugin.

Just trying to figure out what happens with things that have no "script unit" - imagining rtti is already in and I am looking at a variable through the new rtti powered AGS debugger.

Their "unit" is actually called a "BuiltinScriptHeader" (or something like that).
I imagine plugin's "unit" will also have some generated name like that.

By the way, it is already possible to see these names through a program debugger, if using my new wip branch:
https://github.com/ivan-mogilko/ags-refactoring/tree/ags4--rtti

There's a number of debug fields I added that work as a cross-references between types and fields, and let explore the table after it's built by compiler.
(I think I move these to separate struct later)
#605
Quote from: eri0o on Sat 04/02/2023 12:57:03Is there a way to have the table of names be built separately so it's not part of the release build? I think the names are not needed unless the game is being debugged? Maybe not consider this on the first interaction of the feature, but something to consider at some point.

Technically, the strings may be skipped, because with the updated format (as described in the latest comment in the ticket) the strings are saved in a separate table, so it's a matter of not generating this data during compilation, and skipping the step during writing.

The problem is though that the full type names are used as global keys when merging rtti tables from different script units. Either something else should be used to identify types globally, or these names may be obfuscated.
#606
My opinion on this, shortly:

1. I believe there should be a sort of VideoPlayback type (name is an example), which is returned from PlayVideo, and lets you control the video, similar to how AudioChannel lets you control the audio playback.
On a side note, as we discussed this previously, we should consider introducing AudioPlayback type, representing a playing audio instance, which is returned from AudioClip.Play, instead of returning AudioChannel. Maybe AudioPlayback and VideoPlayback could have a parent type (MediaPlayback?) which shares common properties and functions too. This will make both video and audio handled similarly.

2. The video should be updated on the main game loop, regardless of whether it's blocking or non-blocking. The difference between these would be simply that some of the game parts are not run during blocking video, similarly to how some parts are paused during blocking Walk or Say command.
NOTE: the video decoding may be performed on a separate thread even. By "updated on the main loop" I mean that the playback state and displayed image should be updated when the rest of the game updates.

3. The video should be decoded onto a dynamically created sprite, which may then be applied to any object. This will allow to play video on anything, and sort among other game elements on screen. VideoPlayback will have a Graphic property, or similar, to let reference this sprite. The sprite likely should be "owned" by the video until it is stopped, after which the sprite is disposed automatically.

4. The video's audio should be played through standard audio system, VideoPlayback should have a reference to AudioChannel it plays its audio on.
Maybe AGS will let configure which channel to play on, but that's a secondary question.
There are other details to decide here, like, should the video's audio have its own configurable "audio type", and so on.
#607
Quote from: eri0o on Fri 03/02/2023 02:17:10My suggestion would be to make a minimal version of TheoraPlayer and have the source files of it in the project itself

I may look into this if I have spare time.

There's already some issues with building TheoraPlayer on linux, as it does not have a proper lib installation.
#609
Quote from: AndreasBlack on Thu 02/02/2023 09:33:32As for auto-saving do you just call the SaveGameSlot(1, "Autosave"); in a repeatedly execute function or is there additional code that needs to be done for an autosave feature?

The code should follow game design. First of all, you decide when you want your game to autosave. If you really prefer it autosave each game frame (40+ times a second), then sure put it in repeatedly execute function. If you like it to autosave in particular moments only, then you'd need to code that accordingly.
#610
As a heads up, I consider the RTTI (and expanding the managed pointers support in particular) my priority task after 3.6.0 release. So, I return to this issue, and posted an update on a RTTI table format in the ticket:
https://github.com/adventuregamestudio/ags/issues/1259#issuecomment-1412573652
#611
Quote from: Manu on Sun 22/01/2023 21:50:02Hello
I found this bug on my game compiled with AGS 3.6.0.41. It can be easily reproduced:
1) Play the game in full screen
2) Press Alt+Tab to switch to another program (the game gets minimized in the taskbar)
3) Click the game title in the taskbar to restart playing.

The game crashes badly.

Possibly fixed in this temp build:
https://cirrus-ci.com/task/5463418820362240

It does not fix the previously reported problem, where Direct3D full screen may "hang" randomly if you alt+tab multiple times.
#612
It should not make the first test for (acPropaganda == null) at all, since that does not matter, and it seems that sound must restart every time player enters the room. (It is stopped when player leaves the room).

The Khris's code will fail starting from the second time, because AudioChannel's pointer never gets null after being assigned for the first time.

Code: ags
function propagandaPlay() {
  acPropaganda = aSpeech_close.Play();
  if(acPropaganda != null) {
    acPropaganda.SetRoomLocation(866, 252);
  }
  SetTimer(1, 1200);
}



There's another problem in room_Leave, where you test for acPropaganda.IsPlaying before testing that acPropaganda is null. If acPropaganda were null at that moment, there will be a null pointer error when checking acPropaganda.IsPlaying. So the order of conditions should be different.
Besides that, this probably is not related to the problem, but I think you should also stop the timer when you leave the room in order to avoid potential conflicts with other rooms, which might use same timer ID:
Code: ags
function room_Leave() {
  if (acPropaganda != null && acPropaganda.IsPlaying) {
    acPropaganda.Stop();
  }
  SetTimer (1, 0);
}
#613
The crash is trivially reproduced in any game that has a GUI. It is related to gui textures getting disposed when the display mode changes. I'm not completely certain yet, but either something is not reinitialized correctly, or this may happen in the middle of the render pass (and then renderer happen to access a deleted texture).
#614
Is the question currently why do you need to check for null at all, or why Play returns null in that particular case?

I answered the first question, but I cannot answer the second without knowing more details about your game's audio, and particular circumstances.
#615
Quote from: Thanyx on Sat 21/01/2023 14:14:15I think the main difference between my grammar edit and regular translation is that in my case I really don't need to (and don't want to) re-write 100% of the text.

This does not matter, translation may include empty translations, in which case the game will simply use original text.
#616
Quote from: Joacim Andersson on Mon 23/01/2023 12:17:55However, the GUI is still closing, and yes I have it set to pop up when the mouse moves to the top of the screen. But how do I prevent it from closing if the mouse is still at the top of the screen?

IIRC that's the built-in behavior for these popup guis. If you want a different behavior, you will have to script it instead of using a "popup" style.
Use a "normal" gui, and script it appearing and disappearing depending on the mouse position.
#617
Quote from: Vincent on Mon 23/01/2023 11:58:35So this might work on Android but the plugin need to be compiled separately, how to do that?

I wish I knew myself... Theoretically this may be done under Linux, at least we were building some of the "standard" plugins for Android under Linux previously.

I will have to consult someone about this, like eri0o maybe.
#618
Quote from: Vincent on Mon 23/01/2023 11:26:42Hello, I tested this plugin on the new version of Ags. I think this has already been documented but it seems the plugin doesn't work if the game is compiled for android

Of course, you need to have this plugin compiled for Android too. Each plugin you are using has to be compiled separately for each platform you're building your game for.

I don't remember how do you add plugins for Android though, this has to be clarified. Probably, they are put somewhere inside the Android subfolder, inside the Editor program files.
#619
Quote from: nightmarer on Mon 23/01/2023 11:30:00But why I need to use this "if" if I am playing that sound in the previous line?
Why is this pointer null, then?

The Play() may return a null pointer if the sound failed to play for whatever reason:
- sound driver is not initialized;
- sound is stored in audio.vox, and audio.vox is missing;
- engine failed to start the playback, because of unsupported format or another problem;
- could not find a spare audio channel, and other running sounds have higher priority.
#620
Quote from: Khris on Mon 23/01/2023 09:18:46Also, why is the GUI closing at all? I don't see anything that would cause this in your code.

Could be the gui has a "Popup when mouse is at Y" style?
SMF spam blocked by CleanTalk