Trick Or Sweets (Halloween Compo entry)

Started by Derron, November 01, 2017, 20:47:49

Previous topic - Next topic

Derron



Trick or Sweets

What is it about? Place Sweets from "grannys/grampas" house to the bags of the upcoming waves of children.
Make sure to keep children satisfied - if you do not give them sweets fast enough they get impatient (reducing time for this level).



What's in?
- basic profile support (storing current level, scores, coins, ...)
- basic configuration support (check config/settings.xml to enable fullscreen or reduce resolution. Native is 1920x1080)
- sound loops - short loops are chained into longer ones and then crossfaded with other loops (sounds strange ;-)
- random level generators + scripted ones
- Limits for productions (max 3 per item-stack)



What's not in?
- Tech upgrades: Production speed upgrades, bonus items to keep children "patient" (gummy bears ...), Production limit increase, ...
- Coins (for tech upgrades)
- Boss fights (Children accepting sweets only "ordered" and hiding everything but the top most needed sweet)
- Item bonus/malus: some sweets should gain score multipliers, speed up production time for X seconds ...
- GUI-selectable profiles (had not enough time to add the modal window properly - while the code is there already, thanks to my framework)
- better GUI graphics (have some stuff in mind but time was running out)


Tech Notes:
- graphics done with Blender + HUD-Elements/Overlays with Photoshop CS1
- written using my DIG-framework (https://github.com/GWRon/Dig)
- sounds edited by me and original sources are noted in res/sfx/sources.txt
- gradient/shadowed fonts are done dynamically (via hooking in custom functions to the Freetype-To-BitmapFont-Loading function)
- partially uses Col's Render2Texture code (wanted to try it) - for now the score-entities and the "items on the bag"-graphics use that to minimize draw calls.


What I have learned from it:
- improve Blender knowledge (especially materials with Cycles - and texture painting with my new digitizer/pen)
- some casual "gameplay ideas" (I am not that experienced when it comes to casual games)
- creating a 3d-ish Text-Logo-effect isn't that hard ;-)


Time consumed: (until Halloween-deadline)
- think >10 evenings for modelling the complete stuff. Means >50hrs (including render time)
- ~5 evenings and a long weekend's sparetime (time after lunch when son was asleep) to code the stuff (including nasty debugging when missing a "bla = 0" dev variable somewhere). so I would say ~30-35 hours. But framework code was surely in the hundreds of saved hours



Title Screen:


introduction / helper for unknown new items:


Ingame:



Here is a gameplay video of v0.1:



Download v0.1: http://www.gamezworld.de/files/TrickOrSweets_v0.1_fixed.7z
(Linux 32 bit and Windows 32 bit executables included).
this is the halloween-state without further fixes or enhancements

Download v0.1.1: http://www.gamezworld.de/files/TrickOrSweets_v0.1.1.7z
(Linux 32 bit, Windows 32 bit and MacOS 32 bit executables included)
v.0.1.1 created _after_ deadline but only contains some "throw"-lines to narrow down potential errors and an improved viewport-adjustment as letterbox might introduce render2texture issues)

Download v0.1.2: http://www.gamezworld.de/files/TrickOrSweets_v0.1.3.7z
(Linux 32 bit, Windows 32 bit and MacOS 32 bit executables included)
Contains some adjustments for people with lower screen resolutions like auto-center on windows, gui buttons for half-hd/hd-window-mode and a low-res default screensize

Download v0.1.3: http://www.gamezworld.de/files/TrickOrSweets_v0.1.3.7z
(Linux 32 bit, Windows 32 bit - no mac binary, trashed my build slave :-/)

Download v0.1.4: http://www.gamezworld.de/files/TrickOrSweets_v0.1.4.7z
(Linux 32 bit, Windows 32 bit - no mac binary)
Contains fixes for the bugs reported by user Rooster + "bag auto-upgrades the more sweets got produced" + other fixes and 2 new levels

bye
Ron


Derron

I want to use this thread to read about your ideas on how to continue with this project.

There is plenty to do - like a techtree. Techtrees allow to convert this casual-gameplay into a bit more strategic gameplay. Do I improve "blue lollipops production speed" to avoid impatient children or I better invest in a bigger storage for power ups to keep all children calm for a very short time. What about "slow down"-power ups (decreasing game time progress and allowing for longer "think about it"-reaction-times).


What effects could sweets have (talking about score multipliers, finishing production times of other sweets when dropped in a bag, increasing impatient-factor because of containing coffeine ...).


Another thing is ideas for boss fights. First boss fight I could imagine is against a boss only revealing one accepted sweet at a time, so you cannot choose like with normal sweet bags. This might need some techtree upgrades to make it possible within the given level time. With a "play finished levels again"-selector one could play previous games until he won enough coins to pay  techtree upgrades.

Personal reminder for myself: this needs teechtree item/upgrades to have "minimum finished level" requirements to avoid playing level 1 until every techtree upgrade is bought.


bye
Ron

Rooster

#3
Okay, just tried v0.1.2.

I'm seeing some kind of graphics bug now.
Images of candies that aren't that the children's want list are being overlayed on the bags and the level text, along with images from outside of the program.
The candies seem to be the only things from in the program that are getting overlayed.
Also the images seem to be only from programs what I have running, and for my web browser its dependent on which tab I have open.




In this one, you can see stuff from a Youtube video I had on my web browser.


Again from the Youtube video, but on the title text


PS. Thank you for making a Linux version.  :)
Also for the Techtree you could do "intimidating decorations" and have the effect be a chance for the children to ask for less candy.

Derron

#4
less candy... ok that is something "useful".

@ graphics bug
The only areas using "render to texture" are "candies drawn the bags" and "level/score-texts". Were those errors apparent in v0.1 or v0.1.1 too? I adjusted some things in 0.1.2 to take care of letter-box-resolutions (wider or taller than the ratio of "x * fullHD").

If it was that way in all versions then I think it has to do with some "garbage" being left on the newly created textures. With "CreateImage()" in BlitzMax you also needed to clear all pixels to avoid "garbage".




@ linux
Running mint 17.3 xfce on my computer - so Linux should be "top priority" (except for non-pulse-audio Distros like Knoppix).



bye
Ron

Rooster

In v0.1.1 There is a little bit of a line on the bags, and sometimes the text.
But nothing like v0.1.2.

Derron

#6
As long as there are "garbage lines" in, I think it is the same error - just with varying strength.


Will ask Col whether he knows something about this.


Edit: Could you check what happens if you use "full window" in the start menu? In all screens you have "letterboxes" (left/right or bottom/top) so this might cause issues then too (virtual resolution handling by me - and render2texture by col - are not friendly to each other).



bye
Ron

Derron

#7
Meanwhile here is v0.1.3

I added some calls to SetVirtualResolution - which might interfer into some matrixstuff. Also I added a simple indicator when a child will get impatient. Each time it gets impatient without getting a sweet it removes some more seconds from the timer. Children will move in with individual speed and offsets - maybe it looks more uhm "natural". Also Time between "Level finished" and "next level" was decreased (game waits until every children reached its offscreen target spot - which I now made less far away ;-)). I also adjusted some level times. Ah and you get coins for finishing levels (10 seconds under par = 1 coin, each level gives extra coins). For now coins are useless, but hey, little baby-steps.


Some minor bugs were removed (alignment of the stacks in the top hud-element were a bit odd for 4th+ slots).
Hope we get rid of that nasty rtt-issue on your computer.


Download: https://www.gamezworld.de/files/TrickOrSweets_v0.1.3.7z
(win32 and linux32 only this time ... I accidentally trashed my mac-build-slave).




bye
Ron

Rooster

Sorry for taking so long to get back to you.

