[Beta Release] Snakes - Local play 1-8 players

Current Version: 0.2.5

Gameplay from 0.2.2, thanks to pickPickles:


Introducing a local play game supporting 1-8 players!
This is a great party game!



w5aNmaE.png

0.2.4:
  • 1-3 Bot opponents to play against while waiting for friends to join!
  • Autopilot feature!
  • Will go back to Start Screen if you leave game.
0.2.3:
  • Fixed many netcode anomalies
  • Fixed message flooding after host leaves game options menu
0.2.2:
  • Added "Occasional holes" game option by request of Kingdra. This makes holes about 1/80 dots of your snake on average, allowing you or anyone else to pass through them.
0.2.1:
  • Added Screen Score system. This reflects a score based on the combined lengths of all snakes on the screen at the end of the round.
  • Added High Score system. The High Score is based upon the Screen Score at the end of the round. The winner takes the full Screen Score. Messages will be displayed to all players if you obtain a new high score!
  • You can now reset your High Score by holding R and pressing Y at the start screen.
0.2.0:
  • Fixed bug when many long snakes die in "Disappear on death", the game slows down.
  • Official beta release!
0.1.7:
  • Added new game option: Disappear on death. Now you can have a true tron cycle bike game mode by enabling: Tron mode, No apple, Disappear on death.
  • Fixed a slew of bugs, including: ghost readies, being unable to press A for the first second at the end of a round, dropping death packets that force some players to stay in game when round is actually over, players getting stuck in "game starting...", and many more.

CURRENT KNOWN BUGS:
  • Bots do not know what to do during a game with "No apple" mode enabled.
  • If two snakes cross at the same time, they will both live. This is not technically a bug, as when I asked players how they'd like to handle it, they decided it's more fun if they both live when this happens.
  • Sometimes when using Autopilot in local play, the bot appears longer to other players.
  • If you close the lid while hosting, you may be unable to start a game without re-opening Snakes.
  • All of these bugs will be fixed soon! Sorry about that.
To Start A Game:
You do NOT need a wifi connection to play with others that already have this game installed, but you do need WiFi enabled on your 3ds so local play can work.

Read the instructions on the bottom screen.


At the Start Screen, press START to quit.

Press X to display the QRCode to the latest .cia release of Snakes! Use this so friends can easily install the latest version and play with you. For installing this way, you need a wifi connection and a QRCode .cia installer: https://gbatemp.net/threads/release-qr-web-installer-cia-installer.416243/

Press A to host and start a one player game. HOLD A to wait for a 2nd player to connect.

Hold B to scan for a room. If more than one room is found, you will be able to choose them from a list. The selected room will be highlighted in yellow. If you see a list, press A to select that room to join it.


When joining a room that is in-progress, you will join as dead. This is to be fair to other players. When this happens you will have to wait for the end-of-round screen before you can interact. Press START to quit.

Press Y at the start screen to change your username. This will only be displayed IN the game, not when selecting a host to join.

Press SELECT for game options. Press B to go back a screen. Using directional input will allow you to highlight a selection in yellow. Press A to select. In some sub-menus, pressing A will highlight a special selection in red. When this happens, pressing directional input will change the red value. Press B or A to stop selecting the value. You can always press B to go back a screen.

Here are the game modes you can toggle any combination of:



    • Boundaries kill: Classic snake! You can't touch the boundaries, or they will kill you.
    • Tron mode: For a game of tron, enable this and "No apple" to experience a true tron cycle bike game! Snakes will always grow, and never have a true tail.
    • Disable diagonals: For those of you that think the CPad's automatic diagonals is too OP, this is for you.
    • Disable A: Don't like being able to go fast? Disable it here.
    • Disable B: Don't like being able to go slow? Disable it here.
    • Disable Y: Hate it when people teleport the apple? This is for you.
    • Enable R: Be able to go in reverse by pushing the R button.
    • No apple: Forget the apple, just kill everyone!
    • Apples double length: for easier advantage over other players. you get twice as long for every apple you get
    • Disappear on death: What it sounds like. Use this, no apple, and Tron mode for a tron cycle bike game mode.
    • Occasional holes: This makes all snakes occasionally have holes in them at random. On average, it happens 1/80 "dots". To put this in perspective, non-Tron games start with a length of 40 dots. Requested by Kingdra.
You can also select how many bots you want to play against in one-player. Select the top line that displays "Number of bots: 1" and press Right or Left to increase or decrease the bots.

