Skip to content

Commit 3b4c5cb

Browse files
committed
initial commit, Revision 2020 competition version
0 parents  commit 3b4c5cb

118 files changed

Lines changed: 18290 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Parallel Multiverse
2+
3+
This is **Abyss**´ contribution to the [Revision 2020](https://2020.revision-party.net "Revision") [Demoscene](https://en.wikipedia.org/wiki/Demoscene "Wikipedia") event.
4+
5+
6+
7+
Music by Neurodancer:
8+
9+
* **Drop your baggage** taken from the album [znooQ´d](https://neurowerx.bandcamp.com/album/znooqd "neurowerx.bandcamp.com").
10+
11+
12+
13+
Graphics:
14+
15+
* Abyss logo by Celtic/Axis, used before in the Pulstar demo.
16+
* Eyeball by Tyshdomos, used before in the Drugstore demo.
17+
18+
19+
20+
Code:
21+
22+
This is my first demo in this millenium. It is written in pure native naked Java, which means i haven´t included any external API, no OpenGL, no DirectX, no esoteric stuff of any kind.
23+
24+
Why the hell: You hardly can continue making demos from the point where you stopped 23 years ago. So when i discovered [Coda](https://www.pouet.net/prod.php?which=80998 "Pouet") which gave me the motivation to make 'one more demo', i decided not to restart on Amiga, but to try Java. Knowing that Java is far from being the perfect language for that job. Knowing that accurate timing is hardly possible, taking over the CPU simply impossible. That not enough, i also decided not to play around with outdated OpenGL Java APIs, but to use my own engine which simply promotes an integer array as chunky buffer. With this limitations, creating the demo was in fact real fun.
25+
26+
27+
28+
Technical comments:
29+
30+
- Some parts of the code may look odd. Please keep in mind, for a 'realtime application' like a demo, Java's garbage collector is your enemy. You really don't want this guy to disturb your timing.
31+
- Starting the demo with commandline option `-Dsun.java2d.opengl=true` could give an enormours performance boost, especially on older hardware, so why isn´t this option set by default?
32+
Well, it was. On my elder computer, sending the chunky buffer to the screen takes 29 milliseconds (which drops the framerate to 30 fps). This option decreases the value to 5 milliseconds, resulting in perfect 60 fps.
33+
BUT: While testing the demo, i discovered the following problem on Windows 10: Having a two-screen-system, it´s mandatory that the screen which Windows calls 'number 1' is set as primary screen (which is default). If you change that, you see just nothing. I could reproduce that on two systems. Too bad i could´t find a workaround in time, so i had to drop that option.
34+

parallelmultiverse/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/target/
2+
.settings/
3+
.classpath
4+
.project

parallelmultiverse/pom.xml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
<groupId>abyss</groupId>
4+
<artifactId>parallelmultiverse</artifactId>
5+
<version>0.18.1</version>
6+
<properties>
7+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
8+
</properties>
9+
<build>
10+
<plugins>
11+
<plugin>
12+
<artifactId>maven-assembly-plugin</artifactId>
13+
<executions>
14+
<execution>
15+
<phase>package</phase>
16+
<goals>
17+
<goal>single</goal>
18+
</goals>
19+
</execution>
20+
</executions>
21+
<configuration>
22+
<descriptorRefs>
23+
<descriptorRef>jar-with-dependencies</descriptorRef>
24+
</descriptorRefs>
25+
<archive>
26+
<manifest>
27+
<mainClass>abyss.parallelmultiverse.ParallelMultiverse</mainClass>
28+
</manifest>
29+
</archive>
30+
<appendAssemblyId>false</appendAssemblyId>
31+
<attach>false</attach>
32+
<finalName>aYs_ParallelMultiverse</finalName>
33+
</configuration>
34+
</plugin>
35+
</plugins>
36+
</build>
37+
<dependencies>
38+
<dependency>
39+
<groupId>abyss</groupId>
40+
<artifactId>lunarengine</artifactId>
41+
<version>2.2</version>
42+
</dependency>
43+
</dependencies>
44+
</project>
Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
package abyss.parallelmultiverse;
2+
3+
import java.io.BufferedInputStream;
4+
import java.io.ByteArrayInputStream;
5+
import java.io.ByteArrayOutputStream;
6+
import java.net.URL;
7+
8+
import abyss.lunarengine.Commander;
9+
import abyss.lunarengine.ICommanderAction;
10+
import abyss.lunarengine.LunarEngine;
11+
import abyss.lunarengine.LunarEngineCallback;
12+
import abyss.lunarengine.LunarEngineTools;
13+
import abyss.parallelmultiverse.part01textintro.MainTextIntro;
14+
import abyss.parallelmultiverse.part01textintro.PartTextIntro;
15+
import abyss.parallelmultiverse.part02abysslogo.MainAbyssLogo;
16+
import abyss.parallelmultiverse.part02abysslogo.PartAbyssLogo;
17+
import abyss.parallelmultiverse.part03mosaicbackground.PartMosaicBackground;
18+
import abyss.parallelmultiverse.part04bobspiral.MainBobSpiral;
19+
import abyss.parallelmultiverse.part04bobspiral.PartBobSpiral;
20+
import abyss.parallelmultiverse.part05bobbackground.PartBobBackground;
21+
import abyss.parallelmultiverse.part06lightningobject.MainLightningObject;
22+
import abyss.parallelmultiverse.part06lightningobject.PartLightningObject;
23+
import abyss.parallelmultiverse.part07turnbars.MainTurnBars;
24+
import abyss.parallelmultiverse.part07turnbars.PartTurnbars;
25+
import abyss.parallelmultiverse.part08ribbons.PartRibbons;
26+
import abyss.parallelmultiverse.part09bounce.MainBounce;
27+
import abyss.parallelmultiverse.part09bounce.PartBounce;
28+
import abyss.parallelmultiverse.part10confetti.PartConfetti;
29+
import abyss.parallelmultiverse.part11bobscubes.MainBobCubes;
30+
import abyss.parallelmultiverse.part11bobscubes.PartBobCubes;
31+
import abyss.parallelmultiverse.part12eyewave.PartEyeWave;
32+
import abyss.parallelmultiverse.part13tunnel.MainTunnel;
33+
import abyss.parallelmultiverse.part13tunnel.PartTunnel;
34+
import abyss.parallelmultiverse.part14lightningfields.MainLightningFields;
35+
import abyss.parallelmultiverse.part14lightningfields.PartLightningFields;
36+
import abyss.parallelmultiverse.part15rgb.MainRGB;
37+
import abyss.parallelmultiverse.part15rgb.PartRGB;
38+
import abyss.parallelmultiverse.part16dottyobject.PartDottyObject;
39+
import abyss.parallelmultiverse.part17splinescroller.MainSplineScroller;
40+
import abyss.parallelmultiverse.part17splinescroller.PartSplineScroller;
41+
import abyss.parallelmultiverse.part18creditsbobs.PartCreditsBobs;
42+
import abyss.parallelmultiverse.part19creditsscroller.MainCreditsScroller;
43+
import abyss.parallelmultiverse.part19creditsscroller.PartCreditsScroller;
44+
import abyss.parallelmultiverse.part20lasercutter.MainLaserCutter;
45+
import abyss.parallelmultiverse.part20lasercutter.PartLaserCutter;
46+
import oggvorbisplayer.ExamplePlayer;
47+
48+
/*
49+
* Parallel Multiverse
50+
*
51+
* is Abyss´ contribution to the demo competition of the Revision 2020 Demoscene event.
52+
*
53+
* Credits:
54+
*
55+
* - Music by Neurodancer
56+
* 'Drop your baggage' taken from the album 'znooQ´d'
57+
* https://neurowerx.bandcamp.com/album/znooqd
58+
*
59+
* - Abyss Logo by Celtic/Axis
60+
* Used before in the Abyss Amiga demo 'Pulstar'. So once more: Thank you, Niels, again it fits perfect.
61+
*
62+
* - Eyeball by Tyshdomos
63+
* Used before in the Abyss Amiga demo 'Drugstore', cut-out from your great title pic.
64+
* I think we´ve never met or had personal contact, anyway, thanks Thomas for all your great work.
65+
*
66+
* - Sans Forgetica font developed by RMIT University in Melbourne, Australia.
67+
* Creative Commons Attribution-NonCommercial license.
68+
* https://creativecommons.org/licenses/by-nc/4.0/
69+
*
70+
* - Ogg Vorbis Player by Jon Kristensen
71+
* http://www.jcraft.com/jorbis/tutorial/Tutorial.html
72+
* Creative Commons Attribution-ShareAlike 3.0
73+
* https://creativecommons.org/licenses/by/3.0/
74+
*
75+
* - Java Code by Moon
76+
*
77+
*/
78+
public class ParallelMultiverse implements LunarEngineCallback{
79+
private static ExamplePlayer oggVorbisPlayer;//Ogg Vorbis Player by Jon Kristensen
80+
81+
public static void main(String[] args){
82+
try{
83+
LunarEngine.clientName="Parallel Multiverse by Abyss";
84+
System.out.println(LunarEngine.clientName);
85+
final ParallelMultiverse parallelMultiverse=new ParallelMultiverse();
86+
parallelMultiverse.initializeMusic(parallelMultiverse);
87+
LunarEngine.fullscreenExclusiveMode=true;
88+
LunarEngine.initializeEngine(parallelMultiverse);
89+
Commander.addCommanderAction(1000,new ICommanderAction(){
90+
public void doAction(Object object){
91+
parallelMultiverse.startMusic();
92+
}
93+
});
94+
95+
final PartTextIntro partTextIntro=new PartTextIntro();
96+
final PartMosaicBackground partMosaicBackground=new PartMosaicBackground();
97+
final PartAbyssLogo partAbyssLogo=new PartAbyssLogo();
98+
final PartBobSpiral partBobSpiral=new PartBobSpiral();
99+
final PartBobBackground partBobBackground=new PartBobBackground();
100+
final PartLightningObject partLightningObject=new PartLightningObject();
101+
final PartTurnbars partTurnbars=new PartTurnbars();
102+
final PartRibbons partRibbons=new PartRibbons();
103+
final PartBounce partBounce=new PartBounce();
104+
final PartConfetti partConfetti=new PartConfetti();
105+
final PartBobCubes partBobsCubes=new PartBobCubes();
106+
final PartEyeWave partEyeWave=new PartEyeWave();
107+
final PartTunnel partTunnel=new PartTunnel();
108+
final PartRGB partRGB=new PartRGB();
109+
final PartLightningFields partLightningFields=new PartLightningFields();
110+
final PartDottyObject partDottyObject=new PartDottyObject();
111+
final PartSplineScroller partSplineScroller=new PartSplineScroller();
112+
final PartCreditsBobs partCreditsBobs=new PartCreditsBobs();
113+
final PartCreditsScroller partCreditsScroller=new PartCreditsScroller();
114+
final PartLaserCutter partLaserCutter=new PartLaserCutter();
115+
116+
117+
partTextIntro.precalc();
118+
MainTextIntro.addCommands(partTextIntro);
119+
120+
partMosaicBackground.precalc();
121+
partAbyssLogo.precalc();
122+
MainAbyssLogo.addCommands(partAbyssLogo,partMosaicBackground);
123+
124+
partBobSpiral.precalc();
125+
MainBobSpiral.addCommands(partBobSpiral, partMosaicBackground);
126+
127+
partBobBackground.precalc();
128+
partLightningObject.precalc();
129+
MainLightningObject.addCommands(partLightningObject,partMosaicBackground,partBobBackground);
130+
131+
partTurnbars.precalc();
132+
MainTurnBars.addCommands(partTurnbars,partBobBackground);
133+
134+
partBounce.precalc();
135+
partRibbons.precalc();
136+
MainBounce.addCommands(partBounce,partRibbons);
137+
138+
partBobsCubes.precalc();
139+
partConfetti.precalc();
140+
MainBobCubes.addCommands(partBobsCubes,partRibbons,partConfetti);
141+
142+
partEyeWave.precalc();
143+
partTunnel.precalc();
144+
MainTunnel.addCommands(partTunnel,partEyeWave);
145+
146+
partRGB.precalc();
147+
partLightningFields.precalc();
148+
MainLightningFields.addCommands(partLightningFields, partRGB);
149+
150+
partDottyObject.precalc();
151+
MainRGB.addCommands(partRGB,partDottyObject);
152+
153+
partSplineScroller.precalc();
154+
MainSplineScroller.addCommands(partSplineScroller,partRGB);
155+
156+
partCreditsBobs.precalc();
157+
partCreditsScroller.precalc();
158+
MainCreditsScroller.addCommands(partCreditsScroller,partCreditsBobs);
159+
160+
partLaserCutter.precalc();
161+
MainLaserCutter.addCommands(partLaserCutter,partConfetti);
162+
163+
Commander.start(3);
164+
LunarEngine.startEngine();
165+
}catch(Throwable throwable){
166+
LunarEngine.throwableHandler(throwable);
167+
}
168+
}
169+
170+
private void initializeMusic(ParallelMultiverse parallelMultiverse) {
171+
try {
172+
URL url = LunarEngineTools.getResourceUrl(this,"data/Drop your baggage.ogg");
173+
BufferedInputStream bufferedInputStream=new BufferedInputStream(url.openStream());
174+
byte[] buffer=new byte[1024];
175+
int count;
176+
ByteArrayOutputStream baos=new ByteArrayOutputStream();
177+
while((count=bufferedInputStream.read(buffer))!=-1) {
178+
baos.write(buffer,0,count);
179+
}
180+
bufferedInputStream.close();
181+
ByteArrayInputStream bais=new ByteArrayInputStream(baos.toByteArray());
182+
oggVorbisPlayer = new ExamplePlayer(bais);
183+
} catch (Exception e) {
184+
throw new RuntimeException("error initializing music",e);
185+
}
186+
}
187+
188+
private void startMusic() {
189+
oggVorbisPlayer.start();
190+
}
191+
192+
private void stopMusic() {
193+
oggVorbisPlayer.stopPlayer=true;
194+
}
195+
196+
public void lunarEngineShutdown() {
197+
stopMusic();
198+
}
199+
200+
}

0 commit comments

Comments
 (0)