Allegro.cc - Online Community

Allegro.cc Forums » The Depot » [SH15] Elders of Ethos

Credits go to bamccaig, Bruce Pascoe, devo_au, Edgar Reynaldo, Elias, GullRaDriel, Mark Oates, Peter Hull, and SiegeLord for helping out!
This thread is locked; no one can reply to it. rss feed Print
 1   2 
[SH15] Elders of Ethos
Mark Oates
Member #1,146
March 2001
avatar

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. 8-)

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

SiegeLord
Member #7,827
October 2006
avatar

I just did sed -i'' 's/arc4random/rand/g' *.cpp.

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

Elias
Member #358
May 2000

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...

--
"Either help out or stop whining" - Evert

SiegeLord
Member #7,827
October 2006
avatar

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.

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

bamccaig
Member #7,536
July 2006
avatar

SiegeLord said:

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. >:(

SiegeLord
Member #7,827
October 2006
avatar

Sounds like somebody needs to RTFM more often ;).

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

Mark Oates
Member #1,146
March 2001
avatar

#bamslam

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

bamccaig
Member #7,536
July 2006
avatar

Onewing
Member #6,152
August 2005
avatar

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. :)

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Bruce Pascoe
Member #15,931
April 2015
avatar

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.

Onewing
Member #6,152
August 2005
avatar

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. 8-)

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Bruce Perry
Member #270
April 2000

Interesting: the game responds to 'Delete' but not 'Backspace'. Allegro portability issue? (Will post more comments later when I've played it more.)

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

GullRaDriel
Member #3,861
September 2003
avatar

No, it's because delete and backspace are two different keys you have to deal with when building your keyboard management.

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

Bruce Perry
Member #270
April 2000

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.

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Elias
Member #358
May 2000

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 :)

--
"Either help out or stop whining" - Evert

Onewing
Member #6,152
August 2005
avatar

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"}609572

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. 8-)

------------
Solo-Games.org | My Tech Blog: The Digital Helm

Bruce Perry
Member #270
April 2000

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?

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

 1   2 


Go to: