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 - Knox

#1

Hi,
Sorry if I missed any other threads related to this issue I'm having, I searched for "fullscreen scaling style" and "scaling filter/scaling problems fullscreen" (+ checking the help doc as well).

It seems that no matter what configuration I choose in setup for testing my game (native res: 1600 x 900) in full screen (1920 x 1080), the result is quite blocky/ugly:


In photoshop I did a scale-up using the bicubic filter and it looks OK to me...is there something I'm missing, or perhaps did wrong? If not, is there a way to add another filter (bicubic perhaps) to AGS so at 1920x1080 fullscreen the scaling-up looks "good"?

PS: Using: 3.4.1.12 Patch 1
#2
Hi,

I've finally decided to update my project I left behind years ago for serious medical reasons...but I'm running into a problem since trying to get it to work with this newest version 3.4.1.12 Patch 1

It seems that in 3.4.0.16 everything was working normally for custom dialogs:

The "player.Say" zOrder gets drawn behind my customDialogGUI (and behind the semi-transparent black GUI) **I temporarily moved down the dialog GUI to show you how it should be drawn: behind the custom dialog GUI**

But in 3.4.1.12 Patch 1 I get this problem:

The "player.Say" zOrder now gets drawn IN FRONT of my customDialogGUI (and also in front of the semi-transparent black GUI)...also most text labels are now too low (this is an easy fix but still wondering why).

What has changed since these 2 AGS versions and how can I get the default "say" zorder to act like it did before?
#3
Hi,

I was wondering if there was a way to query the room edges the player is about to enter?

For example, say the player is currently in RoomA. The player walks over an exit region in RoomA to go to RoomB, but before that player actually goes to RoomB, I'd like to save RoomB's edges from within RoomA as global variables so I can use them in a custom changeroom function.

Is this possible somehow?
#4
I'm not sure if this has been answered before, but is there a "simple" way to make it so buttons only detect where the mouse is based on its alpha channel? I'm making buttons go around a circle and right now the button's over graphic will highlight when the mouse is over the whole graphic (because obviously the sprite is a box shape)...but I don't want the mouse to activate the button's over or pressed graphics if the mouse is over the transparent part of the button (which is outside of the gui, which is a circle).

Does this make sense?

**Pixel Perfect Detection is set to true**

EDIT:

Ok looks like gui button click detections are always rectangular...

Found this as a work-around...http://www.adventuregamestudio.co.uk/forums/index.php?topic=28882.msg367578#msg367578

Hopefully this feature could be added sometime soon?
#5
Right now I'm implementing a system that if a button is set to non-clickable and you try to click it, the current mouse cursor graphic gets an "x" overlayed on top.

I have to manually set a butt-load of certain buttons Clickable = false...is there a way to query if a button's "ClickAction" has the value "NoAction" set in the editor? Would save me some time! :=

Something like (pseudo-code):
Code: ags

oCg = GUIControl.GetAtScreenXY(mouse.x, mouse.y); 
if (!oCg.HasAction) ShowXClickOverlay();
#6
Hi,

I've searched the forums and found many topics on changing text color for the Display command but nothing really seems to help in my situation. It seems that the only way to change the Display text color is by changing the text color value in the editor for the custom text-window GUI, or by changing the GUI number in General Settings for "Text output: Custom text-window GUI". That's fine if you only have 1 version for your text windows though.

I'd like to give the player the option to choose the type of text window they would want, and each version also has a different color for the Display text. I can change colors OK with the Say command, but not with the Display command.

I just can't seem to set the text color or the gui number via script. Is there a way to get around this without having to use "dirty hacks" that I missed somewhere in the manual/forums?
#7
I've got a script that makes a list of labels visible, or invisible depending on the mode I enter. Since I'm not sure how many labels will exist in the game, is there a way to loop through all existing labels? Right now I'm manually adding all labels into the script, then setting the visibility to true or false.

Pseudo code example:

Code: ags