You can also press up/down to select a specific bot to change its difficulty.
The difficulty range is as follows from most difficult to least: Insane > Hard > Medium > Easy.


How to Play:
This version of snake is a little different from the average!

Your snake is always moving, whether you want it to or not!


To change direction, Use the CPad (left thumbstick) for easy curves, or the D-Pad for precise directional changes.

Your snake is a unique color line that grows the more you eat apples. Don't run into yourself or other snakes! If you die, on the bottom screen it will say in parenthesis who you ran into.

Apples are white dots. Run over one and you will gain a point and get much longer than in the average snake game.

Hold A to go twice as fast!
Hold B to go twice as slow!

Press Y to move the apple once! You can only do this once until someone scores a point. You can still do this when you are dead! Annoy the last one standing by moving it around right before they get it!

Once everyone is dead, or the last one alive gets the highest score, the round will end. To continue, press A! You may not be able to press A right after the round ends, it will be ignored for one second. Once everyone presses A, the next round will begin! You can tell if someone is ready by noting a green R under their score.

You can also press L to toggle Autopilot. Whenever this is enabled, you forfeit that round even if you disable it before the round ends. This is to be fair to others.

Some META:
If the apple is stuck in the center of a square/circle of your long tail, you can teleport it by pressing Y, or you can move in layers (back and forth) to use up the least amount of space possible. Eventually the end of your tail will stop wrapping around the apple as it catches up to you.

Having trouble getting the apple? Hold B when getting close to it for fine maneuvers!

In multiplayer, you basically have one of two goals:
  • Get apples until you are big enough to kill everyone else
  • Kill everyone first by moving quickly, then grab the remaining apples needed to get the highest score.
  • The Cage Strategy: If you are longer than the last person alive, you can wrap around them and bite your own tail to prevent their escape. You obviously have gotten more apples than them, so they will be forced to suicide and lose. Suggested by elementalcode
Screen Score:
The Screen Score is the balancing between all game modes to give an accurate "score" for the end of the round. This score is calculated by all devices adding up all client-side snake lengths, and sharing this number. All devices agree to use the largest number shared, and this becomes the "Screen Score". If this screen score is higher than the winner's current High Score, it will display a message on all devices saying they have obtained a new High Score, and it will automatically save to the winner's save file on the root of the their SD card.

Credits:
  • Wolfvak - for graphics help like finding color from frame buffer. thanks a lot!
  • smealum - for ctrulib and other contributions to homebrew dev
  • fincs - graphical rendering! Helped me fix a major bug that slowed the game down.
  • Stary - both Stary and fincs both helped me discover and fix a bug that slowed the game down due to inefficient graphical rendering. Thank you so much!
  • zaksabeast - for helping me with this release
  • pickPickles - testing and recording gameplay with 8 players
 
Last edited by Desynched,

Desynched

Well-Known Member
OP
Member
Joined
Jan 4, 2017
Messages
107
Trophies
0
Age
37
XP
171
Country
United States
I am implementing path finding into snakes.
This means one thing for now:
apples are more fair when moved. If the last people alive are in tight spots, it will place it somewhere they can get it... unless, of course, it is TOO tight, in which case it doesn't care, because you obviously goofed up.

But, if you are in a box bigger than 20 x 20 (in any shape), it will try to place the apple somewhere you could technically get to it, if you're really good :)

edit: this also opens the possibility up for ai opponents. However, they will probably be very, very stupid.
 
Last edited by Desynched,

Desynched

Well-Known Member
OP
Member
Joined
Jan 4, 2017
Messages
107
Trophies
0
Age
37
XP
171
Country
United States
Link to the nightly release here: https://github.com/DDews/Snakes/releases/tag/0.2.4

So I'm releasing a nightly for 0.2.4 so people who are interested can test it out.
The autopilot is not perfected. It employs no strategies for survival or killing others, and it doesn't keep memory of where safe places to go are.
If it is unable to compute a pathway to the apple before it moves a "square" on the grid, it will start over on calculating.

Right now I am trying to write code so that it remembers the previous pathway it found if it hasn't changed. This should make it so when its aimlessly running around, it will still be able to "think" every frame about where it can go... Kind of like a person, this will allow it to "think" as it moves slowly.

You can tell if autopilot has failed to find a path in time because it will move mostly erratically, and it will slow down.

Here is some footage of two 3ds's both using autopilot against one another:



edit: fixing the "came from" path is proving incredibly difficult...
 
