Zsenilia (256Kb intro by Resistance)

Announce (tech) demos or games releases

Moderator: Mask of Destiny

Post Reply
astrofra
Interested
Posts: 28
Joined: Sun Dec 14, 2014 8:50 am
Location: Orleans | France
Contact:

Zsenilia (256Kb intro by Resistance)

Post by astrofra » Tue Dec 29, 2015 7:23 am

Hello,

it turns out this is my first post on Sprites Mind, but I've been lurking around and playing with the (amazing) SGDK for quite a while :)
Working with the demoscene groupe called "Resistance", we released a couple of days after Christmas a small demoscene intro for the Megadrive.

It is entirely writen in C, using the SGDK with a few (and dirty) tweaks.

Here is a Youtube capture :
Image

Here is the link on Pouet.net :
http://www.pouet.net/prod.php?which=66742

I hope you will enjoy this little prod as much as we did when making it :)
640 polygons are enough for everyone.

nolddor
Very interested
Posts: 101
Joined: Sun Jun 02, 2013 1:35 pm
Location: Spain

Re: Zsenilia (256Kb intro by Resistance)

Post by nolddor » Thu Dec 31, 2015 4:48 pm

Thanks!!

Would be possible to release the src? I'm quite interesting in learning how those balls work.

Anyway, I've uploaded this demo in my Youtube Channel you can use as a mirror If you want.
(Travel Demo it was uploaded as well)

Sik
Very interested
Posts: 915
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: Zsenilia (256Kb intro by Resistance)

Post by Sik » Thu Dec 31, 2015 9:00 pm

Sorry for spoiling it for you, but just checked and they're just sprites =P (and like 60% of the table only, 48 sprites). Layer priority is used to make them go behind and in front of the graffiti (which is plane A), if you wonder. (the background is plane B, predictably)

The paths may be more interesting. I know how those are made, they're just sines and cosines added together, but coming up with a combination of those that looks good is the hard part. You can happily spend just a few minutes getting the graphics on screen and hours trying to make a single path XD
Sik is pronounced as "seek", not as "sick".

KanedaFr
Administrateur
Posts: 1128
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Re: Zsenilia (256Kb intro by Resistance)

Post by KanedaFr » Fri Jan 01, 2016 7:09 pm

yes, a lot of these demos are "basic" math
the art comes from the ways this math is used...

i made one myself...12years ago :)
http://gendev.spritesmind.net/page-stdream.html
I forgot to release the code, so I added it today !

nolddor
Very interested
Posts: 101
Joined: Sun Jun 02, 2013 1:35 pm
Location: Spain

Re: Zsenilia (256Kb intro by Resistance)

Post by nolddor » Fri Jan 01, 2016 7:48 pm

@Sik
I already knew that balls were simply sprites put together but as you said create a sinus/cos line and put together at least for me it's really complicated.

PD: Thanks KanedaFr for the code. I'll check it ASAP

astrofra
Interested
Posts: 28
Joined: Sun Dec 14, 2014 8:50 am
Location: Orleans | France
Contact:

Re: Zsenilia (256Kb intro by Resistance)

Post by astrofra » Sun Jan 03, 2016 8:32 am

Thanks for your feedbacks, guys.

As Sik mentionned, this intro is mainly made using a table of sprites, with a separate table of attributes to tell them, individually, when to remain behind the logo's layer.

The sin/cos was the fun part indeed. You might find interesting (or not at all) that the cos/sin tables are mainly precalculated, using a piece of Python code :

Code: Select all

# Classic lissajou
def traj0x(a):
	traj_x_amplitude = 128
	return  scr_x_center + int(traj_x_amplitude * math.cos(3.0 * a * math.pi / (rotation_steps / 4.0)))

def traj0y(a):
	traj_y_amplitude = 64
	return scr_y_center + int(traj_y_amplitude * math.sin(2.0 * a * math.pi / (rotation_steps / 4.0)))

# Pseudo bouncing
def bounce0x(a):
	a *= 2.0
	traj_x_amplitude = 128
	return  scr_x_center + int(traj_x_amplitude * math.cos(a * math.pi / (rotation_steps / 4.0)))

def bounce0y(a):
	s0 = traj0y(a)
	a *= 2.0
	a += (math.pi * 0.353857)
	traj_y_amplitude = 64
	s = math.sin(2.0 * a * math.pi / (rotation_steps / 4.0))
	s *= 1.0 - ((1.0 + math.cos(8.0 * a * math.pi / (rotation_steps / 4.0))) * 0.05)
	s = 1.0 - abs(s)
	s = 2.0 * (s - 0.5)
	s *= (traj_y_amplitude * 1.45)
	s -= 4
	s = scr_y_center + s
	s = (s + s0) * 0.5
	return int(s)