void toggleLabels(int iMode)
{
  if (iMode == 0) //HIDE ALL LABELS
  {
    int i;
    while (i < Game.LabelCount) //PSEUDO CODE
    {
      Label[i].Visible = false; //PSEUDO CODE
      i++;
    }
  }
  else if (iMode == 1) //SHOW ALL LABELS
  {
    int i;
    while (i < Game.LabelCount) //PSEUDO CODE
    {
      Label[i].Visible = true; //PSEUDO CODE
      i++;
    }
  } 
}
#8
Hi,

I started my project a few years ago as a hobby and I've been learning as I go. I'm currently in the process of fixing various bugs, and I'm really starting to notice that a lot of my old code is quite poorly written. Back then I didn't really know any better, but since then I've learnt a thing or two and well...some of what I did really sucks. I even think the way I'm currently fixing some of my bugs now is kind of poor, kind of like a jug filled with holes and I'm plugging one or two here and there at a time with chewing gum.

I'm really tempted to re-write parts of my old code, but it kind of seems overwhelming...even discouraging with over 40k of code (a lot of it is prob bloated crap that semi-works or re-copied chunks I should have put in a function). The newer, more recent stuff is OK I think, but a lot of the older stuff (with newer code written on top of it or merged into it) makes me cringe at the thought of "re-writting"...I dont even know if its possible at this stage since some of it is "inter-twined". :cry:

How do "real programmers" approach a problem like this? I remember reading an article on "Bad Coding Practices To Avoid", and I'm noticing I've pretty much violated them all when I started out in the beginning. How do programmers start fixing "mediocre or bad code", and is it normal to really dread this? For example, I've got a lot of else-if statements in my rep exec for special situations that probably only happen once to fix a specific bug, and when I encounter more, I use even more else if's...yikes. Its like piling crap onto even more crap.

Also, I think one of the main problems I have now in fixing bugs is that I create other bugs that I only discover sometimes much later...then when I finally find and fix those new ones I inadvertently break something else...which again I only sometimes notice a loong time later on! Argggg!

How do you guys do it? :embarrassed:
#9
I was thinking of going from 1024x768 to a higher-res widescreen format but really dont know which one to choose...(I guess since I'll only be done around the year 2043 anyways, it prob doesn't really matter much...heh).

So how much is too much? As in, would creating a game at 1920x1080 be considered insane with AGS? Could it be "too much res" for AGS to handle (like with larger sprite animations, really huge rooms, etc). Already as it is at 1024x768, if I have a large scrolling room is gets really sluggish in the room editor, and some large animations take forever to load in the view editor.

How do you guys choose your resolutions? Do I go 1280x720, 1280x800, 1920x1080? Arggg!

I keep reading that the out-dated 4:3 aspect ratio should die (what I have now, yay)...thats the main reason why I'm thinking of switching to widescreen.

Not sure what to choose. :undecided:
#10
Zabnat's Taxi Demo:http://www.adventuregamestudio.co.uk/forums/index.php?topic=36546.msg479382#msg479382
How would I convert the math for vertical/horizontal collisions (0°-90°) to isometric ones (30°/210° - 150°/330°)?

Code: ags

if (wall_angles[regionID] == 90) // vertical wall
        {
          //Display("VERTICAL COLLISION");
          fPatrolVelocity_world.x = -fPatrolVelocity_world.x * fMax(fAbs(sin_drive), 0.2);
          fPatrolVelocity_world.y = fPatrolVelocity_world.y * fMax(fAbs(sin_drive), 0.2); 
        }
        else if (wall_angles[regionID] == 0) // horizontal wall
        {
          //Display("HORIZONTAL COLLISION");
          fPatrolVelocity_world.x = fPatrolVelocity_world.x * fMax(fAbs(cos_drive), 0.2); 
          fPatrolVelocity_world.y = -fPatrolVelocity_world.y * fMax(fAbs(cos_drive), 0.2);   
        }	




(Khris, if you read this), can I use one of the formulas you used to answer previous iso convertion questions, or is it more complicated than that? Sorry if Im being reduntant on the issue!)
#11
Hi,

I hope this isn't one of those questions that gets asked over and over again (I checked the site without much luck, however I could have missed something).

I have a font right now I use in photoshop that uses a style and drop-shadow, and Im just saving the text I need as sprites and placing them as buttons on my GUI's. I figured I could save sprites (and make it easier to translate later) by just making them text labels with a custom bitmap font.

