Trick Or Sweets (Halloween Compo entry)

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

Previous topic - Next topic

Derron

#15
@ Rooster
Copy this new binary in the game (same version number, so just check if file date is of today ;-)):
https://www.gamezworld.de/files/TrickOrSweets_Linux32.7z


It contains the latest "Render2Texture"-code by our beloved Col - maybe the done adjustments already fix stuff. To check it out you have of course to add letter boxes - means you add 100 pixel to width or height in the settings file.


----


Ideas for boss fights and story mode:
What about some kind of competition: "elementary school VS grandma" - each year send the best and hungriest pupils out to notorious grandma. Each X levels the "bully of the class level" will come to "fight" granny and her man.


Boss fight could be: you need to "satisfy" the buddies first until a shield of the bully is removed allowing you to give him sweets (for whatever reason ...).


Boss fight could be: Boss has a "bag with a hole", so each X seconds he refills his required sweets - so if you are too slow, you never pewn him.


bye
Ron

markcwm

#16
Hi,

in response to PM. I have win7 home premium 64-bit, intel integrated graphics, opengl 2.0 (this may be the problem).

QuoteSo what version did you try when it MAVd on windows? There was a version which I fixed _before_ deadline - and this should not MAV (somehow I missed to pack in an image which was not used in my tests - as my "profile" already was on a higher game level).
So did it EAV with 1.1fixed and later too?
I tried all versions 1.1,1.fixed,1.3,1.4 and they all EAV at the same point "game.AnnounceLevel" in the debug window. The game always starts at level 7 (is this a bug too?) and EAVs as soon as it starts, if I start a new game it EAV's after I click the 2nd scroll with the lollipops, basically when the game is loaded/displayed.

I tried with fullscreen but it doesn't go fullscreen, the window gets a bit bigger and is positioned top left outside the screen so I can't click on the titlebar. I'm not sure about 2d but in 3d with Blitzmax, Win/Mac can do 'real' fullscreen but Linux crashes often, so I create a window of desktopwidth/height and it looks fullscreen, it's also fastest at this resolution.

Also, I think most Linux users are using 64-bit now, see this poll. In Blitzmax you can build both 32 and 64-bit in Win/Mac but not Linux, you can't really build 32-bit in 64-bit Linux there are problems, like MaxGUI doesn't work at all, so you need separate installs for 32-bit and 64-bit.

QuoteBecause you mention "looks ok" I think you have some complaints about it (I assume it looks to "clean/static")) and I would like to read your thoughts on this in the TrickOrSweets-Thread - every feedback (especially the "bad things") is important for me to see if I really should continue developing it.
Well, that was just a general impression of the fun rating of the game, the graphics are fine the only issue I have is the gameplay where you have to drag and drop the sweets, this put me off, I'd rather click and select a type (and enlarge or color the box) then click on a bag, maybe it's okay with a mouse but not on a trackpad.

Derron

@ Control / GameplayI created it with "touchscreens" in mind, so "swiping" them from source to target. Any Ideas on how you would like to control them (click top then click target bag?). I asked my wife too, what she - as casual player - would prefer. And they prefered the "click and drag" way it is now.


@ MAV
Regarding the MAV: I assume your gpu is not capable of doing the render2texture stuff then?
Did you try (on windows) the two .bat-files (so DirectX9 or OpenGL) ?


@ Level 7
Hit the button "new Profile" and you _should_ start at level 1 again. It happens if I out of the sudden forget to delete the profile from the download archive ;-) (config/profiles/filenamesXYZ.xml).


@ Fullscreen
Fullscreen is not availeble via "GUI". For this you need to open up config/settings.xml and make it <fullscreen value="1" />.


@ 64 bit
I know, my other game (TVTower) is compiled with Brucey's BlitzMax NG for 64 bit Linuxes already. This is not available here as I wanted to try out Col's Render2Texture code - and for now it is not compatible with NG (it asserts a nice message about a missing implementation for NG ;-)). So if I replaced the 2 occourences of r2t in the code with software rendering, it would work with NG - and potentially also on your computer. Also it would then work on Android too - as my Dig-Framework (and the bigger samples in it) were test cases for the Android target of NG.


