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

#12001
You could make debug functions that would correct your variables at runtime.
Replaying all game from start simply because couple of vars changed is waste of time. :(

For example, a simple GUI window, with buttons to correct (increase/decrease) some important stats.
#12002
You might have a mistake in program logic.
If you will put Children == 18 into your formula (with maxchildren == 17), you will get 106%.
This means your children count gets larger than maxchildren at some point.
#12003
Engine Development / Re: Skinning the winsetup
Thu 25/04/2013 09:18:00
Quote from: JJS on Thu 25/04/2013 08:37:15
Maybe extending the script functions (if that is even necessary) and generally implementing the setup as an AGS game would be a good idea.
<...>
Having the setup run inside the engine would make it instantly cross-platform (ScummVM works like this) and configurable by the average AGS developer (no need to compile anything).
I have certain worries about relying on script in this task. This would mean that it will depend on game developer to insert a proper setup inside a game. On other hand, commercial developers (and some freeware) may stand against having "standartized" setup in their game. Hard-coded feature would work for emulator (like ScummVM) but not for engine meant to run games that are not yet developed.
There should be some compromise, like hard-coded "default" setup gui with possibility to customize it. But it should be protected against developer's attempts to completely remove or break it maybe?

Quote from: JJS on Thu 25/04/2013 08:37:15
If the engine in setup mode starts with sane defaults (windowed, software rendering, 640x480, 32 bit game, sound disabled maybe) it should work as well as the current winsetup.
Would it be nice to have a setup callable at ANY moment in game with an option to reboot the game if hardware settings were changed?.
In this case we would need a "technical" mode that would unconditionally freeze the game.
Rebooting should not be done with common save/load functionality, IMO, because that may trigger unexpected side-effects. There might be separate function that just stores current game state and reloads it next time game is launched (with certain command arguments) without calling for "on save"/"on restore" script events.
#12004
I am curious (professionally), what does the game do when it sais "preloading animations"? Sorry if my question is a bit strange for "completed game announcement".
#12005
Engine Development / Re: Skinning the winsetup
Wed 24/04/2013 22:01:36
Well, it is possible (and not much difficult) to make a window app, that reads the control layout from xml document.

But I have doubts that would have much use apart from setting background image. Why would you change list/button positions for every other game?
#12006
I was thinking more about this, and I am starting to think I better not do any "quick fix" at all :-\.

Reason is, there could not be any ultimate "correct" way to blend one layer (gui controls) into another (main gui surface).

What Chris Jones did is a blender that summs alpha (decreases total translucence of gui) and replaces main gui colors with gui control ones.
What I suggested to do up there is to summ alpha and combine colors.
These are two distinctive methods, but it cannot be said that the first is incorrect and the second correct. They both are correct - for what they are supposed to do. We may speak only about choosing one as "default", depending on what game creator usually expects from translucent gui controls being drawn over (possibly) translucent gui window. And what this "default" expectation is? I don't know. What do you think?

Ideally there should be a blending option for every gui window, at least, or even gui control. But that is more work than a common hotfix.
#12007
The Rumpus Room / Re: Name the Game
Wed 24/04/2013 13:57:27
Yes.
#12008
Engine Development / Re: Skinning the winsetup
Wed 24/04/2013 13:45:19
The setup is a part of engine. "Winsetup.exe" just calls engine with "--setup" argument, which makes it display configuration window before running the game.
The look of the window is defined by resource description, incorporated in the engine.
At the moment, the engine displays setup even before loading any of the game data.
I guess it may be possible to change this, but it would be pretty messy IMO.
What about making separate (and cross-platform!) application instead?
#12009
http://en.wikipedia.org/wiki/CDATA
http://msdn.microsoft.com/en-gb/library/system.xml.xmltextwriter.writecdata.aspx

EDIT: Duh! beaten by JJS.

Quote from: JJS on Wed 24/04/2013 12:51:32
It tells the xml parser to ignore everything inside the CDATA field, so that it doesn't get interpreted as xml
Simply put, this allows to write any special chars there without breaking xml structure.
#12010
The Rumpus Room / Re: Name the Game
Wed 24/04/2013 12:34:01
Beneath a Steel Sky :D

//-----------------------------------------------------------------------
Okay, I am right, right?

Here's the next one, I just cut off the interface to make it... less clear:
[imgzoom]http://img15.imageshack.us/img15/1214/9764b8d749eb7dbc.jpg[/imgzoom]
#12011
Does anyone know any games where the GUI controls with alpha channel were used?

Also, I posted my ideas about the possible fix here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=47699.0
Unfortunately no one made any comment;  should have posted in this forum instead.

I ended up with this blender function:
Code: cpp

union
{
    struct
    {
        unsigned char r;
        unsigned char g;
        unsigned char b;
        unsigned char a;
    } rgba;
    unsigned long color;
} col_x, col_y, col_r;

// x is color of overlaying surface pixel
// y is color of underlying surface pixel
// n is not used for this blender
unsigned long _fixed_additive_alpha_blender(unsigned long x, unsigned long y, unsigned long n)
{
    col_x.color = x;
    col_y.color = y;

    if (col_y.rgba.a == 0)
        return x;
    if (col_x.rgba.a == 0xff)
        return x;
    if (col_x.rgba.a == 0)
        return y;

    col_r.rgba.a = col_x.rgba.a | col_y.rgba.a;
    col_r.rgba.r = col_y.rgba.r - (((col_y.rgba.r - col_x.rgba.r) * col_x.rgba.a) / 0xff);
    col_r.rgba.g = col_y.rgba.g - (((col_y.rgba.g - col_x.rgba.g) * col_x.rgba.a) / 0xff);
    col_r.rgba.b = col_y.rgba.b - (((col_y.rgba.b - col_x.rgba.b) * col_x.rgba.a) / 0xff);
    return col_r.color;
}


I think it is also possible to speed it up a little by replacing "/ 0xff" with ">> 8" at the cost of loosing a small bit of precision (~1/255).
BTW, it is not 100% precise anyway, because I removed the branch for X color component larger than Y component. In such case the value is the result of 8-bit variable overflow; but since color component has the same value range as unsigned 8-bit variable, it will be generally correct, with the loss of precision only about 1/255 (should not be noticeable by human eye).
#12012
Quote from: san.daniele on Wed 24/04/2013 10:32:12
edit: if i get it right, that simple line in the dialog could be even used to trigger events in several rooms (as long as all those objects in question look the same and I place them with the same Object-ID).
Well, yes, although I find such practice a bit unsafe, because if you call this dialog from room which does not have object N, this will cause game to crash.

For safer way, you may check CallRoomScript function.
#12013
If the dialog is supposed to be run from one room only, you may use "object" array:
Code: ags

 object[N].SetView();

where N is the index of your object in that room.

If the dialog may be called from different rooms, you may set global variable and initialize object state in room's "Before Fade-in" handler.

Sort of-
in dialog script:
Code: ags

  if (player.Room == NNN)
    object[N].SetView();
  else
    Must_Set_View_For_My_Object = true;

where NNN is a number of room where object is located.

in room script:
Code: ags

function room_Load()
{
  if (Must_Set_View_For_My_Object)
  {
    oDoor.SetView();
    Must_Set_View_For_My_Object = false;
  }
}
#12014
Quote from: Khris on Wed 24/04/2013 04:23:51
hawkofrawk  is talking about this screenshot from the tutorial :)

Oooh...  (wtf)
lol, yes, it may cause confusion.
#12015
Quote from: Secret Fawful on Wed 24/04/2013 05:47:02
I'm not sure you're aware, but in AGS 3.2, instead of printing null in place of %s, it displays an error instead, stating "One of the string arguments supplied was not a string".

Apparently, earlier versions of AGS do not do this.
That's true. This was changed right in one of the latest versions. I remember Technocrat's "Operation Forklift" has problems running on newer engine because of that.
#12016
I may not know something (actually a lot) about this project, but why don't you make a plugin?

If I understand correctly, main idea is to draw a "rotated" bitmap?
Might be adding some functionality to the engine might help (in perspective)?

#12017
Err.... what?
Now it is "false"...
Anyway, you need to use "=" operator to assign value to variable.
#12018
You have the line:
Code: ags

oFoyerKey.Visible-true;

It should be  "=true", not "-true".
#12019
The Rumpus Room / Re: Name the Game
Tue 23/04/2013 23:27:35
Pink Panter?
#12020
Engine Development / Re: Text translation
Tue 23/04/2013 23:08:38
Ok, I added the Translated property to ListBox only for now for backward compatiblity (defaults to false for imported older projects). It may be easily added to buttons and labels if needed later.
SMF spam blocked by CleanTalk