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

Topics - Scavenger

#61
I've been looking at buying a videocamera, ostensiably for shooting reference footage for an animated short I've been doing, but in the future I'd like to do some green-screening and rotoscoping work with it (ala FMV games and early sierra games). I only want to buy one video camera, and my budget is around £300-400 ,  but I'm at a loss as to which one to get! I'm not a film tech expert and all of these brands astound me. Where do I even begin? I don't have time to trawl through several million reviews, as my coursework takes up pretty much all the time I have.

I need an SD card capable video camera, HD is preferable (widescreen necessary. I can live without full HD). This camera caught my eye:

DV Tape only cameras, unfortunately, are out of the question, as I need the SD card for the fast transfer of video from the camera to my PC. What considerations are there?
- Does interlaced footage mess up green screening?
- What's the best camera I can get for around my budget? As in, which gets the best picture in the worst lights, and records competently.


Do any of you nice film-directing-type-people know which camera I should be getting?

Thanks :)
#62
Ever wanted to do some neat colour effects, but found out too late that you're actually making a 256 colour game? Don't want to take the easy route of switching up the colours to 16bit? Fancy spending long nights tearing your hair out over ill-documented, messy code?

I don't either, but here it is anyway. I was gonna release it after I finished DWEF, but heck, that would take years and by then, who knows if 256 colour games would even be made. I can attest that the functions work really nicely, but  full screen stuff is kind of slow - unless they're on small sprites. Use these things tastefully and sparingly.

PALGORITHMS: The 256 Colour Translucency Module

This module can do it if it's got something to do with a palette:

  • Percentage based simulated translucency (10 real levels, interpolation/dithering for the rest)
  • Discworld I style colourisation: Turn everything monochrome and a colour.
  • TintScreen and FadeToColour, both of which don't pause the game - your characters can walk off screen while the shot fades to black, red, or magenta!
  • Module is currently 99.9% nondestructive. If you ever mess up the palette enough, switching rooms will solve it.
This module also contains crazy voodoo I don't fully comprehend (The Translucency stuff, appropriately enough. The CLUT generation was SteveMcCrea's work, and I reused the buffer technology from Astauber's dialogue module). As of now, translucency only works on objects (no translucent characters as I can't work out how ViewFrame works), and the translucency rendering is rather slow, but that's Get/PutPixel for you. As soon as I work out how to replace frames in a view nondestructively, I'll implement character translucency. I'm not a programmer, so that will take a long time.


DOWNLOAD IT HERE!

How to use PALgorithms:

  COLOURISATION FUNCTIONS

ProcessPalette (int palsiz, int palindex[])
  Creates a new colourisation palette and sets it to the current room palette. For instance, for a discworld inventory effect, you need
   a series of the colour blue, from lightest to darkest. here is the example. PALsiz would be 7, palindex would be bluearray:
      bluearray = new int [ 7 ];
      bluearray [ 0 ] = 46;
      bluearray [ 1 ] = 47;
      bluearray [ 2 ] = 48;
      bluearray [ 3 ] = 49;
      bluearray [ 4 ] = 50;
      bluearray [ 5 ] = 51;
      bluearray [ 6 ] = 52;
   While this can be declared in Game_Start, the game will crash horribly if Process_Palette is called before a room is loaded.
   Put it in On_event for before room fades in, and you'll get a colourisation palette you can use in every room.
   Multiple minipalettes at once aren't supported in this version, unfortunately. DO NOT sort these out of luminescience order, or
   freaky stuff happens.

   
ColouriseArea (this DynamicSprite*, int x1,  int y1,  int w,  int h);
   Places a colourised version of the selected area (x1,y1 are the top left coordinates, w+h are width and height) and places it inside
   the selected Dynamic Sprite. Useful for GUI backgrounds. WARNING: Generating a realtime colourised area that is too large may
   slow down your game!

   
CreateColourisedSprite (this DynamicSprite*,  int oldsprite);
   Creates a colourised version of a sprite (oldsprite is the ID of the sprite in question) and places it in the selected Dynamic Sprite.
   Palette Index 0 is ignored.

   
  FADE FUNCTIONS

   Tint(char R, char G, char B, char p);
    Tints the entire palette that particular RGB value, with an intensity of P. P is 0-63 in range. Leaving a room will restore the palette.
   
   UnTint(char R, char G, char B, char p);
    UNtints the entire palette FROM that particular RGB value, with an intensity of P. I'm not sure what happens if you call UnTint without calling Tint first.
   
   Fadeout(char R, char G, char B, char speed);
    Fades out the entire palette to that RGB value, where P is the speed at which it happens. P is 0-63.
   
   Fadein (char R, char G, char B, char speed);
    Fades out the entire palette from that RGB value, where P is the speed at which it happens. P is 0-63.
   
   
   TRANSLUCENCY FUNCTIONS
    The most complex of the PALgorithms, since it requires being set up from outside the game.

GenerateCLUTForRoom ();
    Generates a CLUT from the room's palette for 10 levels of transparency and saves it in CLUTROOMX.BMP, where X is the Room number.
    This takes an inordinately long time, and the game may appear to hang, but a display box will pop up when it is finished. It should
    take around 5 minutes for the generation to complete, so be patient. Once you have the image file, import it into AGS (exact palette import only, room specific)
    and make a new property for your room: TransCLUTSlot. Set that value to the sprite ID of the CLUT file, and you've finished setting up.


  SetTransparency (this Object*, char alpha);
    Replaces Object.Transparency. Anything below 90 or above 10 will register on the renderer (I don't suggest breaking these bounds with
    a transparent sprite) and render it translucent. Values divisible by 10 are completely smoothly translucent, ones divisible by 5 are evenly
    dithered between the value +5 and the value -5. Values imbetween that are diffusion dithered, and will look like static.
    This is a limitation to keep down generation time and file sizes.


SetGraphic (this Object*,  int graphic);
    Replaces Object.Graphic. Use this when you want to actually change a translucent sprites appearance for animation et al.
    Views for animated objects are not supported.

#63
I'm trying to write a screen tinting and fading function that can be made nonblocking (obviously I can't start that yet since the blocking version doesn't work) and I've run into a problem.

The tinting code doesn't work half as well as I wanted it to. It works, it just... tints the screen a little bit, even with repeated applications, it doesn't fade completely to any colour. It's based on ages old code from AGS 2.1 or so, so likely I've got something terribly wrong. What Fadein and Fadeout are supposed to do is fade the screen to the colour completely. What tint is supposed to do is tint the screen a certain amount.


Code: ags



//backuppal is the original palette, unmolested by any palette functions.
//
static function PALgorithms::Tint(char R, char G, char B, char p) {
  if (p > 63) p = 63;
  int i;
  while (i<256) 
  {
    palette[ i].r = backuppal[ i].r + (R - backuppal[ i].r)*p/256;
    palette[ i].g = backuppal[ i].g + (G - backuppal[ i].g)*p/256;
    palette[ i].b = backuppal[ i].b + (B - backuppal[ i].b)*p/256;
    i++;
  }
  UpdatePalette();
  Wait(1);
}

static function PALgorithms::Fadeout(char R, char G, char B, char speed) { 
if (speed>63) speed = 63;
int p=0;
while (p<=63) 
  { 
  PALgorithms.Tint (R,G,B,p); 
  p+=speed; 
  } 
}
static function PALgorithms::Fadein (char R, char G, char B, char speed) {
if (speed>63) speed = 63;
int p=63;
while (p>=0) { PALgorithms.Tint (R,G,B,p); p-=speed; } 
}


What's gone wrong?
#64
I've been working on another part of my game, and I want to create a Mode-7 type effect for a driving sequence in the game.

Unfortunately, I'm not actually that good at maths, so the render ends up looking like this:



My code is:
Code: ags
// room script file
DynamicSprite *roadspr;
DynamicSprite *camera;
DynamicSprite *tmpline;
int charposx = 149, charposy = 1382;
int viewwidth = 128;
int viewangle;

function room_Load()
{
  Mouse.SetBounds (131, 50, 165, 52);
SetViewport (0, 0);
}

function repeatedly_execute_always ()
{
SetViewport (0, 0);
charposx = mouse.x;
if (charposy > (viewwidth>>1) + 1) charposy-=2;
else charposy = 1400;
roadspr = DynamicSprite.CreateFromBackground ();
roadspr.Crop (charposx-viewwidth, charposy-viewwidth/2, viewwidth * 2, viewwidth);
int i;
camera = DynamicSprite.Create (320, viewwidth/2, false);
camera.ChangeCanvasSize (320, viewwidth, 0, 0);
DrawingSurface *surface = camera.GetDrawingSurface ();
while (i < viewwidth)
{
  tmpline = DynamicSprite.CreateFromExistingSprite (roadspr.Graphic, false);
  tmpline.Crop (i, i, (viewwidth * 2) - (i*2), 1);
  surface.DrawImage (0, i, tmpline.Graphic, 0, 320, 1);
  i++;
}
surface.Release ();
camera.Resize (320, 150);
oRoad.Graphic = camera.Graphic;



I know I'm probably supposed to put in a curve instead of a straight slope, but I can't for the life of me figure out how to do it. Can anyone lend a hand? I want to make the road much narrower when it goes away from the player, and the curve turn into a straight line.
#65
So I've been trying to implement lots of fancy graphical functions into my game, while I wait for my team to get back to me on the game's plot.

I've implemented colourisation pretty easily, and it showed that in 8-bit graphics mode, Get/PutPixel is actually pretty fast. So I tried to make a translucency for objects and special effects, but it seems to have gone belly up. Any object that's blitted in this manner simply turns into a blue cup, and the output I get from ripping the end result is just palette index 0 all the time.

I think it might have been my shoddy attempt at converting this code to AGSScript.

Notably:

Code: ags
     for (i=0; i<64; i++) {
          int i2 = i * i;
          colorDifLut[0  +i] = colorDifLut[0  +128-i] = i2 * (59 * 59);
          colorDifLut[128+i] = colorDifLut[128+128-i] = i2 * (30 * 30);
          colorDifLut[256+i] = colorDifLut[256+128-i] = i2 * (11 * 11);
          }
     }

