[Game] Bulldozer

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: [Game] Bulldozer

Re: [Game] Bulldozer

Post by rommmcek » 01 Sep 2018, 08:15

Great work continues!

Don't have much time to play (currently at level 29 - btw.: I love "Automatically load last played level"), cause it's addictive. I did some tests though, here are my suggestions:
In my opinion you don't need to set midi volume every time you play the sound. Once after Midi Startup is sufficient e.g.

Code: [Select all]GeSHi © Codebox Plus

; Midi Startup
hMidi := DllCall("Kernel32.dll\LoadLibrary", "Str", "Winmm.dll")
VarSetCapacity(strh_MIDIOut, (A_PtrSize = 8 ? 24 : 16), 0)
DllCall("Winmm.dll\midiOutOpen", "UInt", &strh_MIDIOut, "UInt", 0, "UInt", 0, "UInt", 0, "UInt", 0, "UInt")
h_MIDIOut := NumGet(strh_MIDIOut)
Volume:=(100/100)*0xffff ; numerator could be set by GUI control
DllCall("Winmm.dll\midiOutSetVolume", "UInt", h_MIDIOut, "UInt", Volume | Volume << 16)
After hitting the boundary with arrow key pressed there should be a sound too:

Code: [Select all] [Expand]GeSHi © Codebox Plus

bye!

Edit: Due to changes in MidiSound() function, I did changes in Move(x,y) function too e.g.:

Code: [Select all]GeSHi © Codebox Plus

