Allegro.cc - Online Community

Allegro.cc Forums » The Depot » [KrampusHack 2019] Let's Build a Snowman

This thread is locked; no one can reply to it. rss feed Print
[KrampusHack 2019] Let's Build a Snowman
relpatseht
Member #5,034
September 2004
avatar

Let's Build a Snowman was made for GullRaDriel (who seems to have disappeared? Happy holidays regardless!) with the following wishlist:

GullRaDriel said:

I want a game that my 3 yo toddler can understand and play with me / along with me.

Anything is allowed, regarding it's targeting a lil' 3 yo child, who will play together/under supervision of/ his parents, etc.

{"name":"612269","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/4\/44af132d1d5f9b27533e12d22a35be26.jpg","w":1026,"h":802,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/4\/44af132d1d5f9b27533e12d22a35be26"}612269

I've attached a zip with the windows binaries, but wasn't considering linux during the competition, so not sure how easy that build would be (I think just build system work, but not sure off hand).

My interpretation of the wishlist was a co-op game. I'd expect the toddler to control the green guy and just gather snowflakes. I tried to make this fun by not having perfect dampening or mouse following, so you sort of fly all over the place. As snowflakes are gathered, a snowman is built.
The red guy's (adult, I guess) job is a bit more complicated. He has to fend off fireballs (which melt the snowman) by throwing snowballs. It's a lot more fun with a joystick than a keyboard. I designed it with an xbox 360 controller in mind (since those are rather ubiquitous on windows). There's also a resource management component here, since every snowball you throw subtracts from the snowman. Of course, if you want to have a bit more fun with it, you can use the snowballs as a jetpack of sorts, but that may chew through your resources.
You win the game when the snowman is finished, which you're trying to do as fast as possible.

I forgot to include acknowledgements for the assets, and forgot where I got them from exactly... The sound effects I pulled from freesound.org, the fonts from dafont.com, and the theme is (obviously) a slightly modified pull from Cannibal! The Musical. I also based a number of my shaders off stuff I pulled from shader toy, but those acknowledgements are generally listed in the source.

The source for the game is on github. External libraries include allegro (:-p), box2d, imgui, glm, team Mercury's great SDF library, and the glslang compiler, so I wasn't working entirely from scratch.

Mostly, this compo was a good excuse for me to mess around with SDFs, ray marching, and PBR lighting, which was a blast. I think it looks pretty decent to. Effects could use some work, and I should have added more lights, but, eh...

Known issues:

  • Sometimes, when you win, you don't get a face.

  • If you play without vsync, or on a monitor with >60Hz refresh rate, the game is broken (never bothered to control gameplay by proper timer).

Happy hacking!

SiegeLord
Member #7,827
October 2006
avatar

I thought this was a really clever co-op gameplay idea! I really enjoyed how one player's task is significantly easier than the other, and yet very important. It's doable, somewhat inefficiently by one person, so I could beat it by myself and I really enjoyed the process. Everything looks and sounds great. The only issue I hit is that I for some reason couldn't fire snowballs to the top-left.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

GullRaDriel
Member #3,861
September 2003
avatar

I'm here I'm here !! I was more busy with the saw than the keyboard :-)

Thanks for the present, I'll try it tonight !

Edit: It does not start.

(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) [answered Y; input not from terminal]
Starting program: C:\Users\gullr\Desktop\LetsBuildASnowman\LBM.exe
[New Thread 9484.0x1f58]
[New Thread 9484.0x2094]
[New Thread 9484.0x1f50]
warning: onecore\com\combase\objact\objact.cxx(834)\combase.dll!00007FF9AC038CC7: (caller: 00007FF9AC038046) ReturnHr(1) tid(7e8) 800401F0 CoInitialize n▒a pas ▒t▒ appel▒.
[New Thread 9484.0x2898]
[New Thread 9484.0x25bc]
[New Thread 9484.0x2610]
[New Thread 9484.0x9b8]
[New Thread 9484.0x27bc]
[New Thread 9484.0x2510]
[New Thread 9484.0x578]

Thread 1 received signal SIGTRAP, Trace/breakpoint trap.
0x00007ff7ad428a6f in ?? ()
(gdb) bt
#0 0x00007ff7ad428a6f in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)

Will try to compile it and see.

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

amarillion
Member #940
January 2001
avatar

Right now I can only report that the Windows binary doesn't work for me - a Window opens and immediately closes. Running from the CLI / GDB doesn't reveal any error message.

I'll try to find some time to investigate further.

relpatseht
Member #5,034
September 2004
avatar

Possibly needs the vc 2019 redistributable.

GullRaDriel
Member #3,861
September 2003
avatar

Hell. Still not working, I have a black windows appearing and then it's just stopping without a hint.

I'll try to dig tomorrow and 'make it works' (tm) as I really want to try it with my son ;-p

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

relpatseht
Member #5,034
September 2004
avatar

That's no good. I threw together a binary (attached) which should be more forthcoming with details.

amarillion
Member #940
January 2001
avatar

All right, I put a bit more time into troubleshooting. Here are my findings.

  • My PC doesn't want to install that VC redistributable - it gets stuck at "Initializing" (Edit: I managed to install it now, but it doesn't help)


  • The problem doesn't seem to be related to missing DLLs. When I run objdump to check for dependencies, the output is like this:

objdump.exe -p KH19.exe | grep 'DLL Name:'
        DLL Name: OPENGL32.dll
        DLL Name: IMM32.dll
        DLL Name: DSOUND.dll
        DLL Name: SHLWAPI.dll
        DLL Name: WINMM.dll
        DLL Name: KERNEL32.dll
        DLL Name: USER32.dll
        DLL Name: GDI32.dll
        DLL Name: SHELL32.dll
        DLL Name: ole32.dll

I believe these are all common system dependencies that should be there.

Finally, the attached binary (KH19.exe) does provide a little more info when I run it. It reports:

Failed to create display.

relpatseht
Member #5,034
September 2004
avatar

Probably graphics drivers need to be updated. It requires OpenGL 4.6.

Go to: