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
Darn, was looking forward to attending tomorrow, unfortunately my household is Mac-only. Good luck everyone!
#2
AGS Engine & Editor Releases / Re: AGS 3.6.1
Sun 07/04/2024 06:31:44
Quote from: Crimson Wizard on Fri 05/04/2024 16:06:09@Khris I remember now, @vga256 had same problem in one game, I was able to reproduce this with his game sources, but I was not able to create the minimal test case.
Even using your code from above separated into a dummy game does not cause the issue (compiler still correctly detects undefined "nide").
It seems that a number of factors are required to make this happen, and I don't know which ones.

This was such a strange compiler bug - I spent hours trying to figure out what the conditions were, and couldn't replicate it using "simpler" code.

One thing I can say though is that, superficially, the call looks similar to Khris':
the offending code: where I could write any combination of letters in place of the "i" index, producing the same results
Code: ags
 CurrentVehicleMap[i].FlyToPosition(terrainTile.x, terrainTile.y);

CurrentVehicleMap was also a struct with several functions like FlyToPosition
CurrentVehicleMap[MAX_VEHICLES]

I just wish I could figure out what the issue was. As CW said, switching to AGS4 did solve the compilation problem (e.g. it caught my mis-spelling of the 'i' index every time.)
#3
CW - Thanks for figuring this out and the fix. Confirmed working on my end.
#4
Quote from: Crimson Wizard on Wed 21/02/2024 16:36:55The crash with Software renderer is occuring within a call to Display, inside "game_start" (specifically it is displaying text "x 11 y 10 currentMapWidth 64", if that matters). It looks like engine is trying to draw room viewport for some reason, although the room is not loaded yet, and this where it crashes because some data is not initialized yet. I would need to investigate this, but most likely it's simply should be skipping certain steps when the game is drawn without any loaded room.

EDIT: yes, it's confirmed, in 3.6.1 calling Display in game_start crashes the game if using Software renderer.

Interesting. I added that Display call in game_start, just before I uploaded the binary, just to see if I could trace the source of the 'out of bounds' -1 index error.
UPDATE: just confirmed - yep, I had a second Display call buried in my initialization code that was triggering the crash. It is definitely caused by Display in game_start by the software renderer.
#5
Quote from: Crimson Wizard on Wed 21/02/2024 03:47:43Yes, please, either a Crashdump or a compiled game would be necessary.
Also, could you elaborate, does it crash all the time or not, and if yes, then when does the "out of bounds" happen?

It crashes every time time after running, and only about 5% of the time (or less - I'm just guessing the frequency) does it trap an out of bounds error and halts execution before a crash can happen. I can't tell if the two are related, or coincidental. (Link to compiled game and crashdump sent via PM.)
#6
Just upgraded a 3.6.0.51 project to 3.6.1.20. It ran correctly and without errors in 3.6.0.51, but now it is crashing and throwing an error at startup with 3.6.1.20.

For context: The game involves a lot of procedural generation at startup, which is probably where it is generating the crash.

---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x004210E9; program pointer is +3, engine version 3.6.1.20, gtags (379,16)
------------


Crashdump is available if that helps. I can also provide you with the entire project source if you prefer. About one out of 20 times running the game, it yields an 'out of bounds' array index of -1 in one of my function calls. This is strange, because I am not able to replicate that bug in my scripts using 3.6.0.51.
#7
Quote from: eri0o on Mon 15/01/2024 00:35:55As far as I remember it does a reverse projection of the point in the transformed rectangle of the sprite and then picks up the pixel color and returns true if it doesn't match the COLOR_TRANSPARENT

It uses some sorting to figure it out the order too (which can be slow, but it sorts only on Objects I think).

Perfect, thanks! That explains why I was getting no object found when it was hitting transparent pixels on my object. (I had Pixel Perfect enabled).

I tested it, and it is true. This is kind an interesting undocumented feature of the engine: Object.GetAtRoomXY's point hit detection is determined by the Pixel-perfect click detection setting.
#8
I did some searches through github and reviewed the engine documentation, but I couldn't find an answer to this problem: I'm trying to understand how Object.GetAtRoomXY works at an algorithmic level.

Does the hit test involve a simple check whether there is a room object - defined by the object's height and width at room coordinates, regardless of the object's sprite transparency? Or does it only return an object when the point is opaque (e.g. non-transparent) in the object's transparency mask?
#9
Can confirm the dissolve transition transparency fix works great. Thank you!
#10
Quote from: Crimson Wizard on Fri 05/01/2024 07:57:23Please, give some details about your project:  color depth, the graphics driver you are using, what is the actual room background; are these real guis or you are drawing them on a drawing surface, etc.

Color depth: 32-bit
Resolution: 512x384
Renderer: Dragging GUI + dirty background painting occurs with SDL 2D Software Renderer. See note below.
Room background: 512x384 32-bit PNG
GUIs: No drawing surfaces or dynamicsprites used.

I will PM a zip of the project separately.

Notes on renderers:
The problem specifically with dirty background rectangles seems to be limited to the SDL2 2D Software Renderer. I also tested it with the OpenGL and D3D9 renders which do *not* paint dirty rectangles when dragging around GUIs. However, upon further testing I noticed that all three renderers produce a pink background between background fades. So unless there is some corrupted image in my sprites somewhere, it appears to be an underlying engine renderer problem somewhere.

It also may be of interest - I just tested it, and the exact same pink rendering problems also occur with AGS4.
#11
Running 3.6.1.15b (latest) and I tried upgrading my 3.6.0.x project using it. It compiles properly, but when I run the game, I get a pink background which fills in only when I move GUI objects over it. Screencap of behaviour here (MP4).

Happy to send a zip of my project if it helps to pin down the problem. Or perhaps it is something obvious I missed when upgrading my project?
#12
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.
#13
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.
#14
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?
#16
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?
#17
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
#18
Apologies for the necropost - since monkey0506's link is long dead, just wanted to share an archived link to the module:
Download Here
#19
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:
#20
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.
SMF spam blocked by CleanTalk