TIGSource Forums

Community => Procedural Generation => Topic started by: Sar on May 22, 2008, 04:45:09 PM



Title: Compendium [FINISHED]
Post by: Sar on May 22, 2008, 04:45:09 PM
So, Compendium is finished. Or at least, finished enough for now.

You'll need .NET2.0 (not included), some text files containing poetry or short stories (two included) and to be able to press the arrow keys (to move) and the Z key (to fire) in order to play.

All controls are configurable in config.xml

COMPENDIUM 1.0 (~6.2MB) (http://www.eviscerate.net/stuff/compendium-1.0.zip)

Here's some screenshots:

(http://www.eviscerate.net/scraps/20080602b.jpg)

(http://www.eviscerate.net/scraps/20080602c.jpg)




ORIGINAL POST CONTENT FOLLOWS:

So, hey. I told myself I'd enter this competition, then immediately after that I was held up by Circumstances for about a week, then work got crazy-busy, and I've only now had the time to sit down and get it to the point where it all runs at the same time.

I'm hoping to actually finish, but I may not finish within the actual deadline. But hey - screw the deadline! YOU HEARD ME! A week late is better than nothing at all, right?

Anyway: I'm mostly posting this topic so that I can't tell myself that nobody will notice if I just give up and abandon the whole project now and spend the next week sleeping or something.

So far, I don't have much to show. There's a pretentious title screen:

(http://www.eviscerate.net/scraps/20080522b.jpg)

...but that's entirely generated in Photoshop at the moment, so that doesn't really count.

Here's how far I've got:

(http://www.eviscerate.net/scraps/20080522d.jpg)

- it'll be a shooter, because... well, firstly I love shooters, secondly the guys on Shmup-Dev have been mooting a procedurally-generated shooter for ages without actually going anywhere, and thirdly I already have a perfectly servicable skeleton of a shooter engine written so I can offset the last three weeks of not-working-on-this. ;-)

The idea is that instead of the supplied-random-seed approach, Compendium will read in a text file - I've been developing around classic poetry - and use that text file to generate all the numbers it needs to run the game. And for added spice, parse through the text file for bits of dialogue, questions and exclamations, and pop these up periodically as speech bubbles from the enemies.

(http://www.eviscerate.net/scraps/20080522e.jpg)

If I have time, I'd like to have a set of graphical 'themes' it can select based on the words it finds in the source text, as well, so The Raven takes place against a lightning-filled sky with leaf-less trees and gravestones and spooky statues 'cause it has words like 'demon' and 'terrors' in it, while I Wandered Lonely as a Cloud would be all blue-skies and fluffy-clouds, 'cause it has words like 'bliss' and 'dances' in.


Title: Re: Compendium
Post by: superflat on May 22, 2008, 04:51:37 PM
That's a really sweet idea!


Title: Re: Compendium
Post by: Melly on May 22, 2008, 04:59:16 PM
(http://www.eviscerate.net/scraps/20080522d.jpg)

I already love this.


Title: Re: Compendium
Post by: shrimp on May 23, 2008, 12:21:09 AM
Great idea!

Quote

If I have time, I'd like to have a set of graphical 'themes' it can select based on the words it finds in the source text, as well, so The Raven takes place against a lightning-filled sky with leaf-less trees and gravestones and spooky statues 'cause it has words like 'demon' and 'terrors' in it, while I Wandered Lonely as a Cloud would be all blue-skies and fluffy-clouds, 'cause it has words like 'bliss' and 'dances' in.


DEFINITELY use some sort of Google image search integration to generate the enemies!

/has no idea of the feasibility or wisdom of this


Title: Re: Compendium
Post by: Noyb on May 23, 2008, 12:24:39 AM
DEFINITELY use some sort of Google image search integration to generate the enemies!
Safesearch off + love poems =  :o

I love the idea of parsing text as random dialogue. Spiffy.


Title: Re: Compendium
Post by: William Broom on May 23, 2008, 03:08:58 AM
Awesome! Nothing much more to say.


Title: Re: Compendium
Post by: Sar on May 23, 2008, 04:48:43 AM
Thanks for the enthusiasm, guys; it's a good motivator to actually complete the thing! ;-)

DEFINITELY use some sort of Google image search integration to generate the enemies!

It's a nice idea conceptually, but I'm not sure how feasible it'd be, unfortunately. Even leaving aside the fact that half the development's being done at my desk at work where I don't have 'net access. ;-)

If one were to literally just load in images from Google image search, then all the enemies would end up being rectangular and carry around bits of background with them, which I don't like the idea of at all. I could probably come up with some way of automatically removing simple backgrounds (e.g. pictures of ravens against the sky) but probably not within the scope of the competition and certainly not with any reliability for irregular backgrounds, like... most backgrounds. :/

Another thought is just to google for a noun found in the text, pick the central third of the image result and use that to colour the enemies, perhaps - so searching for 'raven' would end up with lots of pictures with black near the middle, so the enemies would all get coloured in black. But then again, that kind of thing's not so noticable, and it would probably be equally worthwhile to just look for colour names or hints in the text itself; the same poem has lots of mentions of 'dark' or 'plutonian' or 'stygian' from which the same conclusions could be drawn with a sufficient dictionary of colour-hints.


Lastly, though, I like the idea that running the game with the same source text will always result in the exact same generated text, and pulling stuff out of GIS would change that since the results change over time. Even if it's just colour, it might make a large difference if - say - you're talking about black things on a dark background compared to light things on a dark background. :/



Title: Re: Compendium
Post by: shrimp on May 23, 2008, 06:54:09 AM
Hence my disclaimer :)

Are these of any interest...
http://en.wikipedia.org/wiki/Semantic_net (http://en.wikipedia.org/wiki/Semantic_net)
http://en.wikipedia.org/wiki/WordNet (http://en.wikipedia.org/wiki/WordNet)

(I was thinking of making a kind of semantic net for a kind of rogue-like open world game thing, so that the game would know that oaks grew from acorns, oaks were symbolic of strength, etc, so that characters and the overall culture of the world had a kind of common sense to it. I never actually implemented it though. Maybe one day...)

Anyway, the poem-seed idea has loads of potential, looking forward to seeing what happens with it. Now I see what you were talking about in some other thread about a proc-gen game without use of a random function!


Title: Re: Compendium
Post by: increpare on May 23, 2008, 07:56:39 AM
Hence my disclaimer :)

Are these of any interest...
http://en.wikipedia.org/wiki/Semantic_net (http://en.wikipedia.org/wiki/Semantic_net)
http://en.wikipedia.org/wiki/WordNet (http://en.wikipedia.org/wiki/WordNet)
They're certainly of interest to me.  Somehow I overlooked them when I was downloading datasets earlier on... .


Title: Re: Compendium
Post by: Sar on May 30, 2008, 06:38:35 PM
So, yeah... I managed to spend most of the last week playing Rock Band, which finally got a release over here. Hitting things with sticks = awesome. According to Alex Rastapopolous (I know that's not his real name and he probably isn't the head of a sinister opium cartel) I can now play the drums for Garbage, Weezer and Bon Jovi. Awesome! I can only assume Garbage, Weezer and Bon Jovi have really crappy drummers. Or maybe he was being economical with the truth, I don't know.

Still, I did some stuff. Mostly I've been wasting my time getting sidetracked by balancing and pacing each stage of development despite the fact that as soon as I put the next bit in everything will change and all the balancing will have been for naught. But hey, it does more things than it did when I put the first screenshots up, at least.

So, firstly: downloadable work-in-progress version:

http://www.eviscerate.net/scraps/20080531.zip (http://www.eviscerate.net/scraps/20080531.zip)

It's developed in C# and SDL.NET. You'll definitely need the .NET2 runtime to run it, you may also need the SDL.NET runtime. I can't remember whether everything you need is in the zip or not, and it's half three in the morning so I can't be bothered to read up on it. Neither thing is very big, and Google will help you find them. Buttons are arrows and X and Escape to close it down if you manage to finish. Or get bored. One of these is more likely than the other, right now.

If you want to use anything other than The Raven for input then add '-O' to the commandline when running and the game will give you an open-file dialog box with which to find a text file. If you want the game to rip out dialogue and use it for enemies periodically, you'll have to make sure that text file uses double-quotes for its dialogue because there's no way I'm going to spend time working out which apostrophes are apostrophes and which ones are supposed to be single quotes.

The last project I wrote with this engine ran fine on OSX and Linux, but needed Mono and some fiddling on each platform. *shrug*.

Anyway, without further ado: screenshots.

(http://www.eviscerate.net/scraps/20080530d.jpg)

(http://www.eviscerate.net/scraps/20080530e.jpg)

You will notice that all the things which were square before are now round. And that the game now has a border! Joy.


Next I think I will have to make some pretty graphics so that I don't go insane looking at coloured circles.

EDIT: Pretty graphics:

(http://www.eviscerate.net/scraps/20080531b.jpg)


Title: Re: Compendium
Post by: Sar on May 31, 2008, 06:33:01 PM
(http://www.eviscerate.net/scraps/20080531c.jpg)

Hmm. I'm thinking the random-recolouring probably needs a bit more work on the weightings...


Title: Re: Compendium
Post by: Josh R on June 01, 2008, 04:40:42 AM
I love the idea that enemies will use dialoge from the text file, its brilliant.


Title: Re: Compendium
Post by: Sar on June 01, 2008, 07:06:04 AM
I love the idea that enemies will use dialoge from the text file, its brilliant.

I've wasted a fair bit of my development time playing with "Full-Life Consequences" as the source file and giggling periodically. Does that make me a bad person?


Title: Re: Compendium
Post by: Josh R on June 01, 2008, 08:58:43 AM
Those new graphics are cool, can they spin around or can they only move directly vertically/horizontally?

Also, how many different themes will you have?
Quote
If I have time, I'd like to have a set of graphical 'themes' it can select based on the words it finds in the source text, as well, so The Raven takes place against a lightning-filled sky with leaf-less trees and gravestones and spooky statues 'cause it has words like 'demon' and 'terrors' in it, while I Wandered Lonely as a Cloud would be all blue-skies and fluffy-clouds, 'cause it has words like 'bliss' and 'dances' in.

Because that sounds like a very cool idea, could you have words from the text file incorperated into the background?


Title: Re: Compendium
Post by: Sar on June 01, 2008, 10:42:51 AM
can they spin around or can they only move directly vertically/horizontally?

The engine quite happily supports sprite rotation, but currently nothing like that is used... mostly 'cause currently, all the enemies only move horizontally in straight lines. Certainly once I get some bullet sprites drawn they'll be rotating, at the very least.

Also, how many different themes will you have?

Currently it's looking like just one in terms of player and enemy and bullet sprites, and two in terms of backgrounds, at least as far as the competition deadline goes. Drawing graphics takes a while, after all... and I'd still like to get some more movement behaviours and balancing done before the deadline. I've not managed to make nearly enough time for this one way or another. :/

(http://www.eviscerate.net/scraps/20080601a.jpg)

(The other one is a cheat, really - scrolling starfield.)

After the deadline, if I end up with something that's actually fun enough to play then I'd like to expand it, and adding extra themes is the first way I'd do that.


Title: Re: Compendium
Post by: Sar on June 01, 2008, 05:23:14 PM
OK! I'm got something which does at least most of what I wanted it to do.

WIP Download (~2.5MB) (http://www.eviscerate.net/scraps/20080601d.zip)

There's still some stuff I want to clean up before the deadline, and as I said before I hope to finish it properly at a more leisurely pace after the competitions's over, but this does everything important at least. I know of some things I want to fix, but of course any feedback would be greatly appreciated.

I'm pretty sure all the stuff you need to run it is in the zip except .NET2.0; you'll need to download and install the runtime from microsoft's site if you don't have that already. Apologies in advance to Melly, although at least it's not XNA, eh? ;-P

(http://www.eviscerate.net/scraps/20080601c.jpg)


Title: Re: Compendium
Post by: Melly on June 01, 2008, 06:14:38 PM
I hate Microsoft. <.<


Title: Re: Compendium
Post by: Noyb on June 01, 2008, 08:28:23 PM
Sometimes it randomly freezes when choosing a custom seed text, while other times it makes the window where I have the shortcut randomly switch to My Documents or Recently Changed Files. (On Vista, btw.)  :-\

Not bad when it works correctly. "The Love Song of J Alfred Prufrock" is pretty intense.  ;)


Title: Re: Compendium
Post by: Durruti on June 01, 2008, 10:23:49 PM
This is the second game I've seen in this compo that I really want to see developed further. The concept is fantastic and the game is pretty good as is. I think it could be amazing if you continue with it.

Oh, and as for bugs/glitches, I haven't seen any, but I've only tested a few texts, so.


Title: Re: Compendium
Post by: Melly on June 01, 2008, 10:45:40 PM
Well what the dickens it works. Kind of.

Did you originally have music or sound, cause I ain't hearing anything.

So all that happens is the enemy ships come endless at you? They don't really pose much of a threat and rarily speak, so it unfortunately got boring fairly quickly.


Title: Re: Compendium
Post by: Sar on June 01, 2008, 10:59:55 PM
Sometimes it randomly freezes when choosing a custom seed text

Oh? At what stage is it stopping? I mean - is it white with text in the middle of the screen, or with the open-file dialog up, or what?

There's been an annoying bug for ages where periodically it'll freeze partway through startup (only ever happens during initialization, never in gameplay) but I've never been able to replicate it without the debugger attached, and never been able to replicate it while stepping through code...

while other times it makes the window where I have the shortcut randomly switch to My Documents or Recently Changed Files. (On Vista, btw.)  :-\

Now that's pretty weird!

Did you originally have music or sound, cause I ain't hearing anything.

Not yet, no.

So all that happens is the enemy ships come endless at you? They don't really pose much of a threat and rarily speak, so it unfortunately got boring fairly quickly.

As to threat: it should get harder as the stage progresses, in theory, with more complex and faster attacks. One problem I'm still undecided about is that generally speaking, stages are too long, or at least take too long to get interesting, because you don't really need that many characters of the source text to determine where to spawn which enemies, and I'm trying to use all of it. So one solution is to make stages a fixed length (or at least a maximum length) and then just discard any of the source text which hasn't been used yet, but that seems like cheating. Also, I suspect different people would have differing ideas about how long 'too long' is...


Title: Re: Compendium
Post by: Noyb on June 02, 2008, 12:16:54 AM
Oh? At what stage is it stopping? I mean - is it white with text in the middle of the screen, or with the open-file dialog up, or what?

There's been an annoying bug for ages where periodically it'll freeze partway through startup (only ever happens during initialization, never in gameplay) but I've never been able to replicate it without the debugger attached, and never been able to replicate it while stepping through code...
It happens immediately after choosing the text in the open-file dialog. The dialog box disappears, the game window opens, but doesn't render anything (it shows my desktop through it in Vista. clicking on it turns the render area black and tells me that the program is not responding). If I see text on the screen almost immediately, it never freezes.

I'm pretty sure it's not complexity of the file, since it loaded the entire plaintext of Dracula (http://www.gutenberg.org/etext/345) in just a few seconds for a playable level...then froze the next time I tried it. It has both loaded correctly and frozen on the same files.

By the way, is the entire game supposed to quit when you die? Would it be possible to have it restart the level instead, quitting on ESC or Alt-F4?

while other times it makes the window where I have the shortcut randomly switch to My Documents or Recently Changed Files. (On Vista, btw.)  :-\
Now that's pretty weird!
It's also changing that directory to My Music as well. Weird. :-\

Edit: Playing Nietzsche's Beyond Good and Evil (http://www.gutenberg.org/etext/4363) was trippy. Enemies were shouting "Be still, you pessimistic mole!" and "Become mediocre!"  ;D


Title: Re: Compendium
Post by: AdamButcher on June 02, 2008, 03:11:01 AM
I love this idea, but am having a couple of problems (like many others).

1) I don't know how to make it select a poem that isn't Raven.txt. The only way I can get it to read another poem is to paste one intoe Raven.txt. All other methods seem to make it fault just as it says "Reading Input File".

2)The enemies only quote things in quotes I take? What of poems with no speech? Shouldn't they just quote whole lines/sentences?

3)It's a real shame you haven't been able to get sound, music and varying (themed) backgrounds in time.

Still really nicely programmed. And some poems are well challenge- try "Dead Before Death" by Christina Rossetti.


Title: Re: Compendium
Post by: Sar on June 02, 2008, 03:46:28 AM
It happens immediately after choosing the text in the open-file dialog. The dialog box disappears, the game window opens, but doesn't render anything (it shows my desktop through it in Vista. clicking on it turns the render area black and tells me that the program is not responding). If I see text on the screen almost immediately, it never freezes.

Damn; that sounds just like the issue I've been having, although it's the first time I've heard of it occurring outside of the IDE. :/ I'll look into it some more, but it probably won't be a priority for the deadline since there's all the game-nicety stuff to do before then as well...

By the way, is the entire game supposed to quit when you die? Would it be possible to have it restart the level instead, quitting on ESC or Alt-F4?

Yeah; basically, the game consists a load of nested states, and when you die it quits out of two states. One of these is the 'handle player death' state, and one of them is the 'game-stage' state which contains that. Ordinarily this would quite back to the menu state which sits right at the top, but I've not written a menu yet. ;-) That's for tonight.

It's also changing that directory to My Music as well. Weird. :-\

Have you opened any files from that folder? The only directory-changing stuff I'm doing is changing the application's 'current directory' so that it can still find game assets after you've loaded a text file from a different dir; I wouldn't have expected it to be even possible to affect the instance of Explorer which the app was launched from...

Enemies were shouting "Be still, you pessimistic mole!" and "Become mediocre!"  ;D

Awesome. ;-)

For a long while I was testing it with Full-Life Consequences, mostly 'cause it turned out to have a nice tall and wide game arena, and at the time - I've since changed some of the generation - the stage opened with a few seconds' pause, followed by a single guy charging right down the middle yelling "ITS TIME TO END THIS ONES AND FOR ALL!" ;-)


1) I don't know how to make it select a poem that isn't Raven.txt. The only way I can get it to read another poem is to paste one intoe Raven.txt. All other methods seem to make it fault just as it says "Reading Input File".

The interface for this will be improved before I mark it as 'finished'; are you starting the app with the '-O' commandline argument (a temporary hack) and getting the same freezing issue that Noyb was describing?

2)The enemies only quote things in quotes I take? What of poems with no speech? Shouldn't they just quote whole lines/sentences?

Yep, just stuff in quotes. I guess it wouldn't be too hard to check whether it's managed to glean any quotes and take some likely-looking lines if it hasn't, but it's a whole lot harder to detect sentences that make sense on their own from free text, which is why I'd not done it previously. I expect some of the time to get some pretty weird utterances when grabbing stuff which isn't dialogue!

3)It's a real shame you haven't been able to get sound, music and varying (themed) backgrounds in time.

(As it goes, I should be able to get some sounds done this evening, and at the very least drop a combat theme from a previous game in so it's not totally silent the whole game.)


Title: Re: Compendium
Post by: Gainsworthy on June 02, 2008, 07:12:56 AM
I also don't know how to use non-raven quotes.

Could you make the game slightly more gratifying? I'm one of those hyped up individuals who needs to see and hear the demise of his foes. The enemy ships are snazzy, but they just vanish! Into the aether!  :'(

Um, also, how much of this is procedurally generated? Think I'd enjoy it more with a little descriptor.

I guess this is still the demo though. I'd love to see this with some more polish!


Title: Re: Compendium
Post by: Hideous on June 02, 2008, 08:15:12 AM
My enemies don't ever seem to actually say anything :(

I open my files with that -O argument, by the way.


I even tried it with The Raven, and the enemies never utter a word.


Title: Re: Compendium
Post by: Sar on June 02, 2008, 09:53:25 AM
My enemies don't ever seem to actually say anything :(

Do they still not say anything when you don't shoot them? The ones that talk start talking after they've been deployed for 1 second, so it's feasible that you could be killing them too fast... in the copy of The Raven which was supplied, enemies nine and eleven should have something to say...


That said, I think I do need to adjust the balance of how frequently the enemies say things; originally my choice-generator had a bit of a bias towards lower numbers, which got taken into account when I balanced stuff... then I noticed this and fixed it, and now things which were picked at the low end of the spectrum don't happen as often as they should.

I also don't know how to use non-raven quotes.

Open the game with the commandline parameter '-O'. An easy way to do this is to create a shortcut to the executable (drag the executable to where you want to create the shortcut while holding Alt), then right-click that, choose 'Properties', then on the 'Shortcut' tab go to the end of the text in the 'Target' box and append "-O" without the quotes, outside of the quotes which are already there.

Could you make the game slightly more gratifying? I'm one of those hyped up individuals who needs to see and hear the demise of his foes. The enemy ships are snazzy, but they just vanish! Into the aether!  :'(

This is a good point. The game needs explosions. And explosion sound effects. This can be done. ;-)

Um, also, how much of this is procedurally generated? Think I'd enjoy it more with a little descriptor.

Basically, it 'randomly' generates the levels for the most part, except instead of using actual random numbers, it reads the text file bit by bit until it has enough bits to make up a number within the range requested. So for example, at the beginning it thinks "Should this be a dense Touhou-esque game with a tiny player collision radius, or should this be a sparse R-type-esque game with a large collision radius?"; this is a 1-bit decision, so I ask for a number between 0 and 1, the number-feeder picks a single bit out of the feed and returns that as the result.

There's quite a bit of structure to the randomness, as well - for example, each enemy it generates has a grade (how good it is) and as the game progresses it should be throwing enemies of progressively higher grades at you; unfortunately one problem right now is that the stages are too long and it's pretty hard to get far enough to see the grade 4 and 5 enemies where they start firing homing and re-vectoring missiles at you...


Title: Re: Compendium
Post by: Hideous on June 02, 2008, 10:40:09 AM
Enemies 9 and 11. Okay, I'll try that.


EDIT:

Enemy 9 was quiet. Enemy 11 did say something though ;D.


You really need to make them speak more often.


Title: Re: Compendium [FINISHED]
Post by: Sar on June 02, 2008, 04:50:58 PM
So, Compendium is finished. Or at least, finished enough for now.

As per first post in thread:

You'll need .NET2.0 (not included), some text files containing poetry or short stories (two included) and to be able to press the arrow keys (to move) and the Z key (to fire) in order to play.

All controls are configurable in config.xml

COMPENDIUM 1.0 (~6.2MB) (http://www.eviscerate.net/stuff/compendium-1.0.zip)

I'll release the classes I used for the number-feeding and text analysis later, in case anyone's interested in that part. Right now I'm too annoyed 'cause I've only been trying to post this for about two hours... lousy ISP caching forum errors and refusing to let me post. :/


Title: Re: Compendium [FINISHED]
Post by: moi on June 06, 2008, 05:46:36 PM
Not an easy concept but nicely done nonetheless.
The game would need more variety in backgrounds, ennemis, pattern, strategies, ship capacities, etc.. and that would be an interesting game (I know the compo delay wasn't sufficient for all that)
Due to the PCG aspect, maybe a time attack style of gameplay would be appropriate (instead of infinite play) ?

Also : I don't know how feasible this would be, but it would be cool if the game could use parts from the text to add a background story or sthg.


Title: Re: Compendium [FINISHED]
Post by: William Broom on June 06, 2008, 06:31:17 PM
WAYWAYWAY too hard for me, but still a cool idea.


Title: Re: Compendium [FINISHED]
Post by: Hideous on June 07, 2008, 05:06:57 AM
I have no idea how to open a file other than the Raven with this :/


Title: Re: Compendium [FINISHED]
Post by: Sar on June 07, 2008, 06:25:29 AM
I have no idea how to open a file other than the Raven with this :/

At the title screeen, up/left and down/right will cycle through options; the speech bubble above the player ship will change. Hit fire (Z, by default) on "Choose a New Story" and it should let you select a new text file to source the game from.


Title: Re: Compendium [FINISHED]
Post by: Daniel Benmergui on June 13, 2008, 02:21:19 PM
I love the amiga-style artwork and music :).

As for the gameplay... nothing much happens... enemies will only rarely shout out any Raven quotes, which was dissapointing :(.

I really liked the idea of enemy poetry quoting though.

Thanks, Sar!


Title: Re: Compendium [FINISHED]
Post by: zradick on June 19, 2008, 08:13:31 PM
Very nice! I particularly liked the music.
The ship design was interesting as well.  Kind of an anime style but without being overboard.
Cheers,
--Zack