Code Monkey home page Code Monkey logo

Comments (8)

stephenjsweeney avatar stephenjsweeney commented on May 22, 2024

It could be that the config file has corrupted, which would cause a crash. The config file can be found in:

~/.local/share/blobwarsAttrition/config.json

That should be valid JSON. Try renaming it and restarting the game (which will effectively reset your configuration). If that works, it means your config was busted. Attach the file in a comment and I'll take a look (or you could see if you could fix it manually).

If that doesn't work, try running through gdb. This should show you a stacktrace of where the crash occurs.

gdb blobwarsAttrition
run
(upon crash) where

from blobwarsattrition.

timsoftgit avatar timsoftgit commented on May 22, 2024

yes, that file was empty - 0 bytes long. having deleted the empty file blobwarsAttrition starts.
however, trying to load a game gives
ERROR: Corrupt save file: /home/neil/.local/share/blobwarsAttrition/0/game.json
and it crashes out
looking at the files in ~/.local/share/blobwarsAttrition/0/
there are 9 files. beachApproach.json beachFront1.json boss1.json game.json greenlands1.json greenlands2.json greenlands3.json and greenlands4.json

beachFront1.json boss1.json game.json and greenlands5.json are all 0 bytes
should I just delete all the zero length files?

from blobwarsattrition.

stephenjsweeney avatar stephenjsweeney commented on May 22, 2024

You shouldn't have any zero length files in there, at all. Sounds like the game isn't saving correctly for some reason.

You could delete them, yes. But it will put the game into an inconsistent state where you'll find you end up with more keys than you should do; it will basically make your playthrough too easy.

Did you compile the game yourself? Or are you using the version from itch.io?

Edit: a bit more info - those files are used to store the level state, for the purpose of creating a persistent game world. Deleting them will basically reset the level as if it's being visited for the first time.

from blobwarsattrition.

timsoftgit avatar timsoftgit commented on May 22, 2024

ok, so it looks like it is safe to delete. my son is playing it and he quit out of a few levels (esc) because he got stuck (he needs more patience :-) ). I compiled it myself, using the source+data from itch.io
I created a package build script (for slackware) which is below. as you can see there are a couple of build patches and a cosmetic (default gore setting) patch included. It requires the source tar.gz file in the same ditrectory as the script (and also a slack-desc and README file, which I can post if you're interested)
#!/bin/sh

Slackware build script for blobwarsAttrition

Written by Tim Dickson [email protected]

(C) 2019

changelog

PRGNAM=blobwarsAttrition
VERSION=${VERSION:-1.2.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi

set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.src.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L .
( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555
-o -perm 511 ) -exec chmod 755 {} ; -o
( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444
-o -perm 440 -o -perm 400 ) -exec chmod 644 {} ;
#patch file to fix build problem
sed -i "/nextp/d" src/game/credits.h
sed -i 's/*strtok_r/*strtok_rr/g' src/util/util.c
#patch to make default more kiddy friendly
sed -i 's/app.config.blood = 1/app.config.blood = 0/g' src/system/init.c

make CFLAGS="$SLKCFLAGS" DATA_DIR="/usr/share/games/$PRGNAM"
make install DESTDIR=$PKG DATA_DIR="/usr/share/games/$PRGNAM"

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
cp CHANGELOG.raw LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION/
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

from blobwarsattrition.

timsoftgit avatar timsoftgit commented on May 22, 2024

(appologies for the weird formatting github put on my pasted text)

from blobwarsattrition.

stephenjsweeney avatar stephenjsweeney commented on May 22, 2024

I'm not having any luck duplicating this error.

Something you could try: backup or delete the ~/.local/share/blobwarsAttrition directory and start a new game using:

blobwarsAttrition -debug

When playing, you'll see debug stuff on screen, but you can also press 0 on the keyboard to automatically complete a mission. Do this on a few stages and then check to see that the save files are being created properly. If they're all still 0 in size then we'll need to do more digging.

The saving is done by first creating temporary files and then renaming them, in order to try and keep things in sync. This is done here:

https://github.com/stephenjsweeney/blobwarsAttrition/blob/master/src/hub/postMission.c#L91

The main level saving is done here:

https://github.com/stephenjsweeney/blobwarsAttrition/blob/master/src/world/worldSaver.c#L30

Perhaps more debug and error checking will be needed?

from blobwarsattrition.

timsoftgit avatar timsoftgit commented on May 22, 2024

it seems to be saving ok. I tried completing a level in debug mode as well as "0" completing, and tried quitting the program (x) in corner, also tried kill -9 gamepid but no zero-length files. I'll have to see if my son can remember what he did when it "went wrong".

from blobwarsattrition.

timsoftgit avatar timsoftgit commented on May 22, 2024

apparently it happened after he died on grasslands5, or whengrasslands5 was completed. Unfortunately it's not much to go on. I'll close this, and if it re-occurs open a fresh issue hopefully with more info.

from blobwarsattrition.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.