became:
Code: ags
while (i<64) 
     {
          i2 = i * i;
          colorDifLut[0  +i]     =  i2 * (59 * 59);
          colorDifLut[127+i]     =  i2 * (30 * 30);
          colorDifLut[255+i]     =  i2 * (11 * 11);
          colorDifLut[0  +128-i] =  i2 * (59 * 59);
          colorDifLut[127+128-i] =  i2 * (30 * 30);
          colorDifLut[255+128-i] =  i2 * (11 * 11);
          i++;
     }


and
Code: ags
 for (i=0; i<256; i++) {
     colorDif = colorDifLut[(pal[i].g - g) & 0x7F];
     if (colorDif < lowest) {
          colorDif += (colorDifLut+128)[(pal[i].r -are) & 0x7F];
          if (colorDif < lowest) {
               colorDif += (colorDifLut+256)[(pal[i].b - b) & 0x7F];
               if (colorDif < lowest) {
                    bestMatch = i;
                    if (colorDif == 0)
                         return bestMatch;
                    else
                         lowest = colorDif;
                    }
               }
          }
     }


became:

Code: ags
while (i<256) 
 {
     colorDif = colorDifLut[(palette[i].g - g) & 127];
     if (colorDif < lowest) {
          colorDif += colorDifLut[128+((palette[i].r -are) & 127)];
          if (colorDif < lowest) {
               colorDif += colorDifLut[256+((palette[i].b - b) & 127)];
               if (colorDif < lowest) {
                    bestMatch = i;
                    if (colorDif == 0)
                         return bestMatch;
                    else
                         lowest = colorDif;
                    }
               }
          }
          i++;
 }


I was simply guessing the syntax, since I have never seen syntax like that before in my life. If only I could get it to work, I am so close I can taste it.

If anyone wants to have a go at it, I uploaded the game here. I am way, way out of my league here. If it works correctly, the Zipdisk at the right of the room should render semitransparent. As it is now, it renders a blue cup.

Thanks guys. Sorry for always posting on this subject. x3 At least you get to see some other stuff I've been working on.
#66
So I'm working on functions for my game (which I'm programming from the bottom up, as the last version had unworkable code.), and I need to judiciously use GetPixel since I don't want to use plugins this time. Once again, working in 8-bit. I am using 3.1.2 SP1, but I did compile it on 3.2, with no improvement.

As I was working on a colourisation function, I noticed I was getting a lot of strange crashes about "Array Out of Bounds: Range 0-255, not -1". So I tested it a bit and found out it wasn't my shoddy coding producing this result, but the GetPixel function itself.

I'm not sure quite what's causing it, and I'm pretty sure GetPixel isn't supposed to give values like that.

EDIT: The problem has been found and a workaround given. Quite a surprise!

I changed palette slot 254 to Magenta, which messed up the background colours. I have since reimported the background, but maybe that's what's going wrong.

Thanks, guys :) I am pretty hopeless without y'all.
#67

So I'm trying to create some graphic effects for my game that are reminiscient of the stuff you'd find on the Super NES, and one particular one I thought I'd cut my teeth on was dissolving a sprite into nothingness.

Turns out it's harder than it looks in AGS! With the following code, I can make things dissolve at an increasingly slow rate (depending on how many pixels have already been decimated), slowing down to infinity as my "Is it Done" checker slugs along. Without the checker, the code does pretty much function, but leaves behind one or two errant pixels that annoy me and make it so that I can't tell whether or not an object needs to be removed or not.

How do I speed up this code? How would you run a check on a sprite to see whether it's fully dissolved? Am I doing this completely wrong? Is there a way to do this in reverse? (I wanted to do this in code rather than with sprites because I'd be doing this on several sprites of varying size rather than just a select few.)

Code: ags

function Dissolve (this DynamicSprite*,  char speed)
{
  DrawingSurface *surface = this.GetDrawingSurface();
  char i=speed;
  int x;
  int y;
  int errorchecking;
  int area = surface.Width * surface.Height;
  surface.DrawingColor = 0;
  while (i)
  {
    x = Random(surface.Width);
    y = Random(surface.Height);
    if (surface.GetPixel (x, y) != 0)
    {
      surface.DrawPixel (x, y);
      i--;
    }
    else errorchecking++;
    if (errorchecking > area)
    {
      surface.Release ();
      return 1;
    }
  }
  surface.Release ();
}

