david-pfx / PuzzleFAB

Pattern language for abstract single-player games and puzzles, and Unity player
Other
10 stars 0 forks source link

Assertion failed: move Stationary #1

Closed Leuthil closed 5 years ago

Leuthil commented 5 years ago

I'm getting an error and I'm finding it hard to pinpoint the cause of the issue. I know in the readme you specify that there's no guarantee for existing PuzzleScript games to work with this tool, which is completely cool, but I'm wondering if you are providing support for these types of things?

Leuthil commented 5 years ago

Nevermind, I debugged the code in PuzzLangLib and found that I needed to add Directions.Station to the GameDef.MoveDirections hashset. After doing that everything (for my game at least) seems to be working as intended. Thanks again for this project!

david-pfx commented 5 years ago

Good to hear you found the solution to your problem, but that leaves me with a bug in the code. Stationary is handled explicitly in various parts of the code, so that means this is not a simple oversight but some case I missed. It would help if you could provide a repro case (your game) so I can check it out and make sure it gets fixed.

Leuthil commented 5 years ago

Oh I see, sure not a problem. My game code is pretty lengthy, but I managed to trim it down to something more manageable which still reproduces the issue. Essentially if you load up the game and try to move into a wall, it crashes with that error. Below is the puzzle game code:

title move Stationary bug
author Leuthil

========
OBJECTS
========

Background
PINK
00000
00000
00000
00000
00000

Temp
PINK
.....
.....
.....
.....
.....

Wall
GREY
00000
00000
00000
00000
00000

Goal
GREY
.....
.0.0.
..0..
.0.0.
.....

Player
GREY
.....
.....
..0..
.....
.....

PlayerBlack
BLACK DARKGREY
.111.
.000.
11111
.000.
.0.0.

PlayerWhite
WHITE LIGHTGREY
.111.
.000.
11111
.000.
.0.0.

BlackTile
BLACK
00000
00000
00000
00000
00000

WhiteTile
WHITE
00000
00000
00000
00000
00000

=======
LEGEND
=======

. = Background
# = Wall
B = BlackTile
W = WhiteTile
1 = PlayerBlack and WhiteTile
2 = Player and PlayerWhite and BlackTile
Y = Goal and BlackTile
U = Goal and WhiteTile
ColouredPlayers = PlayerBlack or PlayerWhite

=======
SOUNDS
=======

================
COLLISIONLAYERS
================

Background
Temp
Wall
WhiteTile
BlackTile
Goal
PlayerBlack
PlayerWhite
Player

======
RULES
======

[ Action Player PlayerBlack] [ PlayerWhite ] -> [ Temp ] [ Action Player PlayerWhite ]
[ Action Player PlayerWhite] [ PlayerBlack ] -> [ PlayerWhite ] [ Action Player Temp ]
late [ Temp ] -> [ PlayerBlack ]

[ MOVING Player STATIONARY PlayerBlack ] -> [ MOVING Player MOVING PlayerBlack ]
[ MOVING Player STATIONARY PlayerWhite ] -> [ MOVING Player MOVING PlayerWhite ]

[ > PlayerBlack | Wall ] -> [ PlayerBlack | Wall ]
[ > PlayerWhite | Wall ] -> [ PlayerWhite | Wall ]

[ MOVING Player ] [ STATIONARY PlayerBlack Player ] -> [ STATIONARY Player ] [ STATIONARY PlayerBlack Player ]
[ MOVING Player ] [ STATIONARY PlayerWhite Player ] -> [ STATIONARY Player ] [ STATIONARY PlayerWhite Player ]

==============
WINCONDITIONS
==============

All Goal on ColouredPlayers
Some ColouredPlayers on Goal

=======
LEVELS
=======

################
################
#####1wwwwu#####
################
################
#####2bbbby#####
################
################
################
david-pfx commented 5 years ago

Much appreciated. I can see how that might happen. I'll see if I can turn that into a test, a fix and an update! Please feel free to raise any further issues.

david-pfx commented 5 years ago

Problem reproduced and was already fixed in the next release. Which will be Real Soon Now.

david-pfx commented 5 years ago

The latest commit should fix this, as well as adding a number of new features. Let me know if you try it.