June 27, 2019, 10:26:20 AM

Author Topic: Trick Or Sweets (Halloween Compo entry)  (Read 3397 times)

Offline Derron

  • Hero Member
  • *****
  • Posts: 2171
Re: Trick Or Sweets (Halloween Compo entry)
« Reply #15 on: November 04, 2017, 05:52:57 PM »
@ 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

Offline markcwm

  • Sr. Member
  • ****
  • Posts: 390
Re: Trick Or Sweets (Halloween Compo entry)
« Reply #16 on: November 04, 2017, 06:51:31 PM »
Hi,

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

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

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

Offline Derron

  • Hero Member
  • *****
  • Posts: 2171
Re: Trick Or Sweets (Halloween Compo entry)
« Reply #17 on: November 04, 2017, 07:09:40 PM »
@ 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

Offline markcwm

  • Sr. Member
  • ****
  • Posts: 390
Re: Trick Or Sweets (Halloween Compo entry)
« Reply #18 on: November 04, 2017, 09:51:09 PM »
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.

Offline Derron

  • Hero Member
  • *****
  • Posts: 2171
Re: Trick Or Sweets (Halloween Compo entry)
« Reply #19 on: November 04, 2017, 10:14:45 PM »
@ 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

Offline Rooster

  • Sr. Member
  • ****
  • Posts: 358
  • I don't know what this does...
Re: Trick Or Sweets (Halloween Compo entry)
« Reply #20 on: November 05, 2017, 12:55:21 AM »
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.

Offline Derron

  • Hero Member
  • *****
  • Posts: 2171
Re: Trick Or Sweets (Halloween Compo entry)
« Reply #21 on: November 05, 2017, 09:04:28 AM »
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
  1. SuperStrict
  2. Framework Brl.GLMax2D
  3. Import Brl.Retro
  4. Import "renderimage.bmx"
  5.  
  6. '=== NOTE ===
  7. ' Ignore the wrong aspect ratio for the rendered things! We want
  8. ' to keep the code small ;-)
  9.  
  10.  
  11. '=== INIT ===
  12. SetGraphicsDriver GLMax2DDriver()
  13. Global gc:TGraphics = Graphics(800, 600,0)
  14. Global designWidth:int = 1200
  15. Global designHeight:int = 900
  16. Global virtualGraphicsMode:int = 2
  17. Global lastTime:int = Millisecs()
  18.  
  19.  
  20. '=== RENDER RANDOM IMAGE ===
  21. Global image1:Timage = GenerateRandomImage()
  22. Global image2:Timage = GenerateRandomImage()
  23. Global bg:Timage = GenerateCheckerboard(designWidth, designHeight)
  24.  
  25.  
  26. '=== LOOP ===
  27. SetClsColor 40, 80, 160
  28. Cls
  29. SetupVirtualGraphics()
  30. While Not KeyDown(KEY_ESCAPE)
  31.         'fetch current offset
  32.         local originX:float, originY:float; GetOrigin(originX, originY)
  33.        
  34.         If MouseHit(1) or lastTime + 1500 < Millisecs()
  35.                 image1 = GenerateRandomImage()
  36.                 image2 = GenerateRandomImage()
  37.                 lastTime = Millisecs()
  38.         EndIf
  39.         if KeyHit(KEY_SPACE)
  40.                 ResetVirtualGraphics()
  41.                 Cls
  42.                 virtualGraphicsMode = (virtualGraphicsMode+1) mod 3
  43.                 SetupVirtualGraphics()
  44.         endif
  45.         Cls
  46.         SetColor 255,255,255
  47.         DrawImage(bg,0,0)
  48.        
  49.         DrawImage(image1, VirtualMouseX() - originX , VirtualMouseY() - originY)
  50.         DrawImage(image2, VirtualMouseX() - originX - 311 - 1, VirtualMouseY() - originY)
  51.  
  52.         SetScale 2.0, 2.0
  53.         DrawText("GraphicsDriver=" + GetGraphicsDriver().ToString(), 0, 30)
  54.         DrawText("virtual resolution: " + int(VirtualResolutionWidth()) +" x " + int(VirtualResolutionHeight()), 0, 60)
  55.         DrawText("origin: " + int(originX) +" x " + int(originY), 0, 90)
  56.         DrawText("mode: " + virtualGraphicsMode, 0, 120)
  57.         SetColor 255,0,0
  58.         SetScale 3, 3
  59.         DrawText("Hit SPACE to change modes", 110, 560)
  60.         SetColor 255,255,255
  61.         SetScale 1.0, 1.0
  62.  
  63.         'mark original resolution
  64.         DrawRect(0,0,20,20)
  65.         DrawRect(0,580,20,20)
  66.         DrawRect(780,0,20,20)
  67.         DrawRect(780,580,20,20)
  68.  
  69.         'mark stretched one
  70.        
  71.  
  72.         Flip
  73. Wend
  74. End
  75.  
  76.  
  77.  
  78. '=== HELPERS ===
  79.  
  80. Function GenerateRandomImage:TImage(width:int=300, height:int=150)
  81.         'unset offsets, origins ...
  82.         ResetVirtualGraphics()
  83.        
  84.         local rt:TRenderImage = CreateRenderImage(gc, width, height)
  85.         SetRenderImage(rt)
  86.                 'in comparison to example_1 we do NOT cls!
  87.                 'so the background should be transparent!
  88.                 'Cls
  89.  
  90.                 For Local i :Int = 0 To 100
  91.                         SetColor Rand(0,255), Rand(0,255), Rand(0,255)
  92.                         DrawText("Hey", Rand(0, rt.width-50), Rand(0, rt.height-20))
  93.                 Next
  94.  
  95.                 'draw an outline
  96.                 SetColor 255,255,255
  97.                 DrawRect(0,0,width,1)
  98.                 DrawRect(0,height-1,width,1)
  99.                 DrawRect(0,0,1,height)
  100.                 DrawRect(width-1,0,1,height)
  101.         SetRenderImage(null)
  102.  
  103.         'set back offsets, origin, virtual resolution...
  104.         SetupVirtualGraphics()
  105.  
  106.         return rt
  107. End Function
  108.  
  109.  
  110. Function GenerateCheckerboard:TImage(width:int, height:int)
  111.         local img:TImage = CreateImage(width, height)
  112.         'create a checkerboard
  113.         Local pix:TPixmap = LockImage(img)
  114.         Local cols:Int[] = [(Int(255 * $1000000) + Int(150 * $10000) + Int(150 * $100) + Int(150)), ..
  115.                                           (Int(255 * $1000000) + Int(200 * $10000) + Int(200 * $100) + Int(200))]
  116.         Local corner:int = Int(255 * $1000000) + Int(255 * $10000) + Int(0 * $100) + Int(0)
  117.         For Local x:Int = 0 Until width
  118.                 For Local y:Int = 0 Until height
  119.                         if x=0 or x=width-1 or y=0 or y=height-1
  120.                                 WritePixel(pix, x,y, corner)
  121.                         else
  122.                                 WritePixel(pix, x,y, cols[ ((Floor(x / 80) Mod 2 = 0) + (Floor(y / 80) Mod 2 = 0)) Mod 2 ])
  123.                         endif
  124.                 Next
  125.         Next
  126.         return img
  127. End Function
  128.  
  129.  
  130. Function SetupVirtualGraphics(mode:int = -1)
  131.         if mode = -1 then mode = virtualGraphicsMode
  132.  
  133.         Select mode
  134.                 case 0
  135.                         'same aspect ratio - no bars
  136.                         SetVirtualResolution(designWidth, designHeight)
  137.                         SetViewport( 0, 0, designWidth, designHeight )
  138.                         SetOrigin(0,0)
  139.  
  140.                 case 1
  141.                         'different ratio, no offset (letterbox)
  142.                         SetVirtualResolution(designWidth, designHeight+160)
  143.                         SetViewport( 0, 0, designWidth, designHeight+160 )
  144.                         SetOrigin(0,0)
  145.  
  146.                 case 2
  147.                         'different ratio, offset (letterbox)
  148.                         SetVirtualResolution(designWidth, designHeight+160)
  149.                         SetViewport( 0, 80, designWidth, designHeight )
  150.                         SetOrigin(0,80)
  151.         End Select
  152. End Function
  153.  
  154.  
  155. Function ResetVirtualGraphics()
  156.         SetVirtualResolution( GraphicsWidth(), GraphicsHeight() )
  157.         SetViewport( 0, 0, GraphicsWidth(), GraphicsHeight())
  158.         SetOrigin( 0, 0 )
  159. End Function
  160.  
  161.  

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


