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

#41


Hey, I am starting to play around with Sprite Stacking in AGS. Has someone ever done this here?

Sliced.ash
Code: ags
// new module header
#define MAX_SLICED_OBJECTS 32
#define MAX_OVERLAYS 2048
#define OVERLAYS_STEP 32

managed struct SlicedObject {
  import void Set(float x, float y, float z, int graphic_first_slice, int graphic_last_slice);
  import static SlicedObject* Create(float x, float y, float z, int graphic_first_slice, int graphic_last_slice); // $AUTOCOMPLETEIGNORESTATIC$
  writeprotected int GraphicFirstSlice, GraphicLastSlice, SliceRange, SliceWidth, SliceHeight;
  writeprotected float X, Y, Z;
};

struct SlicedWorld{
  import void AddSlicedObject(int x, int y, int z, int graphic_first_slice, int graphic_last_slice);
  import void Render(float angle_radians = 0.0);
  protected SlicedObject* SlicedObjects[MAX_SLICED_OBJECTS];
  protected int ObjectCount;
  protected Overlay* Overlays[MAX_OVERLAYS];
};

Sliced.asc
Code: ags
// new module script
// -- SLICED OBJECT --

void SlicedObject::Set(float x, float y, float z, int graphic_first_slice, int graphic_last_slice)
{
  this.X = x;
  this.Y = y;
  this.Z = z;
  this.GraphicFirstSlice = graphic_first_slice;
  this.GraphicLastSlice = graphic_last_slice;
  this.SliceRange = graphic_last_slice - graphic_first_slice;
  this.SliceWidth = Game.SpriteWidth[graphic_first_slice];
  this.SliceHeight = Game.SpriteHeight[graphic_first_slice];
}

static SlicedObject* SlicedObject::Create(float x, float y, float z, int graphic_first_slice, int graphic_last_slice)
{
  SlicedObject* sobj = new SlicedObject;
  sobj.Set(x, y, z, graphic_first_slice, graphic_last_slice);
  return sobj;
}

// -- SLICED WORLD --

void SlicedWorld::AddSlicedObject(int x, int y, int z, int graphic_first_slice, int graphic_last_slice)
{
  SlicedObject* sobj = SlicedObject.Create(IntToFloat(x), IntToFloat(y), IntToFloat(z), graphic_first_slice, graphic_last_slice);
  
  this.SlicedObjects[this.ObjectCount] = sobj;
  this.ObjectCount++;
}


void SlicedWorld::Render(float angle_radians)
{
  float pre_cos = Maths.Cos(angle_radians);
    float pre_sin = - Maths.Sin(angle_radians);
  
  for(int i=0; i<this.ObjectCount; i++)
  {
    SlicedObject* sobj = this.SlicedObjects[i];
    
    int overlay_id_start = i*OVERLAYS_STEP;
    int slice_range = sobj.SliceRange;
    
    for(int j=0; j<slice_range; j++) {
      int overlay_id = overlay_id_start + j;
      if(this.Overlays[overlay_id] == null || !this.Overlays[overlay_id].Valid) {
        this.Overlays[overlay_id] = Overlay.CreateRoomGraphical(0, 0, sobj.GraphicFirstSlice + j);
      }
      
      Overlay* ovr = this.Overlays[overlay_id];
      
      float dist = IntToFloat(j) + sobj.Z;
      
      float lx = dist * pre_cos;
      float ly = dist * pre_sin;
      
      ovr.X = FloatToInt(sobj.X - lx);
      ovr.Y = FloatToInt(sobj.Y - ly);
      ovr.Rotation = Maths.RadiansToDegrees(angle_radians);
    }
  }
}

Usage code

Code: ags
#define SPR_BARREL 1
#define SPR_BARREL_LAST 8
#define SPR_CHAIR 9
#define SPR_CHAIR_LAST 19
#define SPR_CHEST 20
#define SPR_CHEST_LAST 30

SlicedWorld sWorld;

function room_AfterFadeIn()
{

}

function room_Load()
{
  sWorld.AddSlicedObject(32, 32, 0, SPR_BARREL, SPR_BARREL_LAST);
  sWorld.AddSlicedObject(64, 32, 0, SPR_BARREL, SPR_BARREL_LAST);
  sWorld.AddSlicedObject(64, 96, 0, SPR_CHAIR, SPR_CHAIR_LAST);
  sWorld.AddSlicedObject(128, 96, 0, SPR_CHAIR, SPR_CHAIR_LAST);
  sWorld.AddSlicedObject(200, 48, 0, SPR_CHEST, SPR_CHEST_LAST);
  sWorld.AddSlicedObject(230, 48, 0, SPR_CHEST, SPR_CHEST_LAST);
  sWorld.AddSlicedObject(160, 96, 0, SPR_CHEST, SPR_CHEST_LAST);
  sWorld.AddSlicedObject(32, 111, 0, SPR_CHEST, SPR_CHEST_LAST);
}

float angl;
function room_RepExec()
{
  angl += 0.0125;
  sWorld.Render(angl);
}

So far my code and usage is like so, but I am not sure on this design. Any ideas?

(link to above project zip file to download)
#42
DistFX version 0.2.0

Get Latest Release distfx.scm | GitHub Repo | Project with Demo!

AGS Script Module for Distortion Effects, based on Earthbound Battle Backgrounds.



Play with the demo!

Usage

In a room script, link before fade in and repeatedly execute, and try the example below.

Code: ags
DistFX fx; // somewhere with the same lifetime as the surface owner while distorted
Overlay* ovr;
DynamicSprite* spr;

function room_RepExec()
{
  fx.Update(Room.GetDrawingSurfaceForBackground(), spr.GetDrawingSurface(), 2 /* effect */);
  ovr.Graphic = spr.Graphic;
}

function room_Load()
{
  if(ovr == null) {
    spr = DynamicSprite.CreateFromBackground();
    ovr = Overlay.CreateGraphical(0, 0, spr.Graphic, true);
  }
}

Original Earthbound effects used a per pixel approach, but due to how AGS Script drawing performs and works, this module uses a tile based approach.

Script API

DistFX.Update
Code: ags
void DistFX.Update(DrawingSurface* source, DrawingSurface* dest, int effect);
Draws from a source surface to a destination surface using a distortion effect, from the effect bank. Currently, the available effects range is 1-135. Effect 0 appears as no effect but still goes through all the effect pipeline - and will use CPU resources the same.

DistFX.Reset
Code: ags
void DistFX.Reset();
Reset internal state, use on state change.

DistFX.DrawingTransparency
Code: ags
attribute int DistFX.DrawingTransparency;
Drawing Transparency, use for blurring the effects. Default is 0, range from 0 to 99.

DistFX.TileWidth
Code: ags
attribute int DistFX.TileWidth;
Distortion Tile Width, factor of source width, bigger is less resource intensive. Default is 64 pixels.

DistFX.TileHeight
Code: ags
attribute int DistFX.TileHeight;
Distortion Tile Height, factor of source height, bigger is less resource intensive. Default is 1 pixel.

License

This code is licensed with MIT LICENSE.
#43
So, I recently begin to think of something like this



With the EventHandler mapping to a script of the form of a ActionName_Triggered(Action *action, bool state) in global script. Actions would be arbitrary, and you could use for both a keyboard button that you map or a joystick button being pressed triggering the same event handler.

Possibly some reserved actions would exist, which would allow things like mapping different inputs to being able to skip text. All possible inputs would be selectable from a predefined list, using something like the packed InputType+Keycode/Button+modifier.

While I have some idea how this would work on the Editor side, I don't have much idea how this works in the engine. Perhaps I need some reverse map to be able to check whenever an input event happens if I need to trigger some script event. Also this may need a script API in case someone wants to remap buttons on runtime.

Questions/Problems:

  • Action folders could have some property that you could set and the actions in it would inherit?
  • Figure a way to handle multiple gamepads/joysticks, perhaps something outside maps to either gamepad 1 or 2 or...?
  • Big list of possible inputs has to be manually maintained in sync between engine and editor
  • Should continuous input be included here? They have no state change, so they don't make sense as event generating.
#44
This is just an experiment

AGS-3.6.0.34-Beta14_HardwareCursor.zip

You can copy and use the acwin.exe + the sdl dll in the directory of an existing compiled ags game or use this editor to make an experimental game yourself.

In acsetup.cfg add the hardware_cursor=1 text under the [mouse] category or use --mouse-hardware-cursor when running the game from command line.

Code: ini
[mouse]
hardware_cursor=1


When hardware cursors are activated, the mouse cursor of your game won't be drawn in the game window, but instead your actual mouse cursor will be using your game graphics. Usually you can notice better when playing your game windowed, the mouse cursor will bleed outside of the game window.

This is just a test engine so more people could play with this feature because I am currently a bit stuck in what is need or is not needed for this.
#45
Engine Development / UTF8 ready pixel fonts
Sun 05/06/2022 15:59:15
Hi, I would like to invite people who have pixel fonts that are UTF-8 ready to share here!

I made a repository to stash them here: github.com/ericoporto/pixel-utf8-fonts
You can see fonts in the engine web build here: ericoporto.github.io/pixel-utf8-fonts/










NamelDownloadLicenseCompletenessHeight
k8x12j🔽📜Incomplete12 px
Lana Pixel🔽📜Almost Complete11 px
Pixel Locale🔽📜Incomplete9 px
Pixel Operator🔽📜Very Incomplete16 px
Pixel Operator 8🔽📜Very Incomplete8 px
Pixel Unicode🔽📜Incomplete16 px
Unifont🔽📜Complete16 px

This is probably not the appropriate place in the forum, so if there's a better place for it, please move it!  8-)
#46
Hi, I am looking for examples of lighting usage in 2D games. Here's an example from the game Backbone:



I would like to look into examples and see what games are doing, but I don't have much information on this. Any ideas and things you have seen in other games? I am looking at strictly games that are either 2D or really close to 2D. If it's an adventure, it's more interesting, but it doesn't have to be.

Also found an interesting tutorial on casting shadows in top down 2D: https://ncase.me/sight-and-light/
#47


https://github.com/microsoft/Microsoft-3D-Movie-Maker

This is a classic. I hope people will fork and resurrect this.
#48
Just to not swarm Dave's game topic, here's an article that fully explains this : https://devblogs.microsoft.com/directx/demystifying-full-screen-optimizations/

Just to explain that any performance gap difference in the past has been narrowed a lot in Windows 10 and forward, to the point there's no perceptual difference performance wise in modern systems.
#49
⚠ the stuff below is all very old, this has been merged in ags4

Code: ags
  /// get number of connected joysticks.
  static readonly attribute int Joystick.JoystickCount;
  /// get a connected joystick by index or null on invalid index.
  static readonly attribute Joystick* Joystick.Joysticks[];
  /// gets joystick name
  readonly attribute String Joystick.Name;
  /// checks if joystick is really connected
  readonly attribute bool Joystick.IsConnected;
  /// checks if joystick is a valid gamepad
  readonly attribute bool Joystick.IsGamepad;
  /// checks if a gamepad button is pressed, including dpad.
  bool Joystick.IsGamepadButtonDown(eGamepad_Button button);
  /// get gamepad axis or trigger, trigger only has positive values.
  float Joystick.GetGamepadAxis(eGamepad_Axis axis, float dead_zone = AXIS_DEFAULT_DEADZONE); 
  /// get joystick axis or trigger, by index
  float Joystick.GetAxis(int axis, float dead_zone = AXIS_DEFAULT_DEADZONE);
  /// checks if a joystick button is pressed.
  bool Joystick.IsButtonDown(int button);
  /// gets the direction a dpad from the joystick is pointing to.
  eJoystick_Hat Joystick.GetHat(int hat);
  /// get axis count from the joystick
  readonly attribute int Joystick.AxisCount;
  /// get button count from the joystick
  readonly attribute int Joystick.ButtonCount;
  /// get hat count from the joystick
  readonly attribute int Joystick.HatCount;

Spoiler

Experimental Editor with AGS with Gamepad support!

Download Editor Here: >>AGS-3.99.106.0-Alpha3-JoystickPR.zip<< | installer | Code Source | GitHub Issue | GitHub PR

First the concepts, joystick means a generic input device comprised by binary (button) and analog (axis) inputs. A Gamepad means something that is vaguely close to a Xbox360 controller.

We can expand the API later, but the basics is joystick connection and disconnection is handled inside the AGS Engine and we can skip things by pressing A,B,X,Y or the symbols in PS controller.



@Alan v.Drake made a beautiful test project!



Playable AgsGameGamepadV4.zip | project | Online https://ericoporto.github.io/agsjs/gamepadtest/




Joystick Static Methods

Joystick.JoystickCount
Code: ags
static readonly int Joystick.JoystickCount
Get the number of connected joysticks. No joysticks should return 0!


Joystick.Joysticks
Code: ags
static readonly Joystick* Joystick.Joysticks[int index]
Gets a joystick by index from the internal engine joystick list.


Joystick Instance Attributes and Methods

Joystick.IsConnected
Code: ags
readonly bool Joystick.IsConnected
True if joystick is connected.


Joystick.Name
Code: ags
readonly String Joystick.Name
joystick name.



Joystick.IsButtonDown
Code: ags
bool Joystick.IsButtonDown(int button)
checks if a joystick button is pressed, by index. DPad is usually mapped separately as a hat.


Joystick.GetAxis
Code: ags
bool Joystick.GetAxis(int axis, optional float deadzone)
get a joystick axis or trigger, trigger only has positive values, by axis number. Values varies from -1.0 to 1.0 for axis, and 0.0 to 1.0 for triggers.


Joystick.GetHat
Code: ags
eJoystick_Hat Joystick.GetHat(int hat)
returns hat value


Joystick.AxisCount
Code: ags
readonly int Joystick.AxisCount
get the number of axis in the joystick


Joystick.ButtonCount
Code: ags
readonly int Joystick.ButtonCount
get the number of buttons in the joystick


Joystick.HatCount
Code: ags
readonly int Joystick.HatCount
get the number of hats in the joystick



Joystick.IsGamepad
Code: ags
readonly bool Joystick.IsGamepad
True if joystick is a valid gamepad connected - this means SDL2 recognized it as a valid GameController and has successfully mapped it's buttons to an Xbox360 gamepad.


Joystick.IsGamepadButtonDown
Code: ags
bool Joystick.IsGamepadButtonDown(eGamepad_Button button)
checks if a gamepad button is pressed, including dpad.

Possible buttons:
  • eGamepad_ButtonA
  • eGamepad_ButtonB
  • eGamepad_ButtonX
  • eGamepad_ButtonY
  • eGamepad_ButtonBack
  • eGamepad_ButtonGuide
  • eGamepad_ButtonStart
  • eGamepad_ButtonLeftStick
  • eGamepad_ButtonRightStick
  • eGamepad_ButtonLeftShoulder
  • eGamepad_ButtonRightShoulder
  • eGamepad_ButtonDpadUp
  • eGamepad_ButtonDpadDown
  • eGamepad_ButtonDpadLeft
  • eGamepad_ButtonDpadRight


Joystick.GetGamepadAxis
Code: ags
float Joystick.GetGamepadAxis(eGamepad_Axis axis, optional float deadzone)
get gamepad axis or trigger, trigger only has positive values. Values varies from -1.0 to 1.0 for axis, and 0.0 to 1.0 for triggers.

You can optionally pass an additional parameter to use as deadzone. If an axis absolute value is smaller than the value of deadzone, it will return 0.0. Default value is AXIS_DEFAULT_DEADZONE, which is for now 0.125, use the name if you need a number.

Possible axis and triggers:
  • eGamepad_AxisLeftX
  • eGamepad_AxisLeftY
  • eGamepad_AxisRightX
  • eGamepad_AxisRightY
  • eGamepad_AxisTriggerLeft
  • eGamepad_AxisTriggerRight


