Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Sonic Adventure Remix Thread


Recommended Posts

  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

Actually, UnlimitedChaos, you would be right about that being in Sonic Dash. Regarding the areas that have the wavy parallax are set in the 'Draw' function of the Parallax object.

The version that has that is the most current of the Dash Engines. Actually, the sticky on this forum that has all the other major GM Engines has it there at the top of the post.

Link to comment
Share on other sites

So does this consult to the Dash Engine:tbored: ...even though i already tried it and the coding is HECTIC! I need an easier way then just copy,paste,tinker for 1000 years until i get it right because i cant understand all of the coding...isnt there like a tutorial or would anybody mine telling me what everything means....

create...


var OverallYOffset; OverallYOffset = 1;

scrParallaxAddNode(1, backGhzClouds, 0.85, -0.4, 0, 0, 0, OverallYOffset, 0, 0, 0, 0, 0, 0, 256, 32);
scrParallaxAddNode(1, backGhzClouds, 0.83, -0.3, 0, 0, 0, OverallYOffset, 0, 0, 32, 0, 0, 32, 256, 16);
scrParallaxAddNode(1, backGhzClouds, 0.8, -0.2, 0, 0, 0, OverallYOffset, 0, 0, 48, 0, 0, 48, 256, 16);
scrParallaxAddNode(1, backGhzMountainsA, 0.7, 0, 0, 0, 0, OverallYOffset, 0, 0, 64, 0, 0, 0, 512, 88);
scrParallaxAddNode(1, backGhzMountainsB, 0.6, 0, 0, 0, 0, OverallYOffset, 0, 0, 110, 0, 0, 0, 512, 43);

for (i = 0; i < 15; i+= 1)
scrParallaxAddNode(1, backGhzWater, 0.5-((1+i)/15)*0.5, ((1+i)/15)*-1.8, 0, 0, 0, OverallYOffset, 0, 0, 152+i*8, 0, 0, i*8, 256, 8);[/CODE]

create of parent

[CODE]
// ---- Constants declaration ------------------------------------------------
constParallaxTileDirection = 0;
constParallaxBackground = 1;

constParallaxXFactor = 2;
constParallaxXSpeed = 3;
constParallaxXScroll = 4;
constParallaxXOffset = 5;
constParallaxXSeparation = 6;

constParallaxYFactor = 7;
constParallaxYSpeed = 8;
constParallaxYScroll = 9;
constParallaxYOffset = 10;
constParallaxYSeparation = 11;

constParallaxLeft = 12;
constParallaxTop = 13;
constParallaxWidth = 14;
constParallaxHeight = 15;

// ---- Parallax data --------------------------------------------------------
NumParallaxNodes = 0;
ParallaxNodes = -1;[/CODE]

step of parent

[CODE]
var CurrentNode, xSpeed, xScroll, ySpeed, yScroll;
// -----------------------------------------------------------------------------------------------

// Handle parallax
for (CurrentNode = 0; CurrentNode < NumParallaxNodes; CurrentNode += 1) {
// Retrieve values
xSpeed = ds_grid_get(ParallaxNodes, constParallaxXSpeed, CurrentNode);
xScroll = ds_grid_get(ParallaxNodes, constParallaxXScroll, CurrentNode);
ySpeed = ds_grid_get(ParallaxNodes, constParallaxYSpeed, CurrentNode);
yScroll = ds_grid_get(ParallaxNodes, constParallaxYScroll, CurrentNode);

// Add speed values to scroll
ds_grid_set(ParallaxNodes, constParallaxXScroll, CurrentNode, xScroll+xSpeed);
ds_grid_set(ParallaxNodes, constParallaxYScroll, CurrentNode, yScroll+ySpeed);
}[/CODE]

draw of parent

[CODE]
var CurrentNode, TileDirection, Background, xFactor, xSpeed, xScroll, xOffset, xSeparation;
var yFactor, ySpeed, yScroll, yOffset, ySeparation, Left, Top, Width, Height, xFinal, yFinal;
// -----------------------------------------------------------------------------------------------

