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

#1
Is this the only thread about AGS4? It is very old.
The only other one mentioning AGS4 is Engine & Editor V4.0 Alpha - Proposal, and an issue on github.

I would like to follow the ongoing discussion, if any, about new features going to be implemented  in AGS4.

I add here a link to all AGS4-tagged issues on github, for reference:

Open
Closed

#2
I copied my "defective" .ags file into a folder containing the files of web engine taken from latest release (3.6.0 RC6), but the flickering is still there:

https://jumpjack.github.io/Space1999Adventure/AGSdebug3_/

I didn't keep the source of the defective .ags so I cant't compile it with updated editor.

Should the problem have been fixed on the editor/compiler or in the engine?

I thought that this fix included also the overlays ordering bug (undefined order if Zorder is the same):

Quote- Fixed GUI sorting for cases when ZOrder is equal (this could cause both regression in drawing order, and click detection mistakes);

#3
Sorry if it's a silly question, but why also in 3.6.0 there is no "New" button/menu to create a new game without exiting the editor?

Apart from this, I just opened an issue about a "text bug" I recently discovered in RC3 but still present:

https://github.com/adventuregamestudio/ags/issues/1900
#4
Engine Development / Splash screen build date
Tue 17/01/2023 09:00:36
In splash screen of Build 3.6.0.38 I read "November 2022", shouldn't it read january 2023?
#5
Quote from: eri0o on Tue 05/04/2022 22:57:56I updated the link on the first post with an updated version of this.



You now only have two groups active in the Editor log, which is the Game log group, with things that are reported from the engine internals that are relative to the Adventure game parts, and the Script log group, which are the logs you yourself can output by using System.Log().

Interesting, but listboxes are quite uncomfortable for continuous usage: I would suggest two static lists of radioboxes on the right or left.

I would also suggest separated panels for game messages and script messages.
#6
Quote from: FanOfHumor on Wed 19/01/2022 14:55:53Could you also include a list off to the side having all the objects and characters and their coordinates beside them as a window.The log shows where the characters go to but not where they are.
I cant remember all the times when I wished I knew where the character was exactly at a certain moment.
I know this Is a bit extra to ask.Especially since there might not be any room to place a window.
You are mixing up editor features with engine features...

The list of objects should be placed in the Explore Project panel of Editor window (I wonder why Chris did choose that strange view mode for objects, areas and whatelse).

The runtime engine should show current character(s) position. Showing the positions of dozens of objects looks not feasible/useful: too many data.
#7
Quote from: Crimson Wizard on Tue 18/01/2022 13:22:31By the way, this is somewhat related, but theoretically one could write a stand-alone application that either reads the engine log on the fly, from the file or stdout; or connects to the engine using same "Debugger" interface as editor uses, and then displays all messages in a window. This way one would be able to see game's log even without the editor.
It's what I am currently doing with my favourite text editor, PSPad, which has an "autoupdate" feature,to show in real time how a loaded file is changed by other applications.

I created this function:


Code: ags
function debugPrint(String text,  bool displ) { 
  File *output = File.Open("$SAVEGAMEDIR$/log.txt", eFileAppend);
  if (output == null)
    Display("Error writing to log file.");
  else {
    DateTime *dt = DateTime.Now;
    String dateText = String.Format("%4d/%02d/%02d %02d:%02d:%02d" , dt.Year, dt.Month, dt.DayOfMonth,  dt.Hour,  dt.Minute,  dt.Second);
    String filetext = dateText.Append(" - ");
    filetext = filetext.Append(text);
    output.WriteRawLine(filetext);       
    output.Close();
    if (displ) { // blocking message
        Display(filetext);
    }
  }
 }

It saves log into "Saved games" system folder.

But having this function embedded in the editor would be of course much better.
#8
Upon creating a new game in 3.6.0 RC4, if I select the empty template I am warned about it being... empty  ;) , and suggested to use "Defualt Game" template, but there is no Default Template available: I see Bass, Empty Game, Sierra-Style, Tumbleweed and Verb Coin.
#9
Engine Development / Re: AGS engine Web port
Sat 14/01/2023 11:38:31
I have another installation of AGS 3.6.0 RC4 in another PC (but reading/writing the game in same cloud folder of the other PC), and it does not create the "phantom" my_ags_game.ags , so I don't know what is going on.
In  the AGS-3.6.0.39-RC4.zip file there is no my_ags_game.ags file.
I started with 3.6.0 RC3 but I see it is no more downloadable so I cannot check.