function CheckDissolveComplete (this DynamicSprite*)
{
  DrawingSurface *surface = this.GetDrawingSurface();
  int x1 = surface.Width;
  int y1 = surface.Height;
  while (y1 != -1) 
  {
      if (y1 == -1)
      {
        // You should never get here. This is in case whiles run one last loop when their condition is met

        surface.Release ();
        return 1;
      }
      if (surface.GetPixel (x1,y1) != 0)
      {
        surface.Release ();
        return 0;
      }
      else x1--;
      if (x1 == -1)
      {
        x1 = surface.Width;
        y1--;
      }
  }
  surface.Release ();
  return 1;
  }

//The Room code I used (object 0 is needed, uses default game)

function room_AfterFadeIn()
{
DynamicSprite *sprite = DynamicSprite.CreateFromExistingSprite(object[0].Graphic);
Display ("This is a test of the Dissolve function.");
char speed = 30;
while (sprite.CheckDissolveComplete () == 0)
{
  sprite.Dissolve (speed);
  Wait (1);
  object[0].Graphic = sprite.Graphic;
}

Display ("This has been a broadcast of the Dissolve Function.");
}


Any help would be appreciated. This kind of thing really stumps me.
#68
So I want to continue working on my game, and whenever I look at the palette I cringe. I'd like some advice on how to sort it out. I want to make it 64 colours, 16 of them being the C64 palette and the rest pretty versatile to model all the sprites. It may be that I've been looking at it on both a Mac and a PC monitor, but the colours seem a little off. Too saturated.



Also, can any of these sprites be improved so that they can be animated better? I want to keep them as unshaded as possible so I can quickly animate them on paper first. They were made ages ago, so I'm sure they can be improved - Khato in particular. There's something about his feet. And Ollie and Desiree (bottom two) are terribly clunky looking. I loathe their art.
#69
I've been trying to work out for ages how to alter sprites just before they're blitted to the screen. This will be incredibly useful for the transparency plugin I'm using for my game - it would mean I can have transparent objects and characters rather than simply using overlays.

Unfortunately, I've been reading the plugin API extremely intently, and I've seen no reference to catching sprites before they're blitted, only when they're loaded. This means that if the plugin tries to implement the transparency, it will only be against the background, and instead mask out the objects behind the translucent character. It's important that the screen is already half drawn before the sprite is changed, as this will give the plugin an accurate description of the screen behind the character.

I reiterate, I don't want the sprites before any of them have been blitted, nor when all of them have, but when some of them (the ones drawn behind the translucent actor) have been blitted.

If anyone has a workaround for this, it would be awesome.  And if not, is there any hope that the hook to catch sprites before they are blitted can be added to the plugin API (similiar to the "Sprite is loaded into the cache", but called at a different time, I guess)? I believe it could be quite useful for those wanting a half-completed screen to mess around with. Apologies if this has already been asked. :)
#70
Okay, so I'm working on the second part of my game, and there are a few stumbling blocks I'm finding difficult to overcome:

Regarding tracker music: Is there any way to control the volume of the individual tracks on IT files while you're playing them in AGS, or is the MOD-etc playing library a black box (i.e, I'll have to write a plugin for it and handle music playing myself)? I think this would be incredibly useful in implementing dynamic soundtracks - for example, if you have a more furtive melody that follows the same bassline, you could reduce the volume on the calm melody's track and increase the volume on the furtive melody to create a simple iMuse style thing with tracker music. If it were, theoretically, implemented into AGS's new sound system or as a plugin, I'm guessing the format could be something like:
aMusicTrack.trackvolume[0] = 100;

I'm curious, is this possible at all in the tracker library that AGS uses? It would be very useful for me.

Regarding 8-bit graphics: Exporting a background in 8-bit mode seems to export a 24bit bitmap rather than an 8bit one, which struck me as kind of counter-intuitive when I tried exporting a background to change its palette.

Also, I used to be able to export a complete palette file by opening a room and changing the room-specific palette slots to gamewide, thus giving me a full 256 colour palette to work with in case I needed to add objects to the room that weren't interactable. Unfortunately, the new versions of AGS seem to keep the palette slots black.  And I don't know a proper workaround for this - is there any way to merge the game palette with the room palette? Exporting backgrounds doesn't work, and the colours panel has lost this functionality?

