Closed colonelfazackerley closed 8 years ago
I guess an implementation of #369 may fix this.
This problem makes android crash for levels with water in when the screen is rotated.
Yes, we will need to make water save and load before we can release.
I just thought about this some more today after seeing Andy's comment in the water animations pull request.
If the method of persisting level state is by using characters then we're going to have a lot of pain trying to persist water. For #369 I was planning to only allow loading full and half full water regions, but obviously it's possible to have any amount of water in a region midgame. This needs some design work to consider how we're currently persisting the level, and whether it scales when we have more features than printable ASCII characters.
Yes I'd be open to proposals for saving water state such as a list of numbers, a secondary grid for water, * symbols with more info below like e.g. bashing state is stored or something else.
A separate grid or list of numbers for water state might work well. I think trying to include it in the standard grid will be messy because the range of values is so large. Using * points might work too, as it would allow adding the water out of sequence.
Possibly allowing a special character of N for 'full water region' might be useful, as it could be used ore easily during level design.
Definitely agree we should provide at least 1 water level that is easily encodable in the standard grid.
Was wondering about something like:
:~
:~23,1,,255,,,,,4
:~,,,4,,,199
:~
I.e. a non aligned comma separated grid where zero values are skipped and trailing zeroes are omitted and trailing empty rows are omitted. (And all lines begin :~)
Just a first suggestion, not thought through.
Since we have a power of two for the maximum, how about using hexadecimal representation and allow spacing or leading zeroes to align.
:n
:n 17, 1, ,ff,,,,,4
:n , , , 4,,,57
:n
Maybe better to start simple and add more features later. Maybe hex is more confusing, as the other numbers (eg token counts) are all dec.
Also, I l tried to use ~ during development, but got burnt as it means something else already. I suggest using n
for water rows. (But I'm not too strongly opposed to ~)
got a idea like this:
:name=example
:description=no need
:author_name=GamingInky
:author_url=https://github.com/GamingInky
:hint.1=no hints
:hint.2=no hints
:hint.3=no hints
:num_rabbits=0
:num_to_save=0
:rabbit_delay=0
:num_saved=0
:num_killed=0
:num_waiting=0
:paused=false
:bash=0
:block=0
:dig=0
:explode=0
####
#r #
#nn#
####
:n1=167
:n2=34
I think I have a fix for this. I need to test it.
After trying to play a level on android with invisible water, this happens. I don't quite get it, but I think the problem is that level that is running can't round trip with the 'n' chars in.