Author Topic: MODULE: rellax 0.1.3  (Read 1157 times)

MODULE: rellax 0.1.3
« on: 07 Oct 2019, 03:26 »
rellax version 0.1.3

Get Latest Release rellax.scm | GitHub Repo | Demo Windows | Demo Linux | Download project .zip

Rellax while the camera tracks with cool parallax



This module uses the camera and Viewport API from Adventure Game Studio 3.5.0.

Demo game uses keyboard arrows control, up arrow jumps. WASD should also work.


  Usage
Before starting, you must create the following Custom Properties in AGS Editor, for usage with Objects.
Just click on Properties [...] and on the Edit Custom Properties screen, click on Edit Schema ... button, and add the two properties below:

  PxPos:
  • Name: PxPos
  • Description: Object's horizontal parallax
  • Type: Number
  • Default Value: 0

  PyPos:
  • Name: PyPos
  • Description: Object's vertical parallax
  • Type: Number
  • Default Value: 0

The number defined on Px or Py will be divided by 100 and used to increase the scrolling.
An object with Px and Py 0 is scrolled normally, an object with Px and Py 100 will be fixed on the screen despite camera movement.
Objects with negative Px and Py are usually at the front, and positive values are usually at the back.


  Scritp API

static attribute Character* TargetCharacter
The character being tracked by the Game.Camera.

static attribute bool EnableParallax
Gets/sets whether Parallax is on or off.

static attribute bool EnableSmoothCam
Gets/sets whether Smooth Camera tracking is on or off.


  License
This module is created by eri0o is provided with MIT License, see LICENSE for more details.
The code on this module is based on the code of Smooth Scrolling + Parallax Module from Alasdair Beckett, which bases on code from Steve McCrea.
The demo game uses CC0 (Public Domain) art provided by jetrel.
« Last Edit: 10 Feb 2020, 22:54 by eri0o »

Re: MODULE: rellax 0.1.0
« Reply #1 on: 07 Oct 2019, 15:29 »
Hi  @eri0o

It's so fantastic!!!  8-0. FPS is great too. Is it possible to add some features like Grab ledge and so on?
My official site: http://www.pershaland.ir/

Re: MODULE: rellax 0.1.0
« Reply #2 on: 07 Oct 2019, 16:52 »
The module is just for parallax and smooth camera, the platformer was just for fun to test it under quick movement situations :)

The game project is on GitHub, you can also download it as zip, if you want to play with the code, the platformer bits are all on room1.asc, and it's just around 100 lines of code (if I remember it correctly). It requires the latest 3.5.0 release available!

Erh, maybe the take here is figuring out a new module that would provide some facility for 2D platfomer, but I don't have anything figured out for this for now (except further developing AgsBox2D to support the full Box2D api, but still, details like grab ledge would be onto who is using it :/)
« Last Edit: 07 Oct 2019, 17:01 by eri0o »

Re: MODULE: rellax 0.1.0
« Reply #3 on: 09 Oct 2019, 20:26 »
Thanks eri0o, that module will probably come in handy once i start exporting various art groups separated from Photoshop! :) I've always wanted to see how a "plattformer" is made in AGS also, i know there's another plattformer done by abstauber. It didn't work in Ags 4.3.1 tho :-\ parallax scrolling is really cool too indeed.  (nod). Looks like i have to get the latest AGS, will do! 8-)

Re: MODULE: rellax 0.1.2
« Reply #4 on: 09 Nov 2019, 18:11 »
@Olleh19 the platformer here was just a small thing so it was faster to see the parallax effects happening than by just clicking to interact, so a really dedicated person can make a platformer with a much nicer code :]

Just adding minor bug fix that prevented actually turning the smooth scroll off before.

Edit: Small fix so that the parallax still happens even when smoothing is disabled.
« Last Edit: 16 Nov 2019, 23:43 by eri0o »

Re: MODULE: rellax 0.1.2
« Reply #5 on: 31 Dec 2019, 23:23 »
Wow Beautiful!
_______________________________________ ____________________

Re: MODULE: rellax 0.1.2
« Reply #6 on: 01 Jan 2020, 13:14 »
Thanks!

I have a small update to add in and need to throw a little explanation on how to mod it.

Also I discovered there's no way a character that walks really fast and have movement linked to animation can have a smooth scroll on the background AND not have the character blurred, so if anyone plans to use this, I recommend adding a check that if the level has a big scroll to change the movement type of the character (again, this is only a problem if the character walks really fast). Other alternative is a old-school Zelda like scrolling - just lerp rounding for camera sized grid.

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: MODULE: rellax 0.1.2
« Reply #7 on: 03 Feb 2020, 12:36 »
Can you describe how your module differs from the SmoothScrolling module, which offered smooth scrolling & Parallax (by Ali) and foreground+background parallax too?
« Last Edit: 03 Feb 2020, 14:22 by Monsieur OUXX »
 

Re: MODULE: rellax 0.1.2
« Reply #8 on: 03 Feb 2020, 13:46 »
Basic changes are:

- use of AGS 3.5.0 Camera API, even though a single camera.
- parallax on y axis
- fractional parallax, instead of pre-defined values


Additionally, but totally subjective:
- algorithm works better for the specific demoed case of a character that jumps in a platform.
- code is simpler and easier to understand and modify (like, zone based scrolling like NES Zelda is easy to mod to achieve it)

"Bug" still present:
- character with movement linked to animation moving fast will produce "ghosting" when scrolling as the previous module did. I tried a ton of things and decided is just best to not have movement linked to animation with large scrolling areas and fast characters.

Known issue:

I need to close an issue opened on GitHub and release a new version of this.

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: MODULE: rellax 0.1.2
« Reply #9 on: 03 Feb 2020, 14:19 »
Basic changes are:

Love it!
 

Ali

  • What will become of the baron?
    • Ali worked on one or more games that won an AGS Award!
    •  
    • Ali worked on one or more games that was nominated for an AGS Award!
Re: MODULE: rellax 0.1.2
« Reply #10 on: 03 Feb 2020, 16:16 »
Great stuff, my module is getting pretty old. I've put a link to this one on the first post.

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: MODULE: rellax 0.1.2
« Reply #11 on: 03 Feb 2020, 17:07 »
Great stuff, my module is getting pretty old. I've put a link to this one on the first post.

Your module was awesome, but it's nice to have a module made for 3.5 natively.
 

Re: MODULE: rellax 0.1.2
« Reply #12 on: 04 Feb 2020, 00:13 »
Thank you Ali! You are awesome! I used your module for so much for so long! And you make cool games, and you are fun and have beautiful hair :]

---

Edit:

Pushed a minor bug fix update:
  • Prevents wrong position updates by moving calculations to late repeatedly execute always.
  • Fix crash by wrong player loop when loading a new room.
« Last Edit: 10 Feb 2020, 22:55 by eri0o »

Re: MODULE: rellax 0.1.3
« Reply #13 on: 20 Feb 2020, 07:23 »
Thank you so much for this, it works so well and smooth
« Last Edit: 20 Feb 2020, 09:07 by ld-airgrafix »