Thanks for your detailled feedback - especially the "control/handling/gameplay"-feedback is what is the most interesting - my personal opinion about best handling isn't the best in all cases ;-)


Regarding the "r2t"-issue I must convince Col to add a fallback doing a pixel-wise "render to texture" compared to the FBO-one (which might be the failing thing for you). As long as one does not need it "realtime" it would allow for convenient drawing (DrawOval instead of running your own algorithms for filled ovals when it comes to software-rendering :-)).


bye
Ron

markcwm

Hi,

yes I got it working with the DX9 batch file and I edited settings.xml to get full windowed, it's just OpenGL 2.0 it EAVs on (AGK2 also EAVs on my PC but that error is about GL shaders). GL 2.0 is not really worth the trouble anyway (considering how few people will have it).

The simplest way I know to fix it is to use "GL_VERSION_2_1" which determines if 2.1 or above else it's 2.0 or below, but you could also use "glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)" if you're creating an FBO and if it's not "GL_FRAMEBUFFER_COMPLETE_EXT" then use software rendering.

Actually, it was playing it on the Macbook with the trackpad that is also a button if you know those ones, it's a little awkward, but if you intend on touchscreens then the drag is probably more fun. On a normal trackpad the drag is okay, I just personally don't like doing too much drag n drop. My idea was like you say, one click on top (and show it's selected somehow) then one click on bag. Also I found the time limit too tight, I only got to the 5th level (the one with the pink ones) and I ran out of time.

Derron

@ DX 9
Ok, glad you got it working ("that way") ;-)


@ GL_FRAMEBUFFER***
Thanks for the hints - although I am sure Col knew this before I will try to keep that in mind if I ever have to do the "non-fbo-GL-thing" (as said my VirtualBox also does not emulate FBOs and so the game crashes there...good test bed :-)).


@ Trackpad
Hmm, I think I could do do a nother input mode - because that "Tap here then tap there" was what I thought of doing thirst - until my wife told me suggested to use the other one. I think once I created the "settings-window" I could have a "use tap-mode" checkbox. For touch screens this is also less strain on the fingers (I think so at least).


@ Balancing
Yeah, I did the levels in just a short period of time. I then started the levels and checked if I was able to finish them in <50% of the time (because I know how it works and am a bit more experienced I should be fast enough in the "introduction levels").


Hmm, I think a "Level cleared"-board with some "bonus time: xxx" entries should be added too - and eg. combos when adding the same fruit multiple times in the row  - or adding 5 different in a row ... and so on.


Seems I already got plenty of stuff to do. Best thing is to add the settings menu so people could more easily adjust resolutions and enjoy a "tap tap" instead of "drag n drop" game.




bye
Ron

Rooster

Finished testing the new binary.

The issue with the numbers seems to be fixed.
I'm still seeing stuff on the bags\text when the resolution is out of proportion.

Derron

#21
Hmm, both use the same approach so why does one seem to be fixed and the other is still failing?
I think it a random "works" rather than a properly solution ... or the bug consists of multiple problems and one is solved now.

The example_1 in Cols code works for you?
https://github.com/davecamp/Render2Texture

Once you downloaded it, save this in the same folder and name it example_6.bmx (or whatever ;-):
Code (BlitzMax) Select

SuperStrict
Framework Brl.GLMax2D
Import Brl.Retro
Import "renderimage.bmx"

'=== NOTE ===
' Ignore the wrong aspect ratio for the rendered things! We want
' to keep the code small ;-)


'=== INIT ===
SetGraphicsDriver GLMax2DDriver()
Global gc:TGraphics = Graphics(800, 600,0)
Global designWidth:int = 1200
Global designHeight:int = 900
Global virtualGraphicsMode:int = 2
Global lastTime:int = Millisecs()


