Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics

3D Flying Snake Devlog

A topic by BloodyPommelStudios created Dec 19, 2017 Views: 275 Replies: 2
Viewing posts 1 to 3

Since I've been here for a few days now I suppose I'd better start a Devlog. I've spent the last couple of days trying desperately to promote my game. Researching marketing, emailing journalists, emailing letsplayers, starting a twitter account, uploading pictures, videos etc. All the dull stuff devs generally don't talk about. There's a ton of great resources here to help with that aspect of things such as this thread:

I got very very lucky when I released an early build on Newgrounds and receiving 20k hits in my first week after getting featured, I wasn't expecting a repeat of that I was expecting at least double digit downloads. Anyway I'm certainly not giving up, success cannot happen over night.

I'm still waiting on emails, these people no doubt get 100s of emails per day so maybe things will suddenly pickup once they process the emails.

I have to be real here though! I have also spent a silly amount of time downloading games from here and procrastinating. I find it very easy to tell myself that I'm playing games for the purpose of research and inspiration but deep down I know that at the moment I'm a gamer first and a dev second. I urge other new devs to try not to fall in to that trap!

Anyway since there isn't much else to tell about from the last few days I guess I'll tell you the story of how 3d Flying Snake came to be. 

A friend of mine was learning to code and decided to make a simple snake close. Since I'm as competitive as a 6 year old I decided to do the same thing but make it 3d.

I got off to a good start but then ran to a game breaking bug where after a while the snake would become misaligned and rather than moving on a flat plane he started spassing out and flying in to space. After about an hour of failing to fix this bug I realised it would be more fun to turn it in to a feature. 

After about a week I had a functional game and decided to upload it to Kong. It only got 2 stars there and quite frankly at that point it deserved it. It had bugs, it probably ran slowly on a lot of people's computers, it took too long to load, the snake was too slow and it was lacking any level of polish. I also had a crazy idea to use procedurally generated music at that time to improve download speed but it sucked and nobody liked it. At this point decided to let the project go.

Fast forward a few months and a Youtuber I was subscribed to made a random video about Newgrounds. I hadn't been there for about 10 years! Many fond memories, I had to see how the site had changed. I found some great games but 90% of them I found myself thinking "I can do better than that, why don't I try uploading something?". I fired up Unity, looked over a few of my old projects and decided I could vastly improve the snake game. 

Simply speeding the snake's up, optimising and changing the music made a world of difference. I ditched the proceedurally generated music, the quality just isn't there yet and wasn't worth trying to save a couple of MB.  At this point the game was a long way from what it is now but 1000s of people seemed to love it so I decided it was worth my time continuing development.

I got a crazy amount of feedback and relentlessly trying to fill everyone's requests. More sound effect, particle effects, made fruit colliders bigger and snake colliders smaller, implemented medals, leaderboards and a radar. 

The number one request though was extra game modes. This was always part of the plan but I was reluctant to do this early on because I knew it would double or triple the amount of tested I needed to do but eventually I caved and instantly regretted it.  People liked the new levels but the game would probably be complete now if I had left it and I couldn't strip it out again after.

I do love Newgrounds but it's not without it's issues. The monetisation absolutely sucks, you get about 1 fan per 1000 plays, there are a few really abusive dicks there, views drop off rapidly after the first few weeks and good games get stolen and put on other websites, seriously at one point Flying Snake's Newgrounds page had 4 pages above it in Google searches from sites which had stolen my game! That was an eye opening experience, I was actually quite shocked at how much effort some of them went to rewriting the description, posting screenshots and even making gameplay videos.

Anyway I've now got a fantastic 3d modeller now too so we will see some great graphics once he's made the assets but due to circumstances beyond his control he's had to take a leave of absence so that's when I decided to take a break from coding and start promoting the game on other sites like Itch and Gamejolt, hopefully making a little cash from it as well.

