All falls apart at the end

There's a ton of stuff I'm proud of on this project, esp. the dynamic music stuff. But, in the end, I ran out of time. Thinking back on it, I probably should've just ripped the combat system out rather than trying to fix it at the last minute.

So, why'd I fail? Well... to be honest, I think it just comes down to one single thing; the fact that I wasted a day trying to get the raycaster working efficiently when brute force worked just fine. If I'd started with the option I ended up using anyway I'd have a whole nother day and a half, which was really all I needed - heck, even just a few more hours to figure out the combat balance would have made a huge difference. Alas, it was not to be. If i'd stuck to standard Final Fantasy clone combat it'd probably have been fine as well, so there's a lesson - don't innovate just for its own sake, especially when you're under time pressure.

Still! It's a pretty cool walking-around-mazes simulator, except for when it decides to force you to play broken RPG combat instead. And the dynamic music stuff tieff and I put together is definitely awesome.

So, while I'm pretty disappointed in the version that I'm actually submitting to PyWeek, I think with another couple days of work this could be a pretty friggin' cool game.

(log in to comment)

Comments

I followed the instructions in the readme, have pip installed from requirements.txt.

I can't get it to run:


$ python main.py 
Traceback (most recent call last):
  File "main.py", line 255, in 
    pygame.key.set_repeat(500, 75)
pygame.error: video system not initialized

Ubuntu 18.04, Python 3.7.4
@ntoll
Should be able to just comment that line out.

If all else fails you should be able to run the EXE version under Wine.
@schilcote I already tried that and I get this:
$ python main.py 
Traceback (most recent call last):
  File "main.py", line 257, in 
    g = GameState()
  File "main.py", line 98, in __init__
    self.mainwin = gfx.MainWindow(self.camera)
  File "/home/ntoll/src/pyweek/gfx/__init__.py", line 103, in __init__
    self.window_surface = win = pygame.display.set_mode(TARGET_RESOLUTION)
pygame.error: No available video device
When I try to run it with WINE I get
Unhandled exception: unimplemented function api-ms-win-core-path-l1-1-0.dll.PathCchCanonicalizeEx called in 64-bit code (0x000000007b44c1e7).
Register dump:
 rip:000000007b44c1e7 rsp:000000000023bcf0 rbp:000000000023be60 eflags:00000206 (   - --  I   - -P- )
 rax:000000000023bd10 rbx:0000000080000100 rcx:000000000023bd10 rdx:000000000023bd30
 rsi:000000000023bea0 rdi:000000000023bd40  r8:0000000000000002  r9:000000000023be90 r10:0000000000000002
 r11:00000000000164e8 r12:000000000023cbb0 r13:0000000000000000 r14:0000000000000000 r15:000000000023c4a0
Stack dump:
0x000000000023bcf0:  000000000023bd10 0000000000000000
0x000000000023bd00:  0000000000000000 0000000000000000
0x000000000023bd10:  0000000180000100 0000000000000000
0x000000000023bd20:  000000007b44c1e7 0000000000000002
0x000000000023bd30:  00007f31b5a6bd29 00007f31b5a6bde0
0x000000000023bd40:  0000000000000000 0000000000000000
0x000000000023bd50:  0000000000000000 0000000000000000
0x000000000023bd60:  0000000000000000 0000000000000000
0x000000000023bd70:  0000000000000000 0000000000000000
0x000000000023bd80:  00007f31b5a60000 000000000023bdf0
0x000000000023bd90:  00000000002421d0 000000000023cbb0
0x000000000023bda0:  0000000000000000 5581223d8b672500
Backtrace:
=>0 0x000000007b44c1e7 in kernel32 (+0x2c1e7) (0x000000000023be60)
  1 0x00007f31b5a6bd19 in api-ms-win-core-path-l1-1-0 (+0xbd18) (0x000000000023be90)
  2 0x00007f31b5a6b9b7 in api-ms-win-core-path-l1-1-0 (+0xb9b6) (0x000000000023bf20)
  3 0x000000018001cc6a in python37 (+0x1cc69) (0x000000000023bf20)
  4 0x000000018001cbb1 in python37 (+0x1cbb0) (0x000000000023c2a0)
  5 0x000000018001e3f2 in python37 (+0x1e3f1) (0x000000000023c2a0)
  6 0x000000018001e67a in python37 (+0x1e679) (0x000000000023c949)
  7 0x000000018001b390 in python37 (+0x1b38f) (0x000000000023c949)
