Category Archives: Coding

Low poly water shader:evolved

Hi, folks! I’ve continued working on my water shader! I’ve added transparency and today I added impact waves to the shader, which I’m quite happy with managing to do! It’s limited to 10 simultaneous “impact waves” at the same time at the moment. But adding more is not a problem. The collision points and impact force is sent to shader from script. And waves are calculated in shader.
Have a look at what it looks like in action:

Low poly water shader

Edit: I’ve added a link to a downloadable version of the shader! Copying the code from this post does crazy stuff to the symbols..

The side tracking specialist strikes again.

I’ve been working on another project lately and ended up in need of low poly flat shaded animated water.

I tried editing the mesh at runtime by script. Using the method mentioned by joni.giuro here: http://forum.unity3d.com/threads/low-poly-water-help.276685/

But when using the standard plane with this script, basically 200 triangles and when you’ve separeted all vertices (600), FPS drops down from 1500 without script to 190 with script applied. If you add more planes or models with more triangles you quickly get to a point where you get 1 FPS. So I needed something else.

That’s when I figured I’d try my luck with shaders.

Tried googling for solutions, but nothing was to be found so I needed to build my own. With no experience in shader programming this proved to be harder than I expected. But fast forward through some horrible looking results to today. Now I’ve gotten to a point where I can take any plane (not having to worry about splitting verts) applying my shader and getting this:

Almost no hit on FPS with fully animated low poly flat shaded water with specular color. And with this solution:

I can add looots of planes with this shader with almost no hit on FPS. Here I’ve added got 30 standard Unity planes with 200 tris each, all animating off into the distance.

Here’s a video of it in motion:

So how is this done, you say?

Code below.

It’s not perfect but it works! F.ex. I’ve left the UV coords in there but don’t need them for this. And I’m not entirely happy with the waves just yet.. But here you go.

Link to downloadable version

Slow, not stopped

Progress on Battle Maze has been really slow for quite a while, but not as slow as the updates on this site. I’ve gotten sidetracked by alot of other projects, and personal stuff. Projects I’ve been working on is updates to 3ounce and other apps I’ve made, and I started working on a new game that I probably will never finish. But I’m now back to working on Battle Maze again, and progressing slowly. I’ve decided to use the new UNET Networking API introduced in Unity 5.1 for network games in Battle Maze. So far it seems quite simple to set up, and things are actually working. Documentation of the new API is a little lacking at the moment though so I have to google-hunt a lot to find solutions for simple problems that pop up. But it’s getting there.. I think! I’ve changed alot of the way the game plays lately so I’ll come back with some screenshots and maybe videos soon!

Unity WP8 Shadow Problem

This weekend I recieved an update to Unity (v 4.5.4f1) and I decided to try out getting realtime shadows to work on the Windows Phone 8 Version of 3ounce. Since Unity actually claims “shadows on all platforms”, I still haven’t gotten shadows to work for my wp8 builds.. I’ve tried out every quality setting and tried building a simple scene just for testing purposes, but no go.. This really bothers me since I want my game to look the same for Android, iOS and Windows Phone.. What makes it worse is the fact that on the Windows phone Emulator it Works fine! So I’m guessing that some wp8-phone models could pull the shadows off just fine.. But some, including my Lumia 930 can’t handle shadows. What bugs me is the fact that when shadows isn’t working the entire light actually cast a gigantic shadow covering everything within the max shadow distance..

 

ShadowTest Editor

This is what the scene is supposed to look like (In editor)

ShadowTest wp8

This is what it looks like on my Lumia 930.

ShadowTest wp_emu

And on the Windows Phone Emulator….

I’m not sure if I want to disable shadows for all wp8 or have an option for switching shadows on/off in settings..

We’ll see what I end up With.. but the best thing would be for unity or Microsoft to fix whatever’s causing this..

Getting closer to release

I’ve spent alot of time since my last post working on 3ounce.. And I’m getting closer and closer to re-releasing the game. I don’t have much left on my todo-list. But I do have a little work left in the sound Department… Game sound is not something I’m really good at.. Up until now I’ve been using music and sounds that are Public domain and I’m probably just sticking with that for 3ounce, since I don’t have the money to get someone to make something good for me, and a lot of the Public domain stuff I’ve found online is great! Will be working on the audio this weekend and believe I can finish most of what I have in mind.. After that I think all that is left to do before release is fine tuning.. Will spend some time on making a good trailer for the game also.. Which is another area I’m not very good at… See you later!

3ounce all over the place

It’s been a while since my last post, but I’ve also got a lot of work done!

3ounce has changed radically since it was released for Windows Store. The Things I have changed is:

  • New Maze-generating code. Creates “better” Mazes now. Minor changes.
  • New player control. Before I rotated the entire maze at input, while the player was always falling down. This was quite heavy to process when the Mazes got bigger.. So I changed my code, so now you change the direction of gravity instead, which has improved performance very much!
  • New 3D models (Blender) added for levelcubes, pickups, goalmarker, obstacles ++
  • New particle effects upon pickups, Death, and goal.
  • New pickup and goal placement. Through the use of pathfinding algorithms (A*)
  • Added obstacles around the Maze, With the possability to “die” (Move 4 steps back).
  • Alot of other stuff

I’ve also tested my game on Android, and I’m working on testing it on iPhone (need to borrow a Mac).

Here running on PC, Nokia Lumia 930, Samsung Galaxy SIII and Samsung Galaxy Tab 2.

Running on Android

Here’s some recent screenshots of the game (Some things has already changed from this version):

wp_ss_20140831_0008 wp_ss_20140831_0010 1 wp_ss_20140831_0013 wp_ss_20140831_0014 wp_ss_20140831_0015 wp_ss_20140831_0016 wp_ss_20140831_0017 wp_ss_20140831_0018

Who is this?

I’m back from a fantastic vacation in Rhodes, Greece, and tomorrow it’s back to normal/work.

I thought I should write a little about who I am and what I’ve done before.

My name is Ronnie Moe, and I live in a small town called Odda in the west of Norway. I have two sons and a beautiful woman in my life, that I spend as much time as possible with. I work at a zinc smelting plant as an automations engineer.

My first programming experience is probably when I was little and I wrote code off a book into my Amstrad 6128(?). Making words and numbers come alive was really fascinating to me, and I’ve been interessted in computers and electronics since then. I’ve been programming my own code since about 2006 when Microsoft XNA preview was released. I started to play around with it, but didn’t put any serious work into it at that time. But I made some games with XNA later that never got polished enough to release. Made a platformer called Sheikh, and other small projects. Later I made some apps for Windows Phone 7/8 and Windows Store. I’ve made a board game called Tactiles and a maze game called 3ounce that’s on the Windows store. I started to play around with Unity 3D this year and 3ounce is the first game I’ve released using it.

Appart from programming as a hobby I’ve got a bachelors degree in Electrical engineering. During my education I’ve covered topics as Java programming, algorithms, PLC-programming (Do this alot in my work as well) and other semi-programming related courses.

Other hobbies that I have that come in handy when making games is drawing and painting, 3D modelling, and of course playing other games.

I release my games under the name ‘Trolltunga Kreative’. Trolltunga or ‘Troll’s tongue’ is a local hiking destination where I live. A beautiful wonder of nature, where a rock lies extended from the cliffside like a tongue, with a breathtaking view underneath. Here’s a picture of me there.

IMG_3084.JPG
That’s it for now I guess.

/Ronnie

Unity Networking tutorials

Here’s a quick list of tutorials I have found interesting on Unity Networking.

Brent Farris – Unity Networking tutorials:

Tutorial Playlist

Createathings Unity networking tutorials:

Part 1/4

Part 2/4

Part 3/4

Part 4/4

Sky Arena  Photon tutorials:

These videos are referencing a tutorial asset, that can be bought at the Unity Asset store. I haven’t bought this so I can’t say anything about it. But found the videos interesting either way.

Part 1 – Lesson 1

Part 1 –  Lesson 2

Part 1 – Lesson 3

Part 1 – Lesson 4

Part 2 – Lesson 1

Part 2 – Lesson 2

Part 2 – Lesson 3

Part 2 – Lesson 4

Quill18Creates Multiplayer tutorial:

Part 1/2

Part 2/2

I haven’t decided yet if I wan’t to use PUN or built-in Unity Networking for BattleMaze. Both choices has it’s pros and cons as I see it at the moment, but I think PUN is a little bit ahead.

Do you have any experience with Unity networking? Or PUN? What do you think?

Thank you, Tube

YouTube

A new beginning..

I’ve been too busy to actually do any gamemaking for a while, until a few days ago when i updated my old maze game “3ounce” for windows 8 to windows 8.1. I started doing some changes to the graphics ingame as well, and quickly found that I wanted to do more with it.. I wanted to add some form of multiplayer, and I wanted to do a total overhaul of the looks of the game.. Soon I realized that this was more than just an update.. It had to be a whole new game! And then the idea of “Battlemaze” was born..

I’m new to network gaming so I’ve been reading about Unity networking and also Photon Unity networking. I’ve been looking through some getting started tutorials. But I’ve realized that I need to get a clear idea of what kind of game I’m going to build this time, before I start coding and implementing features.

At the moment it’s all just a big pile of ideas floating around on postIts and in my head. This time I think I’ll try to narrow down all features and gameplay mechanics in some document before I go further.. But I always have to check up on some stuff on the way.. Like lately.. facebook integration, pathfinding algorithms and unity networking/photon.

pathfinding tutorial

How to create a multiplayer game with unity

Photon UN

Facebook for Unity

Do any of you make games? How do you go about planning your games?