# Alternate Lissajou
def traj1x(a):
	traj_x_amplitude = 128
	return  scr_x_center + int(traj_x_amplitude * math.sin(2.0 * a * math.pi / (rotation_steps / 4.0)))

def traj1y(a):
	traj_y_amplitude = 64
	return scr_y_center + int(traj_y_amplitude * math.cos(5.0 * a * math.pi / (rotation_steps / 4.0)))

# Alternate Lissajou 2
def traj2x(a):
	traj_x_amplitude = 128
	s0 = traj_x_amplitude * math.sin(2.0 * a * math.pi / (rotation_steps / 4.0))
	s1 = traj_x_amplitude * math.cos(9.0 * a * math.pi / (rotation_steps / 4.0))
	s = 0.75 * s0 + 0.25 * s1
	return  scr_x_center + int(s)

def traj2y(a):
	traj_y_amplitude = 64
	s0 = traj_y_amplitude * math.cos(5.0 * a * math.pi / (rotation_steps / 4.0))
	s1 = traj_y_amplitude * math.sin(1.0 * a * math.pi / (rotation_steps / 4.0))
	s = 0.8 * s0 + 0.2 * s1
	s *= 1.15
	s += 4
	return scr_y_center + int(s)
640 polygons are enough for everyone.

nolddor
Very interested
Posts: 101
Joined: Sun Jun 02, 2013 1:35 pm
Location: Spain

Re: Zsenilia (256Kb intro by Resistance)

Post by nolddor » Mon Jan 04, 2016 8:39 am

Too much maths for a stupid guy xDD

I can't underestand nothing, but thanks a lot for sharing these piece of code.

astrofra
Interested
Posts: 28
Joined: Sun Dec 14, 2014 8:50 am
Location: Orleans | France
Contact:

Re: Zsenilia (256Kb intro by Resistance)

Post by astrofra » Mon Jan 04, 2016 11:23 am

There's no such thing as a "stupid guy".
It seems complicated once turned into Python, but all you need to know is the basics of parametric equations :

The most basic figure you want to draw using a parametric equation is a circle :
http://mathworld.wolfram.com/ParametricEquations.html

Then, you can start playing with frequencies and draw some wavy figures :
http://mathworld.wolfram.com/LissajousCurve.html

If you want to 'live experiment' such equations, I suggest Wolfram Alpha :
http://goo.gl/Prtrr4

'hope this will make it less obscure :)
640 polygons are enough for everyone.

nolddor
Very interested
Posts: 101
Joined: Sun Jun 02, 2013 1:35 pm
Location: Spain

Re: Zsenilia (256Kb intro by Resistance)

Post by nolddor » Mon Jan 04, 2016 2:40 pm

Much better now!

Its time to learn I guess!!

matteus
Very interested
Posts: 336
Joined: Mon Feb 04, 2008 1:41 pm

Re: Zsenilia (256Kb intro by Resistance)

Post by matteus » Mon Jan 04, 2016 5:48 pm

nolddor wrote:Much better now!

Its time to learn I guess!!
Dude you'd sail this sort of stuff! I've seen your coding abilities you'll be fine :)
Last edited by matteus on Tue Jan 05, 2016 10:04 pm, edited 1 time in total.

nolddor
Very interested
Posts: 101
Joined: Sun Jun 02, 2013 1:35 pm
Location: Spain

Re: Zsenilia (256Kb intro by Resistance)

Post by nolddor » Tue Jan 05, 2016 12:03 pm

Have I got any code abilities? xDDDDDDD

Anyway, It seems to be that you need some math knowledge to reach this kind of movements... It's not related to code ability

astrofra
Interested
Posts: 28
Joined: Sun Dec 14, 2014 8:50 am
Location: Orleans | France
Contact:

Re: Zsenilia (256Kb intro by Resistance)

Post by astrofra » Wed Jan 06, 2016 6:51 am

It was one of the courses I enjoyed the most at college :')
Back then I wouldn't have imagined it will help me 25 years later!

It was more or less like this :
Image
640 polygons are enough for everyone.

astrofra
Interested
Posts: 28
Joined: Sun Dec 14, 2014 8:50 am
Location: Orleans | France
Contact:

Re: Zsenilia (256Kb intro by Resistance)

Post by astrofra » Fri Jul 22, 2016 6:07 am

The source code was pushed on Github :
https://github.com/ResistanceVault/demo-Zsenilia
640 polygons are enough for everyone.

Post Reply