Tetrismus

Started by wolf_m, August 18, 2006, 00:17:16

Previous topic - Next topic

wolf_m

Hi!

I've programmed a simple Tetris clone called Tetrismus. There's no multiplayer support, but apart from that, it's pretty much a complete game.

You can get the game along with the source code here.

Comments welcome!

Thanks to the LWJGL programmers for making this possible :)

Matzon

works as advertised :)
- quick comments:
- some boxing around some of the text, perhaps some texture offset issue
- too slow to play, should be faster and not as ... time-step like as it is now
- colored pieces (important)

thats it - off to work

wolf_m

You can adjust the starting speed and the key recognition speed in the options menu. Besides, there's a death mode, try it :)
About the texture offset issue: I'm aware of that, I'll fix it.
Colored pieces: I'm considering it. It should be pretty simple.

Fool Running

I'm getting a crash trying to run with the .bat file (for windows):
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x69097300, pid=2624, tid=3732
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode, sharing)
# Problematic frame:
# C  [atioglxx.dll+0x97300]
#

---------------  T H R E A D  ---------------

Current thread (0x00036cc0):  JavaThread "main" [_thread_in_native, id=3732]

siginfo: ExceptionCode=0xc0000005, reading address 0x05d840aa

Registers:
EAX=0x000000c0, EBX=0x00000002, ECX=0x05d840a9, EDX=0x00000008
ESP=0x0007f0c8, EBP=0x00000000, ESI=0x05d840a9, EDI=0xffffffff
EIP=0x69097300, EFLAGS=0x00210287

Top of Stack: (sp=0x0007f0c8)
0x0007f0c8:   0000012c 00000002 0007f4a4 05d2b908
0x0007f0d8:   00000020 05d82489 000005a4 000004b0
0x0007f0e8:   05d82489 00000026 00000001 ffffffff
0x0007f0f8:   00000029 0000002a 0000002c 0000002d
0x0007f108:   0000002e 0000002d 0000002d 0000002b
0x0007f118:   00000024 00000026 00000027 00000028
0x0007f128:   00000029 00000024 00000021 0000001e
0x0007f138:   00000020 00000021 00000021 00000021 

Instructions: (pc=0x69097300)
0x690972f0:   8b ce ba 08 00 00 00 eb 07 8d a4 24 00 00 00 00
0x69097300:   0f b6 6c 19 ff 89 ac 04 30 02 00 00 0f b6 29 89 


Stack: [0x00040000,0x00080000),  sp=0x0007f0c8,  free space=252k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [atioglxx.dll+0x97300]

[error occurred during error reporting, step 120, id 0xc0000005]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.lwjgl.opengl.GL11.nglTexImage2D(IIIIIIIILjava/nio/Buffer;IJ)V+0
j  org.lwjgl.opengl.GL11.glTexImage2D(IIIIIIIILjava/nio/ByteBuffer;)V+70
j  game.output.GraphicsProcessor.loadTexture(Ljava/lang/String;)I+182
j  game.output.GraphicsProcessor.loadTextures()V+138
j  game.Tetrismus.initVideo()V+46
j  game.Tetrismus.initMenu(Z)V+84
j  game.Tetrismus.run(Z)V+2
j  game.Tetrismus.main([Ljava/lang/String;)V+30
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------
...


I have Windows XP Pro - ATI Radeon X600

I looked at the source code. The only thing I found is the scratch buffer is not Flip()ed (I'm pretty sure it has to be in this case). Why no one else is seeing this, I don't know... So maybe that's not the problem  :D
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

wolf_m

You're actually not the only one having this problem. Another ATI guy has precisely the same issue with this game. I'd love to fix this issue, unfortunately, I don't have a configuration in which the game crashes that way.

QuoteThe only thing I found is the scratch buffer is not Flip()ed (I'm pretty sure it has to be in this case).
Could you elaborate on that? I don't have a clue what you're trying to say. If it's some necessary OpenGL operation and I let it out because of my silliness, it could be the problem, I guess.

Another thing: Some people report issues with OpenAL.
1. The native library for linux seems to crash under Gentoo. It crashes when the ogg-files are buffered into pcm buffers for OpenAL. Any input?
2. OpenAL error: Invalid Value (40963) -- as far as I have understood, this error occurs when someone's sound card doesn't support the number of sources I adjusted. How should I deal with that? I don't have any idea that doesn't force me to reload the data into buffers -_-

wolf_m

I have fixed the OpenAL error 40963 issues; I did it the way I described before.
And I fixed the background pic size to a power of 2, that seems to be necessary for some graphics card drivers' OpenGL implementations.
Numerous people complained about the font not being readable in the main menu, so I made a new font.

All of this is in release 0.54 and above, so everybody who has had problems running Tetrismus should consider downloading the newest release :)

Thanks for your input!

wolf_m

Yay, triple post! Sorry for that.

I've fixed some bugs again.

Unfortunately, some ATI users report that the application is just black on their setup. Example:

It works fine on just about any other graphics card type. Some Dell users with integrated Intel chipset report the same problem though. Can anyone help me with that?

darkprophet

your not cleaing depth, but instead, clearing stencil which you dont use.

in GraphicsProcessor.java#pointBg() replace GL11.GL_STENCIL_BUFFER_BIT with GL11.GL_DEPTH_BUFFER_BIT

DP

wolf_m

Thanks darkprophet! I hope this is fixed once and for all now :)

Release 0.6 is on the sourceforge servers with coloured pieces and new backgrounds, check it out!

Release 0.61 fixes the annoyances with the keys, but you have to press enter in the menu to confirm choices now because space doesn't work anymore.

wolf_m

Linux users with ALSA reported that Tetrismus crashes on their system with a log like this:
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0x0000000a, pid=9024, tid=3085522624
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode, sharing)
# Problematic frame:
# C  0x0000000a
#

