Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.

Messages - Crimson Wizard

Pages: [1] 2 3 ... 375
There may be a game from me and Jim Reed (art + tech ideas), eventually.

I can frankly admit that lost capability of working under time pressure, and if not for Jim and him keeping pushing me, I would give up somewhere in the middle of the month.

Had to significantly simplify original concept to be able to make it in time. :-X . Opponent AI is to blame...

Hopefully the game will be at least playable. Even if not, I still keep hopes to make a more complete game later, because the code and art have good potential.

A small teaser:
Add spoiler tag for Hidden:

Advanced Technical Forum / Re: hq2x filter glitches
« on: 19 Nov 2017, 23:36 »
When running a 320x200 game fullscreen with the hq2x filter, the game appears with black borderas at the top and bottom. That is fine. However on the first screen some graphics are painted on these borders anyway (I assume by the filter) and remain visible throughout the rest of the game. It would help to paint over the borders as black whenever the screen is updated.

What version of AGS is that? I recall doing some fixes to Hq filters couple of years ago.

From changelog:
VERSION 3.3.4, July 2015

- Fixed Hq2x and Hq3x filter rendering when the display resolution requires side borders.
- Fixed Hq2X and Hq3x filters leaving graphic artifacts on letterbox borders.

Mouse.IsModeEnabled was added to AGS built-in functions in 3.4.1, which means that you need to disable (comment out) it in the script module.

Fixed first answer, the previously posted function was not really interesting so I just posted important bits

As for DrawingSurface.DrawImage(), that uses slightly different ones:

Code: C++
  1.     inline int Trans100ToAlpha255(int transparency)
  2.     {
  3.         return ((100 - transparency) * 255) / 100;
  4.     }
  6.     inline int Alpha255ToTrans100(int alpha)
  7.     {
  8.         return 100 - ((alpha * 100) / 255);
  9.     }

Transparency works bit differently in different parts of AGS, probably because its concept changed over time.

GUI, in particular, use following algorithm (refactored into separate utility function):
EDIT: posted wrong function first.
Code: C++
  1.     // Special formulae to reduce precision loss and support flawless forth &
  2.     // reverse conversion for multiplies of 10%
  3.     inline int Trans100ToAlpha250(int transparency)
  4.     {
  5.         return ((100 - transparency) * 25) / 10;
  6.     }
  8.     inline int Alpha250ToTrans100(int alpha)
  9.     {
  10.         return 100 - ((alpha * 10) / 25);
  11.     }

Your Edit 2 has found the root of the issue. The game was running fine for me because the .cfg existed in my Saved Games folder. However, deleting the save game folder - to mimic a fresh install from Steam - means the game defaults back to Max Round multiplier etc when the game is loaded up for the first time. Do you know how I can avoid this happening - as obviously someone installing the game for the first time will not have this .cfg file in the Saved Games folder. Even though the other .cfg file exists in the game folder, it still reverts back to Max round multiplier.

This was an oversight on my part since AGS 3.3.5, that you cannot set default game config by convenient means anymore.
Since AGS 3.4.1 you can use "Default Setup" pane in the editor for that.
Before 3.4.1 - edit configuration with winsetup, then copy file from Saved Games to Compiled folder.


This is happening too often, people use default settings and get unexpected results, that they do not know how to fix in settings. This means that "stretch" must be default.

This is it, I am adding separate scaling settings for windowed and fullscreen modes.

How do I get AGS to save games to a folder in the game folder instead of to a folder in My Docuements?
This can be now done only through game setup.
If you are using latest AGS 3.4.1, then there is the Default Setup pane, where you can set "Use custom game save path" option.
For AGS 3.4.0 you would need to do that on advanced tab in winsetup, but also copy acsetup.cfg from My Documents to Compiled folder when you're done, or these changes will stay in your personal settings (in my documents).

I actually thought you get the line number as well, though I don't understand how that can be available after compilation.)

Line numbers are saved also, in a form of special command code "beginning of line".

So, would *anyone* be able to reverse engineer a game based on what was commented in their code? A catagoric no?
Comments are not saved in compiled code.
Compiled code on its own can be reverse-engineered, there is already an utility that decrypts AGS compiled scripts into human-readable list of operations (the result is not actual AGS script source, but in theory may be used to understand what is going on in the program and try to recreate it).

Are names of variables recorded or are they also translated to just numeric code (like variable 'GotTheCoins' becomes '&102'?)
Names of exported variables and functions are recorded for some reason, non-exported variables are known only by their relative offset in memory.

