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

#2781
Not sure where to post this, but following a user's problem report recently I remembered that the game templates feature ASCII bitmap fonts. In 3.6.0 the default text mode is Unicode, but if you try to use unicode texts in your game right of the start, the game won't be able to display them. Besides annoyance, for a new user this may cause a false impression that AGS does not really work with the unicode.

Replacing fonts may be not a trivial task, as they have to at least match the template's art style. So I wonder, can anyone contribute to this, perhaps if you know a good suitable TTF which at least have extended latin letters (with accents etc), or can even draw one (who knows)? Or is there a way to convert a bitmap font to TTF reliably?
#2782
Updated to v0.9.2,

- Fixed D3D_Sprite's Tint properties not working in OpenGL mode.
- Fixed plugin crash when exiting game while video is playing.

For Windows: https://github.com/ivan-mogilko/ags-sprite3d/releases/download/v0.9.2/win_ags_sprite3d.zip
For Linux (debian-based): https://github.com/ivan-mogilko/ags-sprite3d/releases/download/v0.9.2/libags_sprite3d.tar.xz
#2783
This is done by "escaping" with the back slash: \"

Code: ags

String s = "script1=\"king01.txt\" run=1";
#2784
Quote from: Pajama Sam on Wed 27/07/2022 20:31:45
Thanks again.That solved it but there's another problem now.WriteRawLine skips to the next row everytime it places text.
The way I have it is that each placement adds to the last and after those are placed it moves to the next line.

You could do that in one call to WriteRawLine if you create a full formatted string, for example:
Code: ags

String s = String.Format("CreateObject pos=%d; %d dir=0.0 type=Bot3", other[othernum].X, other[othernum].Y)
output.WriteRawLine(s);


Or, alternatively:
Code: ags

String s = "CreateObject pos=";
s = s.Append(somethingx);
s = s.Append("; ");
s = s.Append(somethingy);
s = s.Append(" dir=0.0 type=Bot3");
output.WriteRawLine(s);
#2785
If you are using File.WriteString or WriteInt, they precede every written value with special data. If you want to write simple text, you need to use File.WriteRawLine and File.ReadRawLineBack.

This is mentioned in the manual:
https://adventuregamestudio.github.io/ags-manual/File.html#filewritestring
https://adventuregamestudio.github.io/ags-manual/File.html#filewriterawline

If you are already using File.WriteRawLine, but it causes this problem, then please post your script.
#2786
I'm not an artist and only speak as a "technical person"; from the technical perspective, I'd imagine, that the downside of a physical art vs digital art is:
a) more difficult to apply additional edits;
b) difficult to make copies (e.g. have two versions of same scene for testing);
c) no image layers, or more difficult to make ones.

All the above may affect game making, especially the later stages, when you (and/or your testers) are testing your partially complete game and realize that you need to adjust numerous small things.

For instance, in regards to layers, the game scenes are often composed of the pieces, where characters may walk behind some of them (e.g. a part of the wall, a furniture). Or objects that change shape (opened door or wardrobes, for a quick example). It's important to plan this ahead when designing a game scene. You can use masks to create "walk-behinds", but that may work well for pixel art where there's a clear pixel-precise edge between objects, and may not work well for other art styles. So, with digital painting, authors often create scenes split into layers, so that they could adjust different pieces separately, move them around, and export as separate sprites. With real painting, I'd imagine, that would require even more careful planning, and maybe extra editing in a graphic software.

Doing game prototype with unfinished or simple art may also help; that is - only draw complete picture after you've got game logic worked out and tested.

I assume real paintings might work best for the visual-novel style of the game though, where the characters don't walk freely around, and there are little to none moving parts overall.
#2787
Quote from: Pajama Sam on Wed 27/07/2022 16:21:39
Can you write to the file in installdir?

Have you read the article I linked in my reply above?

No, you cannot, you may write in $SAVEGAMEDIR$ or $APPDATADIR$. Also, if you want to overwrite a file that comes with the game, this is what I proposed in my first reply:
Quote
If you need to have some file distributed along with your game's exe, to which you also want to write as the game runs, then you could have default file provided with the game, but write into a separate file in $SAVEGAMEDIR$ (for example). When reading, first check if a new file exists in $SAVEGAMEDIR$, and if not then read the default from $INSTALLDIR$.

#2788
Quote from: Pajama Sam on Wed 27/07/2022 15:57:14
Where is the savegamedir and where is the Installdir and appdata dir?

The $INSTALLDIR$ is always the location of game's exe.

As for $SAVEGAMEDIR$ and $APPDATADIR$, their actual location depends on operating system, and may also be overridden by player's config. Players may change these locations to any custom path if the like, after which they are themselves responsible for the game to work correctly.

For example, on Windows by default $SAVEGAMEDIR$ is located in "%USERPROFILE%/Saved Games/<GameName>", and the $APPDATADIR$ is located in "C:/ProgramData/Adventure Game Studio/<GameName>".
#2789
Explicitly writing to the game directory is forbidden, as the game may be run from a readonly location, or location where user does not have write permissions.