I see that if I put a .ags file in data folder, upon compiling it's copied to web fodler and added to the list of files in my_game_files.js. But why should I add a .ags file in data folder? And can a game be made of multiple .ags files?
#10
Engine Development / Re: AGS engine Web port
Fri 13/01/2023 21:04:42
it's even listed in my_game_files.js , and I didn't create it!

https://github.com/jumpjack/Space1999Adventure/blob/main/AGSdebug2/my_game_files.js

I am using 3.6.0 RC4.
#11
I changed my code as suggested above, no more flickering now.  :)

https://github.com/jumpjack/Space1999Adventure/tree/main/AGSdebug2

This solution also saves some of memory, using just 100 overlays rather than 400.

Code: ags
  ///// Build room tile by tile
  int layerNumber = 0;          
  int overlayIndex = 0;
  int tileIdInt[4];
  for (int isoX = 0; isoX < mapwidthTiles; isoX++) {
    for (int isoY=0; isoY < mapheightTiles; isoY++) {
      isoToCartesian(isoX, isoY,  tilewidth * (mapwidthTiles/2));
      tileIdInt[0]  = mapTiled[isoX].elements[isoY];
      tileIdInt[1] = mapTiled1[isoX].elements[isoY];
      tileIdInt[2] = mapTiled2[isoX].elements[isoY];
      tileIdInt[3] = mapTiled3[isoX].elements[isoY];

      DynamicSprite* tileLayersContainer = DynamicSprite.Create(24, 200); // will hold all tiles stacked on same isox, isoy location
      DrawingSurface *tileLayersContainerSurf = tileLayersContainer.GetDrawingSurface();

      /////// Build the room by stacking on same isoX, isoY coodinates all the tiles from all the layers, 
      /////// and storing them into a room overlay; overlay is drawn only once all tiles have been drawn in it.
      ////
      //// # Create temporary sprite "tileLayersContainer"
      //// # Gets its drawingsurface into "tileLayersContainerSurf"
      //// # For each (isoX,  isoY) location:
      //// #    For each layer:
      //// #      Paste the layer tile into the drawing surface, at an Y level depending on layer number (Layer 0: y=0,  layer 0: y=7, ...)
      //// #    Create a RoomOverlay from the final sprite drawingsurface, and assign it a ZOrder as follows:
      //// #    Should be like this...
      //// #              0        
      //// #            1  1      
      //// #          2  2  2
      //// #        3  3  3  3  
      //// #      4  4  4  4  4 
      //// #    5  5  5  5  5  5  
      //// #    ....                  
      //// #    But player should be placeable between levels,  so multiply this ZOrder by half tile height:
      //// #                      
      //// #              0        
      //// #            6  6      
      //// #          12  12  12
      //// #        18  18  18  18  
      //// #      24  24  24  24  24
      //// #    30  30  30  30  30  30 
      //// #    ....                  
      
      for (int currentLayer = 0; currentLayer < 4; currentLayer++) {
        if (currentLayer == 0) { // Draw floor tile under all tiles,  empty or not.
          non_flipped = DynamicSprite.CreateFromDrawingSurface(floorTileSurf, 0, 0, floorTileSurf.Width,  floorTileSurf.Height);
          DrawingSurface *non_flippedSurf = non_flipped.GetDrawingSurface();  // Put sprite graphic into surface to draw it onto container surface
          tileLayersContainerSurf.DrawSurface(non_flippedSurf, true, 0, TILEDOWN + YFACT + 12); // Paste tile into container      
        }        
        if (tileIdInt[currentLayer] > FACTOR) { // Tile to be flipped  
          tileIdNorm = tileIdInt[currentLayer] - FACTOR - 1; 
          flipped = DynamicSprite.CreateFromExistingSprite(tileIdNorm,  true); // clone the sprite to flip it
          flipped.Flip(eFlipLeftToRight); 
          DrawingSurface *flippedSurf = flipped.GetDrawingSurface();  // Put sprite graphic into surface to draw it onto container surface
          tileLayersContainerSurf.DrawSurface(flippedSurf, true, 0, TILEDOWN - 7*currentLayer); // Paste tile into container      
  //debugPrint(String.Format("FLIPPED Overlay n. %d is located at ISO %d, %d, has normalized id %d (original id: %d, flipped slot: %d) and Z=%d", overlayIndex, isoX,  isoY,  tileIdNorm, tileIdInt[currentLayer],  flipped.Graphic, roomOverlay[overlayIndex].ZOrder), false);
        } else { // Don't flip tile
          if (tileIdInt[currentLayer] !=0) { // Regular tile
            tileIdNorm = tileIdInt[currentLayer];
            non_flipped = DynamicSprite.CreateFromExistingSprite(tileIdNorm,  true); // clone the sprite to flip it        
            DrawingSurface *non_flippedSurf = non_flipped.GetDrawingSurface();  // Put sprite graphic into surface to draw it onto container surface
            tileLayersContainerSurf.DrawSurface(non_flippedSurf, true, 0, TILEDOWN - 7*currentLayer); // Paste tile into container      
  //debugPrint(String.Format("normal  Overlay n. %d is located at ISO %d, %d, has default    id %d (                                ) and Z=%d", overlayIndex, isoX,  isoY,  tileIdNorm, roomOverlay[overlayIndex].ZOrder), false);          
          } else {  // Empty tile (=walkable area)
  //debugPrint(String.Format("normal  Overlay n. %d is located at ISO %d, %d and is empty", overlayIndex, isoX,  isoY), false);                    
            tileIdNorm = 0;
          }
        }
              
        if (currentLayer == 0) {    // Draw walkable areas only for base layer        
  //      1
  //    3  2
  //    5  4
  //      8

  // ymargin needed above tile for better handling adiacent tiles occluding player
        int x1 = screenx;                          int y1 = screeny + YFACT - YMARGIN/2;
        int x2 = screenx + tilewidth/2;            int y2 = (screeny + tileheight/2 + YFACT)  - YMARGIN/2;
        int x3 = screenx - tilewidth/2;            int y3 = (screeny + tileheight/2 + YFACT)  - YMARGIN/2;

  // ymargin needed below tiles to prevent apparent player walking over objects
        int x4 = x2;                                int y4 = y2 + YMARGIN; 
        int x5 = x3;                                int y5 = y3 + YMARGIN; 
        int x6 = screenx;                          int y6 = screeny + tileheight + YFACT + YMARGIN;
      

        if ((tileIdNorm != 0) && (tileIdNorm != 10) && (tileIdNorm != 23)  && (tileIdNorm != 45)  && (tileIdNorm != 46)) {
          // 0 = walkable:
          //    10 = doors (debug: open/closed)
          //    23 = glass floor (used between stairs)
          //    45, 46 = stairs      
          // !=0 = not walkable
    
          walk.DrawingColor = 0; // Drill non walkable areas
        
          ///// drill nonwalkable holes in walkable area:
          walk.DrawTriangle(x1, y1,  x2, y2,  x3, y3);
          walk.DrawRectangle(x3,  y3,    x4,  y4);
          walk.DrawTriangle(x4, y4,  x5, y5,  x6, y6);
          /////////        
          
        } else {
          //// Draw special regions (stairs and glass floor)
          if ((tileIdNorm == 45) || (tileIdNorm == 46)) { // stairs: not directly walkable,  but player.z must be increased
            myRegions.DrawingColor = REGION_STAIRS;
            myRegions.DrawTriangle(x1, y1,  x2, y2,  x3, y3);
            myRegions.DrawRectangle(x3,  y3,    x4,  y4);
            myRegions.DrawTriangle(x4, y4,  x5, y5,  x6, y6);
          }
  
          if (tileIdNorm == 23) { // glass floor (slightly above base level)
            myRegions.DrawingColor = REGION_GLASS;
            myRegions.DrawTriangle(x1, y1,  x2, y2,  x3, y3);
            myRegions.DrawRectangle(x3,  y3,    x4,  y4);
            myRegions.DrawTriangle(x4, y4,  x5, y5,  x6, y6);
          }
        }    
      }
        //Wait(5);
    }
    roomOverlay[overlayIndex] = Overlay.CreateRoomGraphical(screenx - tilewidth/2, screeny - 2*tileheight + YFACT - TILEDOWN,  tileLayersContainer.Graphic,  0,  true);
    roomOverlay[overlayIndex].ZOrder = (isoX + isoY + 1)*6 + YFACT ;
    overlayIndex++; 
    } // isoY  
  } // isoX
  walk.Release();    
  Debug(5, 0); // show path of player  