0x000000007b44c1e7: movq	0x00000000000000b8(%rsp),%rax
Modules:
Module	Address					Debug info	Name (72 modules)
ELF	        7b400000-        7b80d000	Dwarf           kernel32
  \-PE	        7b420000-        7b80d000	\               kernel32
ELF	        7bc00000-        7bd16000	Deferred        ntdll
  \-PE	        7bc20000-        7bd16000	\               ntdll
ELF	        7c000000-        7c004000	Deferred        
PE	       140000000-       140056000	Deferred        main
PE	       180000000-       1803c4000	Export          python37
ELF	    7f31b5a5a000-    7f31b5c6e000	Dwarf           api-ms-win-core-path-l1-1-0
  \-PE	    7f31b5a60000-    7f31b5c6e000	\               api-ms-win-core-path-l1-1-0
ELF	    7f31b5c6e000-    7f31b5e94000	Deferred        imm32
  \-PE	    7f31b5c80000-    7f31b5e94000	\               imm32
ELF	    7f31b5e94000-    7f31b60c6000	Deferred        libexpat.so.1
ELF	    7f31b60c6000-    7f31b630b000	Deferred        libfontconfig.so.1
ELF	    7f31b630b000-    7f31b6528000	Deferred        libz.so.1
ELF	    7f31b6528000-    7f31b675a000	Deferred        libpng16.so.16
ELF	    7f31b675a000-    7f31b6a0e000	Deferred        libfreetype.so.6
PE	    7f31b6a0e000-    7f31b6c22000	Deferred        api-ms-win-crt-filesystem-l1-1-0
PE	    7f31b6a10000-    7f31b6c22000	Deferred        api-ms-win-crt-filesystem-l1-1-0C:\windows\system32\api-ms-win-crt-filesystem-l1-1-0.dll
ELF	    7f31b6c22000-    7f31b6e36000	Deferred        api-ms-win-crt-conio-l1-1-0
  \-PE	    7f31b6c30000-    7f31b6e36000	\               api-ms-win-crt-conio-l1-1-0
ELF	    7f31b6e36000-    7f31b704a000	Deferred        api-ms-win-crt-heap-l1-1-0
  \-PE	    7f31b6e40000-    7f31b704a000	\               api-ms-win-crt-heap-l1-1-0
ELF	    7f31b704a000-    7f31b725d000	Deferred        api-ms-win-crt-process-l1-1-0
  \-PE	    7f31b7480000-    7f31b7684000	\               api-ms-win-crt-time-l1-1-0
ELF	    7f31b7684000-    7f31b7899000	Deferred        api-ms-win-crt-convert-l1-1-0
  \-PE	    7f31b78a0000-    7f31b7aae000	\               api-ms-win-crt-stdio-l1-1-0
ELF	    7f31b7aae000-    7f31b7cc4000	Deferred        api-ms-win-crt-string-l1-1-0
  \-PE	    7f31b7ee0000-    7f31b80f0000	\               api-ms-win-crt-math-l1-1-0
ELF	    7f31b80f0000-    7f31b8305000	Deferred        api-ms-win-crt-runtime-l1-1-0
  \-PE	    7f31b8330000-    7f31b8619000	\               ucrtbase
ELF	    7f31b8619000-    7f31b882f000	Deferred        vcruntime140
  \-PE	    7f31b8620000-    7f31b882f000	\               vcruntime140
ELF	    7f31b882f000-    7f31b8abf000	Deferred        advapi32
  \-PE	    7f31b8840000-    7f31b8abf000	\               advapi32