If (PosChrX1 = "3") { ; Target+Boulder
If (RegExMatch(PosChrX2, "(2|3|8|9|A|B|C|D|E|F)")) { ; Boundaries
MapUpdate(Bulldozer "|" PosNum)
MidiSound(9, 86) ; Now penultimate line of the if statement (for all if statements in Move() function)
return
}

Re: [Game] Bulldozer

Post by TheDewd » 31 Aug 2018, 16:21

Updated:

Revision 14 (2018-08-31)
  • Changed hotkey prevention to use window handle instead of title
  • Fixed levels 64 & 127 not applying "missing target" hotfix after restart of level
  • Changed Titlebar progress to only check for update when moving an object
  • Added MIDI SOUND EFFECTS (Enable from options menu)

Re: [Game] Bulldozer

Post by TheDewd » 28 Aug 2018, 22:13

Updated:

Revision 13 (2018-08-28)
  • Added 'Boss Key' hotkey to quickly minimize game window using "Spacebar"
  • Added alternate 'Undo Last Move' hotkey using "Backspace"
  • Added "Page Up" & "Page Down" hotkeys to change levels
  • On-screen level number now indicates level completion status using colors
  • Minor changes to 'Level Select' screen layout
  • Automatically load last played level
  • Show levels from same collection as current level on opening 'Level Select'
  • Added 'Mouse Movement' to control the bulldozer movement with the mouse
  • Fixed level 179 to prevent bulldozer from moving outside of viewable area
  • Improved prevention of unintended tab switching of tab control
  • Fixed tab display issues when toggling menu items while not on game screen
  • Fixed 'Level Select' color status drawing issue
  • Added current level progress in the Titlebar

Re: [GAME] Bulldozer

Post by TheDewd » 14 Aug 2018, 14:19

Updated:

Revision 12 (2018-08-14)
  • Fixed 'Undo Last Move' not working for map strings containing only digits



A comparison check is performed in the MapUpdate function to determine if the Bulldozer has moved. This is done to avoid populating the 'UndoArray' array when the user moves the Bulldozer into a boundary, such as a wall or other immovable object.

According to the documentation:
"...a variable containing only digits (with an optional decimal point) is automatically interpreted as a number when a math operation or comparison requires it. (To improve performance, numbers are cached internally to avoid conversions to/from strings.)"

This was causing unexpected behavior when map data was being interpreted as a number instead of a string.

After investigating the issue by searching the forums, I found a suggestion from lexikos to include literal quotes after the variable name to force interpretation as a string.

Before

Code: [Select all]GeSHi © Codebox Plus

If (TempMap <> UndoMap) {
UndoArray.Push(Undo)
}

After

Code: [Select all]GeSHi © Codebox Plus

If (TempMap "" <> UndoMap "") {
UndoArray.Push(Undo)
}


I apologize for any inconvenience.

Re: [GAME] Bulldozer

Post by SpeedMaster » 07 Aug 2018, 19:00

TheDewd wrote:Which Sokoban solver did you use?

I used Sokoban Automatic Solver ver 7.2.2 (aka Takaken solver)
by Ken-ichiro Takahashi

TheDewd wrote:I'm interested in which is the best.

You may find some statistics here
http://sokobano.de/wiki/index.php?title ... Statistics

Re: [GAME] Bulldozer

Post by TheDewd » 07 Aug 2018, 17:51

@SpeedMaster,

Which Sokoban solver did you use? I'm interested in which is the best. I was going to create solution for all levels but the solvers I tried couldn't find solutions for many of the levels.

Re: [GAME] Bulldozer

Post by SpeedMaster » 07 Aug 2018, 17:32

Reeree wrote:Can You please tell me how to get through level 163 on Bulldozer codezone. This level is really hard


Press SPACE to send step by step solution :shh: :angel:

Code: [Select all] [Expand]GeSHi © Codebox Plus



Cheers,

Re: [GAME] Bulldozer

Post by SpeedMaster » 07 Aug 2018, 17:11

TheDewd wrote:Thanks, SpeedMaster!

You're welcome! :D
The game is now fully functional. Well done ! :thumbup: :clap:

I will try to learn how to make games by string manipulation. :o Thanks!

Minor optional bug fix:
I have set a drawing priority to fully preserve transparency of the player on target.
This works well for most of the themes but it could also ruin estetica of some others. :think:

Code: [Select all] [Expand]GeSHi © Codebox Plus



Theme:AHKBAN
Ahkban.png
Ahkban.png (8.39 KiB) Viewed 148 times

Re: [GAME] Bulldozer

Post by TheDewd » 06 Aug 2018, 16:11

Updated: Revision 10 (2018-08-06)

  • Fixed levels 64 & 127 not showing a target due to bulldozer start location (Bulldozer starts on top of target)
  • Added level completed status to the Level Select screen

Thanks, SpeedMaster!

Note: Please let me know if any issues with latest release.

Re: [GAME] Bulldozer

Post by Reeree » 04 Aug 2018, 14:34

Can You please tell me how to get through level 163 on Bulldozer codezone. This level is really hard

Re: [GAME] Bulldozer

Post by TheDewd » 02 Aug 2018, 15:34

SpeedMaster wrote:I used Run-length encoding from Rosetta to store resolved levels in the ini file.

Excellent! I had planned to add this feature in a future release. The original author included this in his 2008 release of the game. I may borrow your code if you don't mind! :)

SpeedMaster wrote:Levels 64 and 127 are unplayable :cry:

Thanks for finding this! I've already made a solution that I'll include in the next release. The issue is when the bulldozer begins on a target at the start of the level.

Re: [GAME] Bulldozer

Post by SpeedMaster » 02 Aug 2018, 12:42

hello,

Nice Level Menu Selector 8-) Thanks.

I added check mark flags to keep track of resolved levels. :idea:
(the original script is not modified, I only added new lines and functions for the flags)

flags.PNG
flags.PNG (3.22 KiB) Viewed 263 times


I used Run-length encoding from Rosetta to store resolved levels in the ini file.
Run-length encoding https://rosettacode.org/wiki/Run-length_encoding#AutoHotkey



Cheers,

Re: [GAME] Bulldozer

Post by TheDewd » 31 Jul 2018, 23:28

Updated.

Made some drastic changes. Removed a lot of "bloat" features I no longer felt belonged in this game.

See main post.

Re: [GAME] Bulldozer

Post by SpeedMaster » 26 Jul 2018, 17:45

TheDewd wrote:Fixed issue where arrow keys were changing tabs

Works fine now thanks :thumbup:

TheDewd wrote:Added additional options to menus

Unlimited undo :dance: (Great ! some levels are really difficult to complete without it) :!:

The game is almost identical to the original now however the original game displays a message + congratulation sound when you have completed a level

07_27_18 @12_14_28.PNG
07_27_18 @12_14_28.PNG (8.21 KiB) Viewed 344 times



Cheers,

Re: [GAME] Bulldozer

Post by TheDewd » 26 Jul 2018, 16:17

Updated:

Revision 8 (2018-07-26)

  • Fixed issue where arrow keys were changing tabs
  • Added additional options to menus
  • Save/Load game states

Hope you enjoy it!

Re: [GAME] Bulldozer

Post by SpeedMaster » 24 Jul 2018, 09:58

TheDewd wrote:Did you make any modifications to the script?

No
TheDewd wrote:Do you have another script running that has remapped any of these keys?

Not that I know, I have disabled my other running scripts.
TheDewd wrote:I can't reproduce this issue.

I am right-handed and I have a french keyboard (AZERTY) for these reasons I do not use the WASD keys to move.
The focus stays on tab control and in windows 7 you can switch tab with cursors ( left, right).

Here is a script that reproduce this behaviour. If you can change tab with your cursors that's it :thumbup:

Code: [Select all]GeSHi © Codebox Plus

Gui, Add, Tab3,, General|View|Appearance|Settings
gui, show, w500 h500

Re: [GAME] Bulldozer

Post by TheDewd » 24 Jul 2018, 07:20

SpeedMaster wrote:this could be part of the ini file

Code: [Select all]GeSHi © Codebox Plus

infinite_undo = 1

Thanks for the suggestion! I'll consider it for the next release.

SpeedMaster wrote:Debug mode ... (Skips the levels correctly, but the script displays the "Level Select" when you try to play.) :cry:

Did you make any modifications to the script? Do you have another script running that has remapped any of these keys? I can't reproduce this issue. Any other information you can provide would be helpful and much appreciated.

SpeedMaster wrote:Automatically save/load last played level would be also great. :roll:

Thanks for the suggestion! I'll consider it for the next release.

SpeedMaster wrote:Tilemap.png ---> dimension of the image ? :think: size of the tiles ? :think: number of tiles ? :think: fontmap.png ---> idem :think: :?:

My initial thought was that the user could just visit the link from my previous post that has examples of tilemap/fontmap images. You can take those images and edit them into something new.

Tilemap (480x32) [32x32 tiles] [15 Count]
Fontmap (768x16) [16x16 tiles] [48 Count]

Re: [GAME] Bulldozer

Post by SpeedMaster » 23 Jul 2018, 17:34

Thank you for all the improvements you have made. 8-)
I particularly appreciate line 784 : If (UndoArray.MaxIndex() > 1) { ; Number of times to allow 'Undo' :angel:
this could be part of the ini file

Code: [Select all]GeSHi © Codebox Plus

infinite_undo = 1

  1. Debug mode is not working for me (AHK 1.1.28.02 Unicode x32 on WIN_7 64bit)
    (Skips the levels correctly, but the script displays the "Level Select" when you try to play.) :cry:
  2. Automatically save/load last played level would be also great. :roll:
ini file

Code: [Select all]GeSHi © Codebox Plus

load_last_played_level = 1


TheDewd wrote:Use a custom tilemap or fontmap image by including in the script directory as tilemap.png or fontmap.png

Tilemap.png ---> dimension of the image ? :think: size of the tiles ? :think: number of tiles ? :think:
fontmap.png ---> idem :think: :?:

Cheers

Re: [GAME] Bulldozer

Post by TheDewd » 23 Jul 2018, 15:50

Updated:

Revision 7 (2018-07-23)

  • Code optimization
    • Minimized code in some areas
    • Improved functionality
    • Rearranged order of some functions to group with other related code parts
  • Background color selection
    • The background color can be changed to one of the 16 presets (as in the original Bulldozer 1 game)
    • Custom background colors are selected using the color chooser dialog
  • New fontmap for increased readability of level/password display text
    • Changed the fontmap image (display lettering at bottom of window) for increased readability & better aesthetics
  • Debug Mode
    • Special mode enabled by clicking the Bulldozer on the 'About' screen while holding Ctrl + Alt + Shift
    • Level skip by pressing keys F11 (Previous) & F12 (Next) when Debug Mode enabled
  • Save/Read settings with INI file
    • Save/load background color selection between game sessions
  • Custom tilemap & fontmap images

:!: Note: Please take care not to display level passwords in public areas that may spoil the game for other players.

Re: [GAME] Bulldozer

Post by SpeedMaster » 20 Jun 2018, 02:26

Because maps can be loaded very fast with GDI it is quite easy to implement a raw multiple undo moves however it is not the most efficient way. :think:


Code: [Select all] [Expand]GeSHi © Codebox Plus


Top