Thursday, September 10, 2015

Tutorials never, learning always

Hi,

Today I will write about learning.

Games should teach us how to play. Good designed game doesn't need any tutorial.

Good and clear interface makes easy to understand where are functions that we need. When you play strategy game you won't look in building menu for changing taxes. You should have another bar or icon for that. Everything with clear and understable signs. If you know where find most of things you need, we can call this interface good and clear.

Many platformer games teach by the chalanges. The game starts with small hole to jump over. Next level has bigger, the next one shows us how to jump on walls and etc. We see the progress and we have fun when we 'win' the level. This design is very intresting, because we don't see any words. Everything we can learn by tries and fails.

What when we get this two designs make in one. Good interface and learning not by words and instructions, but by chalanges and tries are natural way how people learn. We see readable signs and icons, so it's easy to understand what it can be. We also love chalanges so we want to try and try while we win.

I love this way to learn and I hope more games will use that. Imagine learning programming in this way, will be a little funny :)

Bye,
Patys

Sunday, July 12, 2015

Making platfromer game with Haxe and Flixel (compo game)

Hi,

I decide to take part in compo. It's local 3 months compo, no topic, no restrictions, just a game. I think the platfromer game will be good.

Where I started? At first I deep into Haxe and Flixel. I passed tutorials and made some simple games, just mechanics so now I think I'm ready to write something bigger.

At first I created simple story. This is basic. You have to know what you want to do.

Next I wrote about a game, what I want in game, etc.
 - 2D platformer game
 - 4 languages (Polish, English, German, Spanish)
 - cutscenes - to narrate story
 - menu, many levels
 - maybe dubbing
It's general tasks, nothing more. Now I see that I need something to manage languages and dubbing, something to show cutscens, managing many game states e.g. select language, menu, game etc.

Flixel provide nice managing game states, so this stuff is done. You just extend your class by FlxState.
In my opinion cutscens will be sprites and texts so every cutscene will be another game state.
Managing languages will be static class with variables e.g. TXT_BTN_PLAY and function selectLanguage(language) where just set variable to needed text.

Flixel is amazing and has everything what game developer need. You can load tilemaps from many programs like tiled, ogmo etc., has included pathfinding on these tilemaps. Flixel has basic things like buttons, physics etc. too.

So what I did for now?
I have done:
 - class for managing language
 - selecting language
 - menu with selected language

It's not much but I started today.
I will post here about progress.

See you soon. Bye :)

Tuesday, July 7, 2015

Best and simplest tutorial about pathfinding

Hi,

Everybody want to have nice pathfinding in game. We need it to many games: strategies, rpgs, platformers etc. so we should understand how it works. I learn pathfinding from here:


I think it's best ever tutorial about graphs and pathfinding. Thanks to Jorge Rodriguez I understood graphs and mainly pathfinding.

Here all videos: https://www.youtube.com/playlist?list=PLW3Zl3wyJwWO7p6xpTzs-QR58DRg2Ln0V

Hope it helps you :)

See you soon.

Wednesday, June 24, 2015

Bitcoin for games - why not?

Hi,

Today let me talk about bitcoins. If anyone don't know them, look here: https://www.weusecoins.com/. Hope it will explain you.

So I found this article https://99bitcoins.com/how-teach-kids-bitcoin-minecraft-answer/ and it inspires me to think why we don't use bitcoins as internal currency for games.

What developers receive?
 - We get nice working currency system.
 - Players can buy goods using real money, but we can do that in very small amounts, e.g. 0.00001$.
 - When we create trade system without npc etc. e.g. players do goods and sell, so we have independent economic
 -  Of course we can add npc which sell potions and earn money for us in bitcoins
 - And many many more ... if you have any suggestion leave in comments

Opportunities are huge, we receive best tool for economic system to our game, simply way to monetize, big community to help and peoples who want that game.




What you think about using bitcoin as currency in games? Maybe you know games using bitcoin, let me know :)

See you soon :)

Thursday, June 18, 2015

Missed awesome - what happened?

Hi,

A few weeks ago I programmed beautiful game. I made graphics, story, only some music left to do (I don't have music skills :c ).

But what when the story is awful? What when you missed something important. This what added "awesome" to game. What when you lost it when you code everything?


So I concede to that. My game is not what I want. I missed something and this game probably never will be released.

I realized I miss source of the awesome when I end programming most stuff and when I played I saw that. This is not my game, not what I want. In my mind it looks much better.

So how to avoid this? Maybe we should write 'source of awesome' on paper and when we start coding look at that. Every time remind what the game will be, how to include all awesomeness to game. We should check the 'awesomeness' is still in the game.


I understood the game is not only mechanic and nice graphic, music, sounds. I missed why I create, why I want people to play my game. Idea, content is not everything, creator should leave some part of self. His feeling of awesome should be part of game and maybe it's reason why some games are better then others, even if game is worse we choose the game with this 'something'.

I hope this help you to don't create empty games, just for money, glory or something. Create games how will artists should do, for feelings.


This video will help you understand, maybe don't tell exactly what I wrote here, but is really similar and complement this article.

Bye and see you soon.

Thursday, June 11, 2015

Programming simple multiplayer game - easy way

Hi,
Again me and I want to share simple idea of making multiplayer game. It's hard to find simple tutorial about multiplayer so I created one.

The first thing: it's simple, you don't make huge MMO game, only simple game to local plays.
The second thing: there is many ways to do that better, so don't think it's good - it's simple and easy to do.
The third thing: it's nice for beginners, so when you understand how works multiplayer games, you should do it 'proper way'.

So let's start:
 - in examples I use C++ and SFML 2.x


We need server and client. So I created two classes Client and Server.
Client is for communicating with server and passing data to game.
Server process every command from client and send updated world.
All data is store in World class. There is players, enities, items etc.
Server store all world and send copy for client.

At first we need to connect:
 - it's simple, just look tutorial on SFML site: http://www.sfml-dev.org/tutorials/2.3/network-socket.php
When you have established connection you can start:

Server side:
 - we need add unique id for player
 - we need add player to world
 - send informations about created player to client

So when client connect to server, server should do:

std::string player_id = "player_id__" + std::to_string(reinterpret_cast<uint32_t>(client)); 

In this way (up) we create player id. It's just get client address in memory (of server) and add it to text "player_id__". Pretty simple and enough safe for local game.

world->addPlayer(Player(player_id, sf::Vector2f(100, 100), sf::Vector2f(66, 92), 100));

Here we add player with: created earlier id, start position, size of player and health points.

Next we send informations about player to client: e.g.:


sf::Packet start_packet;
start_packet << "connect" << *world->getPlayer(player_id); 
client->send(start_packet);

Client side:
 - get our player id from received packet and store in client (it's to inform server which player we are)

So when you receive packet just extract first variable and check is it "connect" and then client_player_id = player.id;

Very easy and rest is very similar.

Client send e.g. "update world" and when server receive this, send all world to client.
When client receive "update world" just replace world in game.
Client send "move player up" and player_id, so server on "move player up" get player from world and move up.

It's simple, to make sure you understand just look this parts of code. It's from my simple project:

Client side:


void Client::runCommand(const std::string& command, const std::string& id)
{
  if(command == "player move")
    {
      sf::Packet packet;
      packet << "player move" << id << player_id;
      socket.send(packet);
    }
  if(command == "destroy item")
    {
      sf::Packet packet;
      packet << "destroy item" << id;
      socket.send(packet);
    }
} 
 
It's part of Client class and I use it in game to make actions, e.g. when player click up arrow I do client.runCommand("player move", "up"); and this is send to server, which do move. Simple and work :)

And server side:

sf::Packet packet;
if(client.receive(packet) == sf::Socket::Done)
{
    std::string event;

    if(packet >> event)
    {
        if(event == "player move")
        {
            std::string player_id;
            std::string direction;
            if(packet >> direction >> player_id)
            {
                if(direction == "up")
                    world->getPlayer(player_id)->position.y -= 5;
                if(direction == "down")
                    world->getPlayer(player_id)->position.y += 5;
                if(direction == "left")
                    world->getPlayer(player_id)->position.x -= 5;
                if(direction == "right")
                    world->getPlayer(player_id)->position.x += 5;
            }
        }
        if(event == "update world")
        {
            sf::Packet send_packet;
            send_packet << "update world" << *world;
            client.send(send_packet);
        }
        if(event == "destroy item")
        {
            std::string item_id;

            if(packet >> item_id)
            {
                world->removeItem(item_id);
            }
        }
    }
}

 
So it's simple, maybe not clean but it's only to show idea.
I hope it's help on the beginning. I know it's hard to find easy tutorials about making multiplayer games so I hope it's good for beginners.

When you understand the basics which you get from this tutorial, you can start doing it like professionals. Just find out more from forums, other blogs etc.

Here is more code and working project that I do in free time, of course you can help me :)
https://github.com/Patys/pmr

Hope it help. If you have any question, just leave comment. Good luck and see you.

Wednesday, June 10, 2015

Quality and Idea

Hey,
Today I want to talk about ideas and quality.

I saw many games where ideas were awesome. Unfortunately often the games are pretty ugly. I don't know what make that, but games are not only code. Programmers think: "I'm coder. I don't need awesome graphic. It's just prototype." 

When game is ugly with awesome idea, the game is still ugly.
When game is nice with awesome idea, the game is AWESOME!
When game is nice with poor idea, the game is just boring.

Boring is still better then ugly. The first view is important. When you see nice start screen, you feel the game can be pretty nice. You don't need mega graphics with profesional elements. You can do it minimalistic. One simple shape with contrast color always looks good.

If you take a moment for creating some good looking stuff, it's better then code new level or something. Player will see graphics all time, it's important to create quite nice. 

When you can't draw, just find somebody who create graphic for you. Show him your ugly game. If you don't have money for that, many peoples can do it to portfolio, for free. They look on your game, not like ugly game, but like the game can look when they create new awesome graphic.

So If you think have awesome idea, just create prototype. Share it and ask for feedback, tell them you create new graphic or need somebody to do that.

Ok, now we have awesome graphic and idea. But what if idea is not good?
What when we don't know how to make it cool? I don't want to waste your time, just watch this and you understand:


And don't forgot about sounds and music. Music add many live to game. Add new layer of feelings. It add quality to games. When I started I always miss that simple thing: sounds. When I add later some sounds I was amazed. The game was better, much better. Sounds make that you can feel what you do: ohh, I touch this, ohh, it bounce; and you see and hear that. More senses are used and it make game better. You don't need to create awesome sounds, just basic, even from the internet. Simple sounds are easier to remember. Look this:



Remember: Quality is important like idea. Sometimes bad idea may become good. Just add some quality.

Tuesday, June 9, 2015

What means magic word: "simple"?

Hi,
Let's start from the beginning.
The start should be simple and I think you hear that all time.

But what means simple?
For beginner simple is e.g. get input from console but hard is create arkanoid clone. For expert this things are simple. So at first you have to decide what is simple for you. Just think for a while, can you get input from console, can you calculate input, can you create window, can you create arkanoid clone, can you code platform game, can you create rpg game or mmo, can you code physics etc. This questions are hard, because contain many parts, huge parts. And on this parts we have to focus.

Start simple doesn't mean start small. Start simple means start from small things and upgrade. Every step will be as simple as it's possible. When you want to create rpg, don't code all player stats, all items and all things which you don't use. It needless when you start. The proper way is code only player as sprite you can move, next add health bar, next add walls and colliding player with them. Next you add everything step by step.

Here is most important thing. Don't start coding everything but only things you need. When you start player don't need intelligence or attack, because  don't use them. We need only position and speed. After that we can add next simple thing, like showing health bar.

So simple doesn't mean small, means you should create simpler parts of your idea and realize them step by step.

Hope you think about it.
See you :)

Monday, June 8, 2015

Hi all.
It's first post.

I'm glad to write this. At the beginning I want to apologize for mistakes (I'm not native english).

This blog I create to post only practical things, e.g. how to code something, what I think about creating something and how I will do something. This 'something' is probably games.

Yes, I'm 18 years old programmer who loves coding games.
If you have any suggestions just tell me.

Thanks for reading and see you soon :)