ELF	    7f31b8abf000-    7f31b8e3a000	Deferred        gdi32
  \-PE	    7f31b8ad0000-    7f31b8e3a000	\               gdi32
ELF	    7f31b8e3a000-    7f31b9276000	Deferred        user32
  \-PE	    7f31b8e60000-    7f31b9276000	\               user32
ELF	    7f31b9276000-    7f31b9503000	Deferred        shlwapi
  \-PE	    7f31b9290000-    7f31b9503000	\               shlwapi
ELF	    7f31b9503000-    7f31b971d000	Deferred        version
  \-PE	    7f31b9510000-    7f31b971d000	\               version
PE	    7f31b971d000-    7f31b9931000	Deferred        api-ms-win-core-localization-l1-
PE	    7f31b9720000-    7f31b9931000	Deferred        api-ms-win-core-localization-l1-C:\windows\system32\api-ms-win-core-localization-l1-2-1.dll
ELF	    7f31b9931000-    7f31b9b44000	Deferred        api-ms-win-core-fibers-l1-1-1
  \-PE	    7f31b9e60000-    7f31ba099000	\               ws2_32
ELF	    7f31ba199000-    7f31ba3ab000	Deferred        libnss_files.so.2
ELF	    7f31ba3ab000-    7f31ba5c5000	Deferred        libnsl.so.1
ELF	    7f31ba5c5000-    7f31ba7d1000	Deferred        libnss_nis.so.2
ELF	    7f31ba7d1000-    7f31ba9db000	Deferred        libnss_compat.so.2
ELF	    7f31bb4aa000-    7f31bb6c2000	Deferred        libgcc_s.so.1
ELF	    7f31bb6c2000-    7f31bba60000	Deferred        libm.so.6
ELF	    7f31bba60000-    7f31bbc64000	Deferred        libdl.so.2
ELF	    7f31bbc64000-    7f31bc055000	Deferred        libc.so.6
ELF	    7f31bc055000-    7f31bc274000	Deferred        libpthread.so.0
ELF	    7f31bc619000-    7f31bc843000	Deferred        ld-linux-x86-64.so.2
Threads:
process  tid      prio (all id:s are in hex)
0000000c services.exe
	00000021    0
	0000000e    0
	0000000d    0
00000011 explorer.exe
	00000015    0
	00000012    0
0000001f winedevice.exe
	00000026    0
	00000023    0
	00000022    0
	00000020    0
0000002d main.exe
	0000002e    0
0000002f (D) Z:\home\ntoll\src\pyweek\main.exe
	00000030    0 @schilcote I already tried that and I get this:
$ python main.py 
Traceback (most recent call last):
  File "main.py", line 257, in 
    g = GameState()
  File "main.py", line 98, in __init__
    self.mainwin = gfx.MainWindow(self.camera)
  File "/home/ntoll/src/pyweek/gfx/__init__.py", line 103, in __init__
    self.window_surface = win = pygame.display.set_mode(TARGET_RESOLUTION)
pygame.error: No available video device
When I try to run it with WINE I get
Unhandled exception: unimplemented function api-ms-win-core-path-l1-1-0.dll.PathCchCanonicalizeEx called in 64-bit code (0x000000007b44c1e7).
Register dump:
 rip:000000007b44c1e7 rsp:000000000023bcf0 rbp:000000000023be60 eflags:00000206 (   - --  I   - -P- )
 rax:000000000023bd10 rbx:0000000080000100 rcx:000000000023bd10 rdx:000000000023bd30
 rsi:000000000023bea0 rdi:000000000023bd40  r8:0000000000000002  r9:000000000023be90 r10:0000000000000002
 r11:00000000000164e8 r12:000000000023cbb0 r13:0000000000000000 r14:0000000000000000 r15:000000000023c4a0
