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

#1
Quote from: Crimson Wizard on Thu 12/10/2023 16:10:18
Quote from: vga256 on Fri 06/10/2023 18:22:41Oh interesting. It appears this is bug is far less generalized that I had guessed. I'll run through a few different coding scenarios until I figure out which one it can be reproduced with.

Edit: I've tried to replicate this with a new/empty test project with the same kind of code, and I cannot replicate it. Would you mind if I zipped up my project folder and sent it to you via PM? I can point out how to reproduce it using my project.

I managed to replicate this with certain code, but only after I copied lots of your code over (struct definitions, etc). My attempts to replicate this in a smaller environment failed consistently.

This is definitely a compiler's error, but not an obvious one, it fails to track element access correctly at some point, maybe it cannot handle more complicated script.

The new compiler by fernewelten, which we use in ags4, does not have this problem, it points out the scripting mistake.

Using new compiler I found multiple other syntax mistakes in your game's script, so that's not the only issue: non-optional args following optional args (with default value), comparing non-managed object to null, comparing void function return value to an integer, and so on.
Old compiler misses all these for some reason.

Too bad the new compiler has its own problems, where things that were supposed to work with old compiler normally don't work anymore. For instance, it no longer can print char[n] array as a string into String.Format. I might report these as mistakes. But I think there are workarounds for all of these cases.

Interesting! I tried unsuccessfully for hours replicating the issue with identical code (not entire scripts, just structs and definitions), but it seemed like the scripts needed a certain level of complexity before it was triggered. Considering how rare and difficult to reproduce this is, it's probably not worth spending any time on it. I do appreciate that you at least confirmed that I'm not crazy.

Funny - I hadn't even caught the null comparisons - and the void-integer comparisons are definitely typos on my part.

Thanks for your time.
#2
Quote from: Crimson Wizard on Thu 05/10/2023 18:52:41Hmm, this sounds like a compiler error, as engine merely follows compiler's instructions there, getting into unexpected behavior.

But how do I reproduce this exactly? Trying random array access, compiler does not let this through:

Oh interesting. It appears this is bug is far less generalized that I had guessed. I'll run through a few different coding scenarios until I figure out which one it can be reproduced with.

Edit: I've tried to replicate this with a new/empty test project with the same kind of code, and I cannot replicate it. Would you mind if I zipped up my project folder and sent it to you via PM? I can point out how to reproduce it using my project.
#3
Discovered an interesting crash in 3.6.0.51. I did a search for this one, but couldn't find it documented anywhere:

Code: ags
An internal error has occurred. Please note down the following information.
If the problem persists, contact the game author for support or post these details on the AGS Technical Forum.
(Engine version 3.6.0.51)

Error: Error running function 'tileMapCell_OnClick':
Error (line 1878): internal error: SCMD_CALLOBJ argument is not an object of built-in or user-defined type

in the active script:
in "TerrainMap.asc", line 1878
from "GlobalScript.asc", line 863

The offending code is this Case, wrapped in a switch statement:
Code: ags
case eModeHeliDrop:
    CurrentVehicleMap[i].FlyToPosition(terrainTile.x, terrainTile.y);

The cause is the use of "i", which is an undefined variable. It was actually a typo - I meant to type "1", and stumbled upon this accidentally.

I just tested out various non-existent variable names like "[udfcjviw]" and "[xujiosygj]" as array indices, and they all compile, yet cause a crash when those lines are executed in the case statement. I assume this means that the compiler does not check whether array indices are valid variables when in switch/case statements?
#5
Quote from: ThreeOhFour on Thu 14/09/2023 02:56:05Hello folks! The lovely Eduardo Moreno Martin emailed me and asked me if I would consider releasing this little old thing for free, as it's impossible to find anywhere online! I'm quite happy to do so, but don't have a solid hosting solution at the moment, so anybody interested, here's the Dropbox link, in true, classy, indie style!  :=

Fantastic. Any objections if I upload this to archive.org for archival?
#6
This module is a rewrite/port of an excellent Java module for generating Simplex Noise.

Screenshot of demo, with noise generated using 64x64 grid, and 32px by 32px tile sprites


Screenshot of demo, with noise generated using 256x256 grid, and 4px by 4px tile sprites


What is Simplex Noise?
This is a kind of "organized" noise, designed by Ken Perlin. It is most often used for procedurally generating mountainous or underwater terrain in simulation games, but it has many other uses.

What can I do with it?
You can generate "noise maps" which resemble natural terrain like landscapes, oceans, clouds.

How do I use it in my game?
Refer to the demo for an example of 2D noise, drawn as a 2D map over the background using the DrawRectangle function. For games that use tilemaps, like Roguelikes, the general strategy is to produce a 2D noise heightMap, and then translate the heightmap into meaningful tiles.

e.g.
heights of 0.0 to 0.2 are ocean
0.2 to 0.3 is shoreline
0.3 to 0.5 are grasslands
0.5 to 0.7 are foothills
0.7 to 0.9 is mountainous
0.9 to 1.0 is mountain peaks