// Handle parallax
for (CurrentNode = 0; CurrentNode < NumParallaxNodes; CurrentNode += 1) {
// Retrieve values
TileDirection = ds_grid_get(ParallaxNodes, constParallaxTileDirection, CurrentNode);
Background = ds_grid_get(ParallaxNodes, constParallaxBackground, CurrentNode);

xFactor = ds_grid_get(ParallaxNodes, constParallaxXFactor, CurrentNode);
xSpeed = ds_grid_get(ParallaxNodes, constParallaxXSpeed, CurrentNode);
xScroll = ds_grid_get(ParallaxNodes, constParallaxXScroll, CurrentNode);
xOffset = ds_grid_get(ParallaxNodes, constParallaxXOffset, CurrentNode);
xSeparation = ds_grid_get(ParallaxNodes, constParallaxXSeparation, CurrentNode);

yFactor = ds_grid_get(ParallaxNodes, constParallaxYFactor, CurrentNode);
ySpeed = ds_grid_get(ParallaxNodes, constParallaxYSpeed, CurrentNode);
yScroll = ds_grid_get(ParallaxNodes, constParallaxYScroll, CurrentNode);
yOffset = ds_grid_get(ParallaxNodes, constParallaxYOffset, CurrentNode);
ySeparation = ds_grid_get(ParallaxNodes, constParallaxYSeparation, CurrentNode);

Left = ds_grid_get(ParallaxNodes, constParallaxLeft, CurrentNode);
Top = ds_grid_get(ParallaxNodes, constParallaxTop, CurrentNode);
Width = ds_grid_get(ParallaxNodes, constParallaxWidth, CurrentNode);
Height = ds_grid_get(ParallaxNodes, constParallaxHeight, CurrentNode);

// Calculate final position
xFinal = floor((view_xview[view_current])*xFactor+xOffset+xScroll);
yFinal = floor((view_yview[view_current])*yFactor+yOffset+yScroll);
// xFinal = floor((view_xview+xOffset+xScroll)*xFactor);
// yFinal = floor((view_yview+yOffset+yScroll)*yFactor);

// Draw
switch(TileDirection) {
case 0:
draw_background_part(Background, Left, Top, Width, Height, xFinal, yFinal);
break;
case 1:
scrDrawBackgroundTiledHorizontalPart(Background, Left, Top, Width, Height, xFinal, yFinal, xSeparation);
break;
case 2:
scrDrawBackgroundTiledVerticalPart(Background, Left, Top, Width, Height, xFinal, yFinal, ySeparation);
break;
case 3:
scrDrawBackgroundTiledPart(Background, Left, Top, Width, Height, xFinal, yFinal, xSeparation, ySeparation);
break;
}
}[/CODE]

and then there is still more coding in the scripts...:adead:

Link to comment
Share on other sites

i just managed to copy and paste the code in the game but i have no idea how to mix the one i already have and the one i just plugged in. What i mean is that i see it in the background and it DOES move at different speeds but when i go underwater it remains the same and it NEEDS to change its scale. how do i do that to the code up above

Link to comment
Share on other sites

Only thing he is doing in the create is creating the object and parent of course then in the step of the parent hes making the background scroll back, and forth with different sprites on a grid set using path's to configure it, and in the drawing of the parent the top is him putting shortcuts for all the coding he did the middle is making the backgrounds have a certain position to where it started and will finish, and the bottom is preety much what it says. (It's drawing the background in 3 different styles for each part tiled, vertical, and horizontal.

Link to comment
Share on other sites

is there a way i can fit this

for (i = 0; i < 15; i+= 1)
scrParallaxAddNode(1, backGhzWater, 0.5-((1+i)/15)*0.5, ((1+i)/15)*-1.8, 0, 0, 0, OverallYOffset, 0, 0, 152+i*8, 0, 0, i*8, 256, 8);[/CODE]

into that hydrocity parallax effect code(where you go under water and it changes y_scale). If only Damizean was here to explain this:asweatdrop:

right now its looking like this...

WTF.png

Link to comment
Share on other sites

  • 5 weeks later...

Long time no see guys. Ive been working on the game alot! With some minor set backs.... Anyways im about to release this baby but im not sure if i can release it with all 4 charaters, most likely im going to have only sonic. The release should be here be the beinning of next month, that is if i get any help with the parallax i indicated above. PLZ! If i can get any help with that id be much appreciated.:)

Link to comment
Share on other sites

The parallax example on the engine thread is not sufficiently advanced enough. Use this version instead. Do not combine this with the parallax object in your build.

  • The parallax stretches itself between Height position and WaterLevel.
  • MaxScaleY is a limit to how much each individual strip can be stretched.
  • RatioY is how much the parallax will vertically interpolate from Height position. Values will typically lie between 0 (won't shift from its starting point Height) and 1 (will always be Height distance away from the camera).
  • In the for loop of the draw event, value <20> is the number of strips the water texture is broken up into. value <8> is the height/minimum spacing between each strip (should be <texture height>/<amount of strips>). <384> is simply half the texture width. I recommend turning these into variables.
  • (current_time*0.01)*_i is your "xSpeed" factor. Could also be made a variable, I guess. (see below)
  • The texture width should not be thinner than the view width; otherwise, you will notice gaps between each strip and the edges of the view. As a general rule, it should actually be bigger.

Btw: scrParallaxAddNode(

  • Tiling direction; 0 is a static image; 1 tiles horizontally; 2 tiles vertically; 3 does both
  • x/yFactor: how much the parallax will interpolate from its initial position (same as Height above)
  • x/ySpeed: how much each strip will move
  • x/yScroll: optional; when each strip should start moving (is actually used to hold increments of x/ySpeed)
  • x/yOffset: where each strip should be placed
  • x/ySeperation: gap between tiled strips
  • Left, Top, Right, Bottom; actual texture mapping of each strip.

);

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...