I'd rather use Photoshop to make my bitmap font, but how do I do this so it works in AGS...? I checked google too but I'm not too sure what the "best way" would be, I really am a noob when it comes to this. Can anyone offer a tutorial or perhaps point me in the right direction?

Thanks in advance guys! :=
#12
Engine Development / Mouse Acceleration bugs
Wed 11/09/2013 02:50:01
(I moved this question to a new thread, hope its OK)

For a while now I've noticed my mouse (logitech mx518 "setpoint" driver) was really "laggy" and the acceleration way off when I tried to play the game fullscreen but pretty much ignored it (until lately) thinking it was something I could clear up on my own in time since it was low-priority for me.

However since working on my driving gameplay it is becoming almost impossible to test since I need to move the mouse quickly and accurately, and I really don't know how to fix it myself (I tried multiple solutions offered in the thread below without any luck). I searched the forums and it looks like (to quote Subspark in a PM) AGS does it's own internal mouse averaging and smoothing procedures and that this was likely to compound precision issues with any system/hardware settings underneath.

I was wondering, is this something that is really complicated/too long to perhaps look into and have possibly fixed for a not-too-distant future release? To quote Subspark again, it looks like there would be 2 things to happen in order for that to be fixed: upgrading the AGS pathfinder (it calculates in 4:3 aspect regardless of the wider 16:10 runtime mode), and perhaps make the internal mouse processing going on in the engine an optional feature (not hard compiled into our games).

Here is the thread I am referencing:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=37518.msg565726#msg565726

What would your thoughts be (Crimson) on those issues my good sir? :smiley:

Quote from: Crimson Wizard on Tue 10/09/2013 08:27:07

I think I saw this mouse problem myself; I thought it is related to the coordinates scaling AGS does to mouse cursor position. This is most noticeable with custom display resolution build, when the 4:3 game is proportionally stretched to large wide-screen window. Now when I read that thread I am a bit confused. Are there two problems, the second being lack of hardware acceleration support? I wasn't aware of this, and I do not even know where to start looking.
I think this problem deserves its own thread BTW (and it is an Engine problem, not Editor's).

I was planning to look into both mouse and pathfinder issues naturally since I am working on custom resolutions now. But I have no certain forecast.

#13
I was searching the threads to see if this problem has been posted before and only seemed to find this thread (with no response):
http://www.adventuregamestudio.co.uk/forums/index.php?topic=46041.msg617865#msg617865

Ive come up with a solution, however for some reason it doesnt seem to work when I press the PageUp or PageDown keys (diagonal up right, diagonal down right)
Code: ags

//IN REP EXEC:
void holdKey_TapMode()
{
  if (bKbdTap)
  {
    if (!bPressMode_Temp && (IsKeyPressed(eKeyRightArrow) || IsKeyPressed(eKeyLeftArrow) || IsKeyPressed(eKeyUpArrow) || IsKeyPressed      (eKeyDownArrow) || IsKeyPressed(eKeyPageUp) || IsKeyPressed(eKeyPageDown) || IsKeyPressed(eKeyEnd) || IsKeyPressed(eKeyHome))) 
    { 
      iKbdPressTimer++;
      if (iKbdPressTimer >= 10)
      {
        KeyboardMovement.SetMode(eKeyboardMovement_Pressing);
        bPressMode_Temp = true;
        iKbdPressTimer = 0;
      }
    }
    else if (!IsKeyPressed(eKeyRightArrow) && !IsKeyPressed(eKeyLeftArrow) && !IsKeyPressed(eKeyUpArrow) && !IsKeyPressed(eKeyDownArrow) && !IsKeyPressed(eKeyPageUp) && !IsKeyPressed(eKeyPageDown) && !IsKeyPressed(eKeyEnd) && !IsKeyPressed(eKeyHome)) 
    {
      if (bPressMode_Temp)
      {
        bPressMode_Temp = false;
        KeyboardMovement.SetMode(eKeyboardMovement_Tapping);
      }
    }
  }  
}


What it does is if the user holds down on the key while in tap mode, it will temporarily switch to the press mode so the ugly stuttering no longer happens.

Only thing is, for some reason it doesnt work for those 2 keys (or directions). What am I doing wrong?

Ok, found the prob! Is this a good way of solving the issue?
#14
Hi,

When playing an adventure game, sometimes players (myself included) get impatient and would like to bypass a character walking from A to B.

I was wondering what would most people prefer between 2 options to bypass the walking animation:

A) While walking to point B, the player can right-click the mouse and the character will instantly appear at point B
B) While walking to point B, the player can right-click the mouse and the character will run to point B.

I was thinking I could even give the option to the player to choose which they prefer in the game settings.

The only thing Im "worried" about is if the player chooses option B to bypass walking animations, the run icon/mouse mode becomes kind of redundant:


What do you think?
#15
Hi guys,

I was wondering: can a user make a custom font that uses "alpha sprites" instead of characters (A, B, C, etc)...and then use the DrawString function to draw transparent pink to dynamic sprites? The text you type would correspond to the various alpha sprites you placed in the font file.
#16
I get this error "Script appears to be hung (a while loop ran 150001 times). The problem may be in a calling function; check the call stack."when I try to run the code below:

Code: ags

  while (iY1 < dsSourceGraphic.Height) //768
  {
    while (iX1 < sSourceGraphic.Width) //1024
    {
      //iAlpha = GetAlpha(dsLongGrass.Graphic, iY1, iX1);
      //ds.DrawingColor = Game.GetColorFromRGB(iAlpha,iAlpha,iAlpha); //this is a grey color representing the alpha.
      //ds.DrawPixel(iX1,iY1); // draw the alpha to the copy.
      iX1++;
    }
    iY1++;
    iX1 = 0;
  }


I've been using that "while snippet" throughout my game, but it only works when the dynamic sprite "dsSourceGraphic" is square (70x70, for example). How do I get it to work with a rectangle? (1024x768)

Its being used to go through the dynamic sprite's pixels to copy the alpha channel.
#17
Hi,

I downloaded Skygoblin's "master" (not sure what that is, master "build" I guess) and I copied the contents inside the bin folder to my AGS editor folder. Everything works fine, I now can have custom resolutions (yay!).

What Id like to know, (really stupid question), is how do I modify various editor values + "recompile"? Id like to change MAX_INIT_SPR to 60 inside acroom.h + recompile (means increasing the max objects per room to 60, right?)...but with what program do I use? Some c++ kind of program? Plus, Id like to increase the maximum amount of gui controls above 30, but where do I find that value?

If there is a newbie tutorial on all this, sorry but I looked and really couldnt find it!

PS: Also, if Id like to keep the draconian editor's changes (awesome), but merge it with skygoblin's changes, how would one do that? I realize this will probably get me an answer like "go take a programmer's course", hehe..which Im thinking of doing...(what classes would you suggest for ags type scripting and editor changes, etc?)

**EDIT: OK, I need visual studio.
#18
I'm trying to code a mini-game where the main player cuts his lawn. I was thinking Id divide the room up into squares and place dynamic sprites with the uncut grass texture on them. When the player moves from one square to the next, I'd clear/delete the dynamic sprite to reveal the room's background underneath, which would have the cut grass texture.

Something like this: (Space Quest 5 waxing the floor -->skip to 5min)
http://www.youtube.com/watch?v=VPa2ax02FJA

Is that a good way to solve this? Or is there a better, more efficient/clever way?
#19
Hi,

I have a script that seems to be dependant on the game's framerate, but not too sure if my solution to overcome this is a good idea. I placed this question in the "Advanced" section since Im guessing what you guys might suggest could be complicated, but Im not sure.

Basically what Im doing is if the user presses the left arrow key down for a certain amount of time, it calls a script that will turn the car in 30º increments. The values I use for the timer that tells when to stop the rotation has been set by me manually so that the car turns left perfectly at an intersection on an isometric map. The only thing is, I tested this script on two computers where the FPS is about 98, and everything works as it should...but on a laptop where the FPS is 35, the turning "mechanism" timers no longer seem to be "in sync" and the car rotates too much (therefore missing the intersection turn)...the various values for the timer (iTurnTimer) are no longer valid when the game runs at a lower FPS:

Code: ags

//in the driving map room.asc:
function on_key_press(int keycode)
{
     if (IsKeyPressed(375)) //LEFT TURN   
    {
      setTurnTimerValue(0);
      if (bLeftKeyHOLD == false) carDrive_LEFT(eManual, 0);
    }
}
// in my driving module:
void setTurnTimerValue(int iMode)
{
  if (iMode == 0) //Left
  {
    if (fDrive_Angle == 210.0 || fDrive_Angle == 30.0) iTurnTimer = 17; //NW or SE                 
    else if (fDrive_Angle == 330.0 || fDrive_Angle == 150.0) iTurnTimer = 20; //NE or SW                      
    else
    {
      iTurnTimer = 0;
      return;
    }  
  }                                       
}

function repeatedly_execute()
{
      if (!bAutomatic) //Manual
      {
        //TURN MANUAL
        if (IsKeyPressed(375)) processQuickTurn_Left(1);
        else 
        {
          iHoldKeyPressLeft = 0;
          if (bLeftKeyHOLD) bLeftKeyHOLD = false;
        }
}

#define KEYHOLD 15 //in the .ash 

void processQuickTurn_Left(int iMode)
{
  if (iMode == 1) //Manual
  {    
    if (iHoldKeyPressLeft >= KEYHOLD) 
    {
      if (!bLeftKeyHOLD) bLeftKeyHOLD = true;
      //value of iTurnTimer is set in the room, at "on_key_press"
      if (iHoldKeyPressLeft < iTurnTimer) 
      {
        rotateCar_TAP(-30.0);      //script that rotates the car by 30 degree increments
        iHoldKeyPressLeft++;
      }
    }
    iHoldKeyPressLeft++;
  }
}


As a solution I was thinking of using scorpiorus' script http://www.adventuregamestudio.co.uk/yabb/index.php?topic=42836.0 to detect the game's FPS, and if during the driving sequences the FPS drops to a certain amount, have the iTurnTimer values changed on the fly so that everything works as it should on slower computers.

Is that a good idea, or is there a better way?
#20
Hi,

Ive been trying to draw a sprite onto a scrollable background (larger than game resolution) without success. It seems to work when I draw lines/triangles, etc...but for some reason I cant get it to work with sprites.

What I want to do is I have a button on a gui that when pressed draws a sprite onto the room's background (but saves a copy of the original first). The room's background will stay this way with the sprite drawn onto it until the player presses the same button again...when he does, the background image reverts back to the way it as before.

Here's what I am currenty doing:

Code: ags


//global 
DrawingSurface *dsCurrentMap;
export dsCurrentMap;
DrawingSurface *dsMapBackup;
export dsMapBackup;

void drawLabelsOnCityMap(int iX, int iY, int iMapLabels)
{
  dsCurrentMap = Room.GetDrawingSurfaceForBackground();
  dsMapBackup = dsCurrentMap.CreateCopy();
  
  dsCurrentMap.DrawImage(0, 0, iMapLabels, 0);
  dsCurrentMap.Release();
}

//when button is pressed:
void manageStreetNamesOverlay(int iRoom)
{
  int iOverlayLabelSprite;
  if (iRoom == 299) iOverlayLabelSprite = 3639;
  //else if (iRoom ==) iOverlayLabelSprite =; 
  
  if (bStreetNamesOn && !bStreetActivated) //Show Labels
  {
    Display("Draw labels onto background"); //debug line
    Wait(40);

    drawLabelsOnCityMap(0, 0, iOverlayLabelSprite);

    //SetBackgroundFrame(1); //WITH DUPLICATE ROOM + LABELS PNG
    bStreetActivated = true;  
  }
  else if (!bStreetNamesOn && bStreetActivated) //Hide Labels
  {
    Display("Remove map labels..."); //debug line
    Wait(40);

    //**do "revert to original background image (dsMapBackup) script" and place it here

    //SetBackgroundFrame(0); //WITH DUPLICATE ROOM + LABELS PNG
    bStreetActivated = false;
  }
}



Right now I dont see anything being drawn onto the background. Ive also tried the solution of just using a 2nd frame for my background and showing that, but I plan on having many maps so I dont want to duplicate each room's background just for displaying the street names/locations.
SMF spam blocked by CleanTalk