Week #28 update
What I've done this week##
This week was all about improvement. Monk AI, the options dialog and a better single/two-player gameplay dialog. Game controller support also progressed with only proper integration into the options dialog to go.
A name in parenthesis and in bold is the finder of the bug/quirk. Thanks to all, I really do appreciate your time and support. Cheers!
- fixed bug with selecting, moving and undoing a region that restored wrong
- fixed FPS drop when selecting a large region of the puzzle (Lavi)
- fixed bug that prevented a monk from falling into a hole on some scenarios if liquid was underneath
- further tweaked the rope/snare trap to not trap a hero after setting up the trap
- improved pause game keys
- gamepad vibrates when a bomb goes off
- fixed bug when dropping from a monkey bar directly onto a ladder, causing a visual animation glitch
- tweaked the game pausing after a hero enters - it now matches the original (Dan)
- fixed monks not dropping off monkey bars but moving into a wall or becoming frozen
- monks can now make a move down a ladder before waiting for the game to start
One of the main issues with the monk AI was them ignoring Wes Reckless. In a very early build, monks did chase the hero that was closest by "drawing" a line between the monk and each hero and going for the one that was closest. This was not accurate as it did not take into consideration a hero being unreachable or the oddness of monks. I forced monks to chase Jake and put this part of monks on the backburner until now.
I spent quite a lot of time trying to work out what the original does and the original is by far perfect. Sometimes a monk will chase Jake when Wes is closer or vice versa or get stuck and not know what to do. I think I have replicated the original behaviour as close I can.
How it works;
- each monk works out how many pixels away horizontally and vertically to each hero and adds them together to make a cost
- the same function the AI uses to determine the best direction to go is asked if each hero is reachable; if not, the cost is penalized to make them less attractive. The benefit of using the AI to determine if the hero is reachable is the AI already ignores blocks that are in the way
- the monk will chase whichever hero has the smallest cost. If both heroes are the same, the monk will favour the team leader, Jake Peril.
- if both heroes are not available, the monk will currently do nothing - this is on my TO-DO list;
- the monks appear to follow some herd behaviour and head in a random direction and stay there for around 10 seconds before going to another random position
- I'm still working out this exact behaviour and mechanics before starting
- it is also a little more difficult as the monks are not working independently which is a little odd or if they are I'm not sure how they arrive at the same random destination
Like I said, this method may not be bang-on to the original but without the source code, I can only play for hours and try to work out how the monks choose their food.
The orange tick is who the monk wants to eat
- tweaked some of the character positioning in the Lode Runner font
- tweaked the font alignment in the textbox control
- open/save file dialog improvements;
- now modal windows and not full-screen windows
- fixed bug that did not move the option buttons when scrolling
- changing folder/directory support added
- less code required to maintain a dialog
- improvements made to option buttons
A toggle was added to allow you to turn on 'Quirks Mode' and alter the game language. The language is just a place-holder for the time being. The joystick icon has been replaced with a controller icon, the revert and swap controls have both been re-coloured and re-shadowed.
The updated options dialog
Also new this week is the single/two-player dialog which you can see in the video below. Why a new dialog? There are a couple of things that I don't like with the originals;
- too many buttons
- why is there a revert button purely to go back to puzzle zero?
- loads of empty space
- not very intuitive
The main part is it takes too many clicks to view a puzzle you'd like to play. I'm sure I'm not the only one that when they have 30 minutes to spare, crank up MMR and pick a random puzzle and play from there. The main focus now of the new dialog is to make it easier to see and choose what puzzle you'd like to play. The only thing missing is the name of the puzzle set as it is not really needed.
Remember, this dialog doesn't have to be permanent - if people don't like it then it will be dropped in favour of the original. Both are in the game side-by-side at the moment. If you love it or hate it, let me know!
What I'll probably do next week
- play/test for bugs
- continue AI improvements
- LAN gaming basics
- complete gamepad support