Uncontrolled intersection better, than controlled?

While creating and testing levels with new features and road signs. I’ve noticed quite a big problem. Traffic flow is better when you just leave all traffic lights green. Basically make an uncontrolled intersection and let the cars figure it out for themself. Yes, cars sometimes crash, maybe more often, than with controlled intersections. But overall intersection throughput is much better.

As you imagine this is not very good for gameplay. Why bother to set up traffic lights if it is just better to leave them always green. Problem is, that the cars are a little bit like daredevils and drive through intersections very confidently. My first thought was to detect such an uncontrolled intersection, where all traffic lights are green, and upon car entering the intersection, make it more stupid, disable some detection colliders. So more crashes would accrue.

I did not like this idea much. My car’s AI is not perfect. They crash a lot already. So I did. So I made them drive through uncontrolled intersections very slow. It makes sense. You just don’t fly through an uncontrolled junction. You stop, take a look around, and approach slowly.

Now if you leave all traffic lights green, for cars it takes much longer to reach the destination. Problem solved. What do you think?

Pathfinding nightmare

Hi, guys. I just one to make a short devlog about what I was doing recently.

So I’m working on a road signs system for my game Traffic brains. I want the player to be able to easily divert traffic and optimize traffic flow through some intersections.

When I started, I thought, How hard can it be. I will just place some roadblocks in my path-finding algorithm. So yeah, needless to say, how wrong I was. I was stuck with this feature for 3 weeks.

So many corner cases. Sometimes pathfinding algorithm will get stuck in the loop or just can’t find the path, even tho it is clearly visible. At least for me.

At first, I thought I don’t need to visualize how my algorithm works. I will debug my code with breakpoints. Just nope. I’m not a genius. I forget numbers fast and unless I’m drawing everything on the paper, not gonna happen.

So I’ve invested some time to make crude visualization, which saved me a ton of time trying to figure out what the hell is happening.

So here are the results of my new road signs feature. I’m pretty happy with how it works. It really adds a new dimension to the gameplay. And sparks new ideas for new levels.

There are more types of road signs. You can increase the speed of the traffic on the open road or bypass. Block road altogether or just limit trucks’ movement.

Dude, where is my road?

This week I’ve been working on a new game mode implementation. Players can pause the game, adjust traffic lights, and then continue traffic flow. This is different from other modes because previously when you stop traffic all cars were removed and each time you start traffic, everything starts from the beginning. Cars were spawning at their starting spawn points. All path findings were when the player tapped “GO”. And if there were no available paths for any car, the player was informed and simulation could not be started…

With this new play mode, where the player can pause the simulation, adjust traffic lights, and maybe even block roads, there are many tricky situations. What if the car can’t reach its destination? What if the traffic light in front of the car is blocked and will never turn green.

It was an interesting week, at first I thought it will be an easy job. How hard it can be? 😀

Check the video, where I’m trolling testing with a yellow car by changing paths.

Parking lots

I’ve got a little bit of feedback about gameplay. Players wish, that traffic was not only cars going once and you are done. They want traffic to continue all the time. They want some purpose for the cars. Like going to the shopping center and back. Trucks delivering goods. Buses driving around.

I’m working on a big update for Traffic Brains 2. Already created parking lots, where cars can park temporarily and then continue their journey. Cars will never stop driving. Your job as a player is to make traffic as smooth as possible, by controlling traffic lights. Your performance will be measured by the Traffic Flow Quality meter.

Road closed

So I’m looking at my traffic AI and I see a huge flaw. If I set the traffic light to never turn green, cars will sit there and just wait, even when there are alternative routes. This gave me an idea. What If you can block the road when you set traffic to never turn green. Then cars should find alternative paths. It would be an interesting game mechanic, where it is possible to divert traffic to alternative routes and avoid conjunctions.

So I implemented this mechanic. And I’m more than happy with the result. It gives a new fresh feel to the game. Now I need to implement new levels, where this mechanic can be exploited better.

Changing traffic flow.

Traffic Brains 2 is nearing release

I’m happy to announce, that Traffic Brains 2 is in final testing. I’m replaying levels many times and I always manage to find new issues and bugs. But I can see light at the tunnel end. When most bugs will be resolved, then the other tedious works awaits. Screenshots for all screen sizes and preview videos. It is not hard to make it for one screen size, but it is time-consuming to make it for many sizes.

I’m a one-man studio, so I avoided feature creep like plague 😀 I have so many ideas, how to improve gameplay, but. I feel if I will not release this game soon, I’ll run out of steam to make it. This game is in development for more than a year. After release, I’m planning to add new levels, with new game modes and improved game mechanics. I laid the foundation of traffic AI, on which I can improve.

I guess it is just my opinion, but this is the best looking game from the Short Story series 🙂 I’m looking forward to know what you think about it.

Traffic brainz 2 project reveal

Do you know which of my created games is most popular? No, not those RPG games with a story. No, no, not those on which I’ve spent most of the time. It is Traffic brainz. Simple puzzle game, where you control traffic lights patterns. It has 10 levels. It has 3.2-stars rating, which is not very good. But the sheer popularity of it made me think about a new, improved version.

So I took my 3D Short Story engine and started porting my old game logic to the new engine. As always, I though I could do it like in 2 days… So one year later I have somewhat working firs level.

I’m happy with how it looks. There is still a lot to do. I have many ideas on how to improve on the old gameplay. So, lets get back to work!

Short Story: Trip releasing

Today is the day. Finally, I’ve decided, that is enough of tweaking. The game is ready for release. So I created new builds, disabled all debug features, and uploaded to the app store for review.

The game is not finished. Games are never finished. They are just abanondoned. But there is always something to improve. I will make updates. I have a list of improvements I want to make. Add more quests, more storyline. Update and improve graphics.

For me, it is a huge sense of accomplishment. It is another milestone in the long road to the ultimate game. With each game, my game engine is improved. This game brought basic 3D graphics to my game. So now I can improve other systems, which were stagnated because I didn’t want them to be created for the 2D game engine.

Here is app preview video, that I created for the app store.

Project 3D coordinates to screen coordinate

I’m on my way to converting my 2D action-adventure game engine to 3D. It should have been easy. Convert 2D tiles to 3D cubes, change up a few textures. All characters as flat planes walking around. All game logic can remain the same, working in a 2D coordinate system. It will take a few weeks to work in my spare time. Yes?

Oh, how I was wrong… Maybe, just maybe if everything went super smoothly without any hiccups, I could do it. But I’ll tell you what. Everyone always underestimates. And here I’m working on my engine for one year. The simple task here, simple task there. On or another feature. It looks like converting from 2D to 3D is just adding one more dimension. But believe me, it adds so much complexity. So much more mathematics needed.

All I needed is to convert the 3D position from the world to the 2D point on the screen. So I can show enemies health bar under their head and some other effects, which are easier to implement in 2D. It should be simple. There should be many easy methods to do that. In other game engines, it is one line of code. Technically it is. In the GLUT library, there are methods just for that. I implemented them and… It doesn’t work 🙁

Work on this problem for 3 days. Sometimes a position is on the screen but at the wrong position, sometimes it is not visible at all. I’ve tried to work out a good “recipe” to get the correct position. Eventually, I did. It works like a charm. But I think to myself, I’m stupid or it is common to have problems with such simple things.

Anyway. Checkout those effects around monsters, which look the same as in 2D, except they are rendered on the 3D scene incorrect position. Neat.

Next logical update?

I was working on my game engine, which is very creatively is named “Boring engine”, which is written in C++ and for graphics uses OpenGL. It is the foundation for all my games. On top of it, I’ve created the Short Story engine, which I’m using to create specific RPG games. Such as John and The Goat and Isolation. My idea is to make a simple game, while each next game has improved mechanics and much more features.

John and The Goat was the very first game. It was so basic, that you barely could say, that it is an RPG. A small step for the gaming industry, but it was a big step for me. I laid the foundation for my next short story-driven games. The next one was Isolation. It had a much bigger world and introduces the dungeons with many new enemies types, boss fights. After that, I updated John and The Goat. Recreated maps, added more quests. Added everything, that SS: Isolation had.

My game is crude. They are missing many game features and are lacking visually. I guess the next logical step would be to at least add proper animation for characters. But here comes a little problem. If I continue to develop my games as 2D “Zelda-like” RPG, the more I make, the harder it would be to update it to 3D, which I eventually want to make.

One day, I just started to play with that idea. How hard it would be to make my games 3D. Game logic can remain the same. Only I will render not flat tiles, but 3D cubes with the textures of the same tiles on the walls or the ground. So I took a shovel and started digging.

About after 3 months of casually working in my free time. I present you my new game Short Story: Trip. It is a very early stage. Even the main map is not finished. Many features from the old 2D version still not working. Many moons passed, while I updated the level editor to support 3D. But you can check out the video and decide for yourself. Is it looking better? More interesting?