Last edited by Desynched,
  • Like
Reactions: Quantumcat

Desynched

Well-Known Member
OP
Member
Joined
Jan 4, 2017
Messages
107
Trophies
0
Age
37
XP
171
Country
United States
Quick update on where I'm at so far in design.

Soon there will be ai opponents! However, due to processing times, they won't be playable with other players.

The apple, when moved, will continue scanning it's area until it finds a player. If it is unable to do this due to obstacles, it will teleport to a new location. This is independent of your Y usage.

Auto pilot will be allowed, but this will forfeit your score for that round. So if you want to go afk during a round with friends but don't want to kill yourself, you can turn auto pilot on and it will auto-ready for you and play for you. You just won't be able to get a new high score this way. You can also auto pilot against an ai opponent to see which one wins. Spoiler: they will most likely move very similarly to each other, since they both use the same algorithm :P

Other changes I plan for after this next version release:

Improve path history by using linked lists to simplify calculations for snake length and screen score.

Implement true TCP so that connection drops of any size will still be recoverable.

Rewrite code so it's more modular and professional. Basically stop being lazy.

Where I'm at as of typing this:

Autopilot is almost done. This code will be reused for ai opponents. The code will mostly be reused for apple validation as well. Just need to make it so it realizes it's tail movement opens up new paths. I estimate to release 0.2.4 early next week if all goes well.
 
Last edited by Desynched,

Desynched

Well-Known Member
OP
Member
Joined
Jan 4, 2017
Messages
107
Trophies
0
Age
37
XP
171
Country
United States
This sounds neat with autopilot integrated into multiplayer. I'll try it out soon.
Great! Glad someone finds it interesting. I spent a whole week ironing out the path finding :)

So, the "ai" should stall a bit if it doesn't find a path to the apple. While it does this, if B is enabled, it will go slow, and continue to scan the screen for a path to the apple, building upon what it's scanned so far. However, if another snake crosses it's planned path, it starts over on it's path finding, starting from scratch. This happens often with multiple ai's as they tend to bunch together and cut each other off. This is why despite being designed to allow multiple ai's in one player, it defaults to just one.

I made it never use A button as it would be way too good. I plan to leave it as a difficulty option in a later release.
 
Last edited by Desynched,

Desynched

Well-Known Member
OP
Member
Joined
Jan 4, 2017
Messages
107
Trophies
0
Age
37
XP
171
Country
United States
Or have the AI randomly speed up and slow down, that would be exciting.
This is a good idea. It might make multiple ai's be a bit more unique :)

What's your background, @Desynched ? Are you a professional game developer?
I'm a college student, but I'm projected to graduate in spring of next year if all goes well. I've only coded a simple room server for an indie game at my friend's 3 person game company. If you look at the code for snakes you'll see a big mess, showing how amateur I am. I'm flattered you ask! Hopefully I'll find time to clean it up after this version release.
 
  • Like
Reactions: Quantumcat

Desynched

Well-Known Member
OP
Member
Joined
Jan 4, 2017
Messages
107
Trophies
0
Age
37
XP
171
Country
United States
tldr; The current nightly release 0.2.4.2 has faulty ai that is incapable of scanning the entire screen for paths. This will be fixed soon. If you have an idea on how to handle another options menu let me know.

I noticed a couple bugs with the ai.

The current nightly release doesn't properly build upon previous area scans for it's pathfinding.
You can easily replicate this by quickly getting to the apple with a higher or tied score against Saad and die wrapped around the apple. Saad should start going on really long paths back and forth, as it chooses the farthest known path and goes to it while scanning more of the area. However, Saad just continually moves in short distances because he never builds upon his previous scanned areas. This means he currently is incapable of finding more complicated routes.

I am fixing this and implementing a way for Saad to teleport the apple once (like anyone else can) if he can't get to the apple, and dying if he still can't get the apple after thirty seconds.

All of this is working as I want it to on my private build, except he now doesn't properly avoid people cutting him off. While this makes him more human, it's often ... too amateur. He will sometimes suicidally move straight into your snake many seconds after you cut off his planned path, even about two full snake lengths in front of him. I ran out of time to finish fixing this today, but plan to have it fixed tomorrow. I will also be able to implement a difficulty setting for him soon, which will change how easily he avoids someone cutting him off or how easily he goes through tight spaces. The latter difficulty setting I'm not exactly sure how I'm going to efficiently implement yet, but I hope to. (crazy to think that a perfect ai is simpler to make than an imperfect one)

