DizzyAGE General Coding Queries

Need help with using DizzyAGE then look here
AndyG
Hard Boiled Egg
Posts: 208
Joined: Thu May 22, 2014 1:54 pm
Location: UK
Contact:

Post by AndyG » Tue Jun 09, 2015 12:13 pm

So I should have downloaded this before it was updated with complex scrolling! :v2_dizzy_cry: Well thanks anyway. It looks really nice so I guess I'll just play this for a while

User avatar
Rindex
Hard Boiled Egg
Posts: 434
Joined: Thu Apr 16, 2009 10:48 am
Location: Khimki, Moscow Regions, Russia

Post by Rindex » Tue Jun 09, 2015 12:20 pm

Yes, the scrolling in the game Jewel Thief became smoother. But the movements Dizzy didn't change. Smoother movements I already answered, in what two games.

User avatar
Noggin the Nog
Hard Boiled Egg
Posts: 412
Joined: Sun Jul 01, 2012 12:04 am

Post by Noggin the Nog » Tue Jun 09, 2015 3:38 pm

AndyG wrote:Hi everyone,

I'm trying to understand parallax scrolling. I downloaded the brilliant Dizzy and the Jewel Thief, which does this very well, and the coding seems very complex. It has been smoothed, and has 4 layers. I'm just looking for a simple example (no smoothing; 2 layers a la Fantastic Dizzy) to get me started. Does anyone know of any other games that use this technique? (Besides Last Hero, which is also too complex for me :cry: ).

By the way, how do people feel about scrolling in general? I disable the Y axis, but even so (possibly due to Dizzy's frame rate, which I may consider altering if I can) it makes me feel just a little sick. I want to persevere though! I think the map can be made smaller with scrolling, as you don't have to worry about the layout of each individual room.
Hi Andy, when you say 2 layers, you mean just Dizzy's layer and a sky background? You can find that in Pirate's Life Dizzy and it's very easy to do.

If you want to add more layers without the smooth scrolling, I can tell you how to do that - it's not that hard if the scrolling is only horizontal.

I don't understand how the smooth scrolling works either - Dr Titus posted an edited version of Jewel Thief here:

http://www.yolkfolk.com/bb/showthread.p ... #post28038

The version you've got is that one with a few tweaks by me. If you want to see what the game looks like without the smooth scrolling, go into the game options and set the scrolling to stiff. The jerkiness is because Dizzy always moves horizontally in multiples of 4 pixels. There's no easy way round that - Dr Titus' technique is very complicated and my best effort, in Don't Panic Dizzy involved completely changing the player movement file so that Dizzy moves in multiples of 2 pixels - I don't recommend you try that. Even if you looked through my code, I had to make modifications all over the game code - I can't remember where they all were.

I'll have a look and see if I've still got an old 1.0 copy of Jewel Thief if that helps.

AndyG
Hard Boiled Egg
Posts: 208
Joined: Thu May 22, 2014 1:54 pm
Location: UK
Contact:

Post by AndyG » Tue Jun 09, 2015 5:16 pm

Thanks a lot! Silly me, I forgot about Pirate's Life! I've been messing around with this for about an hour and I think I'm starting to understand :v2_dizzy_thumbsup:

EDIT: Yes, I meant Dizzy's layer + sky background. I probably should have figured it out for myself, as I've disabled vertical scrolling so it's just a case of matching the background to Dizzy's X coordinate (minus whatever number so it lines up). I guess adding extra layers is the real challenge. (I don't want to use smooth scrolling, although I can see it's great, just because the coding looks way beyond me.) I'll have a go at extra layers myself, and maybe pick your brain when I inevitably fail :)

Meph
Hard Boiled Egg
Posts: 2963
Joined: Fri Apr 13, 2007 12:47 am
Location: England, Suffolk

Post by Meph » Tue Jun 09, 2015 6:42 pm

I thought Scrolling was built into the dizzyage engine it just need to be switched on?
Its always the cracked ones that let the light in

AndyG
Hard Boiled Egg
Posts: 208
Joined: Thu May 22, 2014 1:54 pm
Location: UK
Contact:

Post by AndyG » Tue Jun 09, 2015 7:12 pm

Parallax scrolling is different layers scrolling at different speeds to create illusion of depth. Or at my low level, just keeping the background screen static while the landscape scrolls (although I suppose it's technically the other way round). Maybe something for DizzyAGE 2.4? :v2_dizzy_tongue: I might abandon it because Noggin, you're right about the jerkiness. I've just given myself a headache after a few hours trying this out. This is what I have for now (in the handlers.gs):

Code: Select all

// scrolling games support
	if( GameGet(G_VIEWPORTMODE) )
	{
		roomw = GameGet(G_ROOMW);
		//roomh = GameGet(G_ROOMH);
		GameSet( G_VIEWPORTX, GameGet(G_ROOM X) *roomw - PlayerGet(P_ X) + roomw/2 );
		//GameSet( G_VIEWPORTY, GameGet(G_ROOMY)*roomh - PlayerGet(P_Y) + roomh/2 );
		
		dx=PlayerGet(P_ X) ;
		dy=PlayerGet(P_Y);
		sky = ObjFind(10);

		ObjSet(sky,O_X,dx-120);
	}
Hugely technical!! :v2_dizzy_yahoo:

User avatar
Noggin the Nog
Hard Boiled Egg
Posts: 412
Joined: Sun Jul 01, 2012 12:04 am

Post by Noggin the Nog » Tue Jun 09, 2015 9:31 pm

Yeah, it's a shame about the jerky scrolling.

It might be worth persevering with the smooth scroll code - I've incorporated it into games without understanding how it works.

If you're copying it from Jewel Thief, you'll have to cut out all the bits relating to the extra layers of parallax (a big long list of objects) - you should spot them easily enough, I used a variable called G_PARALLAX! And there's a second bit of code in the util.gs file to copy over as well.

I don't think there's much else you need to do to make it work actually... :v2_dizzy_confused2: You've just got to find the analog to your bit of code for the backdrop (probably tacked on the end) and change the object number.

Give it a go anyway - scrolling games are much better than flipscreen.

Grandad
Hard Boiled Egg
Posts: 1362
Joined: Sat Aug 08, 2009 10:47 am
Location: Balham - gateway to the south

Post by Grandad » Wed Jun 10, 2015 8:06 am

Give it a go anyway - scrolling games are much better than flipscreen.
Only for some people. I find that parrallax scrolling makes me feel somewhat nauseous after a few minutes.

Grandad
Hard Boiled Egg
Posts: 1362
Joined: Sat Aug 08, 2009 10:47 am
Location: Balham - gateway to the south

Global messages

Post by Grandad » Tue Jun 16, 2015 12:55 pm

Is there a way to set a timer at a particular point and then display a message when the timer runs out. It would need to be global rather than to specific rooms as I'd like the timer to run for about 3 minutes. I can't really use the HandlerGameUpdate as it's only for non-latent stuff and although it could check the timing and display a message, you can't close it.

User avatar
Noggin the Nog
Hard Boiled Egg
Posts: 412
Joined: Sun Jul 01, 2012 12:04 am

Post by Noggin the Nog » Tue Jun 16, 2015 4:00 pm

The trick I use to get round that is to draw a big invisible collider and move it to Dizzy's coordinates when (say) the timer runs out. Then of course, you call the messages etc. from the CollideObject function.

BTW, what do latent and non-latent mean in DizzyAGE? I've wondered that for ages.

Post Reply