Update 0.5.2:
- Bug fix: clamp values to -1,+1 after calculation. Necessary due to float rounding inaccuracy.

version 0.5:
- First working version

Downloads:
Demo AGS project
Simplex Noise Module v0.5
#7
Apologies for the necropost - since monkey0506's link is long dead, just wanted to share an archived link to the module:
Download Here
#8
Quote from: eri0o on Wed 16/08/2023 14:27:31About dynamically created objects we need to first have either delegates (#1409) or pointer downcast (#2018), so we can pass a function/action object from script to a function/attribute that "links" the necessary interactions. Since any of these will probably be exclusive to the new compiler and ags4 is meant to have both the old and the new compiler for a while, we can't do it there until the old compiler is let go - assuming the new dynamic creation will be the only way. So I don't see this making into ags4 without big changes (possibly breaking).

Thanks for pointing out these challenges. As I'm not familiar with the compiler architecture, it helps to know this isn't a simple fix. From my perspective as a game developer, I can write "I wish AGS had..." type requests all day  :wink:
#9
I am beginning AGS4 testing on a game that requires the new features offered by the new data structures. Please let me know if there are specific features or functions the team would like to see tested as I work.

Although I know this is not the proper place for this - I am also among those who needs support for runtime-generated/dynamic GUIs. Scripting workarounds to emulate this (e.g. spawning dozens of empty GUI elements and then showing/hiding them at runtime) is currently extremely painful as a developer.

For the time being, GetAtScreenXY for Overlays alone would be hugely useful for projects like mine.
#10
AGS Engine & Editor Releases / Re: AGS 3.6.0
Sun 02/04/2023 17:50:16
Congrats. That had to be one of the longest beta/patch marathons I've seen for a while.
#11
What a shame! I've archived all episodes here for posterity:

https://archive.org/details/bluecuptools

Quote from: Jean-Pascal on Sun 13/11/2022 04:41:56I used to listen to the podcast from time to time during my commute and unfortunately realized this week that the links to all episodes were now dead. I was wondering if they've been archived somewhere by someone by any chance?

This also got me to finally register on the forum after lurking for a long time. So "hi everyone"!   :)
#12
Update: I added a few lines that allow for a Button to be draggable using the GhostGUI/Overlay:

Code: ags
//===========================================================================
//
// DragDropCommon::TryHookGUIControl()
//
//===========================================================================
static bool DragDropCommon::TryHookGUIControl()
{
  if (!DragDrop.EvtWantObject)
    return false;
  GUIControl *gc;
  // TODO: pixel perfect detection
  gc = GUIControl.GetAtScreenXY(DragDrop.DragStartX, DragDrop.DragStartY);
  if (gc == null)
    return false;
  if (DDSet.TestClickable && !gc.Clickable)
    return false;
  DDState._GUIControl = gc;
  DragDrop.HookObject(eDragDropGUIControl, gc.X, gc.Y);
  // Allow for GhostGUI/GhostOverlay when dealing with GUIControls that 
  // are buttons
  if (DDSet.Move != eDDCmnMoveSelf)
  {
    if (gc.AsButton != null)
    {
      int sprite = gc.AsButton.Graphic;
      DDState.CreateRepresentation(DDSet.Move, gc.X, gc.Y, gc.OwningGUI.X, gc.OwningGUI.Y, sprite,
                                   DDSet.GhostTransparency, DDSet.GhostAlpha);                                   
    }

  }
  return true;
}

For anyone interested in using this code to make buttons draggable via ghostguis/overlays: of note are the offsets "gc.OwningGUI.X" and "gc.OwningGUI.Y" - control positions are always relative to their parent GUI. So I've used the parent GUI's current position as the offset, to ensure that the overlay is created at the right spot.
#13
Quote from: Crimson Wizard on Fri 23/12/2022 23:00:05@vga256,
Another workaround would be to only support controls which are drawn using sprites:
* Empty GUIs with background image and nothing else;
* Buttons which have a graphic assigned to them.

With the current module though, you would have to resort to scripting a custom drag-drop mode. The easiest method may be to replicate "Ghost GUI" or "Ghost Overlay", but let it set any image instead of knowing what AGS object you're dragging. You may follow examples in documentation, or use either demo game or DragDropCommon module as an example.

Thanks for the explanation - that all makes sense. Since I am specifically only trying to drag and drop buttons (with assigned graphics), I will go that route and try to come up with custom drag mode based on GhostGUI.

I'll provide an update here when I come up with something workable.
#14
Hi CW. This module has become one of the most important modules I'm using for an art project that has a fake macintosh-style OS.

I'm running 1.1.0 and I'm wondering if the limitation "eDDCmnMoveGhostGUI - drags supplied custom GUI with object's image on it (currently does not work for GUI and Controls, but this is ONLY way to make inventory items drag & drop)" can be overcome?

