Jump to content
  • Advertisement
Sign in to follow this  
Kirl

Battle snake - Testers wanted

This topic is 4137 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Some time ago I wrote a javascript version of Snake, unfortunatly the original thread is retired. I recently added a cpu controlled snake, in an attempt to make it somewhat more interesting and to prevent the inevitable zig-zagging. I read the GD Article on using Genetic Programming to controll a cpu snake, wich was interesting to read but not much use for creating an interesting opponent. My Cpu snake only reaches a length of around 50-120 on it's own (in a 20 x 20 grid) but hopefully it makes for an interesting opponent. :) I have only tested it with IE and FF. Please let me know if you use another browser. Play Battle snake! Ideas, suggestions and opinions much apriciated! [Edited by - Kirl on May 16, 2007 5:55:10 PM]

Share this post


Link to post
Share on other sites
Advertisement
That's cool, and a fun twist - I enjoyed it. ^_^

Perhaps for the next step you could make the snakes thinner and food items smaller, and with it the map bigger (which would mean that the total screen space needn't change). You could also consider creating wall obstacles within the area for the player and CPU snakes to avoid.

Share this post


Link to post
Share on other sites
Cool, you don't see many games developed in javascript.

On my third go, the CPU snake did not appear. I have no idea how to replicate the bug.

Share this post


Link to post
Share on other sites
Thanks for the positive comments!


@ Thaumaturge
Thanks for the suggestions, there is a limmit to the cell size because it is actually html table, some browsers may go all mimsy... I'll give it a try though, thanks.


@ Mr E
I saw you stumbled upon the same idea I had when I discovered I could change bg color on the fly. I like your white noise example! :)

The snake game is waaaay too fast for me though... (and I've had quite some snake practice already)


@ Talib
That's right, when I got the idea of using tables cells as pixels I couldn't resist trying though.

It all started as a joke & coding practice, but now I think JS defenatly has some atractive qualities for simple skill games, compatibilty being a big one (I can play these games on Pc, Wii, Psp and almost any www capable machine).

I also made this Tetris version using the same aproach. :)


No clue about the bug...



Share this post


Link to post
Share on other sites
- There really should be walls, without walls the player needs a huge snake to try to kill the opponent. If you hate walls, large objects in the middle could work.

- The dots should give more length.

- You could try making the front squares fade in and the back ones fade out, to make the movement smoother.

[Edited by - Zanshibumi on May 18, 2007 6:36:08 AM]

Share this post


Link to post
Share on other sites
There was a slight syntax error, I think it fixed the dissappearing snake...


Thanks for your suggestions Zanshibumi!

- You can kill the cpu snake with a minimum length of 4. :)
I added the opponent snake to create a dynamic sort of wall.

- I don't like to increase the growing speed, I can decrease the size of the playField, but I'm not sure. Why do you think the apple should give more length?

- Fading in and out is a good idea, I may give it a try, but it may require quite a bit more cpu power.


Did anybody test it on browsers other then IE or FF?

Share this post


Link to post
Share on other sites
Quote:
Original post by Kirl
- You can kill the cpu snake with a minimum length of 4. :)
I added the opponent snake to create a dynamic sort of wall.

I think it's more interesting as a "kill the other snake" game where the apples are just a way of growing long enough to kill it.

Quote:
Original post by Kirl
- I don't like to increase the growing speed, I can decrease the size of the playField, but I'm not sure. Why do you think the apple should give more length?

I prefer simple games to be shorter and quickly make the player play again. If they are long, most players will only play once and go.

Share this post


Link to post
Share on other sites
I now know what causes the dissappearing snake, this will be fixed soon...


Quote:
Original post by Zanshibumi
I prefer simple games to be shorter and quickly make the player play again. If they are long, most players will only play once and go.
I agree, you're right. You now grow two squares when eating an apple, let me know if you feel it's still too slow. I'm also working on schooling the AI, but that will probably take slightly longer. :)



Do you think your speed should increase when eating an apple? (it currently is, but not noticably) This will give you a slight advantage at first, but it will eventually become a dissadvantage...

Share this post


Link to post
Share on other sites
Quote:
Original post by Kirl
Do you think your speed should increase when eating an apple? (it currently is, but not noticably) This will give you a slight advantage at first, but it will eventually become a dissadvantage...

Let the speed increase but only to a manageable limit.

Also, you could add a button that removes size (and speed) from you and the opponent. That way, you let the player decide how much speed he's able to manage and how much size he needs to kill the opponent snake.

[Edited by - Zanshibumi on May 20, 2007 4:12:43 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!