bye
Ron

Offline Rooster

  • Sr. Member
  • ****
  • Posts: 358
  • I don't know what this does...
Re: Trick Or Sweets (Halloween Compo entry)
« Reply #22 on: November 06, 2017, 03:38:36 AM »
Okay, just tested it.

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

Offline Derron

  • Hero Member
  • *****
  • Posts: 2171
Re: Trick Or Sweets (Halloween Compo entry)
« Reply #23 on: November 06, 2017, 07:27:49 AM »
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

Offline Rooster

  • Sr. Member
  • ****
  • Posts: 358
  • I don't know what this does...
Re: Trick Or Sweets (Halloween Compo entry)
« Reply #24 on: November 06, 2017, 03:27:23 PM »
It's easy to work around, so I wouldn't worry about it to much. ;)

Offline Derron

  • Hero Member
  • *****
  • Posts: 2171
Re: Trick Or Sweets (Halloween Compo entry)
« Reply #25 on: November 06, 2017, 04:20:13 PM »
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

Offline Rooster

  • Sr. Member
  • ****
  • Posts: 358
  • I don't know what this does...
Re: Trick Or Sweets (Halloween Compo entry)
« Reply #26 on: November 07, 2017, 02:13:02 AM »
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?


Offline Derron

  • Hero Member
  • *****
  • Posts: 2171
Re: Trick Or Sweets (Halloween Compo entry)
« Reply #27 on: November 07, 2017, 10:00:11 AM »
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

Offline Derron

  • Hero Member
  • *****
  • Posts: 2171
Re: Trick Or Sweets (Halloween Compo entry)
« Reply #28 on: November 07, 2017, 10:51:51 AM »
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

Offline Rooster

  • Sr. Member
  • ****
  • Posts: 358
  • I don't know what this does...
Re: Trick Or Sweets (Halloween Compo entry)
« Reply #29 on: November 07, 2017, 04:36:23 PM »
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. :)