Allegro.cc - Online Community

Allegro.cc Forums » The Depot » [TINS2016] Mr Perry's Farm

Credits go to amarillion, Chris Katko, Eric Johnson, GullRaDriel, kenmasters1976, and Peter Hull for helping out!
This thread is locked; no one can reply to it. rss feed Print
[TINS2016] Mr Perry's Farm
Bruce Perry
Member #270
April 2000

Mr Perry's Farm

Can you bring (your twisted idea of) order to the farm?

I may have been a little ambitious this time, and the result is a little unpolished. Still, it should raise a few smiles. If anyone less tired than me wants to have a go at designing some proper levels that involve thinking and planning, I'd love to see them.

I've found one post-competition bug so far. During play mode, although you can't see the machine construction UI, you can still pick things up from it and edit it. It won't break the game, it's just a bit annoying if you accidentally edit your machine (for next time) without being able to see what you did to it.

I'm aware that I haven't explained anywhere what everything does, but I think it should be possible, if not fun, to figure it out by trial and error.

Screenshots

Menu:

{"name":"610351","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/e\/8e18d8c26ef84c5ed15d50883fa3e8cc.png","w":1920,"h":1080,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/e\/8e18d8c26ef84c5ed15d50883fa3e8cc"}610351

Setup phase:

{"name":"610352","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/2\/0256c1386254ebbedb4f285c8076040c.png","w":1920,"h":1080,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/2\/0256c1386254ebbedb4f285c8076040c"}610352

'Go!' phase:

{"name":"610353","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/e\/7ee4a05f96661753c5db0d99adb3af66.png","w":1920,"h":1080,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/e\/7ee4a05f96661753c5db0d99adb3af66"}610353

Download

http://bdavis.strangesoft.net/MrPerrysFarm.zip

Includes an executable and the Allegro DLLs. The one on the TINS site excludes the DLLs since they made it too big.

TINS progress log

Just me: http://tins.amarillion.org/2016/log/4104/
Everyone: http://tins.amarillion.org/2016/log/

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

Eric Johnson
Member #14,841
January 2013
avatar

Of all the TINS 2016 games that have been posted here on the forum so far, this is the one I've played the most.

Right off the bat, I like the fonts and graphics, but the mouse detection is slightly inaccurate (might be because I'm running it from Wine), some of the text overflows offscreen to the right, and I dislike that there is no windowed mode. The lack of instructions is a bit jarring, but I figured most of it out after a while. The splatter graphic is pretty satisfying, and the poems after each level are witty and humorous. :D The level editor is a cool addition. I'm not sure what the last few objects are (like the blue and white circles). Is level 4 supposed to be shaped like a kanji character (kind of looks like 分)?

The inclusion of instructions would make the game a lot better, in my opinion. Once I figured it all out, I had a fun time. ;)

kenmasters1976
Member #8,794
July 2007

Looking forward to try your entry. I can't do it right now since I'm on Linux and can't run it on wine, gonna have to wait until I get to a Windows machine.

Bruce Perry
Member #270
April 2000

It's 弁/Ben from 弁当/bentou :)

The code supports a windowed mode, but there's no way to specify or change it without recompiling. As such, I've now updated the zip (same download link) to include a windowed executable in addition to the full-screen one. I haven't changed anything else (I left the post-competition bug in there). As I said, I had limited time for polish; sorry I didn't have time to put it in as a runtime control.

You're quite right about the weather items not being clear too. Those items cause rain, snow and sun, which cause the animals to speed up (to get out of the rain), slip around, and slow down (to enjoy the sun) respectively.

As for the mouse, I'm drawing everything to a 1920x1080 buffer and then letterboxing/pillarboxing that on to whatever screen (or window) space I have. That means I have to convert mouse events and mouse state back from actual screen (or window) space into buffer space. When it works properly, it will give you a loss of accuracy on the level of one or two pixels, but if you're seeing more than that, then it could be either a bug in my code (somewhere I forgot to do the conversion perhaps) or a symptom of Wine. My feeling is it's probably Wine and it might be specific to displays created with the ALLEGRO_FULLSCREEN_WINDOW flag. Perhaps you could test the windowed executable and see how you get on?

As for the text overflowing, well, I used to avoid TTF files at all costs for exactly that reason. Pixel fonts all the way! Most of the FunOrb games use pixel fonts, although it's possible some developers used TrueType fonts, rendered platform-specifically, especially in the later games.

More sensibly though, as TrueType fonts obviously have benefits - what would be nice is if FreeType and/or Allegro could do their own font rasterisation in a way that's consistent across platforms, or at least have an option to do so. I've just started a thread about that.

Thank you for the comments, and I'm glad you liked the bits you liked :)

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

Eric Johnson
Member #14,841
January 2013
avatar

I gave the windowed version a go, and it worked much better than before. There is no noticeable mouse inaccuracies, nor any text overflow issues this time. :D

Wine, although amazing, is quite buggy, so it comes to no surprise it poses issues with fullscreen (many games have fullscreen issues under Wine). I don't know if it'd be worth attempting to "fix", when using Wine is essentially a hack-ish pursuit.

Bruce Perry
Member #270
April 2000

Ah, so perhaps it's not text but the whole screen that went off the side :)

Thanks for testing :)

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

Eric Johnson
Member #14,841
January 2013
avatar

Well, not exactly the "whole" screen. The items are all in view, but the level text and the main menu text (and occasionally the poem text) bleeds out of view. I've attached two pictures for reference. If the whole screen were to be out of frame, the items would be clipped as well, right?

Bruce Perry
Member #270
April 2000

The items are meant to have numbers to their right :)

I can confirm that the image that's meant to fill the screen is shunted right by the width of your taskbar, resulting in the stuff on the right being cut off. Additionally, the system status bar at the top covers some stuff at the top. What this boils down to is that Allegro thinks it has the whole screen at its disposal, and is reporting the display size accordingly, but it doesn't.

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

Eric Johnson
Member #14,841
January 2013
avatar

Ah, sure enough, you're right. I removed the side bar and now I can see it all in the fullscreen window mode. I've attached an image as reference.

Bruce Perry
Member #270
April 2000

Interesting - you've now got top and bottom clipping, instead of just top as before. But you can indeed see everything you need to see to play.

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

Eric Johnson
Member #14,841
January 2013
avatar

I'd like to compile it from source to build a Linux binary for testing, but I see it's written in D... and I don't know anything about compiling for D. :-[

Peter Hull
Member #1,136
March 2001

... and I don't know anything about compiling for D.

I'm struggling too.
On Ubuntu, I installed package ldc then downloaded the latest allegro and SiegeLord's DAllegro from GitHub. I could build the DAllegro lib and example program.
I then invented a Makefile for Bruce's code, basically just passing all the sources to ldc2. I then got a load of linker errors.
Eventually I found I had to add a load of `pragma(lib, ...)` clauses into Game.d for all the allegro libraries (liballegro.so et al) and libdallegro5.so.
But I think I must be doing something wrong - shouldn't the compiler be picking up the pragma-libs from inside the DAllegro library - and why do I need to include the library and the source code for DAllegro in the compilation line? ldc2's docs don't seem to be very illuminating.

[edit] OK, what I did does work but still don't know why it seems to ignore the pragmas.

Chris Katko
Member #1,881
January 2002
avatar

Hmm, this is interesting. I'll have to try it when I get a chance.

But my experience with D was super easy. Just apt-get either LDC or GDC (based on GCC), git clone DAlleg.

OH! And make sure, for the love of God, you've got the exact same version of Allegro as you do DAlleg. It'll segfault if it detects the slightest version number mismatch.

[edit]

Ah... Visual-D... interesting...

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

GullRaDriel
Member #3,861
September 2003
avatar

I tested and it ran fine.

I played a little and ending doing evil things with tons of animals and explosives. Damn you, Chris Bruce !!

{"name":"610369","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/f\/cfdeb8199d924f57a0143ddd5d9a4df2.png","w":960,"h":540,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/f\/cfdeb8199d924f57a0143ddd5d9a4df2"}610369

Edit: I damn you both !!!

"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

How is that Chris's fault? :)

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

Killing so much poor little electronic beings made my eyes fuzzy. I blamed the first name I saw when coming back to post my report ;-)

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

Chris Katko
Member #1,881
January 2002
avatar

It's okay. :/ I'm used to being associated with mass destruction...

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

amarillion
Member #940
January 2001
avatar

I'm still having a hard time figuring this one out. I see animals moving, they go towards food and then reproduce when they reach it. The machine is moving around and can cause snow and rain, and explosions.

But what is the goal of the game?

Bruce Perry
Member #270
April 2000

Although I didn't have time to program any win conditions in, the goal is to maximise the number of animals blown up (including offspring) :)

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

Chris Katko
Member #1,881
January 2002
avatar

I couldn't figure out the controls, or it was glitched somehow in Wine. The mouse worked, I could click start game / quit. But I couldn't click on anything anywhere, and no keyboard presses seemed to affect anything.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Bruce Perry
Member #270
April 2000

You should be able to click on the tiles in the top right. Any luck there?

The very top right ones can be attached to the machine. The ones to the left (the animals and food) can be placed in the map. The machine itself also needs placing in the map.

[EDIT]
Credited people \ó/

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

MiquelFire
Member #3,110
January 2003
avatar

Man, I wish I had more time to play around with this game more.

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red
If anyone is of the opinion that there is no systemic racism in America, they're either blind, stupid, or racist too. ~Edgar Reynaldo

Go to: