[Game] Bulldozer

Post your working scripts, libraries and tools
User avatar
SpeedMaster
Posts: 235
Joined: 12 Nov 2016, 16:09

Re: [GAME] Bulldozer

07 Aug 2018, 17:32

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

#ifwinactive Bulldozer - Level 163 keys:="UUrRddrruuLLLLLrddRRuurrddLdlUUdlluurRddddlUruuullddRluurrdDDldllLrrruulDrdLuuuurruullDldRRlddrruUdddlddldlluuuuRRuulDuururDlddddddLruurruuLrddlluUluurDDDurrdrruLddlldlUUUluurDldlddRlulld" moves:=strsplit(keys) m:=0 dir:={u:"up",d:"down",l:"left",r:"right"} ~space:: m++ send, % "{" dir[moves[m]] "}" return ~f2:: m:=0 return esc:: exitapp return
Cheers,
User avatar
TheDewd
Posts: 1131
Joined: 19 Dec 2013, 11:16
Location: USA

Re: [GAME] Bulldozer

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.
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.
User avatar
SpeedMaster
Posts: 235
Joined: 12 Nov 2016, 16:09

Re: [GAME] Bulldozer

07 Aug 2018, 19:00

Which Sokoban solver did you use?
I used Sokoban Automatic Solver ver 7.2.2 (aka Takaken solver)
by Ken-ichiro Takahashi
I'm interested in which is the best.
You may find some statistics here
http://sokobano.de/wiki/index.php?title ... Statistics
User avatar
TheDewd
Posts: 1131
Joined: 19 Dec 2013, 11:16
Location: USA

Re: [GAME] Bulldozer

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

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

Code: Select all

If (TempMap "" <> UndoMap "") { UndoArray.Push(Undo) }
I apologize for any inconvenience.
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.
User avatar
TheDewd
Posts: 1131
Joined: 19 Dec 2013, 11:16
Location: USA

Re: [Game] Bulldozer

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
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.
User avatar
TheDewd
Posts: 1131
Joined: 19 Dec 2013, 11:16
Location: USA

Re: [Game] Bulldozer

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)
Image Bulldozer - Sokoban inspired game from 1994 recreated in AutoHotkey.
rommmcek
Posts: 374
Joined: 15 Aug 2014, 15:18

Re: [Game] Bulldozer

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

; 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

MidiSound(Channel, Note, Velocity := 127) { Global ; Assume-global mode If (!Sound) { return } ; Prevent repeating sound on boundary ;~ If (KF_REPEAT && (RegExMatch(PosChrX2, "(2|3|8|9|A|B|C|D|E|F)") || RegExMatch(PosChrX1, "(8|9|A|B|C|D|E|F)"))) { ;~ return ;~ } if (Note=86) { DllCall("Winmm.dll\midiOutShortMsg", "UInt", h_MIDIOut, "UInt", 0x90 | Channel | (Note << 8) | (Velocity << 16), "UInt") keyWait vk%VK% return } ;~ Volume := (100 / 100) * 0xFFFF ;~ DllCall("Winmm.dll\midiOutSetVolume", "UInt", h_MIDIOut, "UInt", Volume | Volume << 16) DllCall("Winmm.dll\midiOutShortMsg", "UInt", h_MIDIOut, "UInt", 0x90 | Channel | (Note << 8) | (Velocity << 16), "UInt") }
bye!

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

Code: Select all

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 }

Return to “Scripts and Functions”

Who is online

Users browsing this forum: jsmain, kczx3 and 56 guests