I am also thinking about ways to implement game settings that will [most likely] be separate from the game modes menu (select button). I want this new menu for setting things like computer opponent difficulty, etc. I am running out of buttons for options... So I might make the select button first display a menu that you choose between the original game modes or game settings menus. I am still undecided about how to handle it. If you have a suggestion let me know.
 
Last edited by Desynched,
  • Like
Reactions: Quantumcat

Desynched

Well-Known Member
OP
Member
Joined
Jan 4, 2017
Messages
107
Trophies
0
Age
37
XP
171
Country
United States
Just wanting to let you guys know where I'm at.

I'm experiencing a bug that is proving difficult to track down. It causes the o3ds to freeze, but not the n3ds. I know it's not running out of memory, but that's all I'm sure of.

This week I'm pretty busy with classes, so it might be a while before I'm able to fix this. I've also decided I will clean up my code in the meantime until I find the bug. So it might be a week longer before the computer opponents are released.
 

Desynched

Well-Known Member
OP
Member
Joined
Jan 4, 2017
Messages
107
Trophies
0
Age
37
XP
171
Country
United States
So I'm getting close to finding the bug.

This is embarrassing to say as a developer, but I'm not sure what caused the problem or why this solution fixes it. Granted, I didn't have much time to work on it.

Apparently calling the function that redraws the console at the start of one of the pathfinding functions prevents the o3ds from crashing. I'm not completely sure why this happens or why it is needed. as this function is called often anyway. The n3ds doesn't seem to mind either way. Hopefully I will learn the true root of the problem soon, but at least I found a simple solution.

I didn't have much free time to do much on the game today, and tomorrow I have a lot of classes, so I may not be able to release the version until next week. I'm sorry about that.
 

Pickpickles

Active Member
Newcomer
Joined
Oct 5, 2016
Messages
39
Trophies
0
Age
24
XP
138
Country
United States
So I'm getting close to finding the bug.

This is embarrassing to say as a developer, but I'm not sure what caused the problem or why this solution fixes it. Granted, I didn't have much time to work on it.

Apparently calling the function that redraws the console at the start of one of the pathfinding functions prevents the o3ds from crashing. I'm not completely sure why this happens or why it is needed. as this function is called often anyway. The n3ds doesn't seem to mind either way. Hopefully I will learn the true root of the problem soon, but at least I found a simple solution.

I didn't have much free time to do much on the game today, and tomorrow I have a lot of classes, so I may not be able to release the version until next week. I'm sorry about that.
Take your time on it. After all, you're the one working on the game.
 

Desynched

Well-Known Member
OP
Member
Joined
Jan 4, 2017
Messages
107
Trophies
0
Age
37
XP
171
Country
United States
So the speed of your snake will be different in this next release. The new fast speed is what the original default speed was. The default and slow speeds are adjusted to match the original ratios.

I hate to do this, but it takes more clock cycles to do the pathfinding, so with the original speeds the game would slow down. This would make it so when the player was holding A to go fast, but the computer opponent was still pathfinding, the player would instead be going close to default speed even when holding A. Then once the computer found the path, the player would go back to fast speed and crash into a wall. I tried making it only use free clock cycles on pathfinding, but when a player went fast, there was literally nothing left to work with, causing the pathfinding to fail, making the computer opponent trivial to beat and severely flawed.

I can't make it slower just for when people play against a bot because people can still use auto pilot in multiplayer, which would cause a desync. I decided, as well, that the previous fast speed was suicidally fast, while this new speed is more controllable.

There may be hope for a faster game, though. I'm looking into different ways to draw to the screen, and hopefully I can find a more efficient way to draw the snakes.

edit: This is old news - I have fixed this problem by refactoring the graphical rendering. Special thanks to Stary and fincs!

Working on this project really showed me flaws in my programming in general, not just in coding in C. With the help of the 3ds dev community I've discovered many better ways of doing things, including code organization. If I were to redo this game, it would be much more elegant. Because of that, I plan to work on refactoring the code for the release after this next one, meaning the release after this next one will probably take much longer than the previous.

You can expect 0.2.4 soon. I just want to make an options menu for the computer opponents as well as thoroughly test the game. Hopefully around Feb 8th it will be released. The code will not be refractored until much later.
 
Last edited by Desynched,
  • Like
Reactions: Quantumcat
D

Deleted User