((Finally, as an aside, does anyone have a weather plugin/module that can render to a screen sized dynamic sprite instead of the framebuffer? It's the only way I'd be able to get it to render translucent instead of solid in 8bit colour mode and I'm not skilled enough to write a rain routine myself.))

Thankyou, everyone :)
#71



The year is 2053. A world, stagnant and full of money-grubbing, heartless corporations gripping onto their intellectual property with iron fists. Nothing can grow, nothing can progress while they squeeze every last penny from their stale ideas. Black Sun, the crypto-anarchist hacker organisation, is the one thing that stands between them and utter oblivion. By stealing back their creations and giving them away for free, Black Sun ensures that ideas can once again circulate in a world where everything comes at a price.

Hackers in the Black Sun movement are the Robin Hoods of the digital age, stealing from the rich, bloated corporations and letting even the smallest user experience the best in ractive entertainment.

Ideas Must Be Free.
The Sun Will Set On Big Business.
A New Dawn Will Rise.
- Black Sun Newsletter #20, "On Ideology"


Jakob is a hacker for Sector H, a new branch of Black Sun, a crypto-anarchistic organisation that looks after its own. Funded by mysterious benefactors, Jakob and the rest of Sector H break open ractives to ensure that everyone can play them. It's a dog-eat-dog political minefield that Jakob wants no part of.

All Jakob wants to do is play ractives, watch the new Ripsaw Bloodgore concert, and have fun. He has no place in this war - but fate conspires against him, dragging him into the very core of this matter. He will never forget the day...


Death Wore Endless Feathers.

Disk 1 of this four Disk tale establishes the setting, as Jakob, taken from his usual routine of grinding for Silver Bracelets and Gemstudded Hides, is forced to get food for Sector H. With no money, and none of his comrades willing to help him, what will he do?

Oh, the humanity!


This Exciting Ractive Features:
- Fully Animated, 256 Colour Graphics!
- A full soundtrack by Sebastian Pfaller!
- Real Time Translucency (Courtesy of Nickspoon)
- Characters You Won't Forget! (most of the time)
- Passable Humor!

Author's Note: This is my absolute first game that I have finished, ever. This took me 6 months of almost solid work, and I really do hope you enjoy playing it as much as I enjoyed making it. Or more, in fact! It was a real rollercoaster ride. If people like it enough, I will definitely get to work on the rest of the series!

MAKE SURE YOU UPDATE .NET to 3.5 and run this game on DirectDraw mode. The plugin will not work otherwise! Updating is a good idea :)


UPDATE: There were a couple of cosmetic bugs in certain parts. Nothing game breaking, to say the least, but they were pretty jarring. v1.0.1 has been put up.

Download Link:
DOWNLOAD

Mirror: (Just in case my bandwidth runs out)
MIRROR (Courtesy of Peder Johnsen!)

#72
DEATH WORE ENDLESS FEATHERS






It was about eleven o'clock in the evening, mid October, with the sun not showing its face and the threat of rain looming hard on the distance. Tired, hounded, sleep still stinging my eyes and wearing the same clothes I had woken up the previous morning with, I set out into the dark, derelict streets in search of a cheap takeout, the sodium glare of innumerable street lamps masquerading as stars lighting my way. I was nothing a cool, collected hacker ought to be. Before I knew it, I was calling on four hundred thousand bytes.

The virus called destiny copied itself to my master boot record. There was no going back.

I wanted to go home.

It's tough being a hacker in the mean cities of Albion. Between the megacorps trying to destroy your rig and the Flock demonising you at every turn, you would think you would have had enough on your plate. You just want to kick back, pirate a few good passives and curl up for the night. But it's not that easy. It's never that easy.

Seven years ago, the cracking group Black Sun fought the megacorp software giant Kankakusakujo in a battle of skill and programming might, a swashbuckling tale of copy protection and cracks, of keygens and counterattacks. But when an early alpha build of Kagi To Mon, a top secret game, was released early, one with protection that surpassed even the rig-destroying DRM that had come before it, the whole of Albion was consumed in the fallout. It did things no computer program could do - it reached inside the minds of the pirates who dared crack its secrets, and it destroyed their sanity. It showed them images of things beyond human comprehension. Acting quickly, the CEO of Kankakusakujo, the mysterious and enigmatic Ms. Eigermann, blamed the pirates for releasing a terrible virus, and gained control of the entire island in one fell swoop. People feared technology. They feared the hackers, and drove them underground, Black Sun being all but wiped out.

So now, on the outskirts of society, living in derelict apartments and run down hovels, the hackers fight back against the megacorps. Their futile efforts to release every bit of software, freed of the shackles that are placed upon them by the megacorps, still run on, long after the battle was won by Kankakusakujo. Until today.

When Kagi To Mon is to be released officially, and the original members of the Black Sun reappear. It is up to the hackers to learn the secret behind this game and stop its release, before it's too late.

Featuring:
- 8-bit graphics with hand drawn backgrounds!
- Several playable characters, each with their own unique way of interacting with the game world!
- Fully animated cutscenes!
- Heapings of Retrofuture and technology from the past, present and future!
- A diverse and intricate game world!