Starting tomorrow I'll be continuing the game and maybe attempted to do some 3d modelling as better placeholders. The remaining features left to add are:

  • Changing the radar to a render texture (the radar is currently an overly camera which doesn't scale quite right)
  • More music and making a player
  • APIs for online leaderboards
  • New Levels / game modes
  • Updated graphics
  • In game graphics settings rather than Unity's startup screen
  • Improving the UI again
  • Snake designer 
  • Split screen
  • Lots of snake puns (I've been meaning to put them in for a while)
  • Exploding snake and death cam
  • VR? Twitch intergration, Twitter integration? Screenshotter? Video recorder? - These are not set in stone, simply things I'm looking in to.

I'll update everyone as these develop but if anyone wants any information about how a particular feature was achieved let me know and I'll make sure to include it at the end of my next log.

Update Time!

I was hoping to have the next build up by now but it's taking a little longer than expected. What I'm focusing on at the moment is UI and adding extra options.

The Options panel is going to be split in to 3 tabs, Graphics, Audio and Controls.

I'm close to finishing the upgraded audio panel. First off I added a separated effects from master volume, I've been meaning to do this for a while now but I decided to save it for when I overhaul the audio system.

Next I decided to implement a sound test like you often got on classic Mega Drive games. This is the first time I've used dropdown boxes. I spent ages trying to figure out how to pass the dropdown text to my sound manager script before realising I could simply call another script which reads the label.

I knew I was going to add more music and wanted players to be able to chose their track so I've made a miniature music player. Because I'm a glutton for punishment though I couldn't just leave it there, I decided it would be really cool to make a visualiser for it as well. After about 6 hours work and learning about fast fourier transform and other stuff my feable brain had never heard of before I finally got a line renderer displaying the frequency data currently playing. Then I added sepperate lines for left and right and did the same thing for the raw sound output. This was then split off to another layer which is invisible to the main camera and rendered separately to a render texture placed inside the player. Another hour of trial and error and I finally got something I'm happy with (see video below). There are so many things I want to try with the visualiser but I'm going to have to restrain myself and wait for another project.

If anyone wants to implement a visualiser themselves this is the basic code to generate the data: 

 public float[] _leftS = new float[256];
    public float[] _rightS = new float[256];
    public float[] _leftO = new float[256];
    public float[] _rightO = new float[256];

public int outputOffset = 64

public int outputMulti= 40

 public LineRenderer rightOutput; //LineRenderer used in the example

void Update(){


for (int x = 0; x <= 256; x++){

//Actual visualisation code goes here! 

// You will probably want to add variables and experiment with multipliers, offsets etc.


 Vector3 rOutput = new Vector3(x / 2, (_rightO[x] * offsetMulti) + (outputOffset), 0);
           rightOutput.SetPosition(x, rOutput);

// use similar code for everything else you want to visualise.

//Doesn't have to be a LineRenderer, you could use GameObject[], particles, terrains, spawn enemies, whatever you want!



 void GetSpectrumAudio(){

        AudioListener.GetSpectrumData(_leftS, 0, FFTWindow.Blackman); //Applies currently playing spectrum data from the left channel to a float[]
        AudioListener.GetSpectrumData(_rightS, 1, FFTWindow.Blackman); ////Applies currently playing spectrum data from the right channel to a float[]
        AudioListener.GetOutputData(_leftO, 0); //Applies currently playing raw output from the left channel
        AudioListener.GetOutputData(_rightO, 1);//Applies currently playing raw output from the right channel

// You don't need to use all of these if you don't want to.

I've still got to add track and artist information to each music clip but apart from that it's pretty much done.

As for the graphics options, I haven't started, I've never done this before but it seems simple enough. I really want to replace Unity's default resolution dialogue box with something less ugly. It'll do everything Unity does and perhaps in the future I'll add motion blur, LOD and that kind of thing.

The controls menu could be done in 5 minutes but while I'm doing it I might as well shuffle around some code and add new options so I don't need to go back over it again when split screen is implemented.

Once all that is done the options menu will become a prefab so you can see exactly the same thing when you click setting on the pause menu (below) rather than having all the options cluttering it like it currently does. So far I've just created a button with a cog which animates when you hover over it to access the settings. It uses another render texture as well, I think it will take up slightly less memory than an animated gif image but really I just wanted more practice with render textures.

I've also turned the radar in to a render texture as well which should always display nicely no matter what resolution you play in. I suppose this would be a good opportunity to talk about how the radar actually works. Ideally  I'd like to use code to figure out where to place the food blip on the radar but I'm pretty sure I need to understand quaternion mathematics which I just cannot get my head around at the moment. I'm not sure if my solution is beautiful or ugly but it works by effectively turning a bunch of game objects in to what is effectually a mechanical device. Here's the method I used:

  1. The radar rotates so it's facing the same way as the snake head with it's camera rotating with it so you always see the same side.
  2. The snake head has a "looker" object which always faces the fruit
  3. The "looker" acts as a control for the "radarRotation" object and turns to give the same relative angle as the looker does to the snake head.
  4. The FoodBlip is moved along the radarRotation object from the centre of the radar proportionally to the food's distance to the snake head.
  5. The whole system is outside the map and on a layer which is only visible to the radar camera. What the camera sees is then rendered to a render texture which is placed in to a raw image on the gameplay canvas.

I've removed a bit of screen clutter from the UI too. There were a bunch of buttons I put in so I could port to mobile but there is absolutely no need for it on PC since this can all be accessed more easily via keyboard shortcuts. I'll worry about putting them back in if and when I decide to make a mobile port.

Finally I've changed all the text in the game to Roboto Black and Roboto Regular rather than the ugly Ariel which is Unity's default.  Maybe there's a quicker way I'm not aware of but I went through every single textbox in the game replacing fonts which took about an hour.

Man I really hate doing UI work, I'll be so glad when this part of development is over so I can concentrate on more fun aspects of development.



V 0.94 (WIN) Out.

New features:

  • Over 35 Snake puns
  • New music track
  • New level
  • Fixed bug where pausing wasn't instantaneous
  • Massively improved UI
  • Removed startup screen and added graphics settings in game
  • New badge

I've reorganised a ton of code in prep for split screen too. 

Couple of new minor bugs which I'm aware of:

  • Full screen toggle stopped working, you can switch with ALT+Enter though
  • FOV and camera distance switches back between levels if you view graphics options.

These will be fixed in the next release (0.94 stable) along with a new mac build. I'll also add a loading screen because the levels can now take over a second to load and this is likely to increase when the new graphics come in.