I've got a situation where I want to simulate dragging a GUIControl from one GUI to another. The GUIcontrol does not have to actually move from one GUI to another, I just need it to *appear* that way (e.g. show a graphic that follows the mouse cursor to its drop point). The usage scenario is dragging an icon from Window A (a remote FTP, gFTP) to Window B (a local hard drive, gHardDrive).

Currently, the DragDropCommon module allows me to drag a GUIControl, but the control is only moved within its parent GUI... it cannot move beyond the boundaries of the parent GUI. After spending a few hours reading through the DDC module, it appears that the eDDCmnMoveGhostGUI setting is ignored for GUIs and GUIControls.

And yet, according to the documentation, "GhostGUI" mode works with everything, and is the only way to drag Inventory Items. You must provide a GUI though, by setting DragDropCommon.GhostGUI. GhostGUI also uses GhostTransparency property.

Is this just an inconsistency between the documentation and the module code? Is there a conceptual workaround that would allow me to simulate dragging and dropping (via a GhostGUI) a GUIControl from one GUI to another?

Thanks for your help and the great module!
#15
Quote from: eri0o on Sat 10/12/2022 19:36:41I managed to reproduce the above (thanks @vga256 !), I opened an issue here:

https://github.com/adventuregamestudio/ags/issues/1847

many thanks to you and CW for the patch. Looking forward to testing it in the next RC.
#16
First off - so glad to see how 3.6 has progressed. I took a few months away from AGS to work on other projects, and I'm glad to be back.

I'm running RC3 and I noticed a (new) bug with the SDL2 Software Renderer. There is a single line of missing pixels at the very bottom of each room. When I hover the mouse over the location, the immediate area surrounding the mouse renders properly. When the mouse leaves, the pixels return to black as shown in the link below:

Screencap of missing pixels

It seems to only affect the room background, as GUIs dragged down to this area render properly.

Let me know if you'd like me to upload a test project to demonstrate this. My project is running in 512x384, with room backgrounds of exactly 512x384.

When I switch to the OpenGL renderer, it renders properly. Testing all done in Windows 10.
#17
Thanks Grundi and Ben for your (ten!) years of service. For a long time, BCT was my only source of intelligent conversation about adventure game design and development. The show eventually (pretty directly) led to me quitting my career and starting work on commercial AGS titles many moons ago. The adventure game landscape is different now than it was in 2012 when the show got off the ground, and I hope you're proud that you're partly responsible for re-shaping it over the years!
#18
Quote from: keelan2000 on Wed 04/05/2022 01:44:36
My name is Keegan. I'm from the US and I'm a newbie! I have very little coding experience and absolutely no game dev experience. My background is in video production/filmmaking. I'm trying to make a first-person PnC horror game based on an unfinished animated horror short that I half-made.

Welcome Keegan - glad you found your way here! You'll find yourself in good company - some of us are (former/current) filmmakers as well. AGS makes a pretty cheap film production suite :D
#19
As always, thanks for this lifesaving module Edmundo.

I've been using some of the less-often-used tweens lately, and was wondering: what do you think about adding a "from" and "to" Panning setting for TweenPanning? I made a few minor changes to the module (seen below), and this new TweenPanning function allows me to start a Pan at any location (from -100 to 100) and end it at another panning location. This gives me a crude form of procedural dynamic sound for rooms (e.g. rolling a chair across the floor from center to left, and then left to right).

The default (unmodified) behaviour is to start all tweens at their current panning position (usually zero) and takes no "fromPanning" parameter. I could also imagine having the parameter order changed to int toPanning, int fromPanning=0, so the "fromPanning" parameter can use zero as a default value for backwards-compatibility sake.

Tween.asc:
Code: ags

int TweenPanning(this AudioChannel*,  float timing, int fromPanning, int toPanning, TweenEasingType easingType, TweenStyle style, float startDelay, TweenTimingType timingType) {
  return _StartAudioTween(_eTweenAudioChannelPanning, this, timing, TweenMaths.ClampInt(toPanning, -100,  100), 0, TweenMaths.ClampInt(fromPanning, -100, 100), 0, easingType, style, startDelay, timingType);


Tween.ash:
Code: ags

import int TweenPanning(this AudioChannel*, float timing, int fromPanning, int toPanning, TweenEasingType easingType=Tween_EASING_TYPE_AUDIO, TweenStyle style=Tween_STYLE_AUDIO, float startDelay=Tween_START_DELAY_AUDIO, TweenTimingType timingType=Tween_TIMING_AUDIO);


I'm not sure if this was the most elegant way of doing it, but you get the idea :)
#20
Quote from: eri0o on Fri 08/09/2017 12:15:59
Another option :-\

I Wonder what people who releases games on Steam does or if it's not needed at all and users are ok with it.  ???

Sorry for the Necro. The Steam (and GOG) launcher is signed and launches the game on behalf of itself, so the game executable does not have to be signed. Signing is only useful if you plan to launch the game via the Windows store, or on itch.io, or some other storefront that allows the game to be run without a launcher.
SMF spam blocked by CleanTalk