PROGRESS
Story 100%
Graphics 20%
Scripting 50%
Sound Effects ??%
Voice Acting 0%
#73
So I'm making a somewhat BASS/Broken Sword like interface for my game, and I've come across a problem I can't solve, but know the answer lies SOMEWHERE I have probably stared at for ages.  I've made everything else work, from interaction, right click, context sensitive mouse graphics, and popup inventories, but I just can't get the cursor to set itself to Use Inventory Item, turning the cursor into that inventory item and having it be the mode you're using. player.Activeinventory never actually becomes anything but null, and I can't see where I'm going wrong. I've tried workarounds, toggling Handle Inventory Clicks in Script, and everything, I just can't see it.

Here's where I changed the code that affects the mouse cursor:

Code: ags
function repeatedly_execute() {


  // put anything you want to happen every game cycle, even when
  // the game is paused, here

  if (IsGamePaused() == 1) return;

if (player.ActiveInventory == null) {
if (GetLocationType (mouse.x, mouse.y) == eLocationHotspot) {
  vhThingover = Hotspot.GetAtScreenXY (mouse.x, mouse.y);
  mouse.UseModeGraphic (hotspot[vhThingover.ID].GetProperty ("mousetype"));
}
else if (GetLocationType (mouse.x, mouse.y) == eLocationCharacter) {
  vcThingover = Character.GetAtScreenXY (mouse.x, mouse.y);
  mouse.UseModeGraphic (character[vcThingover.ID].GetProperty ("mousetype"));
}
else if (GetLocationType (mouse.x, mouse.y) == eLocationObject) {
  voThingover = Object.GetAtScreenXY (mouse.x, mouse.y);
  mouse.UseModeGraphic (object[voThingover.ID].GetProperty ("mousetype"));
}
else mouse.UseModeGraphic (0);}
else mouse.Mode = eModeUseinv;

if (mouse.y > 219)
{
  if (player.ActiveInventory != null) mouse.Mode = eModeInteract;
  gInventory.Visible = true;
  gOverhotspot.SetPosition (gOverhotspot.X, 210);
}
else if (gInventory.Visible == true)
{
  gInventory.Visible = false;
  gOverhotspot.SetPosition (gOverhotspot.X, 230);
}
}


Code: ags

  // called when a mouse button is clicked. button is either LEFT or RIGHT
  if (IsGamePaused() == 1) 
  {
    // Game is paused, so do nothing (ie. don't allow mouse click)
  }
       else if (button == eMouseLeft && player.ActiveInventory == null) 
    {
      //Left Mouse Button triggers an interaction with the subject.
      if (IsInteractionAvailable (mouse.x, mouse.y, eModeInteract)) ProcessClick(mouse.x, mouse.y, eModeInteract);
      else ProcessClick (mouse.x, mouse.y, eModeWalkto);
    }
    else if (button == eMouseLeft && player.ActiveInventory != null)
    {
      //Use an Inventory Item (If active)
      ProcessClick (mouse.x, mouse.y, eModeUseinv);
    }
  else if (button == eMouseRight && player.ActiveInventory == null)
  {
    // right-click triggers an examination.
    ProcessClick(mouse.x, mouse.y, eModeLookat);
  }
  else if (button == eMouseRight && player.ActiveInventory != null)
  {
    // right-click with an active inventory sends it back to the inventory window.
    player.ActiveInventory = null;
  }
  else if (button == eMouseMiddle) { 
    // Middle-button-click, default make character walk to clicked area (a little shortcut)
    // Could have been just "player.Walk(mouse.x,mouse.y)", but it's best to
    // leave our options open - what if you have a special script triggered
    // on "walking" mode?
    ProcessClick(mouse.x, mouse.y, eModeWalkto); 
  }


Using 3.1.2 SP1. I'm sure I'm just doing something really stupid and not seeing it.


All my game files are in here, it's just a shell at the moment, nothing but programmer graphics and bare-bones testing stuff.
http://www.2dadventure.com/upload/Cyberpunk.zip

Please can someone say where I'm going wrong? :3
#74
Looking at the AGS documentation, it seems that dynamic sprites are stored in pointers, so potentially I thought, I might be able to address the data within the dynamic sprite directly, rather than using GetPixel and PutPixel to change the colours within the sprite, and thus speeding up the process tenfold.

So, can I access the data within Dynamic Sprites directly? And how are they structured, so that I don't accidentally overwrite their width/height entries?


