stephenjsweeney / blobwarsattrition Goto Github PK
View Code? Open in Web Editor NEWA C source port of Blob Wars : Attrition
License: GNU General Public License v3.0
A C source port of Blob Wars : Attrition
License: GNU General Public License v3.0
I'm trying to get grenade combo achievement, but I haven't noticed any combo counter with any weapon like it was in metal blob solid. Does it exist in a game?
I'm trying to build the game for linux fedora 27 x86_64 and I get the following error:
src/system/draw.c: In fuction «saveScreenshot»:
src/system/draw.c:269:25: error: «%d» directive writing between 1 and 11 bytes into a region of size between 0 and 1023 [-Werror=format-overflow=]
sprintf(filename, "%s/%d/%s.png", app.saveDir, game.saveSlot, name);
^~
src/system/draw.c:269:3: warning: «sprintf» output 8 or more bytes (assuming 1031) into a destination of size 1024
sprintf(filename, "%s/%d/%s.png", app.saveDir, game.saveSlot, name);
Hi, I just bought the this version and it's amazing! Just have a quick question though. Do you usually get the checkpoint after some completed missions? Currently I am not getting any so just checking if that is normal or is it maybe a issue with my version. Thank you!
I get this error message with both master
and develop
(this):
src/world/world.c: In function ‘draw’:
src/world/world.c:773:2: error: ‘fadeAmount’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
drawRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0, fadeAmount);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/world/world.c:766:6: note: ‘fadeAmount’ was declared here
int fadeAmount;
^~~~~~~~~~
cc1: all warnings being treated as errors
common.mk:64: recipe for target 'bin/world.o' failed
gcc version 7.3.0 (Debian 7.3.0-5)
The description says that you must collect 500 batteries but trophy is granted for 350 really.
I just noticed some strange thing: from main menu select 'load game', but then select 'cancel' to go back, then select 'options' - the game will actually load instead of going to options.
Hello,
First of all I want to say great work. I've been a fan of your games for some time now. I am interested in buying the assets to this game to support you. I would like to know if there is a way to buy the assets and the android apk as a bundle? That way I could buy directly from you without going through the google play store.
If not, thanks anyway. And thank you again for all of your work so far. :)
In one of the Greenlands missions (maybe Greenlands 3, I killed a lazer blob squad leader to finish it), I had a crash right as I completed the mission. As I understand the game, stuff like doors and computers do not need to be unlocked again after level completion. However, even though the mission was marked as partially completed when I re-opened the game, I had to re-unlock everything. Unfortunately, I can't give any more details about the crash and I have not encountered one since then.
Can you confirm that my save data is bugged and that I'm not just overlooking something? If my save data is bugged, how do I get it to the state it should be in? They're all JSON files, so I assume I can just modify my save data to get my items back.
My save data from ~/.local/share/blobwarsAttrition
:
blobwarsAttrition-save.tar.gz
My inventory: 2 silver keys, 2 blue keycards, 3 yellow keycards, 3 gold keys
I've fully completed all missions up to
It seems the game always loads save slot 0 even I select different one.
src/system/i18n.c: In function «setLanguage»:
src/system/i18n.c:85:17: error: «%s» directive writing up to 1023 bytes into a region of size 1006 [-Werror=format-overflow=]
sprintf(c, "%s/%s/LC_MESSAGES/%s.mo", LOCALE_DIR, language, applicationName);
^~ ~~~~~~~~
src/system/i18n.c:85:2: warning: «sprintf» output 35 or more bytes (assuming 1058) into a destination of size 1024
sprintf(c, "%s/%s/LC_MESSAGES/%s.mo", LOCALE_DIR, language, applicationName);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/system/i18n.c:108:18: error: «%s» directive writing up to 1023 bytes into a region of size 1006 [-Werror=format-overflow=]
sprintf(c, "%s/%s/LC_MESSAGES/%s.mo", LOCALE_DIR, language, applicationName);
^~ ~~~~~~~~
src/system/i18n.c:108:3: warning: «sprintf» output 35 or more bytes (assuming 1058) into a destination of size 1024
sprintf(c, "%s/%s/LC_MESSAGES/%s.mo", LOCALE_DIR, language, applicationName);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found several game crashes under linux:
Game crashes randomly after endgame when I enter and then exit any mission
#0 0x00007ffff69c29a6 in __strlen_sse2 () from /lib64/libc.so.6
No symbol table info available.
#1 0x000000000041a496 in cJSON_strdup (str=0x0) at src/json/cJSON.c:63
len = 50891856
copy = 0x3088be0 ""
#2 0x000000000041d63a in cJSON_CreateString (string=0x0) at src/json/cJSON.c:1276
item = 0x3088c50
#3 0x000000000042d78a in save (root=0x3088a90) at src/entities/unit.c:322
u = 0x30676f0
#4 0x000000000043279d in saveEntities (root=0x30c90e0) at src/world/worldSaver.c:145
entitiesJSON = 0x306e520
entityJSON = 0x3088a90
#5 0x00000000004323d0 in saveWorld () at src/world/worldSaver.c:55
root = 0x30c90e0
filename = 0x30c9130 "/home/thesource/.local/share/blobwarsAttrition/0/outpost5.json"
out = 0x4239ab <updateMissionStatus+47> "\211\005\177\a#"
#6 0x0000000000423932 in initPostMission () at src/hub/postMission.c:79
No locals.
#7 0x0000000000430b6c in doWorldComplete () at src/world/world.c:535
No locals.
#8 0x0000000000430216 in logic () at src/world/world.c:178
No locals.
#9 0x000000000041fbe3 in main (argc=1, argv=0x7fffffffda78) at src/main.c:58
then = 322954
nextSecond = 323037
frames = 55
The output of sudo make install
:
[sudo] password for root:
mkdir -p /usr/bin
install -m 0755 blobwarsAttrition /usr/bin
mkdir -p /opt/blobwarsAttrition
cp -r data /opt/blobwarsAttrition
cp -r gfx /opt/blobwarsAttrition
cp -r manual /opt/blobwarsAttrition
cp -r music /opt/blobwarsAttrition
cp -r sound /opt/blobwarsAttrition
mkdir -p /usr/share/icons/hicolor/16x16/apps
mkdir -p /usr/share/icons/hicolor/32x32/apps
mkdir -p /usr/share/icons/hicolor/64x64/apps
mkdir -p /usr/share/icons/hicolor/128x128/apps
cp -p icons/blobwarsAttrition-16x16.png /usr/share/icons/hicolor/16x16/apps/blobwarsAttrition.png
cp -p icons/blobwarsAttrition-32x32.png /usr/share/icons/hicolor/32x32/apps/blobwarsAttrition.png
cp -p icons/blobwarsAttrition-64x64.png /usr/share/icons/hicolor/64x64/apps/blobwarsAttrition.png
cp -p icons/blobwarsAttrition-128x128.png /usr/share/icons/hicolor/128x128/apps/blobwarsAttrition.png
mkdir -p /usr/share/applications
cp -p icons/blobwarsAttrition.desktop /usr/share/applications
cp: cannot stat 'icons/blobwarsAttrition.desktop': No such file or directory
make: *** [makefile:55: install] Error 1
running from a kterminal gives the following output.
neil@timhome:~$ blobwarsAttrition
INFO: Locale is en_US
INFO: Language is en
INFO: Numeric is C
INFO: atof(2.75) is 2.750000
INFO: User home = /home/neil
Segmentation fault
it was working, (but not fullscreen and full resolution of 1920x1080).
I changed the screen resolution and selected fullscreen and restarted, but it didn't restart, it gave the above output.
(running 64bit linux (slackware 14.2) (with paid-for data) Any suggestions to debug?
glxgears -info shows running gl version 3.0 Mesa 11.2.2
SDL2 2.0.9 SDL2_image 2.0.4 SDL2_mixer 2.0.4 and SDL2_ttf 2.0.14
gcc -O2 -fPIC `sdl2-config --cflags` -DVERSION=1.2 -DREVISION=0 -DDATA_DIR=\"/usr/share/games/blobwarsAttrition\" -DLOCALE_DIR=\"/usr/share/locale\" -g -lefence -fms-extensions -std=gnu11 -c -o bin/destructable.o src/entities/misc/destructable.c
In file included from /usr/include/string.h:630:0,
from src/game/../common.h:23,
from src/game/credits.h:21,
from src/game/credits.c:21:
src/game/credits.h:37:14: error: expected identifier or '(' before '__extension_ '
extern char *strtok_r(char *str, const char *delim, char **nextp);
^
common.mk:64: recipe for target 'bin/credits.o' failed
make: *** [bin/credits.o] Error 1
my make commands are as follows ( I am using the paid version - ie includes the data )
make CFLAGS="$SLKCFLAGS" DATA_DIR="/usr/share/games/$PRGNAM"
make install DESTDIR=$PKG DATA_DIR="/usr/share/games/$PRGNAM"
(where SLKCFLAGS is "-O2 -fPIC" PRGNAM is "blobwarsAttrition" and PKG is "/tmp/SBo/package-blobwarsAttrition" )
I'm not sure if it is the intent of the game design, but it is possible to amass large quantities of some keys, and hearts (I had over 100 silver and gold keys), but there appears to be a shortage of yellow key cards. (this is in the paid data, so if there is a better place to raise the question let me know). If it is not intended to allow amassing so many keys, one example is greenlands 4, complete the first half. of the mission on that level, then for the second half, get silver and gold and bronze keys, and extra heart, then don't complete, but quit out of the level, and it will save the extra keys and hearts. repeat for as many as you want.
The down side of this effect, is in some levels you can use keys/cards, fail to complete, but the keys/cards are not restored, so you end up being unable to complete the game.
After grenade combo stat commit in develop game started to often crash when starting a new game or new mission.
Thread 1 "blobwarsAttriti" received signal SIGABRT, Aborted.
#0 0x00007ffff6961660 in raise () from /lib64/libc.so.6
No symbol table info available.
#1 0x00007ffff6962c41 in abort () from /lib64/libc.so.6
No symbol table info available.
#2 0x00007ffff69a3f17 in __libc_message () from /lib64/libc.so.6
No symbol table info available.
#3 0x00007ffff69aa21a in malloc_printerr () from /lib64/libc.so.6
No symbol table info available.
#4 0x00007ffff69abdf8 in _int_free () from /lib64/libc.so.6
No symbol table info available.
#5 0x000000000041cdbd in print_object (item=0x23bf420, depth=1, fmt=1, p=0x0) at src/json/cJSON.c:1035
entries = 0x2386b40
names = 0x23a1640
out = 0x23a6ba0 "{\n\t"cells":\t5,\n\t"hearts":\t10,\n\t"stats":\t{\n\t\t"STAT_MISSIONS_COMPLETE":\t0,\n\t\t"STAT_KEYS_FOUND":\t0,\n\t\t"STAT_CELLS_FOUND":\t0,\n\t\t"STAT_HEARTS_FOUND":\t0,\n\t\t"STAT_TARGETS_DEFEATED":\t0,\n\t\t"STAT_MIAS_RESCUED":"...
ptr = 0x23a7573 ""
ret = 0x23a6580 "[{\n\t\t\t"id":\t"PLATINUM",\n\t\t\t"awardDate":\t0\n\t\t}, {\n\t\t\t"id":\t"BEACH",\n\t\t\t"awardDate":\t0\n\t\t}, {\n\t\t\t"id":\t"GREENLANDS",\n\t\t\t"awardDate":\t0\n\t\t}, {\n\t\t\t"id":\t"UNDERGROUND",\n\t\t\t"awardDate":\t0\n\t\t}, {\n\t\t\t"id":\t"O"...
str = 0x23a5740 "\260W:\002"
len = 2522
i = 6
j = 1
child = 0x0
numentries = 6
fail = 0
tmplen = 10
#6 0x000000000041bbb0 in print_value (item=0x23bf420, depth=0, fmt=1, p=0x0) at src/json/cJSON.c:653
out = 0x0
#7 0x000000000041b7aa in cJSON_Print (item=0x23bf420) at src/json/cJSON.c:540
No locals.
#8 0x0000000000412c6f in saveGame (isTempFile=0) at src/game/game.c:411
root = 0x23bf420
---Type to continue, or q to quit---
statsJSON = 0x23d33a0
keysJSON = 0x2936b40
keyJSON = 0x25386d0
missionsJSON = 0x239f820
missionJSON = 0x239f870
trophiesJSON = 0x239fa00
trophyJSON = 0x23a5510
filename = 0x29c4590 "/home/thesource/.local/share/blobwarsAttrition/1/game.json"
out = 0x0
t = 0x0
trophy = 0x0
i = 8
#9 0x000000000042b900 in doOK () at src/game/title.c:342
saveSlot = 1
#10 0x000000000042ed58 in doWidgets () at src/system/widgets.c:88
No locals.
#11 0x000000000042b30f in logic () at src/game/title.c:124
No locals.
#12 0x000000000041fbcc in main (argc=1, argv=0x7fffffffdaa8) at src/main.c:58
then = 8840
nextSecond = 9655
frames = 11
Your STRNCPY
macro (which just seems to call strncpy and then manually set the last byte to null), seems to frequently copy overlapping strings.
For example, in src/system/i18n.c
, line 78, you have:
if (strstr(language, ".") != NULL)
{
lang = strtok(language, ".");
STRNCPY(language, lang, MAX_LINE_LENGTH);
}
The use of strtok
and strncpy
seem to imply that the lang
and language
buffers overlap. Which, per the man page (and c spec) is undefined, and frequently causes segfaults:
"The strings may not overlap, and the destination string dest must be large enough to receive the copy." -- http://man7.org/linux/man-pages/man3/strcpy.3.html
If you want to copy to buffers that overlap, you either need to do it manually, or use functions like memmove
(note that memcpy
has the same problem).
As is, this currently causes builds to call SIGABRT on os x (10.11, using clang).
I built the game with:
$ make -f makefile.mac -j8
$ ./blobwarsAttrition
[1] 81299 abort ./blobwarsAttrition
While trophy is unlocked successfully for grenade combo, stat menu always shows best combo is 0.
I was playing beach 3, I just got the heart and unlocked the battery powered doors, and the game crashed. Here is the output for the program:
2018-04-24 20:00:19.162 blobwarsAttrition[96592:673694] INFO: Locale is en_US
2018-04-24 20:00:19.163 blobwarsAttrition[96592:673694] INFO: Language is en
2018-04-24 20:00:19.163 blobwarsAttrition[96592:673694] INFO: Numeric is C
2018-04-24 20:00:19.163 blobwarsAttrition[96592:673694] INFO: atof(2.75) is 2.750000
2018-04-24 20:00:19.163 blobwarsAttrition[96592:673694] INFO: User home = /Users/leif
2018-04-24 20:00:19.636 blobwarsAttrition[96592:673694] INFO: 0 joysticks available
2018-04-24 20:16:47.863 blobwarsAttrition[96592:673694] WARN: WARNING: (4) bad sprite frames - 3 > 1
2018-04-24 20:17:52.556 blobwarsAttrition[96592:673694] ERROR: No such lookup value 2, prefix=FACING_
I'd have to look at the code to be sure, but this almost looks like an of by one error.
Here I will note several small (entirely cosmetic) problems I've noticed that do not deserve their own github issues, but should probably be fixed at some point none-the-less.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.