Comments are skipped during compilation, that's general rule for compilers.
Comment tag (//, /* */) tells compiler to "ignore this text".

However, since AGS is a script engine (correct me if I'm wrong), and has a copy of the game scripts within the interpretor within an .exe file, it could be thought of as an exe which is really just one giant complex zip file?

AGS Editor compiles the script source to byte code, where each command from your script may be represented by one or more numberic codes, basically.
AGS does not have a copy of original scripts withing exe file, only the compiled byte-code. **Before AGS 3.0 it actually contained room script sources for some reason, but it no longer does.
Text from the actual script commands (character speech, etc) is contained "as-is", from what I remember, in a separate table. Some texts are stored encrypted, but I do not remember which ones (AGS is pretty non-consistent there).

:/ it appears I don't have the command takeown in my system for some reason, will try to figure out why.

I could add this to exceptions, in which case AGS will fallback to copying the files (it does that in case of lack of permissions).

EDIT: Actually... I realized do not know what I should do; first need to investigate why it needs this command exactly, and whether there is a way around without it.

where should I place the Linux Build Pack? I created a folder named Linux on Program Files/Adventure Game Studio 3.4.1 with the contents of the attached folder, but Linux build didn't work. :/ (Compiled/Linux is slightly empty)

Hmm, things to check: -

1) These files should be in Adventure Game Studio 3.4.1\Linux\, meaning not Adventure Game Studio 3.4.1\Linux\Linux\
2) "Linux" checkbox should be ticked in General Settings - Compiler - Build target platform
3) Run Build Exe.

(Compiled/Linux is slightly empty)
Do you mean the folder was created but no files inside? Was that folder there before or just appeared?

Just reviving this thread to check that there isn't an update to this. It's still not possible to actually access these indeterminate parameters in AGS, right?


AGS 3.4.1 RC2
(also updated first post)

Changes since RC 1:

 - Fixed unhandled exception occuring when user types "#undef", "#ifdef" or "#ifndef" on the last line of the script.
 - Fixed "Script compatibility level" option was incorrectly set to "v3.2.1" every time a project is loaded. (Bug introduced in RC1)

* Also included Linux build pack (

If no critical issue is found in the course of this week, I guess we may call it a final release.

Beginners' Technical Questions / Re: inverted icon???
« on: 13 Nov 2017, 22:16 »
When importing sprite, the import window let you choose how the transparent part is deduced. Default is to take color from "top-left pixel" as transparent, but for your cursor sprite you cannot take top-left pixel, because it has non-transparent color. So you need to choose something else, like "top-right pixel".

This is probably a stupid question - but which URL directs me to the latest copy of the iOS libraries?

Would seem to the second one, but it's hard to know which one is more modern.

Regarding official repository, do not use master's top, because it contains in-development state. Look for stable release tags, such as and release-3.4.0 branch (latest stable release).
I cannot answer other questions though.

I guess I should leave this until next (minor) update or patch. This is not the only thing that makes me concerned, to be honest, another one is new file paths restrictions: at first they seemed to be logical, but I have doubts about usability (they became stronger when I actually tried to create a game with AGS).

I would need to discuss this before changing anything again.

Advanced Technical Forum / Re: How to crossfade music
« on: 13 Nov 2017, 13:08 »
I looked the code but still couldn't figure out. If I use high priority, will the first music be allocated in the channel for music and the second be allocated in a random channel?

It is not allocated in a random channel, it is allocated on any free channel from the ones you reserved for this type. For that reason you need to reserve at least 2 channels for music type.
BTW, for that reason I am not sure priority is much useful here (unless you have situational music VS background music case).

Normally you start one music and stop the previous one - to prevent them playing at the same time (since you have 2 music channels now). But when you need crossfade, you start another music without stopping previous, the new one will play on the second free channel, and the first channel will eventually be freed when the previous music finished volume decay and stopped.

This situation has no solution without separate scaling setting for windowed mode.

For example, many people complained that the game is not stretched to whole fullscreen. For that reason I was considering to make "proportional stretch" be default scaling. But if I do that, then the people who prefer to play in windowed mode will complain that window is too large by default.

And the preference about how the game should behave if mode is switched during runtime (which scaling option used for alternate mode) also may be different.

edit2 : it should be a post-3.4.1 discussion, right?

There are already complains and confusion about this, and who knows when next version will be.

Pages: [1] 2 3 ... 375