((Just to give it some context, the effect I want to achieve initially is that of the Discworld inventory window - replacing the palette underneath the GUI with a small range of colours. To do this, a lookup table is needed, with the palette entries you want to change corresponding to the colour you want to change it to. Example:

Palette entries 250-255 are the range of blues we are using. The array Palettechange has 256 entries, with the alternate palette as the values of these variables (with 0 still being 0 - we don't want to remove the transparency from the sprites just in case).

Now, each time we create a dynamic sprite out of the screenshot, we process it (cropping it as necessary - though it seems it would be a bad idea to use this with Direct3D). If this was a raw image file that stored the data without width + height values before the main bulk of the image, the changing of the data would be just writing each byte as it's presented in memory back with the contents of the lookup table and just keep cycling that call until we reach the end of the array (which is width * height in bytes).

You should find that it turns into something like this:



How fast that would be I have no idea, especially in scrolling rooms. If there was a way to access the framebuffer directly to steal portions of it, it might be a little faster, but more complicated. I dread to think how much processing time it would actually take, even in a 320x240 8bit game.

Successfully pulling this off would open the doorway for other eye candy special effects such as translucency, tinting, and screening in an 8bit game. Simple transparency (50%) would just be comparing in a 2D array of two values (the background colour index and the index of the overlay). Now, I know that hi colour games can do this without all the technical workarounds and fancy coding, and in fact would be a lot easier. But I think the 8 bit colour depth is underutilised, and I just love working with it. The colour artifacts alone are worth it. That, and my game is set in a retrofuturistic early 90s, so it has to look the part.))
#75
I want to give my game more of an immersive feel using the technology we have available in AGS - to not only recreate the style of the past, but take tips from modern games, too. For this, I hope to use 320x240 16bit, rather than 32bit, simply because I really don't like messing with alpha channels and I feel the effect might be too slow at higher res.


VERTIGO

The first thing I want to do is recreate the "vertigo" effect that CoC: DCoTE* had, wherein when something was terribly, terribly wrong, it showed on the player's screen. Gave a sense of urgency and disorientation to the player, as well as the player character. Here are a couple of mockups that I made to demonstrate what I mean.


Three layers:
- 100% size, 100% transparency
- 120% size, 30% transparency
- 80% size, 50% transparency
Effect is basically to resize the duplicates from 100% to 120 and 80 and back again,

This one, when played slowly once, can give the impression of height or disorientation on a closeup (long pit, dead body), if played regularly along with a heartbeat like rhythm, it can suggest something cosmic and powerful.


Base layer, along with translucent duplicate offset 30 and 60 degrees.
This effect rotates rather than resizes the two duplicates, making a weirder effect. Not quite sure how I'd use this one, though.

Now, I haven't coded for AGS since 2.61, but I do know about the Dynamic Sprite commands. The resizing vertigo effect would have to take place as (in psuedocode):

Quotechar gradient = 0;
char bigpercentile;
char smallpercentile;
char direction = 1;
char usevertigo;

rep_ex () {

if (usevertigo == 1)
{
bigpercentile = 100 + gradient;
smallpercentile = 100 - gradient;
DynamicSpriteFromScreenshot (MASTER);
DuplicateDynamicSprite (MASTER to BIG);
DuplicateDynamicSprite (MASTER to SMALL);
ResizeDynamicSprite (BIG, bigpercentile);
ResizeDynamicSprite (small, smallpercentile);
DrawTransparentSprite (BIG, some, coordinates, 50%);
DrawTransparentSprite (SMALL, some, coordinates, 50%);

if (gradient < 1) direction = 1;
else if (gradient > 19) direction = -1;
gradient = gradient + direction;
}
}

Now, as far as I remember, DynamicSprites are based off of RawDraw functions, which are PAINFULLY slow. I'm thinking any attempt to code the above (with proper syntax, OOisms and adequate timing, of course) will end up with the framerate of the game dropping to nigh unplayable levels and ruining the whole atmosphere. It's also important that the entire screen is affected, not just the background image, as we're including, not excluding, the player. I just don't see any way I can do it without it causing major slowdown. Unless I'm totally wrong, of course. I'd like to be wrong in this case.

Mattes

I've been working on a film project recently, and I've discovered a newfound love for mattes and chroma keying. Now, most of the uses for chroma keying we can duplicate simply because heck, it's not film and we can do amazing things as animators. But something has bugged me that I can't solve: How can we blend together video and sprites? Not like, playing a game and suddenly a video takes away your control, but using video as part of the workings of the game. Seamless.

I have no idea whether it's feasable or not, but is it possible to play video underneath the sprites and background on a kind of green screen? Here is a pictoral example.



Here we have our background graphic - someone's house pulled from Google. Notice that the sky is magic pink. This is our "green screen", just like any sprite has around its edges. We want something to happen in that sky in full video, but importing it as an object would be too large and cumbersome (Say the video is 5mb, the individual frames would be 500mb, for example) to bother with. So we set our characters on their merry way into this room's background graphic, and we play the video, using the matte to not render any video that's not on the pink bit, and we end up with this:


(except not psychadelic and bouncing around like that)

Dunno if it would work, though, as I believe video is rendered in blocks on a YUV layer rather than pixels on the RGB layer. But if it did, well, you've probably seen it before on games for the original Playstation-era consoles, and perhaps some FMV games. I definitely think it has utility, especially for animations too complex and cumbersome to merely add as objects (say, for prerendered 3D). It has the advantage of cutting out the characters (as the characters are not magic pink), leaving them to interact on a moving, fully animated background. But the slowdown it might have... terrible.  And I'm not even sure it's possible. But it would look fantastic.

If you've read this far, thanks for your time. If you haven't, thankyou anyway. ^^ I hope I've explained everything well enough - I'm not a programmer by any stretch of the imagination, nor am I very adept at the new scripting style. So, I guess my question would be - does anyone have any advice on implementing these in the script?


*Call of Cthulhu: Dark Corners of the Earth
#76
So, what one of my little hobbies is redesigning and recontextualising characters. At the moment, I'm making some sprites based off of the Cyberpunk rendition of 'Jakob', my signature character.

Design is here:
Cyberpunk Jakob
I'm pretty happy with how his design came out on the whole. Flavored punky, but still cartoony and simple. I'm not asking for any advice on him, as he's pretty much finalised (I didn't want too complex a design, as I might have to hand animate him, too). He's a specieless cartoon character (as would be everything else in the game, if there was one) and pretty interesting and fun to draw.


