AGS Awards nominations close at 13:59 GMT on Saturday 10 February 2018. You haven't yet nominated, so you've got 20 days and 14 hours left to play the games and decide which to nominate!

Author Topic: AGS Draconian Edition 3.4.11 r10 (December 31, 2017)  (Read 41117 times)

monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
Re: AGS Draconian Edition
« Reply #20 on: 29 Sep 2011, 21:17 »
I was actually wondering why you assumed it to be completely impossible without the compiler being open. I mean, I don't see why the linking would be so drastically different as to prevent internal changes to the engine but yet work fine for plugins. Obviously the plugins are a separate compilation (assembly), but the linking I should think would work the same.

In any case, good, someone's finally looking into improving the engine. :=
User was banned for this post.

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: AGS Draconian Edition
« Reply #21 on: 29 Sep 2011, 22:07 »
I guess i just wasnt as cool as you :(

Try this acwin:

http://www.thethoughtradar.com/AGS/acwin.zip

It allows true alpha blending.

Only done preliminary testing but seems to work perfectly fine.

Heres the code for Alan's version

Code: Adventure Game Studio
  1. void Manual_Draw(BITMAP *src, BITMAP *dest, int destx, int desty, int trans)
  2. {
  3.         trans = 100 - trans;
  4.  
  5.         long srcWidth, srcHeight, destWidth, destHeight, destColDepth;
  6.  
  7.         acquire_bitmap(src);
  8.         acquire_bitmap(dest);
  9.  
  10.         unsigned char **srccharbuffer = src->line; //8bit
  11.         unsigned short **srcshortbuffer = (unsigned short**)srccharbuffer; //16bit;
  12.     unsigned long **srclongbuffer = (unsigned long**)srccharbuffer; //32bit
  13.  
  14.         unsigned char **destcharbuffer = dest->line; //8bit
  15.         unsigned short **destshortbuffer = (unsigned short**)destcharbuffer; //16bit;
  16.     unsigned long **destlongbuffer = (unsigned long**)destcharbuffer; //32bit
  17.  
  18.         int transColor = bitmap_mask_color (src);
  19.  
  20.         srcWidth = src->w;
  21.         srcHeight = src->h;
  22.         destWidth = dest->w;
  23.         destHeight = dest->h;
  24.         destColDepth = bitmap_color_depth(dest);
  25.  
  26.         if (srcWidth + destx > destWidth) srcWidth = destWidth - destx;
  27.         if (srcHeight + desty > destHeight) srcHeight = destHeight - desty;
  28.  
  29.         int startx = MAX(0, (-1 * destx));
  30.         int starty = MAX(0, (-1 * desty));
  31.  
  32.        
  33.         int srca, srcr, srcg, srcb, desta, destr, destg, destb, finalr, finalg, finalb, finala, col;
  34.  
  35.         for(int x = startx; x < srcWidth; x ++)
  36.         {
  37.                
  38.                 for(int y = starty; y <  srcHeight; y ++)
  39.                 {
  40.                         int srcyy = y;
  41.                         int srcxx = x;
  42.                         int destyy = y + desty;
  43.                         int destxx = x + destx;
  44.                                 if (destColDepth == 8)
  45.                                 {
  46.                                         if (srccharbuffer[srcyy][srcxx] != transColor) destcharbuffer[destyy][destxx] = srccharbuffer[srcyy][srcxx];
  47.                                 }
  48.                                 else if (destColDepth == 16)
  49.                                 {
  50.                                         if (srcshortbuffer[srcyy][srcxx] != transColor) destshortbuffer[destyy][destxx] = srcshortbuffer[srcyy][srcxx];
  51.                                 }
  52.                                 else if (destColDepth == 32)
  53.                                 {
  54.                                         //if (srclongbuffer[srcyy][srcxx] != transColor) destlongbuffer[destyy][destxx] = srclongbuffer[srcyy][srcxx];
  55.                                        
  56.                                         srca =  (geta32(srclongbuffer[srcyy][srcxx])) * trans / 100;
  57.            
  58.                                         if (srca != 0) {
  59.                                                    
  60.                                                 srcr =  getr32(srclongbuffer[srcyy][srcxx]);  
  61.                                                 srcg =  getg32(srclongbuffer[srcyy][srcxx]);
  62.                                                 srcb =  getb32(srclongbuffer[srcyy][srcxx]);
  63.    
  64.                                                 destr =  getr32(destlongbuffer[destyy][destxx]);
  65.                                                 destg =  getg32(destlongbuffer[destyy][destxx]);
  66.                                                 destb =  getb32(destlongbuffer[destyy][destxx]);
  67.                                                 desta =  geta32(destlongbuffer[destyy][destxx]);
  68.                
  69.  
  70.                                                 finalr = srcr;
  71.                                                 finalg = srcg;
  72.                                                 finalb = srcb;  
  73.              
  74.                                                                
  75.                                                 finala = 255-(255-srca)*(255-desta)/255;                                              
  76.                                                 finalr = srca*finalr/finala + desta*destr*(255-srca)/finala/255;
  77.                                                 finalg = srca*finalg/finala + desta*destg*(255-srca)/finala/255;
  78.                                                 finalb = srca*finalb/finala + desta*destb*(255-srca)/finala/255;
  79.                                                 col = makeacol32(finalr, finalg, finalb, finala);
  80.                                                 destlongbuffer[destyy][destxx] = col;
  81.                                         }
  82.  
  83.                                 }
  84.                 }
  85.         }
  86.        
  87.         release_bitmap (src);
  88.         release_bitmap (dest);
  89.  
  90.        
  91.  
  92. }
  93.  
  94. void DrawingSurface_DrawImage(ScriptDrawingSurface* sds, int xx, int yy, int slot, int trans, int width, int height)
  95. {
  96.   if ((slot < 0) || (slot >= MAX_SPRITES) || (spriteset[slot] == NULL))
  97.     quit("!DrawingSurface.DrawImage: invalid sprite slot number specified");
  98.  
  99.   if ((trans < 0) || (trans > 100))
  100.     quit("!DrawingSurface.DrawImage: invalid transparency setting");
  101.  
  102.   // 100% transparency, don't draw anything
  103.   if (trans == 100)
  104.     return;
  105.  
  106.   BITMAP *sourcePic = spriteset[slot];
  107.   bool needToFreeBitmap = false;
  108.  
  109.   if (width != SCR_NO_VALUE)
  110.   {
  111.     // Resize specified
  112.  
  113.     if ((width < 1) || (height < 1))
  114.       return;
  115.  
  116.     sds->MultiplyCoordinates(&width, &height);
  117.  
  118.     // resize the sprite to the requested size
  119.     block newPic = create_bitmap_ex(bitmap_color_depth(sourcePic), width, height);
  120.  
  121.     stretch_blit(sourcePic, newPic,
  122.                  0, 0, spritewidth[slot], spriteheight[slot],
  123.                  0, 0, width, height);
  124.  
  125.     sourcePic = newPic;
  126.     needToFreeBitmap = true;
  127.     update_polled_stuff();
  128.   }
  129.  
  130.   BITMAP* dest = sds->GetBitmapSurface();
  131.  
  132.  
  133.   if (bitmap_color_depth(sourcePic) != bitmap_color_depth(dest)) {
  134.     debug_log("RawDrawImage: Sprite %d colour depth %d-bit not same as background depth %d-bit", slot, bitmap_color_depth(spriteset[slot]), bitmap_color_depth(abuf));
  135.   }
  136.  
  137.  Manual_Draw(sourcePic, dest, xx, yy, trans);
  138.  
  139.  
  140.  
  141.   if (needToFreeBitmap)
  142.     destroy_bitmap(sourcePic);
  143. }
  144.  
« Last Edit: 30 Sep 2011, 22:08 by Calin Leafshade »

Re: AGS Draconian Edition
« Reply #22 on: 30 Sep 2011, 23:49 »
Thank you Calin, I've applied your changes.
I'm wondering if I should release the current version I'm working on, or compile it withouth the region tinting modification, becuse while it works all cool and dandy through scripting, it breaks up if you set region tinting from the editor. (Not sure what I'm missing there...)


- Alan

Shane 'ProgZmax' Stevens

  • Mittens Serf
  • AGS Project Tracker Admins
  • GARBAAAAAGE DAAAAAAY!
    • I can help with animation
    •  
    • I can help with characters
    •  
    • Lifetime Achievement Award Winner
    •  
    • I can help with making music
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • Shane 'ProgZmax' Stevens worked on a game that was nominated for an AGS Award!
      Shane 'ProgZmax' Stevens worked on a game that won an AGS Award!
Re: AGS Draconian Edition
« Reply #23 on: 01 Oct 2011, 08:29 »
Some nice improvements here, Alan.  I'm not sure how much utility people will get out of the added filters since they're optional (so if you want a game to look old school with scanlines this wouldn't be the way to enforce it) but I suppose some people will try these out.  You might add a color scheme option to the preferences section of the editor so people can adjust the colors themselves and save the result to the prefs file.  That would be pretty cool.

Re: AGS Draconian Edition
« Reply #24 on: 08 Nov 2011, 21:11 »
Since I've been busy with things and there's been movements on AGS' code I'm uploading my current code.
I did not include "nativelibs" and "manual". Also, beware of the region tinting code, since it breaks compatibility expecting 5 values instead of the usual 4 and setting region tint through the editor does not work right yet. Unless you need region tinting as badly as me you're probably better off without.
Don't think badly of me of how I handled the alternate editor colors, I was doing trial and error, if you want a better way to handle them try looking at the source of apps like notepad++ that have a good implementation of Scintilla.

Calin's alpha blend fix is included.

http://www.mediafire.com/?7a6561ucdvwnd5i


- Alan

monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
Re: AGS Draconian Edition
« Reply #25 on: 28 Nov 2011, 00:18 »
For some reason I thought that using this "alpha blend fix" would be faster than re-rendering the entire screen. However, when I did a speed test comparison, I'm actually experiencing a speed drop of 10 FPS by drawing a series of sprites semi-transparently onto a transparent surface as opposed to snagging the background frame, drawing everything onto it to recreate the scene, and then drawing the sprites semi-transparently onto that.

Despite Calin's statement of its inefficiency (due to locking the surface, drawing a single pixel or image, and then unlocking it), the AGSBlend plugin produced better results than this. So, I'm a bit confused why:

Code: Adventure Game Studio
  1. // rep_ex
  2. DynamicSprite *sprite = DynamicSprite.Create(width, height, true);
  3. DrawingSurface *surface = sprite.GetDrawingSurface();
  4. // draw images...
  5. surface.DrawImage(100, 250, 30, 85); // ...etc.
  6. surface.Release();
  7. theOverlay = Overlay.CreateGraphical(x, y, sprite.Graphic, true);
  8. sprite.Delete();

Is so inefficient with this version of acwin.

Edit: I don't experience the drop with a GUI in place of the overlay. I'm continuing to tinker with it.
« Last Edit: 28 Nov 2011, 02:52 by monkey_05_06 »
User was banned for this post.

Calin Leafshade

  • AGS Project Tracker Admins
  • Long live King Cat!
    • I can help with making music
    •  
    • I can help with voice acting
    •  
    • Calin Leafshade worked on a game that was nominated for an AGS Award!
      Calin Leafshade worked on a game that won an AGS Award!
Re: AGS Draconian Edition
« Reply #26 on: 28 Nov 2011, 07:17 »
Overlays are a special case I believe.

The underlying workings of allegro are quite arcane and I dont quite fully understand how it works.

I have slowly begun documenting the AGS source but its a daunting process. I've only just finished documenting the file structure and CLib (I also ported CLib it to C# to better understand how it packs the files).

My suggestion is to avoid overlays where possible.

ig299

  • Guest
Re: AGS Draconian Edition
« Reply #27 on: 22 Jan 2012, 18:33 »
is this a new version?

Re: AGS Draconian Edition
« Reply #28 on: 23 Jan 2012, 08:41 »
is this a new version?


Not exactly, this is  just a different version with some quirks. I released the source so other devs could take the pieces they need.
In the first post there's an older version, but more compatible. (no /almost/ improved region tinting and no Calin's blend)
If you spend a lot of time coding you might want to try the editor with dark colors.

- Alan
« Last Edit: 23 Jan 2012, 08:45 by Alan v.Drake »

Re: AGS Draconian Edition
« Reply #29 on: 24 Jan 2012, 04:02 »
[..]as opposed to snagging the background frame, drawing everything onto it to recreate the scene[..]
Seeing as this is slightly related to your conversation, would it be possible to have something similar to  DynamicSprite.CreateFromScreenShot  that actually grabs the screen before it applies the overlays (GUI's, cursors, speech, etc)?

Also Monkey, how are you drawing the characters and such behind walkbehinds with your method? Or is this done on a pixel per pixel level while checking the walkbehinds? Drawing everything onto the background sprite, then checking walkbehinds and drawing a background pixel over top of anything that a character/object actually is.

Re: AGS Draconian Edition
« Reply #30 on: 06 Feb 2012, 00:43 »
A little patch to support WFN fonts with 256 characters, which means accented characters and whatnot.
There won't be any compatibility issues since the format was not altered.

256-WFN are also compatible with older versions of acwin, even though they'll only display the usual 128 chars.

Source only: http://www.mediafire.com/?2yb9duar7r285lh

To actually make a 256-WFN, though, you'll have to wait for Radiant to update his FontEdit.
Unless you have an hex editor and a strong feeling of confidence.

p.s: This is only for the engine, I can't include support into the editor because AGS.Native has no source.

- Alan

EDIT: Ehrm, seems like I had linked my compiled acwin which I advise not to use due to Region.Tint incompatibility, I've corrected the link now... sorry it was late.
« Last Edit: 07 Feb 2012, 00:36 by Alan v.Drake »

DrJone.s

    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with play testing
    •  
    • I can help with translating
    •  
Re: AGS Draconian Edition
« Reply #31 on: 24 Feb 2012, 16:53 »

Re: AGS Draconian Edition
« Reply #32 on: 24 Feb 2012, 18:44 »
Ah, I thought it was already possible to do, but I now see somethings breaks up along the way preventing the diagonal loops to show. I will look into it.

- Alan

Shane 'ProgZmax' Stevens

  • Mittens Serf
  • AGS Project Tracker Admins
  • GARBAAAAAGE DAAAAAAY!
    • I can help with animation
    •  
    • I can help with characters
    •  
    • Lifetime Achievement Award Winner
    •  
    • I can help with making music
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • Shane 'ProgZmax' Stevens worked on a game that was nominated for an AGS Award!
      Shane 'ProgZmax' Stevens worked on a game that won an AGS Award!
Re: AGS Draconian Edition
« Reply #33 on: 25 Feb 2012, 04:08 »
This isn't really the thread for this, it would be better to make a Feature Request: post in tech or simply follow some of the instructions I offer below.

So you want the character to only move in diagonals?  One way to do this would be to avoid the ags movement logic and do a simple script for movement yourself that checks where the mouse click is relative the x/y of the player and then run the animation of choice until they come to a stop, at which point you'd select a standing frame (it's only slightly more complicated than I'm explaining here since you would also need to check for standing on a walkable area so the character cannot just move anywhere).  So basically, if you clicked up and to the left of the character you would play the NW walking animation and then do a repeat check for the character to stop moving, at which point you'd change the character frame to the NW standing frame.  This would be done for a down-left click, a down-right click, and an up-right click (you would supply number ranges in each case that fit into these directions).  In the rare case of a pure up/down/left/right click you'd just appoint one of the diagonals to handle the job.  I hope this makes some sense as I'm a bit tired right now.

Bear in mind that I don't personally believe the AGS editor needs native support for this since it's so easy to do via scripting but if someone wants to implement in then there's no harm in having it as an option.  My advice, though, is that since you can do this through scripting is that rather than wait, start on it with some help from beginner's tech.

Snarky

  • Local Moderator
  • Mittens Earl
  • Private Insultant
    • I can help with proof reading
    •  
    • I can help with translating
    •  
Re: AGS Draconian Edition
« Reply #34 on: 25 Feb 2012, 11:18 »
This is a good example of the kind of functionality I think should ultimately be separated from the AGS core and turned into a user-editable module. Sometimes you want to use just an up-down walkcycle, or just a left-right, or just the diagonals. Sometimes you might want to adjust the angles that separate each direction (even make it vary depending on the walkable area angle and distance). Any non-standard version of this currently requires you to override the built-in walkcycle system, while it would be better if you could just set the game to use a different module.

Re: AGS Draconian Edition
« Reply #35 on: 24 Mar 2012, 20:22 »
AGS Draconian r2 (March 24, 2012) DOWNLOAD
  • Fixed the previous issue when displaying tints that were set to regions from the editor.
  • Added an optional acwin_perspective.exe that handles better characters direction when in perspective, rename it to acwin.exe if you wish to use it (I did not test it with diagonals views).
  • 256 characters WFN font support without compromising compatibility (we just need an updated FontEdit now)

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: AGS Draconian Edition
« Reply #36 on: 28 Mar 2012, 15:46 »
That's really sexy.
On a similar topic: I was wondering if someone has released a "version" of AGS that includes all the ultimate plugins -- such as "Dialog Designer" and "Speech Center", for example.
It would be cool to upload it alongside the "regular" AGS on the donwload page, just with a "not supported, don't come whining if it doesn't work" warning label.

 

Re: AGS Draconian Edition
« Reply #37 on: 28 Mar 2012, 23:47 »
AGS Draconian r3 (March 29, 2012) DOWNLOAD
  • Windowed mode gamma support! Only for brightening, though, because I don't care about darkening and frankly I don't see the point, if you want to do that too, the source is at the usual place.

    - Alan

subspark

  • Some things, you just can't unsee.
    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with making music
    •  
    • I can help with play testing
    •  
    • I can help with proof reading
    •  
    • I can help with story design
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: AGS Draconian Edition
« Reply #38 on: 29 Mar 2012, 01:52 »
Love the updates Alan.
Would it be piss simple to get the luminance feature to work under conditions like:
Code: Adventure Game Studio
  1. if (this.type == _eTweenRegionTintR) {
  2.     int saturation = this.regionRef.TintSaturation;
  3.     int luminance = this.regionRef.TintLuminance;
  4.     if (saturation < 0) saturation = 0;
  5.     this.regionRef.Tint(Lerp(this.fromX, this.toX, amount), this.regionRef.TintGreen, this.regionRef.TintBlue, saturation, luminance);
  6.   }

Also, is there any reason why it breaks backwards compatibility? Why don't we just revert to the default luminance value if the parameter is not included, like the non-essential Animate parameters (eOnce / eBackwards) do?
It's no huge burden to comment out some code until the Tinting stuff is completed. Is it so far away?
     
Adlanto - A bold step into a valley of forgotten worlds - Coming Soon to Steam in August 2015!       Indiana Jones and the Fountain of Youth - Indy is back!

Re: AGS Draconian Edition
« Reply #39 on: 29 Mar 2012, 07:17 »
Love the updates Alan.
Would it be piss simple to get the luminance feature to work under conditions like:
Code: Adventure Game Studio
  1. if (this.type == _eTweenRegionTintR) {
  2.     int saturation = this.regionRef.TintSaturation;
  3.     int luminance = this.regionRef.TintLuminance;
  4.     if (saturation < 0) saturation = 0;
  5.     this.regionRef.Tint(Lerp(this.fromX, this.toX, amount), this.regionRef.TintGreen, this.regionRef.TintBlue, saturation, luminance);
  6.   }

Also, is there any reason why it breaks backwards compatibility? Why don't we just revert to the default luminance value if the parameter is not included, like the non-essential Animate parameters (eOnce / eBackwards) do?
It's no huge burden to comment out some code until the Tinting stuff is completed. Is it so far away?

Well, seems you're lucky, it was just necessary to add a "=100" to agsdefns.sh, otherwise I would never have done it, ahah.
Overwrite AGSEditor with the one inside here and it's done: http://www.mediafire.com/download.php?ficdrl37i9h9yyv

You can use  Region.GetLightLevel()  (regionRef.LightLevel) for the luminance.

- Alan
« Last Edit: 29 Mar 2012, 07:35 by Alan v.Drake »