'=== RENDER RANDOM IMAGE ===
Global image1:Timage = GenerateRandomImage()
Global image2:Timage = GenerateRandomImage()
Global bg:Timage = GenerateCheckerboard(designWidth, designHeight)


'=== LOOP ===
SetClsColor 40, 80, 160
Cls
SetupVirtualGraphics()
While Not KeyDown(KEY_ESCAPE)
'fetch current offset
local originX:float, originY:float; GetOrigin(originX, originY)

If MouseHit(1) or lastTime + 1500 < Millisecs()
image1 = GenerateRandomImage()
image2 = GenerateRandomImage()
lastTime = Millisecs()
EndIf
if KeyHit(KEY_SPACE)
ResetVirtualGraphics()
Cls
virtualGraphicsMode = (virtualGraphicsMode+1) mod 3
SetupVirtualGraphics()
endif
Cls
SetColor 255,255,255
DrawImage(bg,0,0)

DrawImage(image1, VirtualMouseX() - originX , VirtualMouseY() - originY)
DrawImage(image2, VirtualMouseX() - originX - 311 - 1, VirtualMouseY() - originY)

SetScale 2.0, 2.0
DrawText("GraphicsDriver=" + GetGraphicsDriver().ToString(), 0, 30)
DrawText("virtual resolution: " + int(VirtualResolutionWidth()) +" x " + int(VirtualResolutionHeight()), 0, 60)
DrawText("origin: " + int(originX) +" x " + int(originY), 0, 90)
DrawText("mode: " + virtualGraphicsMode, 0, 120)
SetColor 255,0,0
SetScale 3, 3
DrawText("Hit SPACE to change modes", 110, 560)
SetColor 255,255,255
SetScale 1.0, 1.0

'mark original resolution
DrawRect(0,0,20,20)
DrawRect(0,580,20,20)
DrawRect(780,0,20,20)
DrawRect(780,580,20,20)

'mark stretched one


Flip
Wend
End



'=== HELPERS ===

Function GenerateRandomImage:TImage(width:int=300, height:int=150)
'unset offsets, origins ...
ResetVirtualGraphics()

local rt:TRenderImage = CreateRenderImage(gc, width, height)
SetRenderImage(rt)
'in comparison to example_1 we do NOT cls!
'so the background should be transparent!
'Cls

For Local i :Int = 0 To 100
SetColor Rand(0,255), Rand(0,255), Rand(0,255)
DrawText("Hey", Rand(0, rt.width-50), Rand(0, rt.height-20))
Next

'draw an outline
SetColor 255,255,255
DrawRect(0,0,width,1)
DrawRect(0,height-1,width,1)
DrawRect(0,0,1,height)
DrawRect(width-1,0,1,height)
SetRenderImage(null)

'set back offsets, origin, virtual resolution...
SetupVirtualGraphics()

return rt
End Function


Function GenerateCheckerboard:TImage(width:int, height:int)
local img:TImage = CreateImage(width, height)
'create a checkerboard
Local pix:TPixmap = LockImage(img)
Local cols:Int[] = [(Int(255 * $1000000) + Int(150 * $10000) + Int(150 * $100) + Int(150)), ..
  (Int(255 * $1000000) + Int(200 * $10000) + Int(200 * $100) + Int(200))]
Local corner:int = Int(255 * $1000000) + Int(255 * $10000) + Int(0 * $100) + Int(0)
For Local x:Int = 0 Until width
For Local y:Int = 0 Until height
if x=0 or x=width-1 or y=0 or y=height-1
WritePixel(pix, x,y, corner)
else
WritePixel(pix, x,y, cols[ ((Floor(x / 80) Mod 2 = 0) + (Floor(y / 80) Mod 2 = 0)) Mod 2 ])
endif
Next
Next
return img
End Function


Function SetupVirtualGraphics(mode:int = -1)
if mode = -1 then mode = virtualGraphicsMode

Select mode
case 0
'same aspect ratio - no bars
SetVirtualResolution(designWidth, designHeight)
SetViewport( 0, 0, designWidth, designHeight )
SetOrigin(0,0)

case 1
'different ratio, no offset (letterbox)
SetVirtualResolution(designWidth, designHeight+160)
SetViewport( 0, 0, designWidth, designHeight+160 )
SetOrigin(0,0)

case 2
'different ratio, offset (letterbox)
SetVirtualResolution(designWidth, designHeight+160)
SetViewport( 0, 80, designWidth, designHeight )
SetOrigin(0,80)
End Select
End Function


Function ResetVirtualGraphics()
SetVirtualResolution( GraphicsWidth(), GraphicsHeight() )
SetViewport( 0, 0, GraphicsWidth(), GraphicsHeight())
SetOrigin( 0, 0 )
End Function



This should do similar things as my game does. Press "SPACE" to adjust some virtual screen things. Ignore stretching issues.


bye
Ron

Rooster

Okay, just tested it.

I screenshotted the results and attached them.
I'm not sure if it was showing what you were looking for.

Derron

I "hoped" for some graphical issues ... like the garbage on this "rectangle with texts" (actually a "render2texture" thing). I have done things very similar to how I do it in the game... but it does not seem to show issues.
Meanwhile Col seems to have found some bugs/issues which might be heavily connected to what you experience. As a programmer you might be interested to "follow" or "read here and there":
https://github.com/davecamp/Render2Texture/issues/12

If things are to test out - I will post a new test binary for you - until then you will just be able to test new features with new versions ;-) Do not want to stress you with daily test files.

bye
Ron

Rooster

It's easy to work around, so I wouldn't worry about it to much. ;)

Derron

Could you please try this binary - with letterboxes?
Col fixed two issues in the Render2Texture-code which directly seem to affect what you were experiencing:


https://www.gamezworld.de/files/TrickOrSweets_Linux32.7z


So pay special attention to the score-images (should be "clean") and the sweets in the bag.






Side reminder for me:
Another boss fight: ever hungry child. Certain sweets make the child hungry again (refilling empty bag-slots) - so you need to make sure that you feed them "at first". Of course it is up to the player to find that out ;-). In a later stage this could even be hidden _until_ the bag seems to be clear - so that is is some kind of "blind feature" :-)


Another boss fight: Berry and his companions Cherry-Joe and Cherry-Bob visit Granny. Berry is only "feedable" once Cherry-Joe and Bob are satisfied (similar to an idea above). Now mixing the "hungry" one in means: for every impatience-time of Joe or Bob, Berry will become more "powerful" (hungry) - so he has to get sweets "multiple rounds". In a later stage Bob/Joe could behave similar to the hungry boss before - so they are harder to fight and Berry will become even stronger!




Somehow I begin to like the "elementary school VS granny"-idea.


bye
Ron

Rooster

#26
The level text and candy bags are having the same issues.

The "score-images" were also showing the same thing, which is I think you were looking for?


Derron

You say the "candy bags are having the same issue(s)" ... I do not see them on the screenshot - so does it not happen everytime - or it is now just happening to the level text/score text?

If it was only the text  I would assume it has to do with the sprite atlas (all glyphs of the text on one image) while the candies are stored in individual images - albeit used similar, I mean calling DrawSubImageRect...

I really appreciate that Col is fiddling around with his render2texture stuff to resolve the bug too ;-)


bye
Ron

Derron

Meanwhile here is a new version as Col adjusted some bits in his code. Maybe this helps already.
https://www.gamezworld.de/files/TrickOrSweets_Linux32_v0.1.4c.7z


bye
Ron

Rooster

Well it looks like whatever Col did fixed the issue. :D
I wasn't able to reproduce it with score-images, bags, or level text.

The only other thing right now is a loophole I've noticed.
When you've emptied one of your candy stacks, you can still click and drag it, and when the next candy is produced it will instantly be at your cursor.

Thanks. :)