CounterSheep - The product of 48 hours of insanity

The 48 hour game programming competition has just drawn to a close so you can all find my weekends work here: http://ludumdare.com/user/index.php?viewuser=318 (you may have to register, but I highly recommend you do, if only to check out the competitions entries).

CounterSheep should hopefully have everything included in the final zip, so just unzip to a dir and play. Theres at least one other entry that i spotted that was using Java (Java2D I think) but i’m not sure how completed it was.

As usually all comments are greatly appreciated :slight_smile:

And for people who want to try it without going via the site, you can find the jar directly here: http://studenti.lboro.ac.uk/~cojc5/Programs/CounterSheepFinal.zip

;D

Ugly - but not smooth…

Ok ok, 48 hours… :stuck_out_tongue:

heh, - i’ll see you at the next 48hour comp then :wink:

Unfortunatly time was very tight, so theres very little optimisation in there, not even any view culling…

[quote]heh, - i’ll see you at the next 48hour comp then :wink:
[/quote]
Oh, I’m sorry - I never would dare to compete with you guys …
:-X

very nice! - hope you got some good sleep afterwards - runs fluently at my end in windowed mode!

lol - actually quite fun… - and in an hour or two, I’ll actually know what the purpose of the game is! ;D

What a crack up, I love the sheep bouncing around.

The sheep look soo funny in the screenshots ;D
Unfortunately I keep getting the below errors :-[


C:\temp\sheep>java -jar CounterSheep.jar
Available extensions:
GL_WIN_swap_hint GL_EXT_bgra GL_EXT_paletted_texture
Failed to get function: wglGetExtensionsStringARB
Failed to get function: wglGetExtensionsStringEXT
Failed to acquire keyboard

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x0
Function=[Unknown.]
Library=(N/A)

NOTE: We are unable to locate the function name symbol for the error
      just occurred. Please refer to release documentation for possible
      reason and solutions.


Current Java thread:
        at org.lwjgl.opengl.GL.wglSwapIntervalEXT(Native Method)
        at CounterSheep.HoverCamera.setupPerspectiveProjection(HoverCamera.java:
132)
        at CounterSheep.CounterSheep.render(CounterSheep.java:298)
        at CounterSheep.CounterSheep.run(CounterSheep.java:196)
        at CounterSheep.CounterSheep.actionPerformed(CounterSheep.java:110)
        at OrangyTang.OpenGLToolkit.ScreenManager$ButtonHandler.actionPerformed(
ScreenManager.java:280)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:17
67)
        at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Abstra
ctButton.java:1820)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel
.java:419)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257
)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
istener.java:258)
        at java.awt.Component.processMouseEvent(Component.java:5021)
        at java.awt.Component.processEvent(Component.java:4818)
        at java.awt.Container.processEvent(Container.java:1525)
        at java.awt.Component.dispatchEventImpl(Component.java:3526)
        at java.awt.Container.dispatchEventImpl(Container.java:1582)
        at java.awt.Component.dispatchEvent(Component.java:3367)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3359
)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3074)

        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3004)
        at java.awt.Container.dispatchEventImpl(Container.java:1568)
        at java.awt.Window.dispatchEventImpl(Window.java:1581)
        at java.awt.Component.dispatchEvent(Component.java:3367)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:191)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:144)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)

