SFML community forums

General => SFML projects => Topic started by: lolz123 on December 18, 2012, 03:46:04 am

Title: Ludum Dare 25 Entry - Hero Must Die
Post by: lolz123 on December 18, 2012, 03:46:04 am
Hello,

I took part in the LD25 Jam, and here is my entry:

http://www.ludumdare.com/compo/ludum-dare-25/?action=preview&uid=7769 (http://www.ludumdare.com/compo/ludum-dare-25/?action=preview&uid=7769)

It uses SFML for windowing, sound, and threading.

It uses the NEAT algorithm from the visualization program I previously posted about on this forum: http://en.sfml-dev.org/forums/index.php?topic=9897.0 (http://en.sfml-dev.org/forums/index.php?topic=9897.0)

The AI powered by these neural networks tries to beat levels that you set up with obstacles. You must stop the AI from reaching the princess.

Here is a screenshot:

(http://www.ludumdare.com/compo/wp-content/compo2/201083/7769-shot0.png)
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: Nexus on December 19, 2012, 06:45:16 pm
The AI sounds pretty interesting.

When I start NEAT_Visualizer.exe, the screen remains black. After some time, there are single pink and gray pixels, but the biggest part is still black. How do you render the graphics, if not with SFML?
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: eXpl0it3r on December 19, 2012, 07:19:34 pm
When I start NEAT_Visualizer.exe, the screen remains black.
Unfortunately I can confirm this. The rendering of the images from ui/ and transition/ don't work.
The rendering of the tiles and the robots work fine though, but I can't see the items and can only guess from the screenshots which is placed where.

Maybe some problem with ATI graphic cards?
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: lolz123 on December 19, 2012, 08:01:56 pm
A couple of people reported this issue. I only used SFML's text rendering, the rest I did manually in OpenGL. Perhaps it has something to do with the title textures not being a power of 2. However, all the UI stuff is a power of 2, which is sort of strange.

I uploaded a new version with this modification and some other potential fixes.
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: eXpl0it3r on December 19, 2012, 08:31:05 pm
Perhaps it has something to do with the title textures not being a power of 2. However, all the UI stuff is a power of 2, which is sort of strange.
That was an issue with old graphic cards, but shouldn't be a problem nowadays. ;)

I uploaded a new version with this modification and some other potential fixes.
Okay now the intro (and I guess the outro) appear fine, but the items still don't show.

I wonder though, why have saved all the images rotated? ???
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: Nexus on December 19, 2012, 08:32:47 pm
Okay now the intro (and I guess the outro) appear fine, but the items still don't show.
Same here. I can see the menu, but in-game, only 9 pixels are not black.

There is probably a bug in your OpenGL rendering... Wouldn't have happened with SFML :P
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: texus on December 19, 2012, 09:08:18 pm
I have no problem playing it on linux through wine (intel graphics card).
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: lolz123 on December 19, 2012, 09:33:22 pm
I think I figured it out. In newer versions of OpenGL, you can use glEnable/glDisable for OpenGL arrays. But in older ones you have to use glEnableClientState/glDisableClientState.

Try out the new version! Also, thank you for taking the time to help me debug my game!
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: Nexus on December 19, 2012, 10:02:31 pm
You get closer ;)

Now I can see the bar at the top with "Play" and 3 numbers, but the playing field remains black, apart from the 9 pixels.
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: lolz123 on December 19, 2012, 10:09:36 pm
Oops, I didn't change the code in all instances ::)

Thank you for your help!

EDIT: Should be fixed now!
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: Nexus on December 19, 2012, 10:28:51 pm
Yes, it works now. Cool gameplay :)
I played it through, apparently sometimes it's possible to succeed with fewer tiles than available.

I saw a tiny imperfection (you probably know it): In some levels, I already succeeded, and the hero walked to the right into a wall. Then his position is reset before the wall, he walks in again, and so on...
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: lolz123 on December 19, 2012, 10:40:19 pm
Yeah, the puzzles are mostly pretty obvious, mainly because there are only 3 items and I made all the levels in the last hour  :P. The last one can be done with 1 item.

Several bugs with the character physics actually only became noticeable when I transferred the controls of the character inputs over to the AI. Learning AI can learn to break your game! Originally, it somehow was able to wall jump to beat levels. That was fixed, but I didn't get around to fixing the wall hugging.

Again, thanks for testing out my game!
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: eXpl0it3r on December 19, 2012, 11:45:44 pm
Well the icons still don't appear over here, even with the latest release... :(

Not sure what caused it, but the AI was once able to beat the first level although I had placed the spikes on the floating platform. ;D
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: downtimes on December 20, 2012, 01:38:33 am
Quote
Not sure what caused it, but the AI was once able to beat the first level although I had placed the spikes on the floating platform. ;D

I can second that. The same thing happend to me. The AI used some kind of long jump and barely made it over the gap.
I then changed the spikes around a bit and after a while just placed them on the floating tile again. The second time the AI wasn't so smart. Bit confusing to have different behaviour every time, but learning AI simply does have that drawback ^^.

Nice game never the less. Some more levels would be appreciated!
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: lolz123 on December 20, 2012, 02:02:57 am
I actually had that happen as well, but only after the competition deadline. It doesn't happen very often, because like you said, it barely makes it when it does. If I reduced the weight perturbation amount and increased the number of generations, it would happen more often.
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: lolz123 on December 22, 2012, 06:26:27 am
I released a post-compo version, with 4 new items and 7 more difficult levels!
Also, the AI is smarter. You can find it using the same link as for the previous one.
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: Nexus on December 22, 2012, 10:44:06 am
Cool :)

What's the difference between the white and red spikes?
Title: Re: Ludum Dare 25 Entry - Hero Must Die
Post by: eXpl0it3r on December 22, 2012, 11:10:25 am
Yes, nicely done!
And now I can even see the items in-game. :D

What's the difference between the white and red spikes?
I think the red ones can only be placed next to a  platform, whereas the white ones can be placed anywhere.

Unfortunately we never get around to place some ice items...
Also I was wondering if it's intended that you can't place an arrow item on a self placed platform (if you click on the platform it only disappears.)?

As a 'features request' it would be nice if one could either reset the whole level or simply go back to what one already had and only make changes. ;)