Until Death? (Visual Novel)

Based on the same fanfic from Andur (Until Death?)

Well I decided to make a little game demo with BGECore Framework, so I’ve started with a VN. The reasons for that are the following:

  • It’s a game that can be completed with a small team, no need of +50 people.
  • But it’s still a long game, not something you end in less than an hour.
  • The logic systems doesn’t seem too complex.
  • But it’s still a challenge to code it in blender, since it’s not designed for this kind of games.
  • Therefore BGECore Framework can show a lot of it’s features becouse of the point avobe.

Currently only first chapter is done, artists are needed for the other chapters, if you want to collaborate send me a mail at [email protected]

The dialog system supports a super basic version of the RenPy format. Texts are rendered with BLF and have shadows and wrapping (plus extra features). Two GLSL shaders are used “vignetting” and “sblur”, the vignetting is actually what gives the reddish atmosphere (wich will only be shown now becouse the MC is dying)

UntilDeath.zip (6.14 MB)

Wait this is not a blend! What to do:
Uncompress and run UD.exe (Linux users continue reading please).
The launcher will automatically try to find a Blender copy installed in your computer (should be >=2.76)
You can always open the data/UntilDeath.blend file, the game is open source.
If you still want to use the launcher, but not with the Blender copy installed in your computer you can place another copy inside the “engine” folder. Actually once the game is completed (if ever) this is how it will be distribuited.

Uh, just give us a blend. Some of us run linux.

Lots of us…

Yeah, like me too. I’ve already given you a .blend, just read the post!

You can always open the data/UntilDeath.blend file, the game is open source.

Actually, it includes a launcher for linux too, called “launcher-for-linux”, are you even trying?

Wait this is not a blend! What to do:
Uncompress and run UD.exe

This means I don’t download, I just ask for a blend. I don’t continue reading (as 99.9% of the time I can’t play it), nor do I download the zip (as 99% of the time I can’t play it unless I bring out my mighty blend extractor)

Even had you mentioned it included a linux launcher, I would likely have asked for a blend anyway, as I run a weird system and a lot of linux executables don’t run for me. (normally I’m running libraries too new for most applications).
So in future, just say “This zip includes a blend”

Feedback on blend:
It sucessfully plays the BGEcore logo.
Then it freezes with my CPU load at 100% for several minutes untill I kill it

Feedback on launcher:
It sucessfully plays the BGEcore logo.
Then it starts spawning blenderplayer instances faster than I can pkill them (all of which are frozen). After a few minutes all four threads are at 100% and I have to restart my display manager/X to get control back over my computer.

For reference:
I have run a heck of a lot of stuff on this laptop. I’ve played scenes with over 900,000 polygons. I’ve done really gnarly logic experiements that leave it gasping for breath. (calculating paths of thousands of objects). I don’t think a visual novel should strain it…

(Check you’re running Blender 2.76 or superior, seriously my intuition is telling me this is the problem)

Well that looks like a bug, I have not tested it much on linux, but I don’t remember ever getting something like that. Seems like a case of infinite recursion on the setScene() function (that strangly doesn’t happen to me). Which version of Blender are you using? Any message on the console?

For reference, the load time after the logo should be unnoticiable, after all, all it does is load a background scene.

Note: The launcher looks for a Blender copy in your computer, usually the repositories in linux aren’t updated to the last version, so this can be the cause of the error. In any case what worries me most is this, “Then it starts spawning blenderplayer instances faster than I can pkill them”, this happens when calling utils.setScene() inside the game (so it’s not a launcher bug), but the problem here is that there isn’t any functionality implemented, at lest yet, that lets you spawn another instance of the game.

Thanks for the feedback by the way, if the version was the problem maybe it would be good to quit blender when that is detected. (And show a message or something)

version: 2.76 (sub 11), branch: makepkg, commit date: 2016-02-18 15:29, hash: da81227, type: Release
build date: 2016-02-19, 01:12:04
platform: Linux

There’s a missing font and shader compile error:

Can’t find font: /home/geoffrey/Downloads/TillDeath/tools/Font Generator/BlackChancery.TTF
Setted 2D Filter SBlur to slot 0
2D Filter GLSL Shader: compile error:
1 uniform sampler2D bgl_RenderedTexture;
3 uniform float SBlur_percent;
4 uniform float SBlur_radious;
5 uniform int SBlur_samples; // 4, 8, 16, 32
7 float value = 0.0015*SBlur_radious; // Here, value = distance away to check for pixel color
9 void main(void)
10 {
11 if (value < 0.0001) value = 0.0015;
12 int _samples = SBlur_samples;
13 if (_samples == 0) _samples = 4;
14 int i;
15 vec4 color;
16 for (i=0; i < _samples/4; ++i) {
17 color += texture2D(bgl_RenderedTexture, vec2(gl_TexCoord[0].st.x + value, gl_TexCoord[0].st.y + value)); // Sample area around current pixel
18 color += texture2D(bgl_RenderedTexture, vec2(gl_TexCoord[0].st.x - value, gl_TexCoord[0].st.y - value));
19 color += texture2D(bgl_RenderedTexture, vec2(gl_TexCoord[0].st.x + value, gl_TexCoord[0].st.y - value));
20 color += texture2D(bgl_RenderedTexture, vec2(gl_TexCoord[0].st.x - value, gl_TexCoord[0].st.y + value));
21 value /= 2;
22 }
24 color /= _samples; // And average out the final color by number of samples; this could be in a for-loop
26 vec4 origcolor = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st); // This is a slight difference from the blur filter;
28 gl_FragColor = origcolor + SBlur_percent * (color - origcolor); // Here, we use a simple formula where if percent = 0, then we simply use the original color. Otherwise, we use the blurred color;
0:21(2): error: could not implicitly convert operands to arithmetic operator
0:24(2): error: could not implicitly convert operands to arithmetic operator