Dynamic libraries:
0x00400000 - 0x00406000         C:\WINNT\system32\java.exe
0x77F80000 - 0x77FFA000         C:\WINNT\System32\ntdll.dll
0x77DB0000 - 0x77E0A000         C:\WINNT\system32\ADVAPI32.dll
0x77E80000 - 0x77F35000         C:\WINNT\system32\KERNEL32.DLL
0x77D40000 - 0x77DB0000         C:\WINNT\system32\RPCRT4.DLL
0x78000000 - 0x78046000         C:\WINNT\system32\MSVCRT.dll
0x6D330000 - 0x6D445000         C:\Program Files\Java\j2re1.4.0_01\bin\client\jv
m.dll
0x77E10000 - 0x77E74000         C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7C000         C:\WINNT\system32\GDI32.DLL
0x77570000 - 0x775A0000         C:\WINNT\system32\WINMM.dll
0x69F00000 - 0x69F14000         C:\WINNT\system32\sxgb.dll
0x690A0000 - 0x690AB000         C:\WINNT\system32\PSAPI.DLL
0x10000000 - 0x10009000         C:\WINNT\system32\SXGBSYS.DLL
0x6D1D0000 - 0x6D1D7000         C:\Program Files\Java\j2re1.4.0_01\bin\hpi.dll
0x6D300000 - 0x6D30D000         C:\Program Files\Java\j2re1.4.0_01\bin\verify.dl
l
0x6D210000 - 0x6D228000         C:\Program Files\Java\j2re1.4.0_01\bin\java.dll
0x6D320000 - 0x6D32D000         C:\Program Files\Java\j2re1.4.0_01\bin\zip.dll
0x6D000000 - 0x6D0F6000         C:\Program Files\Java\j2re1.4.0_01\bin\awt.dll
0x77800000 - 0x7781D000         C:\WINNT\system32\WINSPOOL.DRV
0x75E60000 - 0x75E7A000         C:\WINNT\system32\IMM32.dll
0x77A50000 - 0x77B45000         C:\WINNT\system32\ole32.dll
0x6D180000 - 0x6D1D0000         C:\Program Files\Java\j2re1.4.0_01\bin\fontmanag
er.dll
0x51000000 - 0x51044000         C:\WINNT\system32\DDRAW.dll
0x728A0000 - 0x728A6000         C:\WINNT\system32\DCIMAN32.dll
0x0EF60000 - 0x0F0D0000         C:\WINNT\system32\i81xgicd.dll
0x0F1E0000 - 0x0F23D000         C:\WINNT\system32\i81xGDEV.DLL
0x0AFE0000 - 0x0B00E000         C:\temp\sheep\lwjgl.dll
0x69510000 - 0x695D7000         C:\WINNT\system32\OPENGL32.dll
0x6FAC0000 - 0x6FADF000         C:\WINNT\system32\GLU32.dll
0x5F580000 - 0x5F5A7000         C:\WINNT\system32\DINPUT.dll
0x0B010000 - 0x0B0EF000         C:\temp\sheep\OpenAL32.dll
0x61220000 - 0x6122E000         C:\Program Files\Microsoft Hardware\Mouse\MSH_ZW
F.dll
0x14280000 - 0x142BD000         C:\Program Files\Network Associates\VirusScan\Wb
hook32.dll
0x77820000 - 0x77827000         C:\WINNT\system32\VERSION.dll
0x759B0000 - 0x759B6000         C:\WINNT\system32\LZ32.DLL
0x143D0000 - 0x143D9000         C:\Program Files\Network Associates\VirusScan\Re
s09\WbhkRes.dll
0x6F9A0000 - 0x6F9A7000         C:\WINNT\system32\HID.DLL
0x77880000 - 0x7790D000         C:\WINNT\system32\SETUPAPI.DLL
0x77C10000 - 0x77C6D000         C:\WINNT\system32\USERENV.DLL
0x71710000 - 0x71794000         C:\WINNT\system32\COMCTL32.dll
0x77920000 - 0x77942000         C:\WINNT\system32\imagehlp.dll
0x72A00000 - 0x72A2D000         C:\WINNT\system32\DBGHELP.dll

Local Time = Mon Nov 11 16:20:40 2002
Elapsed Time = 24
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.0_01-b03 mixed mode)
#
# An error report file has been saved as hs_err_pid1872.log.
# Please refer to the file for further information.
#

C:\temp\sheep>

Damn - getting rather fond of the highspeed collisions with the walls…

/me ponders a hack to allow crashing into sheeps ;D

Ooops, I seem to have used an old build of my lib which still has the SwapInterval bug in it :-[ I’ll try and get round to uploading an updated version later tonight.

Don’t forget to use that new LWJGL build I put up on SF :slight_smile: Needs testing.

Cas :slight_smile:

Unfortunately, I could not get it to work; I get this error in the log.txt file:

Starting CounterSheep…
Creating display
Failed to create OpenGL: java.lang.Exception: Failed to set display mode to 1280 x 1024 x 16 @0Hz

I have tried it on multiple settings, none of which work…:frowning:

I am on a Windows 98 SE machine.

…with what graphics card / drivers?

Cas :slight_smile:

[quote]…with what graphics card / drivers?

Cas :slight_smile:
[/quote]
Sheeshh, you guys really want me to go through a lot of work don’t you? :wink:

Anyway, the video card I have is a Nvidia Geforce 2, and the drivers I have (As far as I know) are the ones that came with it. I can’t remember where I find the names of the drivers :o; I’m sure if I looked long enough I would find them though.

I got the same error as virum in 640x480 and 800x600, it switched my display res but didn’t change it back. I tried windowed but that didn’t work either.

EDIT: no gfx card; intel chipset.

I’ve also got the same error as virum and nonnus29.

Grfx Card Geforce 3 64m
Driver ASUS V8200 v12.60
win me
AMD 1.4
256m memory
Java version 1.4.1_01

The problem is that it’s returning a 0Hz screen refresh rate, which doesn’t look particularly valid to me… in theory that’s supposed to tell it not to change the rate that the monitor is already set to, but it might not be working…

Cas :slight_smile:

I can’t run it at all. I assume that you have only programmed this for windows; hence, the DLLs ???

It seems like a cool game to demo. I’m sorry you choose to make it platform dependent

Well, you can just get the lwjgl package for linux(assuming it’s linux you’re using?), which wasn’t available at the time he made the demo…:
http://www.java-gaming.org/cgi-bin/JGOForums/YaBB.cgi?board=volunteer;action=display;num=1037718409;start=0

Conzar: Its not platform dependant really, its just the LWJGL was only for windows at the time of writing. Its probably perfectly possible to take the zip i’ve already posted, remove the dlls and replace with the linux native code.

Oh, and anyone with problems when running on intergrated sound/gfx cards are stuck :stuck_out_tongue: sorry but if you can’t even manage to get semi-decent hardware then you’re on you own…