Skip to main content

News

Topic: Project ZeC (My Zelda-esque Clone) (Read 61542 times) previous topic - next topic

0 Members and 4 Guests are viewing this topic.
  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Project ZeC (My Zelda-esque Clone)
Reply #210
If it's broken I can look into it.  Is the mode7 demo in the downloads repo?
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Rhuan
  • [*][*][*][*]
Re: Project ZeC (My Zelda-esque Clone)
Reply #211
If it's broken I can look into it.  Is the mode7 demo in the downloads repo?
It is in the downloads repo as part of "Collection of test games" It's literally just this though:

Code: [Select]
//THE MODE7 EFFECT
//Set it as a renderscript to see it in action!
//(note: sprites are stretched by the effect too!)

var MapImage;

var x1;
var x2;
var y1;
var y2;

//Modify x1 and x2 to change the top blit map x position. Not recommended.
//Modify x3 and x4 to stretch the map more. Make 30 bigger to strech more, and smaller to stretch less.
//If x1 and x2 == x3 and x4 then the map will blit like it would normally show.
x1 = 0;
x2 = GetScreenWidth();
x3 = GetScreenWidth()+50;
x4 = -50;

//Modify both y1 and y2 to change the height from the top of the mode7 map.
//Modify y3 and y4 to change the height from the bottom.
y1 = 0;
y2 = 0;
y3 = GetScreenHeight();
y4 = GetScreenHeight();

var black = CreateColor(0,0,0);



function WorldmapEffect()
{
MapImage = GrabImage(0, 0, GetScreenWidth(), GetScreenHeight());

//Before we start, cover the original map with black
//Turned off by default, but turn it on if you'll need to stetch maps so the old unedited map doesn't
//Show under it. Note that the effect then will be slightly slower and won't work on the DirectX driver.
//Rectangle(0,0,GetScreenWidth(),GetScreenHeight(), black);

MapImage.transformBlit(x1, y1, x2, y2, x3, y3, x4, y4);

//Draw the REAL sprite on the screen.
//var frame =
//RealSprite.images[].blit(160, 120);
}
  • Last Edit: September 16, 2017, 04:01:51 pm by Rhuan

Re: Project ZeC (My Zelda-esque Clone)
Reply #212
Had a quick glance, looks to me like it should work it's just GrabImage and transformBlit I've used both of those in miniSphere.

You can see how it functions in minisphere. I think it may just need adjusting of the various x, y values. I'm attempting a variety of values to see if I can get it to display properly.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #213
After many different attempts, it still has that warping effect to it.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Rhuan
  • [*][*][*][*]
Re: Project ZeC (My Zelda-esque Clone)
Reply #214
In miniSphere the map is being drawn as 2 triangles - you're crossing the boundary between the two hence the warping effect.

Hmm interesting problem.

  • Rhuan
  • [*][*][*][*]
Re: Project ZeC (My Zelda-esque Clone)
Reply #215
I'm afraid I think that will likely be a problem with any use of transformBlit to distort (i.e. change the size unequally) a shape in miniSphere.

Whilst I can't think of a way to fix that with sphere v1 functions without editing miniSphere's internals the below sphere v2 (i.e. miniSphere only) code should do what you want, though not as a render script:

1. turn on the effect.
Code: [Select]
var wh = screen.width / 2;
var hh = screen.height / 2;
screen.transform = new Transform()
    .translate(-wh, -hh)
    .scale(4 / wh, 4 / wh)//change the 4 to a different number to make the screen bigger or smaller
    .translate(0, 0, -1.0)
    .rotate(15, 1.0, 0.0, 0.0)

    .project3D(120, wh / hh, 0.1, 2.0);

2. turn off the effect
Code: [Select]
screen.transform.identity();

(All credit for the above should go to Fat Cerberus)

Re: Project ZeC (My Zelda-esque Clone)
Reply #216
I'm think for right now, I'm going to put the Airship cutscene on my Task List until more of the game is complete. For the time being, I've been turning the level images into actual maps. Right now, I'm coding a multipart secret unlock function.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #217
Haven't test this with minisphere yet...
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: Project ZeC (My Zelda-esque Clone)
Reply #218
Regarding that Mode7 demo: the warping effect is present in Sphere 1.5 too when using the sphere_gl plugin.  Noticing a pattern with these yet? ;)

I'm not sure if there's a way to fix it, as modern GPUs draw things as triangles.  I'll keep it in mind.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Project ZeC (My Zelda-esque Clone)
Reply #219
Regarding that Mode7 demo: the warping effect is present in Sphere 1.5 too when using the sphere_gl plugin.

Because of the issues I had with the video before I added the PCIe card, I never even attempted using the gl.  I've just always had it set to standard32.

Edit: Just attempted it. The mode7 idea was a good thought but I suppose not very feasible.
  • Last Edit: September 17, 2017, 12:35:26 am by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Project ZeC (My Zelda-esque Clone)
Reply #220
Could the Mode7 demo displaying like that have anything to do with perspective correction? It looks very similar to it.

That said, I'm just doing a basic transform, no fancy 3D...

  • Rhuan
  • [*][*][*][*]
Re: Project ZeC (My Zelda-esque Clone)
Reply #221
Regarding that Mode7 demo: the warping effect is present in Sphere 1.5 too when using the sphere_gl plugin.

Because of the issues I had with the video before I added the PCIe card, I never even attempted using the gl.  I've just always had it set to standard32.

Edit: Just attempted it. The mode7 idea was a good thought but I suppose not very feasible.
Try the v2 code I posted above - will only work in miniSphere but should not have any warping effect.

Re: Project ZeC (My Zelda-esque Clone)
Reply #222
Try the v2 code I posted above - will only work in miniSphere but should not have any warping effect.

It is saved to inEdit. I have a side program for testing various things. I'm going to test it in that at some point over the course of today.
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #223
Started to redesign my MapRef() to include individual dungeon functionality for when the player finds that level's map & compass.

And broke the whole gorram thing. The game won't even load now and freezes before the debugger can even load to find an error. Good thing I made a backup of the functioning code before I attempting to edit it.
  • Last Edit: September 17, 2017, 03:52:03 pm by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity

Re: Project ZeC (My Zelda-esque Clone)
Reply #224
Made some major progress with my MapRef(). It already showed the player's  location on the overworld & underworld maps. Now, when you enter a dungeon level, the worldmap is replaced with a blank space. When you collect that levels map, it gets drawn in the blank area and shows your location in the dungeon. When you leave the dungeon the level is again replaced with the worldmap. I have not coded in the functionality yet to display the triforce piece on the map when the player locates the compass. I was in the process of entering in the different room coordinates for level 2 when my power went out...
  • Last Edit: September 17, 2017, 03:17:33 pm by Miscreant
"I am to misbehave." - Malcom Renyolds, Captain of Serenity