If I kill the game engine, it is stuck somewhere in here:

File “~/Downloads/TillDeath/UntilDeath/data/core/glsl/global/filter2D.py”, line 117, in afterend
File “~//Downloads/TillDeath/UntilDeath/data/core/glsl/global/filter2D.py”, line 128, in bindUniformf
if bgl.glIsProgram(prog) == True:

Don’t take that as an exact location, it’s just where the program happened to be when I hit ctrl+C, but it’s probably in the nearest while loop.

I see, about the font, I wouldn’t worry, that doesn’t actually influence the game, though I should relocate the source so that the message doesn’t show up. The problem is with the shader class (it was recently introduced so it makes sense). Basically there is a shader (the SBlur), that fails in your computer, once the shader fails the binding functions also fail (becouse there is no shader where to bind anything). Even if the shader works, the binding function only works once blender draws it, so in a post_draw call, and here is where we have the inifinite recursion.

So, two things to do, first break the infinite recursion when a shader fails, second make the shader work, I’ll update soon.

About the shader error: It seems that your computer (graphic card or drivers) doesn’t support doing this “value /= 2;” but maybe with this “value = value / 2.0;” works.

Ok, done. I’ve updated the OP. Hopefully the shader will work, but even if it doesn’t now you should still be able to play.

Got the launcher to work, but the screen is just black :1
Really want to try this though - and that story is pretty wicked by the way!

Ok, I’ve posted on the OP what you have to do so I can fix this bug. I assume that the logo of BGECore appears, is that correct?

What should happen is that the black screen starts to fade out to show the image on the OP (without the text), then when you click on the screen the text starts to show up (with the classic typewritter effect). Also the sound effects start to fadeIn. Then you have the tipical VN until end of Chapter 1, the screen fades to black again and the credits start (with music) until the credits reach the end where the game stops (basically becouse there the Chapter 2 should start, but it’s not done XD)

Well now it’s not freezing, and the 2D filters (eg noise and fades to black) appear to be working.
But if there are intended to be texture or images they aren’t showing. All that displays are the bars down the bottom, a button down the bottom right, the text/dialog and something in the top left.
So I never see things like the red-tinged clouds in the demonstration image. Check the paths are relative and all images are indluded.

Interestingly when I close it, the clouds are now loaded as the image showing on the plane. So obviously the path is correct, but the shader displaying them still has issues.


No errors in console.

The cursor also appears to be stretched horizontally.

Also seems to be a memory leak in there somewhere, but that’s blender’s problem not yours.

Well yes it looks like a problem with the shaders. Do the following:

  • Check wich shader is the one giving problems, start the game in embedded mode, if the error persists it’s the SBlur, if everything works (except the vignetting), is the vignetting.
  • If it’s the SBlur you can dishable it going at “data/script/behavior/render.py” lines 67, 68, 118, 119, 134, 135 and 136 and commenting them all. Or if you have a good text editor do replace all “self.blur” on the file with “#self.blur”, and then go to line 134 and fix the if.

Of course you will be able to enable/dishable filters on the next update soon, but since I don’t know what’s wrong yet (and I can’t reproduce the bug) it won’t be fixed for now (until new reports at least).

The shaders are on “data/core/glsl” there you will find Vignetting.filter2D and SBlur.filter2D, you may try to find what breaks on your GPU youself if you want. On the *.py files you will find the initialization default values, they are useful for tests.

PS: All the shaders module works standalone and can be used outside BGECore Framewrok too, in case someone is interested.

No errors in console, so I don’t know which one is giving problems.

If you have a computer with an integrated intel card, try using that. That’s what I am using.
I’ll have a bit of a look later today.

I’ve just updated while you where writting. Now you can enable/dishable filters from the configuartion file (config.txt). I’ve also modified a little the SBlur (bindings only support float for now and it was using an int uniform) but I doubt it will solve anything. Wait, now that I think about it, I forgot to add the conditional statment for the vignetting filter… well, on next update.

Edit: I’ve tried it on Ubuntu 14 today, with the integrated drivers for intel, works fine, tough the framerate dropped form 60 to 30, the profiler says it’s the overhead (what’s the overhead? moguri’s suggestion to reduce debug properties are useless when you don’t have any).

Hmmm, there’s only a black screen for me. I have to kill the process to stop it. No errors pop up. Hmmm…

Ok, I’ll try it in another computer tomorrow, both in Windows 7 and Linux Mint. You can try to disable the shaders, everything else should work if you’re using the same version of Blender.

P.S Does the video at the start (the BGECore Logo) work?