How and where you can open files is explained in the manual:
https://github.com/adventuregamestudio/ags-manual/wiki/File#fileopen

I very much recommend to use location tags to tell engine clearly where you want to open the file ($INSTALLDIR$, $SAVEGAMEDIR$ and $APPDATADIR$).

If you need to have some file distributed along with your game's exe, to which you also want to write as the game runs, then you could have default file provided with the game, but write into a separate file in $SAVEGAMEDIR$ (for example). When reading, first check if a new file exists in $SAVEGAMEDIR$, and if not then read the default from $INSTALLDIR$.
#2790
Quote from: Jess McD on Tue 31/05/2022 02:17:33
The goal is to simultaneously play the background music (mp3) and the video (with it's audio as well).

Unfortunately, if *that* is the goal, then the Direct3D plugin won't help, because it does not play any sounds. It simply does not support any audio output.

It could have been a better first solution to fix this in the engine and let play both sound from the game and video at the same time. That might be a trivial thing to do.
(That of course won't fix the issue that the video is always covers and blocks the rest of the game, including game GUI, if that matters).

If using plugin, that would require expanding plugin further and, for instance, connect to SDL2 audio, since 3.6.0 engine now uses SDL2 that possibly may be shared between engine and plugin.

Quote from: Jess McD on Mon 30/05/2022 05:34:42
If not, does anyone know of any other game development software that is well suited for developing FMV adventure games?

To be honest, I do not know what classifies as a FMV game exactly (what features it must have), but you also may check out Ren'Py, it's a visual novel engine, and afaik can play videos too.


EDIT
I made a test build based on 3.6.0 which allows to keep both game and video sounds. I think it's okay to add to 3.6.0, as the changes are quite trivial.
https://cirrus-ci.com/task/5318930892849152
(the download links are under "Artifacts" header)

The new option for both sounds is 20 (so 20 for playing video in original size, 21 for making video fit the screen).
#2791
Quote from: Jess McD on Mon 25/07/2022 01:22:54
Code: ags
Failed to save room room1.crm; details below
GlobalScript.ash(7): Error (line 7): expected variable or function after import, not 'D3DVideo'


Sorry for asking so many questions - this is the first time I've used a plug-in.

Sorry, I said it wrong, it's D3D_Video, not D3DVideo.
This is mentioned in the original plugin's documentation here: http://www.serpentpictures.net/ags_d3d/ where it sais "b) Playing a video over the background"


EDIT:
Quote from: Jess McD on Mon 25/07/2022 01:22:54Getting the music to keep playing while a video plays is one the last obstacles to overcome for my little proof of concept game - then I can start developing the real thing!

I was curious and found your previous posts about the game you're trying to make here: https://www.adventuregamestudio.co.uk/forums/index.php?topic=60020.0

I must mention that this plugin does not play any sound, it technically has no audio output, so it only displays video frames. I should have mentioned this in the description earlier.
Resolving the sound issue would require either to fix the engine and let it play video sounds simultaneously with the game sounds (that's perfectly possible to do), or extend the plugin to support audio output.
#2792
So, how do they look in game; do they appear too big compared to the screen, or to other things? Could you show the screenshot of a problem?
#2793
Quote from: vga256 on Sun 24/07/2022 16:03:32
Hearing no objections to the idea, please consider this as a feature request for a future release of 3.6.x! :)

I think our current thought is to shift to developing "AGS 4" and only keep 3.* branch for perfomance improvements. This is way long overdue.
#2794
AGS has a property of "game resolution", it's on top of the General Settings. This "game resolution" defines the size of the game view, so to speak, and all sprites will be drawn in that resolution.
For instance, if game resolution is 320x200, then 48 x 48 sprite will occupy about 1/4 of the game's height.

But when the game is run in a window, it also may scale to that window. E.g. if your game is 320x200 and your desktop is 1920x1080, then whole game may be scaled x6 and look 6 times bigger, obviously. This scaling is controlled by the game config, which also may be changed by players to their preference when they run your game.

Now, when you say that imported sprites become too big, I cannot really tell what do you mean exactly, I only have some guesses of what could happen, so it would be best if you elaborate on the situation. What are your game settings, do these sprites appear big in the editor when you preview them or when running the game, do your walkable areas apply any scaling to characters, and so on: there are several things that may affect visual representation. Perhaps you could post a link to a sprite, and then a screenshot of how that looks in your game to illustrate the case?
#2795
Quote from: Jess McD on Sat 23/07/2022 21:46:38
I placed:

Code: ags
// define video
D3DVideo* video;


at the top of the global script, but I still get the undefined token error on the "video = D3D.OpenVideo ....." line of my room1 script.

If you are using this variable only in the room script, then you should declare it in the room script. Room script does not see variables declared inside the global script.

If you want to use this variable throughout the game, in global script and multiple rooms, then you need to place it in global script and import/export it.
Code: ags

// in GlobalScript.asc
D3DVideo* video;
export video;

// in GlobalScript.ash
import D3DVideo* video;


AGS manual has this article about sharing variables between scripts:
https://adventuregamestudio.github.io/ags-manual/ImportingFunctionsAndVariables.html
#2796
Quote from: Jess McD on Sat 23/07/2022 20:49:56Everything works just fine, until I try to add the video.  The plug in instructions just had the code, but not a lot of explanation, so I'm sure I just missed something

In your code you are using a variable called "video", but you have not declared it anywhere. Since you are using it in multiple functions, you need to declare a global variable, somewhere at the top of your script:
Code: ags

D3DVideo* video;

#2797
After testing this case with various versions of AGS, I found that it's a regression appeared in 3.5.1, therefore I will have to fix this in 3.5.1 and release a new patch.

EDIT: you may try this temp build:
https://cirrus-ci.com/task/4844281574719488
#2798
Quote from: fernewelten on Sat 23/07/2022 07:18:25
So the dynamic sprite is duly deleted â€" this means when I call  Crate_Assign() again later on, it is extremely likely that DynamicSprite.CreateFromExistingSprite() will return this newly deleted sprite.

To clarify: it may return same slot number, but it cannot return same sprite, as when sprite is deleted - it is deleted and there's nothing to return. When the new sprite is created from the existing sprite - the absolutely new sprite is allocated in memory and painted a copy of a requested sprite on it, so it's guaranteed to be new. There's a way to test this: try drawing newly created sprite somewhere else on screen.

The explanation that I have at the moment is that the object's cached texture is not updated. The engine updates the texture only when it detects a difference with the previous parameters. There's a theoretical assumption that if the number of the sprite stayed the same when object is visible once more, it may think that nothing has changed since it last displayed the object, and so it won't update the texture.

When the dynamic sprite is deleted, engine forces all objects using that sprite to reupdate. Therefore the workaround for this situation, although counter intuitively, to reset object's Graphic after you deleted the sprite (because in this case the engine will mark this object's cached texture for update).

That is, instead of
Code: ags

    Crate[crate].Object.Graphic = kGr_CrateEmpty;
    if (Crate[crate].DS != null)
    {
        debugit(String.Format("Deleting DS Graphic %d", Crate[crate].DS.Graphic));
        Crate[crate].DS.Delete();
    }


Do
Code: ags

    if (Crate[crate].DS != null)
    {
        debugit(String.Format("Deleting DS Graphic %d", Crate[crate].DS.Graphic));
        Crate[crate].DS.Delete();
    }
    Crate[crate].Object.Graphic = kGr_CrateEmpty;


As for the engine fix, it should reset object cache also when changing the Graphic to another sprite, probably. I only wonder if that's the only remaining case when such effect may take place. There are also Views, which frames could be dynamic sprites, so I need to investigate if there's a theoretical possibility that similar thing may happen if you delete/change the dynamic sprite of a view frame.
#2799
Quote from: Dave Gilbert on Fri 22/07/2022 15:30:15When I am in other scripts (room scripts, modules, and the like), I can right click on a command and select "go to definition" to send me to the declaration of the function. Is it possible to enable this for dialog scripts?

So, I looked into this, and apparently the full and proper support of autocomplete, keyword highlighting and "go to definition" in dialogs would require to rewrite like a half of the script editor.

Right now the dialog editor is made like a very stripped copy-paste version of the script editor, with some essential things not implemented. I found it is more or less possible to share most menu and context menu commands, and have a basic support for "Go to definition", but that "basic support" won't work for all symbols. Namely, it won't work for any local variables and their members (the reasons will be difficult to explain here), and maybe something else.

For example, if you have a struct "MyStruct" declared somewhere, with members "int a" and "int b", and in dialog script you type:
Code: ags

    MyStruct ms;
    ms.a = 10;

then "Go to definition" will work on "MyStruct", but won't work neither on "ms", nor "a".

Local variables are also not working with autocomplete at all in dialog. For example, typing "player." will open autocomplete list for Character's members, but having "Character *ch;" and typing "ch." won't open any autocomplete.

Long story short, if I add these commands now, they will be working with a number of exceptions.

To do this properly, we'd have to create a new parent class of editor, which has all the autocomplete, and searching for definitions supported correctly, and then derive both Dialog pane and Script pane from it. As 3.6.0 is closing the completion, making big changes like that is not desired.


EDIT: I've made an experimental version that shares most of the Edit menu and context menu commands between regular script and dialog editors, if anyone likes to try:
https://cirrus-ci.com/task/6417042428395520
#2800
Quote from: Dave Gilbert on Fri 22/07/2022 15:30:15When I am in other scripts (room scripts, modules, and the like), I can right click on a command and select "go to definition" to send me to the declaration of the function. Is it possible to enable this for dialog scripts?

I may look into this later today.
SMF spam blocked by CleanTalk