#12
Engine Development / Re: AGS engine Web port
Fri 13/01/2023 13:53:44
Quote from: eri0o on Thu 12/01/2023 08:41:39There's no standard name, if there's an extra .AGS file in the directory either you put there or you put in the Data directory.
I didn't do anything manually, all files have been created by AGS. I also tried deleting all of them, but upon compiling it recreates both .ags files.
#13
 
Quote from: Khris on Fri 13/01/2023 07:42:45If two overlays have the same z-order, their per-frame order is based on the cosmic rays hitting the earth and the energy flowing through ley lines in that precise quantum moment, which makes them flicker to the front and back.

:-D  Funny... but I think this is not the case: if you watch carefully you can see that flickering is not random, it always happens at same moment on same overlay when player is in same position. There is something in the engine code which makes player position influence overlays draw order.  ???
#14
Quote from: Crimson Wizard on Thu 12/01/2023 22:42:14Another solution that could be tried here, in my opinion: merging multiple static tiles, that are located in the same position, on a single overlay, instead of creating a separate overlay for each tiny element.
This is an interesting idea: rather than  drawing whole layer at once, I should draw all layers of each tiles at once.

Now:




Then:

Draw/create order:



ZOrder assignment:

#15
Quote from: Khris on Thu 12/01/2023 22:34:21The parts that disappear and reappear seem to be in the same spot as a bunch of background overlays; is it possible they have the same z-order value? As in, cannot be sorted reliably?
Yes, I assigned same Zorder to all objects which in "real world" would lie down on same floor tile. But they are drawn bottom-up, so I don't get why the final result is not as I would expect.