CHANGELOG:
  • v1: initial release
  • v2: GetAxis now returns a float
  • v3: GetAxis now has an additional dead_zone parameter. Default value is GAMEPAD_DEFAULT_DEADZONE, which is for now 0.125, use the name if you need a number.
  • v4: Using correspondent A,B,X,Y buttons can skip Speech and Display messages, as long as you Connect to the Gamepad.
  • v5: ditched Gamepad-only approach for a Joystick first approach similar to löve.
  • v6: connection and disconnection handled in-engine, new AGS 4 approach.
  • v7: api renamed get,getcount to instead retrieve from array of joysticks, also fixed save/load game bug
[close]
#50
AGS Toolbox🧰 version 0.5.5

Get Latest Release agstoolbox.exe | companion atbx.exe | GitHub Repo



🚨NOTE: A clean windows 11 installation may require you install this VC_redist.x64.exe (VS2017 redistributable).

Hi, I made something intended for those that deal with multiple versions of AGS Editors and multiple AGS Game Projects. Place the agstoolbox.exe in a folder under your user, like "C:\Users\MY_USER\software", before you run it.



After you run the agstoolbox.exe, you will find a bluecup in your indicator area of your taskbar, near the clock area. Double click or right click it, to open the main panel.

Features
  • Editors that you install using AGS Toolbox are called Managed Editors, as they are managed through the tool. Just double click in any Editor available to Download to get one.
  • Editors you have acquired through other means (like installed through Chocolatey), are called Externally Installed Editors, directories to look for can be configured in the Settings.
  • Game Projects are looked for in directories set in the Settings. It will understand the Editor Version it was used to create, open in it by simply double clicking. You can also use right click to open in a different version.
  • You can add it to your Windows initialization if you want a quick shortcut to AGS game development (it's in the settings menu)

Right clicking any item on the list will show available actions, double clicking will execute the command marked in bold.

I made it initially for myself to help handle my own games and modules. It has also an additional pair tool, atbx, that provides the same functionalities through a command line interface - intended for CI and automation.

For people in Unity, this may be a similar AGS version of the Unity Hub. I actually modeled it on the JetBrains Toolbox, which I use to manage different versions of CLion, Android Studio and PyCharm - it's also developed in PyCharm!

Command Line Usage

NOTE: On Windows, due to OS and PyInstaller limitations, agstoolbox.exe doesn't work with command line arguments, so atbx.exe is for exclusive command line usage.

Code: bash
$ atbx --help
usage: atbx [-h] [-s {bash,zsh,tcsh}] [-v] {list,install,open,build,settings,export} ...

agstoolbox is an application to help manage AGS Editor versions.

positional arguments:
  {list,install,open,build,settings,export}
                        command
    list                lists things
    install             install tools
    open                open an editor or project
    build               build an ags project
    settings            modify or show settings
    export              export from ags project

optional arguments:
  -h, --help            show this help message and exit
  -s {bash,zsh,tcsh}    print shell completion script
  -v, --version         get software version.

Copyright 2023 Erico Vieira Porto, MIT.

As an example, a command line to force install the latest 3.6 AGS Editor, as a managed Editor is as follows

Code: bash
$ atbx install editor 3.6 -f
Will install managed AGS Editor release 3.6.0.47
 Downloading... 40475597/40475597 B |████████████████████████████████| AGS-3.6.0.47.zip
Extracting...
Installed release 3.6.0.47

The command line interface is working, but it is still quite limited, if you have more needs for it, please ask me!

Tab completion is also provided, the script for it can be generated with -s parameter, if you need help setting up just ask.



Experimentally, AGS Toolbox is also available on PyPI. Prefer the exe releases above for now, the PyPI releases are intended for uses of it's core parts and the atbx command line utility in continuous integration, the idea is if the pipeline has pip you can just use it to get agstoolbox and then atbx to get the editor setup in the pipeline - essentially two commands to setup AGS Editor in a CI environment.



AGS Toolbox is written in Python, so if you are interested in a new feature and want to contribute code, just ask me and I can explain the basics of it.
#51
https://howtomarketagame.com/2022/04/18/what-genres-are-popular-on-steam-in-2022/

I saw this article and thought it was interesting. Adventure point click or similar doesn't even make into the graphs!!! Also, I was surprised by how popular Visual Novels are. Perhaps we should see what could be done to accommodate those better in AGS. Anyway, any thoughts?
#52
Modules, Plugins & Tools / MODULE: mode7 0.3.0
Tue 29/03/2022 02:11:31
mode7 version 0.3.0

Get Latest Release mode7.scm | GitHub Repo | Download project .zip

AGS Script Module for Mode7 like graphics. See demo in here! (Use Firefox, Safari or Chrome 100+, WASD to move)



This module allows you to project a sprite on the screen with the visual aspect people are familiar from the mode7 graphics of SNES games. Use the Mode7 struct for that!

If you want to do more, and also want to have other elements in it, similar to Mario Kart, you can leverage Mode7World and Mode7Object functionalities.

This code is based on original code that was written by Khris and presented in this ags forum thread. I asked Khris for the original code, which was very Kart oriented, I refactored to what I thought was more generic and made this module in the hopes people could pick around the code and make games out of it!

A note, the original code was a bit more performant, I pulled out some specific optimizations to make the code more flexible.

Script API
Spoiler


Mode7

Mode7.SetCamera
Code: ags
void Mode7.SetCamera(float x, float y, float z, float xa, float ya, float focal_length)

Sets the camera position, angle and focal length.

Mode7.SetViewscreen
Code: ags
void Mode7.SetViewscreen(int width, int height, optional int x,  optional int y)

Sets the screen area it will draw in.

Mode7.SetGroundSprite
Code: ags
void Mode7.SetGroundSprite(int ground_graphic)

Sets the ground sprite, this is the mode7 rendered sprite.

Mode7.SetHorizonSprite
Code: ags
void Mode7.SetHorizonSprite(int horizon_graphic, eHorizonType = eHorizonDynamic)

Sets a sprite that will roll around in the horizon, you can also make it static.

Mode7.SetBgColor
Code: ags
void Mode7.SetBgColor(int bg_color)

Sets the color of the background where the ground sprite doesn't reach.

Mode7.SetSkyColor
Code: ags
void Mode7.SetSkyColor(int sky_color)

Sets the color of the sky.

Mode7.TargetCamera
Code: ags
void Mode7.TargetCamera(float target_x, float target_y, float target_z, float teta_angle, eCameraTargetType camType = eCameraTarget_FollowBehind, bool is_lazy = true)

Target the camera to something.

Mode7.Draw
Code: ags
void Mode7.Draw()

Draws the ground sprite and horizon rendered in the Screen sprite.

Mode7.ResetGround
Code: ags
void Mode7.ResetGround()

Clears the screen sprite.

Mode7.CameraAngleX
Code: ags
float Mode7.CameraAngleX

The camera angle that is normal to the ground plane (e.g.: up and down).

Mode7.CameraAngleY
Code: ags
float Mode7.CameraAngleY

The camera angle that is on the ground plane (e.g.: left and right).

Mode7.Screen
Code: ags
DynamicSprite* Mode7.Screen

The Dynamic Sprite that represents the screen where the Mode7 ground is draw to.




Mode7World
This is an extension of Mode7 and gives you tools to present billboard sprites, positioned in the world coordinates, using the concept of Mode7Objects. You don't have to use it to do the drawing, but it should help you if you want to!

Mode7World.AddObject
Code: ags
Mode7Object* Mode7World.AddObject(int x, int z, float factor, int graphic)

Adds an object, and sets it's x and z position. The y (vertical position) is always zero. You also must pass a scale factor and it's graphics.

Mode7World.AddExternalObject
Code: ags
void Mode7World.AddExternalObject(int x, int z, float factor, int graphic)

Adds an external object that is not managed by the Mode7World. It will still be updated and draw, but removing it from the world will probably not garbage collect it.

Mode7World.RemoveObject
Code: ags
void Mode7World.RemoveObject(int object_i = -1)

Remove a specific object from the world by it's index. If you don't pass a value, it will remove the last valid object added.

Mode7World.RemoveAllsObjects
Code: ags
void Mode7World.RemoveAllsObjects()

Removes all objects from the Mode7 World.

Mode7World.GetAngleObjectAndCamera
Code: ags
int Mode7World.GetAngleObjectAndCamera(Mode7Object* m7obj)

Returns the angle in degrees between the camera and whatever angle is set to a specific object, pointed by their index. Useful when you want to change the graphic of an object based on their relative angle.

Mode7World.UpdateObjects
Code: ags
void Mode7World.UpdateObjects(optional bool do_sort)

Update the screen transform of all objects world positions to their screen positions. You must call it before drawing any objects! You can optionally skip any sorting if you plan rendering using overlays later, since they have zorder property which will be used later by the graphics driver.

Mode7World.DrawObjects
Code: ags
void Mode7World.DrawObjects()

Draws only the objects in the screen sprite. You can use when you need to draw additional things between the ground and the objects. Or when you don't need the ground at all.

Mode7World.DrawObjectsOverlay
Code: ags
void Mode7World.DrawObjectsOverlay()

Draws objects as overlays, without rasterizing at the screen sprite.

Mode7World.DrawWorld
Code: ags
void Mode7World.DrawWorld()

Draws the ground sprite and the objects over it, in the screen sprite.

Mode7World.DrawWorld2D
Code: ags
DynamicSprite* Mode7World.DrawWorld2D()

Gets a dynamic sprite with the world draw in top down view, useful for debugging.

Mode7World.Objects
Code: ags
writeprotected Mode7Object* Mode7World.Objects[i]

Let's you access a specific object in the mode7 world by it's index. Make sure to access a valid position.

Mode7World.ObjectCount
Code: ags
writeprotected int Mode7World.ObjectCount

Gets how many objects are currently in the mode7 world.

Mode7World.ObjectScreenVisibleCount
Code: ags
writeprotected int Mode7World.ObjectScreenVisibleCount

Gets how many objects are actually visible in the screen.

You can iterate through all the screen objects as follows:

Code: ags
for(int i=0; i < m7w.ObjectScreenVisibleCount; i++)
{
  // will make sure to access in order from far to closer
  int index = m7w.ObjectScreenVisibleID[m7w.ObjectScreenVisibleOrder[i]];
  Obj* m7object = m7w.Objects[index];
  
  // do as you you must with you m7object ...
}





Mode7Object
A Mode7Object, you should create objects by using Mode7World.AddObject. After world coordinates are set, you can use Mode7World.UpdateObjects to transform it's coordinates and get updated values in it's Screen prefixed properties.

Mode7Object.SetPosition
Code: ags
void Mode7Object.SetPosition(float x, float y, float z)

A helper function to setting the Object world position in a single line.

Mode7Object.Draw
Code: ags
void Mode7Object.Draw(DrawingSurface* ds)

Draw the object in a DrawingSurface as it would look in a screen.

Mode7Object.X
Code: ags
float Mode7Object.X

Object World X Position on the plane.

Mode7Object.Y
Code: ags
float Mode7Object.Y

Object World Y Position, perpendicular to plane.

Mode7Object.Z
Code: ags
float Mode7Object.Z

Object World Z Position, orthogonal to X position.

Mode7Object.Factor
Code: ags
float Mode7Object.Factor

Object Scaling factor to it's graphics.

Mode7Object.Angle
Code: ags
float Mode7Object.Angle

Object angle, parallel to plane, not used for rendering.

Mode7Object.Graphic
Code: ags
int Mode7Object.Graphic

Object sprite slot, it's width and height is used to calculate the screen coordinates.

Mode7Object.Visible
Code: ags
bool Mode7Object.Visible

Object visibility.

Mode7Object.ScreenX
Code: ags
int Mode7Object.ScreenX

On-Screen Object X position when drawing, if visible. It's regular top, left coordinates, similar to GUI, assumes a Graphic is set.

Mode7Object.ScreenY
Code: ags
int Mode7Object.ScreenY

On-Screen Object Y position when drawing, if visible. It's regular top, left coordinates, similar to GUI, assumes a Graphic is set.

Mode7Object.ScreenWidth
Code: ags
int Mode7Object.ScreenWidth

On-Screen Object Width when drawing, if visible. It's adjusted by the sprite used in Graphic, projection and scaling factor.

Mode7Object.ScreenHeight
Code: ags
int Mode7Object.ScreenHeight

On-Screen Object Height when drawing, if visible. It's adjusted by the sprite used in Graphic, projection and scaling factor.

Mode7Object.ScreenVisible
Code: ags
bool Mode7Object.ScreenVisible

True if object should be drawn on screen. Gets set to false if object is culled when projecting.

Mode7Object.ScreenZOrder
Code: ags
int Mode7Object.ScreenZOrder

ZOrder of the object when drawing on screen, smaller numbers are below, bigger numbers are on top.
[close]

This is just a quick initial release, I plan to update this soon with a better demo and polish the API and other stuff!


  • v0.1.0 - initial release.
  • v0.2.0 - added ResetGround, CameraAngleX, CameraAngleY to Mode7, added Visible to Mode7Object, added AddExternalObject and DrawWorld2D to Mode7World, change GetAngleObjectAndCamera api.
  • v0.3.0 - added support for using Overlays for rendering mode7 objects using Mode7World.DrawObjectsOverlay, and also to skip sorting for overlay based drawing.
#53
Android Build in the Editor


⚠️⚠️This feature is merged and available in 3.6.0 releases⚠️⚠️


running on your computer may have visual differences ... (I am too lazy to update this gif)

Please test and report. Here's the step by step:


  • Install Android Studio, the latest version available
  • Note down the directories it is installed (probably C:\Program Files\Android\Android Studio) and where it installed the Android SDK (probably C:\Users\YOURUSERNAME\AppData\Local\Android\Sdk)
  • open AGS Editor and either create a new game or load a copy of a game you want to test. Don't use your actual game files with this editor since it will add information to your project settings that are not compatible with other 3.6.X versions.
  • On Editor preferences, Set JAVA_HOME to where your JDK is installed, if you have Android Studio, it' s probably C:\Program Files\Android\Android Studio\jre
  • On Editor Preferences, Set ANDROID_HOME to where the Android SDK was installed, it probably is C:\Users\YOURUSERNAME\AppData\Local\Android\Sdk
  • Still on Editor Preferences, set your Android Keystore information. If you don't have a keystore, use the Generate Keystore button. On the keystore generation screen, everything under Certificate is optional.
  • Go in general settings, find the Android entry there and adjust as needed(aab, APK, ...), then on build, select Android among the platforms
  • Hit Build Exe in the Editor and wait things to happen. This will take a lot of time on the first time since it needs to install a lot of things, it should be much faster afterwards

Icons!

At your project root, create a directory named icons with a directory named android inside. Then you need to add the following files ( template here):


  • icons/android/mipmap-mdpi/ic_launcher.png 48x48 pixels, RGBA png icon
  • icons/android/mipmap-hdpi/ic_launcher.png 72x72 pixels, RGBA png icon
  • icons/android/mipmap-xhdpi/ic_launcher.png 96x96 pixels, RGBA png icon
  • icons/android/mipmap-xxhdpi/ic_launcher.png 144x144 pixels, RGBA png icon
  • icons/android/mipmap-xxxhdpi/ic_launcher.png 192x192 pixels, RGBA png icon

If you want to support round icons, additionally create ic_launcher_round.png files in the same directories. If you need help creating those files, try this online AndroidAssetStudio.
FAQ






  • Q: I am missing the Android SDK!
    A: after installing Android Studio, load Android Studio and click in the top menu in Tools, and then in SDK Manager, at top, hit Edit



    In the next screen, set the adequate location and hit next.


    You can hit next here, just note down that the SDK Folder here is what is set as ANDROID_HOME in the Editor preferences, and JDK Location is the JAVA_HOME on the Editor preferences. <<<<


    And then it comes one thing you have to do, if you want to use it, you need to accept the licenses! There are two licenses you need to accept in this screen, so scroll down and hit accept, switch to the next one, scroll down again, and hit accept again.


    We are going to be using SDK 29 in here for now, so if something complains about it, make sure to comeback to the SDK managed and find and click in Android 10 (Q), API Level 29 and then proceed to installing it. If you don't, AGS Editor may try to download and install it anyway if needed when building your app for the first time, after ANDROID_HOME and JAVA_HOME are set!






  • Q: I installed Android Studio using JetBrains Toolbox! But I can't find it... What do I set in ANDROID_HOME ?
    A: OK, if you did this way, the toolbox entry of Android Studio has an entry to show it in file explorer. If you can't find it, it usually uses a directory similar to below:
    C:\Users\MYUSERNAME\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\211.A_TON_OF_NUMBERS\jre





  • Q: How do I set the screen orientation or rotate it?
    A: Screen Rotation has to be configured in Default Setup, currently there are three possible options: Unlocked (player may rotate device screen freely if he unlocks it), Portrait (game can only be vertically oriented) and Landscape (game screen is horizontally oriented). Default is Unlocked.






  • Q: Why is my app name app-mygame-release.apk? Can I change this name?
    A: You did not change the property Android App ID in General Settings. Set it to something like com.incredibleproductions.indianagame and you will get app-indianagame-release.apk.






  • Q: I got a "validateSigningRelease FAILED" message and my build did not work...
    A: It's possible that the keystore was not set, if that is the case go into Preferences, and on Android tab set the correct keystore information. If you don't have a Keystore, please generate one using the Generate Keystore button, and click OK after successfully generating one.







  • Q: Build is a bit slow, can I do anything to speed it up?
    A: In Editor Preferences, under Advanced tab, in Android, select Use Gradle Daemon and mark it true.




There is still room for improvement, but this should do the general things...

Also when possible please try these experimental versions of editors that appears in this board, the feedback given can help make ags better. After the feature is already in, some things get a lot harder to change.

Spoiler

Additionally, I recently started thinking about build matrixes in AGS, if someone has any design idea for this. It looks something like this (this is a different editor than the above):

[close]
#54
According this Tweet, AGS is now 25 years old: https://www.twitter.com/dosnostalgic/status/1488564059976970242

https://archive.org/details/ags-v2

How old is everyone here feeling?  (laugh)

Joining here a bit late in it's history it's been fun. Thank you everyone that has been here in this corner of the internet. It's been interesting.  8-)
#55
Hey, I think I asked this before at some point but I don't remember when. I am making a tool (nothing major) and soon I will be able to have a working release, and as so I will like to post about it in the forums - to get feedback, showcase, note about releases...

Erh, in which board should companion tools go? The module and plugins, the Editor, ... ? There are some tools that were already added/mentioned in the forums and they seem to be in different boards, so I am trying to figure out where it's best to put it.

Thanks
#56
🚨!!Just to test log, backup things, if you are playing with this!!🚨

⚠�>Download: AGS-3.6.0.35-Beta15_DebugLog.zip<⚠�

So, we currently have logging in the engine, and it's very nice, it has all sorts of options. You can use [tt]System.Log[/tt] function for it. But currently you have to either use AGS through command line or configure it to log to a file.

See log levels at the end of page here: https://adventuregamestudio.github.io/ags-manual/StandardEnums.html#loglevel

Well, I want to add a panel so when you run it through the Editor debugger you can pick up your log messages right there. You may have to enable it, in the above build, by clicking on Help-> Show Debug Log



Anyway, would this be useful to others? Is there anything in particular you want to use in such feature?
#57
General Discussion / Steamdeck!
Thu 15/07/2021 19:21:32
https://www.steamdeck.com/

QuoteNo porting required.
Steam Deck runs SteamOS 3.0, and thanks to Proton, your build will likely work right out of the box. To learn more about how to test your game, make your game even better on Deck, or request a developer kit, visit the Steamworks site.

https://partner.steamgames.com/doc/steamdeck/faq

https://youtu.be/4FXgDAF6QpM

This device looks super neat!
#58
2025, apparently: https://docs.microsoft.com/en-us/lifecycle/products/windows-10-enterprise-and-education

And we have leaks of what may be Windows 11.
https://www.theverge.com/2021/6/15/22535123/microsoft-windows-11-leak-screenshots-start-menu

Not sure of what to make of it. I feel Windows 10 was just yesterday but apparently it was 6 years ago, this would mean that the sunset date gives it a 10 year lifespan, roughly what we had with XP. I feel I am getting old.

If someone just want to go to the past, I found something fun: https://github.com/microsoft/winfile
#59
Engine Development / AGS engine Web port
Wed 26/05/2021 02:45:17
the web port is now available along AGS 3.6.X releases!

>>any game launcher<<
    single game example
it's AGS, so Alt+Enter will get you in/out of Fullscreen

please report bugs here or in AGS GitHub issue tracker! If you are unsure if it's a bug, ask about problems here in the thread!!!

New: CW did an amazing video and sound refactor and after it, it was possible to get video working on the web port! Download this game to test in the above launcher link!

Old packaging instructions are not needed anymore since it should now be possible to build directly from the Editor by simpling checking the appropriate box in General Settings and selecting the Web as a build target.

Packaging a Game

  • In the AGS Editor, go to General Settings, and under Compiler, there is the Build target platforms entry, select Web!
  • Click Build EXE (f7)
  • in the Compiled/Web/, you can test running locally a web server in the directory (python3 -m http.server or any other tiny local server you have) and opening the address in the browser.
  • Remember that if you use anything beyond left click your game won't be mobile friendly for now.
  • TEST BEFORE SHIPPING
  • zip the contents of the Compiled/Web/ dir and upload it in either itch.io or gamejolt so people can play your web port.

Spoiler

Web packages now are available with AGS Releases in GitHub, with a name similar to ags_3.6.0.17_web.tar.gz, with versions changing accordingly. But they are not needed anymore if you are using AGS Editor since you can now build directly from there!
The old instructions are left here for historical purposes.

  • Download the zip above and extract the files to an empty folder
  • Copy your game files to the same directory. If possible, use the .ags version from Compiled/Data
  • Edit the file my_game_files.js overwriting the array with your game files.
  • Edit the title tag on index.html with your game name.
  • Optionally, test running locally a web server in the directory (python3 -m http.server) and opening the address in the browser.
  • Remember that if you use anything beyond left click your game won't be mobile friendly for now.
  • TEST BEFORE SHIPPING
[close]

Notes: the port won't work in any big ags game (like a game beyond 300MB (unless you are like in charge of the navigator using electron or phonegap or something...)).

itch.io
Spoiler
Itch provides here a small guide on html5 games that might be relevant. Config is something like this (note, the resolution has to match your game resolution).

Only mark web-friendly if your game is Left mouse click only (for now everything else will be difficult to support in the touch only device). You can also use itch's full-screen button for now.
[close]
Gamejolt
Spoiler
is a bit simpler, after uploading the zip file
[close]

If you want to build this binary from source...

Known issues

  • Currently the webport kidnaps all keyboard keys, but I could do focus handling (on HTML canvas), if someone has a need for this tell me about and we can test your use case.
  • If you want persistent save files, ask me about it here in the thread, they are technically possible
  • Won't render correctly LucasFan-Font.ttf
  • Can't play MIDI, if you intend to build for web, avoid it. Use ogg files always.
  • Browser interprets ESC key as exiting of Fullscreen (not sure why yet since it's not a default behavior)
  • Last builds are hitting a Chrome bug in Mobile, the way to avoid is using an old Emscripten when building, but this has it's own issues. THE BUG HAS BEEN FIXED in Chromium upstream, and it will be running flawless in Chrome 100, you can test now by installing Chrome Canary. Chrome 100 will be stable after March 29 , 2022!

Extra Information

  • System.OperatingSystem has an enum for the Web system, if you want to account for differences in your game at runtime
  • leave sprite compression on for your game, it has no perceptible perfomance impact.
  • Port idea originated from the previous topic (here).

If you know JS or CSS, I really need help making the HTML and file loading prettier. Below is current loading:

#60
Hey, I know some people here on the forums still use IRC. AGS own IRC has nothing to do with this btw. This is for people who use Freenode! Freenode is now hold by a different company.

Details are on the link below, I also added a copy of the content below in case the site goes under.

https://www.kline.sh/

QuoteSome time ago, Christel, the former head of freenode staff sold `freenode ltd` (a holding company) to a third party, Andrew Lee[1], under terms that were not disclosed to the staff body. It turns out that this contract did indeed intend to sell the entire network and it's holdings, a fact hidden from the of staff. Mr Lee at the time had promised to never exercise any operational control over freenode.
In the past few weeks, we began to realise this had changed[2][3], and Mr Lee has sought to assert total legal control over the network, including user data. Despite our best efforts, the legal advice the freenode staff has obtained is that the contract signed by the previous head of staff cannot be fought with a reasonable likelyhood of success.

As a result, Mr Lee will shortly have operational control over the freenode IRC network. I cannot stand by such a (hostile[4]) takeover of the freenode network, and I am resigning along with most other freenode staff. We know that many of our users and communities also do not want this, as you have made clear directly to Mr Lee in #freenode and through letters[5].

Going forward!
We are founding a new network with the same goals and ambitions to support foss and likeminded communities: libera.chat.
You can connect to the new network at `irc.libera.chat`, ssl port 6697 (and the usual clearnet port).

We're really sorry it's had to come to this, and horrified that someone we knew and trusted violated that trust to sell your (and our) data and communities from under us. We hope that you're willing to work with us to make libera a success, independent from outside control, and under a legally registered Swedish non-profit with a formal governance structure.

Deleting your freenode account data:
Users who wish to remove their account data can do so with nickserv:
/msg nickserv drop <account name> <password>
and follow the instructions given. For extra security, you can also overwrite your email address and password with new ones:
/msg nickserv set password
/msg nickserv set email
You will need to verify that the new email is active and valid before it will take.
Footnotes
[1]: https://find-and-update.company-information.service.gov.uk/company/10308021/officers
[2]: A blogpost about improving our goverance structure was required to be removed: https://freenode.net/news/freenode-reorg (via the wayback machine)

[3]: The freenode testnet, for experimental deployment and testing of new server features was forced to be shutdown on Friday 30th April.

[4]: Logs from Andrew Lee and his staff soliciting an ex staff member to join in a dubious fashion. https://twitter.com/ariadneconill/status/1393006479700078595

[5]: An open letter signed by many community leaders: GitHub Gist

SMF spam blocked by CleanTalk