---------------  T H R E A D  ---------------

Current thread (0x0805c9b8):  JavaThread "main" [_thread_in_native, id=9024]

siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x0000000a

Registers:
EAX=0x00008010, EBX=0xb1b884b4, ECX=0x00000000, EDX=0x0000000a
ESP=0xbfffcdb8, EBP=0xbfffcde4, ESI=0x00000001, EDI=0x00008010
EIP=0x0000000a, CR2=0x0000000a, EFLAGS=0x00010282

Top of Stack: (sp=0xbfffcdb8)
0xbfffcdb8:   b1b7e431 bfffcfec 00008010 00000001
0xbfffcdc8:   00000056 00000010 90e28010 91ec7a64
0xbfffcdd8:   00000000 0852b2e4 0852b2da bfffce14
0xbfffcde8:   b1b7e431 bfffcfec 00008010 8caf5b10
0xbfffcdf8:   bfffce6c 00000010 bfff8010 b7736b14
0xbfffce08:   00000000 0852b2fc 0852b2e6 bfffce44
0xbfffce18:   b1b7e431 bfffcfec 00008010 b7736b14
0xbfffce28:   bfffce88 00000010 bfff8010 b7737b60 

Instructions: (pc=0x0000000a)
0xfffffffa:   

Stack: [0xbfe00000,0xc0000000),  sp=0xbfffcdb8,  free space=2035k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  0x0000000a
C  [libopenal.so+0x3b431]  acFreqDIV2+0x10d
C  [libopenal.so+0x3b431]  acFreqDIV2+0x10d
C  [libopenal.so+0x3b431]  acFreqDIV2+0x10d
C  [libopenal.so+0x3b431]  acFreqDIV2+0x10d
C  [libopenal.so+0x3b431]  acFreqDIV2+0x10d
C  [libopenal.so+0x3b431]  acFreqDIV2+0x10d
C  [libopenal.so+0x3b431]  acFreqDIV2+0x10d
C  [libopenal.so+0x3b7c3]  acConvert16LSB+0xc3
C  [libopenal.so+0x3c127]  acConvertSign+0xe3
C  [libopenal.so+0x3c73b]  acConvertAudio+0x5d
C  [libopenal.so+0xa919]
C  [libopenal.so+0x9ed3]  _alBufferCanonizeData+0x32
C  [libopenal.so+0x9924]  alBufferData+0x2f3
C  [liblwjgl.so+0x1b07f]
j  org.lwjgl.openal.AL10.nalBufferData(IILjava/nio/Buffer;III)V+0
j  org.lwjgl.openal.AL10.alBufferData(IILjava/nio/ByteBuffer;I)V+16
j  game.output.SoundProcessor.loadALData(Ljava/lang/String;)I+61
j  game.output.SoundProcessor.play(Ljava/lang/String;)V+59
j  game.input.MenuInputProcessor.mapInput()V+200
j  game.Tetrismus.menu(Z)V+47
j  game.Tetrismus.run(Z)V+15
j  game.Tetrismus.main([Ljava/lang/String;)V+39
v  ~StubRoutines::call_stub
V  [libjvm.so+0x174fec]
V  [libjvm.so+0x2821f8]
V  [libjvm.so+0x174e1f]
V  [libjvm.so+0x19f5c2]
V  [libjvm.so+0x1907d2]
C  [java+0x1803]
C  [libc.so.6+0x14e4b]  __libc_start_main+0xcb

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.lwjgl.openal.AL10.nalBufferData(IILjava/nio/Buffer;III)V+0
j  org.lwjgl.openal.AL10.alBufferData(IILjava/nio/ByteBuffer;I)V+16
j  game.output.SoundProcessor.loadALData(Ljava/lang/String;)I+61
j  game.output.SoundProcessor.play(Ljava/lang/String;)V+59
j  game.input.MenuInputProcessor.mapInput()V+200
j  game.Tetrismus.menu(Z)V+47
j  game.Tetrismus.run(Z)V+15
j  game.Tetrismus.main([Ljava/lang/String;)V+39
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

[...]

They had to load the modules snd-pcm-oss and snd-mixer-oss because OpenAL wanted /dev/dsp before.

I've set up ALSA on my system and the same error occurs. What's going on there? Doesn't OpenAL work with ALSA? How should I deal with that?

I've tried to compile the newest libopenal.so from OpenAL's subversion server, but the problem remained. I've also tried to replace libopenal.so with the one from Tribal Trouble, without an effect.

I'm using lwjgl 1.0beta2, upgrading to beta3 resulted in other strange errors :/

Fool Running

Well, whatever you did, the game is working now for me :D
All the graphics work fine (no back screen or anything).
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

darkprophet

should I add to the "techSupport" counter? :P

Meh, techSupport++;

DP

wolf_m

QuoteWell, whatever you did, the game is working now for me
Great! Happy to hear that!

QuotetechSupport++;
Oh man, I hate it when I'm screwed.. I don't have the slightest clue how to solve this ALSA+libopenal.so problem (if that's the cause, after all).

darkprophet

try downloading Tribal Trouble and using their openal.dll/so, i think it uses OSS too...

DP

wolf_m

I've already done that, same error.