Guess I have to rethink my isometric algorithm. ???
#16
Quote from: Crimson Wizard on Thu 12/01/2023 20:37:37Alternatively, is it possible to download a game.ags file somewhere, to let me test this under debugger?
I don't  know if web version of AGS can be opened and viewed in editor, anyway it's in the same folder of main page:
https://jumpjack.github.io/Space1999Adventure/AGSdebug/my_ags_game.ags
https://jumpjack.github.io/Space1999Adventure/AGSdebug/004.ags
#17
My game is behaving weirdly again. :-)
I define ZOrder of all my overlays only once at room creation, but I see various overlays changing draw order while character moves around them: sometimes overlay A is drawn over overlay B, other times B gets over A while character moves around; how do character movements influence overlays zorder?

This is the web version (continuously changing, so it could be not working at all when you run it...):
https://jumpjack.github.io/Space1999Adventure/AGSdebug/  (press CTRL+F to unlock the character)

Note:
the room is drawn by layers: layer 0 for floor, then further 3 layers for various objects; the flickering objects, for example windows, are on layer>0.

I seacrhed for "ZOrder" in whole project, but it only occurs in room script, at room creation.
#19
I need that my character Y position is constantly added a fixed quantity as long as character remains inside a region.

I tried with this:

Code: ags
function region1_Standing() {
  //if (!raised) {
    cEgo.y -= 10;
    raised = true;
  //} else {
    // already raised
  //}
}

If  lines are commented, character flickers between "normal" and raised position.
If they are not commented, character Y position is changed only at the beginning, then turns back to the one calculated by pathfinder.
#20
Engine Development / Re: AGS engine Web port
Thu 12/01/2023 08:11:46
I see that in the WEB folder two .ags files are created: one is the copy of the .ags game, named as I called my game (for example pacman.ags), the other has the "standard" name my_ags_game.ags . Why are both needed? They differ only by 1KB, but it looks like a waste of space..
SMF spam blocked by CleanTalk