Sprites

- Idle Pose: Yawning (arms unfinished)
- Walking pose is kind of an amble.

Things I'm looking for advice on is how to maximise expression with the minimal space I've got available, colour (I'm not THAT hot on palette picking, so any advice on how to make a more efficient palette is welcome. I already cut him down to 16 colours from 28) and pointers on which frames his body should be moving in the walking animation. x3 Not too happy about the walking one, to be honest. His legs are short in the sprites, but they look kinda freaky in the animation. Dunno why. Mostly the colours are bothering me, though.

Anyone care to C+C on the sprites? There's something wrong with them, I can tell, but my eyes aren't yet critical enough to see what. x3

Thanks, everyone ^^
#77
So, I'm now comfortable with how I draw, and I draw cartoons.  I decided over the summer, I'm going to try and make a short game based on saturday morning cartoon shows. Because they're awesome (and cut corners in terms of animation). But, if I'm going to do this, I need to decide how. I really don't mind which depth I use (so long as it's not 32bit, as I hate alpha channels with a passion. Hate, HATE. Also, I don't like depths above 640x480 for some reason. Maybe it's the comforting blocky pixels, but I don't think this project would work at anything higher.)

Here are some mockups I made of what I think the sprites would look like, using the protagonist as the example.

CHARACTER

In terms of being simple, the lo-res, 8bit one is probably easiest to produce, but lacks that certain something that makes SatAM appealing. The top one might be too blurry, the middle might be too blocky, I don't know.

As for the background (which I think would be really important in deciding what colour depth and resolution to use), I also made a mockup picture of the style I would use.

CONCEPT ART (it was quickly made just to be an example, so don't critique it. There are SO many things wrong with it, I know. The real backgrounds would probably be done on watercolour paper.)

So my question to all of you out there, which one of the three would be best suited to a SatAM style adventure game?
#78
I'm trying to make a short game, but my protagonist's walk cycles seem to be bugging me quite a lot. I can do the front, but the side and back views are seemingly impossible.

Here he is:

I have him in three different outfits so I could make his poses look more natural (as it's easier to put clothes on a sprite and have it look right, imo, especially with his reaching up front pose). The fact that he has no eyes is intentional - I've never drawn him without that hat.

So, what do you think? Any comments on the sprite? How can I do the side and back view walking frames? Especially the back view. I can never make that look right. Thankyou ^^
#79
Just as a challenge, I decided to make a couple of backgrounds based on an American Gas Station / Diner. They're only sketches scanned in from my art book for now, but I hope to colour them in somehow.

Outside....
... and inside.

I know about the signs, and the correcting the wonky perspective, but how would I go about making them more (stereotypically) American? This kind of.. low budget diner is the theme, (in contrast to a chain of gas station fast food outlets owned by a faceless conglomerate. =P)

Also, this guy.


The main character of this hypothetical setting, but I don't know how to improve him. He kinda looks way off to me. He's supposed to be 'laid back' in a kind of overexaggerated way, and maybe a little arrogant, too.

Hmm. Your comments?
#80
Expressions

These are for use in the bottom right hand of the screen, indicating the mood Ryruu is currently in. As I progress through the project, I will make it so that Ryruu's idle animations reflect his mood, and that the expressions box will also have idle animations. The left column is impartial blinking, while the others show different levels of emotion. The top one being subtle, the middle not so, and the bottom intense. They are: Fear, Anger, Embaressment.

Needless to say, this will dictate how he does certain actions. =P And certain actions will dictate his mood.

Walkwalkwalk

Now, Ryruu's not the most graceful of walkers, so I tried to add a kind of clumsy plod or amble to his walk. o.o Did it work? And how do I do side and back views now?


Some notes: I also totally redesigned his costume. I think it looks more original now ^^. Now, what on earth is the style I'm working to? o.o It's all cartoony =o Much easy this is, due to the lack of real shading.

Any comments, help, or suggestions are welcome =P. Endorsed, even.
SMF spam blocked by CleanTalk