{"name":"609511","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/0\/80e245fe9794e4f0fc7edda64c2084c3.png","w":799,"h":623,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/0\/80e245fe9794e4f0fc7edda64c2084c3"}
Windows Binary
Version 1.1 - speedhack entry (see thread for windows compatibility code modifications)
I'll try to put the binary (Mac app) up later. For now, time to put up the white flag and get a nap in before work.
EDIT:
=== Some Side Notes===
You can press the Up key to cycle through previously input commands
I did program the BACKSPACE function...for a Mac keyboard. In windows, this seems to map to the DELETE key.
There is a crash that I didn't solve in time if you press two arrow keys at the same time (or close to the same time). This is probably the root of other crashes as well.
If you are not getting particles in the background, that's concerning. The windows build I just uploaded has them fine.
To get the annoying sound, put all your spirits to guidance and proceed until ghosts fill up the game. They make the sound (and flash white as particles in the background)
If you get angels, you will start to see them appear as white spirit-particles in the background. This apparently is less frequent than I intended, so you might have to wait a bit.
I was going to have all the levels of The Hierarcy of Needs, but I didn't make it in time and cut out the planes I couldn't get to.
I was going to have other tribes that were doing the same thing as you and you could see their progress, as well as trade with them or potentially send spirits to slow them down if they were getting ahead of you.
My main objective was I wanted the user to feel out where to put spirits based on game feedback, but since I didn't get the rest in, this usually just takes a single play through to figure out. I've got some random events that can trigger at any moment to try to keep it somewhat exciting.
Well done Onewing !
Can't wait to have all SH binaries ^^
Edit:
Mac Only ?
Mac only
For now...yes. I have a PC at home too that I'll try to get a functioning windows build, but gonna have to spend family time tonight and got a big site launch tomorrow evening, so that will have to wait a bit.
I'll wait for your build then ^^
From the screenshot, looks like you put a lot of effort into the dialog.. Look forward to a windows version when you get around to it..
I too am waiting for a windows binary. I tried building it with CB and MinGW but it fails to compile with several warnings and an error about not being able to find the arc4random function. Also, how do you compile .m files? Are those Obj-C?
Yes, it's completely nonsensical but .m is an Objective-C file. No idea how that will ever be able to be ported, I thought Obj-C was an Apple-only thing.
Yeah, I haven't been coding very much past few years and when I do, I'm coding Objective-C for non-allegro projects in xcode. I've completely forgotten the make processes and how to do so.
Our site just launched, so I'm going to eat some dinner and play around with getting a windows build for you guys. Apologies for the delays!
Here's the full compile log for the *.cpp files at least :
Little progress, but I'm (obviously) going to have to get allegro 5 installed on a windows machine. My PC is not connected to the internet and is running Windows XP. I'll have better luck on my work machine which can dual boot to windows. Got to refresh up on makefiles, so that's good.
Fortunately, the only error I'm seeing from Edgar's post is regarding arc4random, which will just need the right include file most likely. The warnings don't look too concerning.
I tried compiling on clang but realized I needed to for solve Cocoa and ended up getting distracted on Facebook. #windowsbuild
FYI, the two .m files (ViewController.m and main.m) can be deleted and are not required for building. I deleted them (apparently, just the reference) from the project and never touched/saw them again, but accidentally blindly copied them into the source I uploaded.
So I've created a build. I had to make a few modifications.
I created a replacement for the arc4random() function, just using rand()
Added the *.wav files into the resources file (the game would crash without them).
Took out the unnecessary .m files.
Compiled with -std=gnu++11
Added #include "allegro5/allegro_primitives.h" and al_init_primitives_addon() in main.cpp. The game was crashing without the addon being initialized.
Had to go hunt down chintzy.ttf on the internet, and put it in the root folder. The font rendering appears different than in your screenshot, I'm not sure what the cause of this is. A result is that the fonts are quite a bit more difficult to read. It's possible that I grabbed an older version of chintzy.ttf that doesn't render as well.
{"name":"609560","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/e\/3e9951383b82d2eed478b3d5b645e0f1.png","w":838,"h":662,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/e\/3e9951383b82d2eed478b3d5b645e0f1"}
I did my make like this
CPP_FILES := $(wildcard *.cpp) OBJ_FILES := $(addprefix obj/,$(notdir $(CPP_FILES:.cpp=.o))) main.exe: $(OBJ_FILES) g++ -o $@ $^ -LE:/allegro-5.1.11-mingw-edgar/lib -lallegro_monolith-debug.dll obj/%.o: %.cpp g++ -std=gnu++11 -c -o $@ $< -IE:/allegro-5.1.11-mingw-edgar/include
I haven't played the game through, yet, but I'm assuming it will work to the end. Here's the binary (including the DLLs).
And here's the revised source and makefile I used:
Got it compiled, and after 1 false start, I managed to win it. That was pretty fun! By the way, you're missing the font (I had to substitute it with a different font without issue).
This is another game that could have used the backspace key .
It's possible that I grabbed an older version of chintzy.ttf that doesn't render as well.
Sure enough
I downloaded the chintzy.ttf font from another website and it was a newer verion. It renders much more nicely now.
{"name":"609561","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/4\/24642286653b61209b05da0a93ac2482.png","w":842,"h":662,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/4\/24642286653b61209b05da0a93ac2482"}
I've updated the downloads to include the new font.
Oates, your first download link gives a 404 not found error. The second source link works though.
I'll have to try this now. The screenshots look very 90s-retro (that's a good thing). Like a Wolfenstein 3D-era DOS game.
Oates, your first download link gives a 404 not found error. The second source link works though.
Yikes! Sorry about that. Fixed now. Here's that link again:
This is another game that could have used the backspace key .
Yes!
That aside it was a nice polished entry. A bit monotone but it's not crashing and the ambiance is cool :-)
Thanks Mark for the Windows build ;-)
Mark: On the subject of arc4random, I don't think your implementation is strictly correct
Reason (from cppreference)
Generally speaking, the pseudo-random number generator should only be seeded once, before any calls to rand(), and the start of the program. It should not be repeatedly seeded, or reseeded every time you wish to generate a new batch of pseudo-random numbers.
I think it actually doesn't matter here because the time between each of the user's entries is going to be random anyway.
Since we're in C++11, might as well use <random>:
#include <random> #include <stdint.h> static std::uniform_int_distribution<uint32_t> uni; static std::default_random_engine engine; uint32_t arc4random() { return uni(engine); }
Onewing: I've got a Linux makefile if you want.
Cheers,
Pete
Mark: On the subject of arc4random, I don't think your implementation is strictly correct
You are correct, it isn't. I wasn't in the business of creating the ideal PRNG, just make a random number generator and make it work. My implementation of arc4random() doesn't meet the specification of the original arc4random() (return uint32_t for example), but it does adequately meet the requirements of its use case in the game.
but it does adequately meet the requirements of its use case in the game.
Well, yes and no. On my Linux it makes the particles go all in a line - and maybe affects the gameplay too, I couldn't tell.
{"name":"609564","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/5\/258550c9e7f0d5b59382a8404ea08a63.jpg","w":1600,"h":1200,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/5\/258550c9e7f0d5b59382a8404ea08a63"}
Interesting.
Spent 20 minutes getting 10 from purity to the top. Had some weird shit going on with meditation requiring every follower to rest at one point before stabilising and moving them back to other disciplines. Good speedhack entry, well done.
Aha! I see the definition of arc4random you gave in your spoiler isn't the same as I found in your source zip file; with the addition of the if (!initialized) bit, yes, I agree, it should work perfectly fine!
Cheers,
pete
Aha! I see the definition of arc4random you gave in your spoiler isn't the same as I found in your source zip file
caught.
I just did sed -i'' 's/arc4random/rand/g' *.cpp.
I liked this entry, but it crashed several times (Using Mark's Windows binary). Also sometimes energy got depleted within a turn I think.
[edit:] And I didn't seen any particle effects at all...
Yeah, I had a few crashes too. I learned not to press any unnecessary buttons, and it worked ok. It's a bit mysterious how the energy and meditation levels work: running out of energy was how I lost the first time. My winning strategy was to ignore the calls to promote spirits and instead put as many spirits into guidance until I had 70-80'ish spirits, with about 50 in guidance. Then I promoted all the extra ghosts and had plenty of reserves to just dump into energy if it budged from the max.
This entry really gave me Master Of Orion vibes, where you had to fiddle with the planet's meters. Even though this is a simple entry, I really liked the atmosphere it gave.
I just did sed -i'' 's/arc4random/rand/g' *.cpp.
That shouldn't work. The shell should remove the '' following the -i and the s/// would be interpreted as a file name. You probably want -i -e instead.
Sounds like somebody needs to RTFM more often .
#bamslam
I'll concede that it appears to work, but I can't imagine how... Please enlighten me if you know.
Thanks, Mark Oates, for getting a build for everybody to play with.
I finally created the official binary based off your findings (updated OP with link). I made this compatible with Visual Studio 2012 using some of your findings + a few other things that Studio complained about.
I did all my work on a repo that I've opened up: Elders of Ethos Repo
I created a tag of the exact code snapshot that I submitted as well as a tag for the official Visual Studio 2012 compliant build. If you review all the commits to the windows_compatibility branch, you can see each step I took to get to that latter tag.
Please try out the new binary and let me know if I'm missing any dll's: Elders of Ethos - Version 1.1
=== And lastly, some side notes===
You can press the Up key to cycle through previously input commands
I did program the BACKSPACE function...for a Mac keyboard. In windows, this seems to map to the DELETE key.
There is a crash that I didn't solve in time if you press two arrow keys at the same time (or close to the same time). This is probably the root of other crashes as well.
If you are not getting particles in the background, that's concerning. The windows build I just uploaded has them fine.
To get the annoying sound, put all your spirits to guidance and proceed until ghosts fill up the game. They make the sound (and flash white as particles in the background)
If you get angels, you will start to see them appear as white spirit-particles in the background. This apparently is less frequent than I intended, so you might have to wait a bit.
I was going to have all the levels of The Hierarcy of Needs, but I didn't make it in time and cut out the planes I couldn't get to.
I was going to have other tribes that were doing the same thing as you and you could see their progress, as well as trade with them or potentially send spirits to slow them down if they were getting ahead of you.
My main objective was I wanted the user to feel out where to put spirits based on game feedback, but since I didn't get the rest in, this usually just takes a single play through to figure out. I've got some random events that can trigger at any moment to try to keep it somewhat exciting.
Re: Backspace: I looked at the code and your check for backspace is weird: You handle KEY_CHAR and test for e.keyboard.unichar == 127. What you should do instead is check if e.keyboard.keycode == ALLEGRO_KEY_BACKSPACE. That's a more reliable check and easier to read as well.
Trivia: ASCII 127 is actually the control code for Delete, Backspace is ASCII 8.
Thanks, Bruce. I was just printing out the codes to the console of what I typed and 127 is what came back (for a Mac wireless keyboard for where the backspace is). Had I made it over to Windows in time, it would've been a 5 minute "oh duh" moment.
Interesting: the game responds to 'Delete' but not 'Backspace'. Allegro portability issue? (Will post more comments later when I've played it more.)
No, it's because delete and backspace are two different keys you have to deal with when building your keyboard management.
Very well presented. Good work on that front!
I found the gameplay a little unforgiving the first time I played. It seemed as if my attempts to restore energy and whatever else was running out were too little, too late, and I didn't have enough people to recover. I restarted and did better the next time, and then it was a bit too easy. Once I had to do sequences of at least three instructions (at least one free, then promote and purity) over and over, it became a bit tedious. These seem like things that could be fixed if there is more time to spend on gameplay design, and what you've done is pretty good for a SpeedHack
No, it's because delete and backspace are two different keys you have to deal with when building your keyboard management.
I know that, but are you telling me you expect Onewing to have programmed Delete rather than Backspace and not noticed it was strange? It seems more likely to me that whatever works on the Mac behaves differently on the PC, which in my view is a bug in Allegro whereby the key codes aren't matched up correctly across the two platforms. Or that Mac users honestly expect to be pressing different keys, which seems less likely.
I agree, backspace should send ASCII 8. This is not technically a bug in Allegro as we make no guarantees about which unicode code any key produces. On a German keyboard ALLEGRO_KEY_Y might produce a "z". ALLEGRO_KEY_CLOSEBRACE simply may not exist at all on some keyboards (that was a problem in Mark's entry).
However, I think it would be good to have a small exception there and ensure that on all platforms:
- The Return key produces ASCII 13
- The Tab key produces ASCII 9
- The Backspace key produces ASCII 8
- The Escape key produces ASCII 27
- The Delete key produces ASCII 127
This will make it easier to at least have working text input across platforms and layouts
Perhaps this will shed some light. The keyboard does in fact say "delete", so it's not surprising that the key maps to that unicode. However, I don't look at what I'm typing and I just mechanically hit where my fingers are programmed to hit backspace. In the Mac app of the game, this works as intended and I never thought twice about it.
{"name":"609572","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/a\/ca925ff7e8750588c6ee7162e2507dab.jpg","w":640,"h":480,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/a\/ca925ff7e8750588c6ee7162e2507dab"}
and what you've done is pretty good for a SpeedHack
Thanks! First time I've actually finished a Speedhack entry. Pretty proud of what I accomplished in a limited weekend for my first allegro 5 project in a Mac environment.
Another interesting sidenote: I never could figure out how to get Ogg files to play, so I tried to find a wav file which are obviously expensive size-wise. I ended up finding a song and used a free tool to compress it down further. The free version of the tool cuts the song in half, but this happens to loop perfectly so it was acceptable. I'll take it.
Elias, I've always checked for key codes (not chars) when dealing with special keys like Enter and Backspace - might be worth having a similar guarantee for those too?
I wonder what the Mac currently does if you check for ALLEGRO_KEY_DELETE. Perhaps it should never generate that code, and if you want anything, you have to check for ALLEGRO_KEY_BACKSPACE? And/or ALLEGRO_KEY_DELETE could be deprecated and replaced with ALLEGRO_KEY_DELETE_PC or ALLEGRO_KEY_DELETE_TO_RIGHT?