Guest
Curious question, forgive me, coding noob. Why does such a simple 8bit game take so much of the 3ds's power when we've got many 3d games, ala pokemon.

Sure'll such a huge amount of power being needed is coding issues (Just saying, no offence meant!) or is something else going on?
 
  • Like
Reactions: Desynched

Desynched

Well-Known Member
OP
Member
Joined
Jan 4, 2017
Messages
107
Trophies
0
Age
37
XP
171
Country
United States
Curious question, forgive me, coding noob. Why does such a simple 8bit game take so much of the 3ds's power when we've got many 3d games, ala pokemon.

Sure'll such a huge amount of power being needed is coding issues (Just saying, no offence meant!) or is something else going on?

To be honest, I'm not quite sure. You're right, and my code is really inefficient, or something else is going on. I haven't really begun refactoring my code, so I might find something incredibly inefficient when I do.

My best guess is I'm doing graphics inefficiently.
 

Desynched

Well-Known Member
OP
Member
Joined
Jan 4, 2017
Messages
107
Trophies
0
Age
37
XP
171
Country
United States
I found what was slowing the game down: my ignorance in graphical rendering.

I was using immediate drawing all wrong, and now I have it using GPU_TRIANGLE_STRIP, which sped things up by a ton.

Original speeds are back. Ignore the previous post of needing to slow the game down.

edit: special thanks to fincs and Stary for helping me discover and fix my problem :)
 
Last edited by Desynched,
  • Like
Reactions: Quantumcat

LucarioWolf

Well-Known Member
Newcomer
Joined
Jan 14, 2017
Messages
56
Trophies
0
Age
28
XP
190
Country
United States
Trying my best to upload ghetto screenshots using my phone.

I'm at a mcdonalds using their terrible wi-fi so bare with me.

Tomorrow I promise to upload a video that shows 4 people playing.
exactly, terrible WiFi at McDonalds

--------------------- MERGED ---------------------------

sounds like a great game like the one that used to be on the Nokia phones. by any chance can you make it so that others who dont have the game downloadable via 3DS or DS download play?
 

Desynched

Well-Known Member
OP
Member
Joined
Jan 4, 2017
Messages
107
Trophies
0
Age
37
XP
171
Country
United States
exactly, terrible WiFi at McDonalds

--------------------- MERGED ---------------------------

sounds like a great game like the one that used to be on the Nokia phones. by any chance can you make it so that others who dont have the game downloadable via 3DS or DS download play?

The download play checks to make sure the game is signed by an authentic developer, or so I'm told when I asked a similar question in the 3ds dev community. If that were possible you'd probably be seeing "downloadhax" or some other exploit.

However, it is possible to transfer a newer version of the game to an older version (if I put in the time to research and implement a version transfer system). Right now I've got enough feature creep to get through before I can start on something like that, so I added a "ghetto" version of it: press x at Snakes' start screen to display the qr code for the cia file of your version of the game. If your friend has the qrcode installer, they can download and install your version quite easily by using your screen. The problem is they have to have the qrcode installer in their 3ds already, and have access to an internet connection. If they don't have those two things, it's kind of useless. The local play doesn't require a wifi connection, but if I implement the transfer system they'd still have to have an older version of snakes already installed... Because of this, I'm not in a hurry to implement it.

Anyway, thank you for the kind words, and for your post!
 
Last edited by Desynched,
  • Like
Reactions: Quantumcat

LucarioWolf

Well-Known Member
Newcomer
Joined
Jan 14, 2017
Messages
56
Trophies
0
Age
28
XP
190
Country
United States
The download play checks to make sure the game is signed by an authentic developer, or so I'm told when I asked a similar question in the 3ds dev community. If that were possible you'd probably be seeing "downloadhax" or some other exploit.

However, it is possible to transfer a newer version of the game to an older version (if I put in the time to research and implement a version transfer system). Right now I've got enough feature creep to get through before I can start on something like that, so I added a "ghetto" version of it: press x at Snakes' start screen to display the qr code for the cia file of your version of the game. If your friend has the qrcode installer, they can download and install your version quite easily by using your screen. The problem is they have to have the qrcode installer in their 3ds already, and have access to an internet connection. If they don't have those two things, it's kind of useless. The local play doesn't require a wifi connection, but if I implement the transfer system they'd still have to have an older version of snakes already installed... Because of this, I'm not in a hurry to implement it.

Anyway, thank you for the kind words, and for your post!
cool, and thanks for the feed back
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: I may take a shower to remove all the sunburns in my body