In v.01.3  I'm still having the same problem.
On full window, I can't see the bags but I couldn't reproduce the issue with the level text (for both v0.1.2 & v0.1.3), so may be it has something to do with the proportions I'm setting in the config file?
I also closed all other windows in one test, but stuff still showed up from them (don't know if that has any relevance.).

Also on level 10, only two candy slots are open, but the second wave will have different candy requirements, but not change the candy you make.

Derron

The bag-slots-bug: will have a look this afternoon.




@ proportions:
Did you try to click "small window" and "big window" in the start screen? It should use full hd or half-full-hd (so correct proportions).


Idea is to avoid the black bars on the left/right or top/bottom - if they are not there but the bug still apparent, then it is not the virtualresolution/offsets/orgin/... causing the problem.


so width/height should equal 1920x1080 - or 960x540 or ...




bye
Ron

Derron

#10
Ok, so I did not read your last reply properly (dream dust in the eyes):
So when doing a full-screen/"full window" then the level text does not have the problems - but the window is bigger than your screen and so the bags are "truncated" or even "not on screen" ?


Means in "small window" it should have no issues too. Then Just find out the biggest possible width for you - and calculate the correct height. I could try to do that too (desktopwidth) but that wont work on multiscreen setups like mine.


bye
Ron

Derron

#11
Thanks for your bug report - fixed that issue by unifying the creation of "receivers" (the children) in waves, subwaves and flexible-slot-refillers (they choose the first free slot to come up). I also added a up to 50% productions-duration-reduction: the more you produce, the faster the refill of the top-slots happens.
Also you start with at least 1 in each slot (nice hm? ;D ). Until boss fights and techtree are added I think it is not needed to add more levels yet (I would prefer that some levels _need_ certain upgrades to be winnable). Ahh and level-selector would be nice.


Still tinkering about the garbage-texture-issue. As said: The areas using render2texture are "text entities" (Level-Text + animated score-thingies) and the graphics drawn _on_ the bags (not the bags itself but the sweets + some ovals drawn behind). So there should be no other areas in the game containing these graphic issues.   
So for now it might still bug on your computer - at least (I assume so) when there is letter-boxing happening.


PS: a big thanks for your endurance testing this thing out. Hope it is not that annoying yet.


Download v0.1.4: http://www.gamezworld.de/files/TrickOrSweets_v0.1.4.7z
(Linux 32 bit, Windows 32 bit - no mac binary)
Contains fixes for the bugs reported by user Rooster + "bag auto-upgrades the more sweets got produced" + other fixes and 2 new levels


bye
Ron

Rooster

#12
Just finished testing v0.1.4.

I tried setting the resolution to 960x540 like you suggested, and using that I have not been able to reproduce the bug for the bags and level text. :D
I've tested this in v0.1.1 - v0.1.4 (I haven't tried v0.1), and this work in all of them.

The only other thing I'm seeing is black boxes over the numbers for when you give a child candy.
This only seems to affect "100".
And again it happens in v0.1.1 - v0.1.4


Quote from: Derron on November 03, 2017, 14:14:26
PS: a big thanks for your endurance testing this thing out. Hope it is not that annoying yet.
Don't worry, I was worried that I was harassing you here with all this. :)

Derron

That "100"-image thing looks pretty odd - as if it was torn apart. (the second zero seems like a "( )" instead of a "0").


Anyways this seems to narrow down the original bug to be something with the virtual resolution / setOrigin / SetScale / SetViewport etc. It's a pity that I cannot reproduce it here on my computer.


I might create a simple sample, utilizing Col's Render2Texture and the code I am using for virtual resolution stuff (basically done by BlitzPlotter years ago - and fixed here and there by me). If that sample was then showing similar problems than the game, we knew that the bug is hidden there. I could even hand you the code without trouble then (if you used BlitzMax) and you could more easily check things out (compared to providing new binaries everytime).






bye
Ron

Rooster

BlitzMax is what I use, so feel free to send me test code. :)