Stack dump:
0x000000000023bcf0:  000000000023bd10 0000000000000000
0x000000000023bd00:  0000000000000000 0000000000000000
0x000000000023bd10:  0000000180000100 0000000000000000
0x000000000023bd20:  000000007b44c1e7 0000000000000002
0x000000000023bd30:  00007f31b5a6bd29 00007f31b5a6bde0
0x000000000023bd40:  0000000000000000 0000000000000000
0x000000000023bd50:  0000000000000000 0000000000000000
0x000000000023bd60:  0000000000000000 0000000000000000
0x000000000023bd70:  0000000000000000 0000000000000000
0x000000000023bd80:  00007f31b5a60000 000000000023bdf0
0x000000000023bd90:  00000000002421d0 000000000023cbb0
0x000000000023bda0:  0000000000000000 5581223d8b672500
Backtrace:
=>0 0x000000007b44c1e7 in kernel32 (+0x2c1e7) (0x000000000023be60)
  1 0x00007f31b5a6bd19 in api-ms-win-core-path-l1-1-0 (+0xbd18) (0x000000000023be90)
  2 0x00007f31b5a6b9b7 in api-ms-win-core-path-l1-1-0 (+0xb9b6) (0x000000000023bf20)
  3 0x000000018001cc6a in python37 (+0x1cc69) (0x000000000023bf20)
  4 0x000000018001cbb1 in python37 (+0x1cbb0) (0x000000000023c2a0)
  5 0x000000018001e3f2 in python37 (+0x1e3f1) (0x000000000023c2a0)
  6 0x000000018001e67a in python37 (+0x1e679) (0x000000000023c949)
  7 0x000000018001b390 in python37 (+0x1b38f) (0x000000000023c949)
0x000000007b44c1e7: movq	0x00000000000000b8(%rsp),%rax
Modules:
Module	Address					Debug info	Name (72 modules)
ELF	        7b400000-        7b80d000	Dwarf           kernel32
  \-PE	        7b420000-        7b80d000	\               kernel32
ELF	        7bc00000-        7bd16000	Deferred        ntdll
  \-PE	        7bc20000-        7bd16000	\               ntdll
ELF	        7c000000-        7c004000	Deferred        
PE	       140000000-       140056000	Deferred        main
PE	       180000000-       1803c4000	Export          python37
ELF	    7f31b5a5a000-    7f31b5c6e000	Dwarf           api-ms-win-core-path-l1-1-0
  \-PE	    7f31b5a60000-    7f31b5c6e000	\               api-ms-win-core-path-l1-1-0
ELF	    7f31b5c6e000-    7f31b5e94000	Deferred        imm32
  \-PE	    7f31b5c80000-    7f31b5e94000	\               imm32
ELF	    7f31b5e94000-    7f31b60c6000	Deferred        libexpat.so.1
ELF	    7f31b60c6000-    7f31b630b000	Deferred        libfontconfig.so.1
ELF	    7f31b630b000-    7f31b6528000	Deferred        libz.so.1
ELF	    7f31b6528000-    7f31b675a000	Deferred        libpng16.so.16
ELF	    7f31b675a000-    7f31b6a0e000	Deferred        libfreetype.so.6
PE	    7f31b6a0e000-    7f31b6c22000	Deferred        api-ms-win-crt-filesystem-l1-1-0
PE	    7f31b6a10000-    7f31b6c22000	Deferred        api-ms-win-crt-filesystem-l1-1-0C:\windows\system32\api-ms-win-crt-filesystem-l1-1-0.dll
ELF	    7f31b6c22000-    7f31b6e36000	Deferred        api-ms-win-crt-conio-l1-1-0
  \-PE	    7f31b6c30000-    7f31b6e36000	\               api-ms-win-crt-conio-l1-1-0
ELF	    7f31b6e36000-    7f31b704a000	Deferred        api-ms-win-crt-heap-l1-1-0
  \-PE	    7f31b6e40000-    7f31b704a000	\               api-ms-win-crt-heap-l1-1-0
ELF	    7f31b704a000-    7f31b725d000	Deferred        api-ms-win-crt-process-l1-1-0
  \-PE	    7f31b7480000-    7f31b7684000	\               api-ms-win-crt-time-l1-1-0
ELF	    7f31b7684000-    7f31b7899000	Deferred        api-ms-win-crt-convert-l1-1-0
  \-PE	    7f31b78a0000-    7f31b7aae000	\               api-ms-win-crt-stdio-l1-1-0
ELF	    7f31b7aae000-    7f31b7cc4000	Deferred        api-ms-win-crt-string-l1-1-0
  \-PE	    7f31b7ee0000-    7f31b80f0000	\               api-ms-win-crt-math-l1-1-0
ELF	    7f31b80f0000-    7f31b8305000	Deferred        api-ms-win-crt-runtime-l1-1-0
  \-PE	    7f31b8330000-    7f31b8619000	\               ucrtbase
ELF	    7f31b8619000-    7f31b882f000	Deferred        vcruntime140
  \-PE	    7f31b8620000-    7f31b882f000	\               vcruntime140
ELF	    7f31b882f000-    7f31b8abf000	Deferred        advapi32
  \-PE	    7f31b8840000-    7f31b8abf000	\               advapi32
ELF	    7f31b8abf000-    7f31b8e3a000	Deferred        gdi32
  \-PE	    7f31b8ad0000-    7f31b8e3a000	\               gdi32
ELF	    7f31b8e3a000-    7f31b9276000	Deferred        user32
  \-PE	    7f31b8e60000-    7f31b9276000	\               user32
ELF	    7f31b9276000-    7f31b9503000	Deferred        shlwapi
  \-PE	    7f31b9290000-    7f31b9503000	\               shlwapi
ELF	    7f31b9503000-    7f31b971d000	Deferred        version
  \-PE	    7f31b9510000-    7f31b971d000	\               version
PE	    7f31b971d000-    7f31b9931000	Deferred        api-ms-win-core-localization-l1-
PE	    7f31b9720000-    7f31b9931000	Deferred        api-ms-win-core-localization-l1-C:\windows\system32\api-ms-win-core-localization-l1-2-1.dll
ELF	    7f31b9931000-    7f31b9b44000	Deferred        api-ms-win-core-fibers-l1-1-1
  \-PE	    7f31b9e60000-    7f31ba099000	\               ws2_32
ELF	    7f31ba199000-    7f31ba3ab000	Deferred        libnss_files.so.2
ELF	    7f31ba3ab000-    7f31ba5c5000	Deferred        libnsl.so.1
ELF	    7f31ba5c5000-    7f31ba7d1000	Deferred        libnss_nis.so.2
ELF	    7f31ba7d1000-    7f31ba9db000	Deferred        libnss_compat.so.2
ELF	    7f31bb4aa000-    7f31bb6c2000	Deferred        libgcc_s.so.1
ELF	    7f31bb6c2000-    7f31bba60000	Deferred        libm.so.6
ELF	    7f31bba60000-    7f31bbc64000	Deferred        libdl.so.2
ELF	    7f31bbc64000-    7f31bc055000	Deferred        libc.so.6
ELF	    7f31bc055000-    7f31bc274000	Deferred        libpthread.so.0
ELF	    7f31bc619000-    7f31bc843000	Deferred        ld-linux-x86-64.so.2
Threads:
process  tid      prio (all id:s are in hex)
0000000c services.exe
	00000021    0
	0000000e    0
	0000000d    0
00000011 explorer.exe
	00000015    0
	00000012    0
0000001f winedevice.exe
	00000026    0
	00000023    0
	00000022    0
	00000020    0
0000002d main.exe
	0000002e    0
0000002f (D) Z:\home\ntoll\src\pyweek\main.exe
	00000030    0 
That's interesting... Have you had the same problem with any other pygame based games?

There's a line at the top of gfx/__init.py_f that sets the environment variable "PYGAME_BACKEND" to "directx" - I was under the impression that it wouldn't do anything on non-windows, but maybe that's the source of the problem.

If not, I'm afraid the Internet knows more than I do. Could try it on another system if you can.
All other PyGame based entries work fine for me. I'll try Google and mess around with the PYGAME_BACKEND envar.
OK... so commenting out the PYGAME_BACKEND setting makes it run for me (well, it start, I'm yet to play it). ;-)