Debian 6.03
Kubuntu 11.10
Windows 8 beta developer preview
In the last weeks I have tried many "new" OSes, the first one was Kubuntu 11.10:
After the decision from the Ubuntu team to use Unity in the standard distro 11.04 I have been waiting to see if in the 11.10 version all the mistakes have been removed, unfortunately I had exactly the same feeling that with the previous version...
One of the things I like from Linux is the freedom: freedom to choose what do you want to install and how to configure it to adapt to your personal tastes and needs
With the infamous Unity I feel like if I was a toy inside a Box: I can see beautiful glitter-filled walls, but I can't see anything else!, I thing that when in your process table Xorg is taking MORE CPU than your mmorpg server, something is completely wrong..
I downloaded and installed Kubuntu 11.10, hell I don't like windows-style from KDE but I was so disgusted with regular "Unitybuntu 11.10" that I decided to try it... now I regret I didn't went for Debian before..
Debian is the mother of Ubuntu, and many other Linux flavors, but I have been always afraid to download the tons of gigabytes the full distro uses, but when I entered www.debian.org last day I realized the network installer only occupied like 400 MB, so I downloaded , burned and installed it..
When I did I felt like my first times with Linux (with Slackware), everything was not made "for dummies", you had to set up many things, like repositories to be able to install apps, but well after goggling a bit I was able to install all the tools I use day by day....
It is not as beautiful as Ubuntu or Kubuntu but now my CPU cycles are used for my apps, not for openGL....
I downloaded today Windows 8 beta developer preview and installed it, after all the things I have heard from it I was almost sure it's gonna be very different from Windows 7, but all the people that has been MS OSes since a few years ago will realize it shares many things from previous versions, the feeling I got from it is that it was completely designed not for pcs, but for Tablets... yes, forget about pcs, the interface is made so you can use it with a touch screen...
Another thing is forget to use it with any computer with less than a 2 dual core fast (2Ghz+ processor) with 2 GB RAM, I installed it in a virtual computer and it took 5 minutes to boot using one core from my I5 core processor (3.2Ghz), assigning the 4 cores to Windows made it boot in "only" 2 minutes... OMG! I hope MS optimize it.. or get ready for a "Vista 8"....
Well I have to test it more but the first feeling is Microsoft wants to change mind of the users.. again, time will say if they are right...
Well , enough OS review for today..
See you!
Friday, November 18, 2011
Tuesday, November 15, 2011
So I want make an MMORPG, Where do I start from? PART 1
That is indeed a good question, asked so many times and answered many times too, in many sites the answer is like:
<If you have a team>
I tried to divide the BIG puzzle into small pieces, c++, SDL, SDL_image, SDL_ttf, SDL_NET, SDL_thread, Gimp, MYSQL....
With those pieces I made some bigger ones: A tileset, a simple game engine, game states, player creation process, a simple chat server....
And now it comes the good thing, I got a Simple (RPG DEMO) server with a client, I didn't made it on time (1 year was my objective), but now , after millions of doubts I know I will finish the game...
My objectives now are:
Q:What do I need to learn to send / receive date across the network?
A:Network sockets
Q: How does network sockets work?
A: Network sockets handles data send/received to an IP network, they are both used by TCP (Connection oriented ) and UDP (Connectionless oriented), in the server you "open" a socket to listen for incoming data, open a socket means bind the program to a particular IP port of the computer, so we could open a socket at port 80 to create a web server, for example, when we create a server socket it waits until a Client machine (program) connects to it, then we create a client sockets that is going to actually communicate with the client. The clients just open a client socket and establish a connection with the server socket.
Q:Why do I need threads?
A: Threads are used to do many things at the same time, for example, a Client for the MMORPG, could have a thread to draw the images on the screen while another one sends/receives network data , the server could have one thread (maybe more?) to handle network data, another one for the AI, another one for Environment events... In the modern multi-core computers, it's a way to use 100% of the processor power
Q:Why are you using SDL_NET? isn't it an ancient library?
A:It is old, but network sockets are older and are still used today (and probably are going to be used for many, many years), just thing the new IP protocol (IPv6) uses them too... SDL_NET has other advantages too, it can be used in a multi-platform environment (I use it in my client and I can compile it under windows / Linux without touching a single line from the code to make it work :) ), finally it is a low-level library so you feel you have the control over what you are working, there are libraries made upon SDL_NET that add things (NET2 uses multi-threading for example), but you have less control about what is happening, another problem is find documentation , SDL_NET is so small that when you read the manual , you realize how easy is to use it.
<More Q/A soon...>
In the next post: Server code and explanations..
JB
<If you have a team>
- Get a team: coders + artists + world designers +well like 10 persons.
- Get ready to expend 2 years (at least) on it
- Pay big amount of money to the ISP
- Have a design document
- Forget about it :(
I tried to divide the BIG puzzle into small pieces, c++, SDL, SDL_image, SDL_ttf, SDL_NET, SDL_thread, Gimp, MYSQL....
With those pieces I made some bigger ones: A tileset, a simple game engine, game states, player creation process, a simple chat server....
And now it comes the good thing, I got a Simple (RPG DEMO) server with a client, I didn't made it on time (1 year was my objective), but now , after millions of doubts I know I will finish the game...
My objectives now are:
- Start a series of posts explaining how I did it.
- Clean Server / client code and upload them (Yes, I'm going to release it soon)
- Set up MYSQL server
Q:What do I need to learn to send / receive date across the network?
A:Network sockets
Q: How does network sockets work?
A: Network sockets handles data send/received to an IP network, they are both used by TCP (Connection oriented ) and UDP (Connectionless oriented), in the server you "open" a socket to listen for incoming data, open a socket means bind the program to a particular IP port of the computer, so we could open a socket at port 80 to create a web server, for example, when we create a server socket it waits until a Client machine (program) connects to it, then we create a client sockets that is going to actually communicate with the client. The clients just open a client socket and establish a connection with the server socket.
Q:Why do I need threads?
A: Threads are used to do many things at the same time, for example, a Client for the MMORPG, could have a thread to draw the images on the screen while another one sends/receives network data , the server could have one thread (maybe more?) to handle network data, another one for the AI, another one for Environment events... In the modern multi-core computers, it's a way to use 100% of the processor power
Q:Why are you using SDL_NET? isn't it an ancient library?
A:It is old, but network sockets are older and are still used today (and probably are going to be used for many, many years), just thing the new IP protocol (IPv6) uses them too... SDL_NET has other advantages too, it can be used in a multi-platform environment (I use it in my client and I can compile it under windows / Linux without touching a single line from the code to make it work :) ), finally it is a low-level library so you feel you have the control over what you are working, there are libraries made upon SDL_NET that add things (NET2 uses multi-threading for example), but you have less control about what is happening, another problem is find documentation , SDL_NET is so small that when you read the manual , you realize how easy is to use it.
<More Q/A soon...>
In the next post: Server code and explanations..
JB
Friday, November 11, 2011
RPG Client Alpha!!!
<Client V0.11>
<Client V0.1>
<Doesn't it looks nice??>
So after two weeks fighting against the elements I have been able to connect my Rpg Demo with the chat server (and basically modifying all the code), but now you can move around with your own player...
You can't do much things, in fact you can just MOVE, but that's exactly the base where I wanted to start from.
I have uploaded the Windows version binaries so basically everybody (windows /linux + wine) can test it, just go to the downloads page and get it!
For alpha testers: To test it, you are going to need an IP number, PM please so I will tell you...
See you
<Client V0.1>
Saturday, November 5, 2011
A Simple chat server, code uploaded...
<A chat server / client>
I've just uploaded the full code for the simple chat server and client projects, it is a very simple project, but shows the core needed to create a server including multi-threading and connections /disconnections from clients.
At the moment the clients can do:
JB
I've just uploaded the full code for the simple chat server and client projects, it is a very simple project, but shows the core needed to create a server including multi-threading and connections /disconnections from clients.
At the moment the clients can do:
- Send messages to other clients.
- Send private messages to another client (/priv nick message)
- Ask for the list of connected users (/List)
- Change nick (/nick newnick)
- And of course, exit the server (/quit)
JB
Monday, October 24, 2011
New Downloads / Windows Binaries
Hello!
New downloads!
<One year ago I started this project with many objectives, one of them was to make it multi-platform so yesterday I decided to compile my projects under Windows, or at least try to do it...>
<And here it comes the ingredients for my Windows recipe:
In all the source files with:
(paths are a little bit different under Windows..)
<And well, that's it! after doing that I got the life game and the three rpg sub-projects working >
<I wanted to include the chat server / client project too, hey ! I really wanted to do, but I found an unexpected and silly problem, the chat server uses the std input / output for everything, I cout << what the clients "say" and get cin >> the clients input, it works fine under Linux, but under Windows, it redirects the output and errors too to the files "stdout.txt/stderr.txt", it is the normal behavior, if you are making a graphical project, you don't have the console, right? but what if you need it?>
<I have been goggling for solution and finally I found something that should work: >
<That was supposed to set the output again to console, I added the code, and when I executed the project under code::blocks, It magically worked again, so I happily rebuild the project...>
<And then I executed the resulting .exe, it opened a console window... (have I said it was black? completely black?) :(, that's when I decided I wont compile it for Windows ( at the moment), if anybody had found that problem and feels eager to help, I will really appreciate it...>
<In the next post, the chat server /client...>
See you
JB
New downloads!
<One year ago I started this project with many objectives, one of them was to make it multi-platform so yesterday I decided to compile my projects under Windows, or at least try to do it...>
<And here it comes the ingredients for my Windows recipe:
- A virtual machine emulator (a.k.a. Virtualbox ), Somebody will prefer a dual-boot configuration or just Windows, well, it's up to you...
- A Windows installation disk, you have one, right? (Important: First, clean the dust)
- Code::Blocks 11.05 compiler + minGW (Install, Next > Next > Next > Next > Finish.... Windows is SO user-friendly...)
- An assorted mix of libSDL libraries (SDL, SDL_image,SDL_ttf,SDL_net): Download, extract, and then mix them so you put all \include and all \lib files together, and of course the DLLs too.
- Download the sources too..
- If you want to compile them you will have to set up the compiler so it uses the sdl\include and sdl\lib paths, other way, it will simple refuse to work.
#include "SDL/SDL.h" #include "SDL/SDL_image.h" #include "SDL/SDL_ttf.h" #include "SDL/SDL_net.h" #include "SDL/SDL_thread.h"
In all the source files with:
#include "SDL.h" #include "SDL_image.h" #include "SDL_ttf.h" #include "SDL_net.h" #include "SDL_thread.h"
(paths are a little bit different under Windows..)
<And well, that's it! after doing that I got the life game and the three rpg sub-projects working >
<I wanted to include the chat server / client project too, hey ! I really wanted to do, but I found an unexpected and silly problem, the chat server uses the std input / output for everything, I cout << what the clients "say" and get cin >> the clients input, it works fine under Linux, but under Windows, it redirects the output and errors too to the files "stdout.txt/stderr.txt", it is the normal behavior, if you are making a graphical project, you don't have the console, right? but what if you need it?>
<I have been goggling for solution and finally I found something that should work: >
SDL_Init(SDL_INIT_VIDEO);
if (ctt)
{
freopen("CON", "w", stdout);
freopen("con", "w", stderr);
fclose( ctt );
}
<That was supposed to set the output again to console, I added the code, and when I executed the project under code::blocks, It magically worked again, so I happily rebuild the project...>
<And then I executed the resulting .exe, it opened a console window... (have I said it was black? completely black?) :(, that's when I decided I wont compile it for Windows ( at the moment), if anybody had found that problem and feels eager to help, I will really appreciate it...>
<In the next post, the chat server /client...>
See you
JB
Thursday, October 13, 2011
SDL_net / SDL_threads(1): The Threading beast, is it so dangerous?
A multi-threaded echo server....
<What is the most important thing beyond every mmorpg? is it the history?, maybe the fancy 3d graphics? nope... it is the network play!>
<When I started the project , one year ago my objective was to bring the game on-line, I just didn't thought how many new things I needed to learn, the C++ language , the libSDL library, all the other extension libraries (SDL_image, SDL_ttf, SDL_net, SDL_thread, ...), how to use blogger... , the Gimp, etc, etc....>
<It has been a long trip, but now I have arrived where I wanted to be, to the network>
<On the top of the page there is an screen-shot showing my first networking demo, a multi-threaded socket server using SDL_net and SDL_thread>
<I start the server and then I can connect with telnet to the server, every thing I type on the telnet window goes to the server and it returns the message to the sender, maybe you can think it is something too easy, but let me show why it's important...>
<Here what you can't see is more important than what you see, that's the project structure:>
<I encapsulate all the network code into two classes: csockserver and csockclient, fist one opens an SDL_net server socket who is going to sit and wait for incoming connections, when it happens (new client connection), it creates a new csockclient and adds it to the vector, then the csockclient starts a thread and the thread wait for data incoming to the server for a client, when it happens it just echoes the data back to the client>
<it is a very simple way to handle data, a perfect base to start adding new features, now if we change just a few lines we will have a chat server, but threaded>
<I have remarked the thread thing because when I started to look for demos / tutorials to use SDL_net I basically found nothing related to using it with threads, the question is a server needs threads, we can't stop the server logic just to see if a client is sending data, and for the server I'm going to use more threads: (for example , for the A.I.) so many things can happen at the same time, making threaded code is very hard, because any small mistake is going to crash the server, make your computer leak memory, or even worse open a security hole....>
<I'm going to finish the next step (the chat server) and I will post the c++ code>
<Ideas / suggestions are always welcome>
<see you, in the chat>
JB
<B.T.W. Ogres are ugly, SDL_net + threads too, what could happen if you mix them?? ;)>
<What is the most important thing beyond every mmorpg? is it the history?, maybe the fancy 3d graphics? nope... it is the network play!>
<When I started the project , one year ago my objective was to bring the game on-line, I just didn't thought how many new things I needed to learn, the C++ language , the libSDL library, all the other extension libraries (SDL_image, SDL_ttf, SDL_net, SDL_thread, ...), how to use blogger... , the Gimp, etc, etc....>
<It has been a long trip, but now I have arrived where I wanted to be, to the network>
<On the top of the page there is an screen-shot showing my first networking demo, a multi-threaded socket server using SDL_net and SDL_thread>
<I start the server and then I can connect with telnet to the server, every thing I type on the telnet window goes to the server and it returns the message to the sender, maybe you can think it is something too easy, but let me show why it's important...>
<Here what you can't see is more important than what you see, that's the project structure:>
<I encapsulate all the network code into two classes: csockserver and csockclient, fist one opens an SDL_net server socket who is going to sit and wait for incoming connections, when it happens (new client connection), it creates a new csockclient and adds it to the vector, then the csockclient starts a thread and the thread wait for data incoming to the server for a client, when it happens it just echoes the data back to the client>
<it is a very simple way to handle data, a perfect base to start adding new features, now if we change just a few lines we will have a chat server, but threaded>
<I have remarked the thread thing because when I started to look for demos / tutorials to use SDL_net I basically found nothing related to using it with threads, the question is a server needs threads, we can't stop the server logic just to see if a client is sending data, and for the server I'm going to use more threads: (for example , for the A.I.) so many things can happen at the same time, making threaded code is very hard, because any small mistake is going to crash the server, make your computer leak memory, or even worse open a security hole....>
<I'm going to finish the next step (the chat server) and I will post the c++ code>
<Ideas / suggestions are always welcome>
<see you, in the chat>
JB
<B.T.W. Ogres are ugly, SDL_net + threads too, what could happen if you mix them?? ;)>
Sunday, October 2, 2011
Code::Blocks(17) RPG 4 - Rpg Demo working, Player creation end.
A preview before starting the networked part:
I have made so many changes in the code that it's gonna take very long to post all them, so what I'm going to to is to make a list with updated things:
<Engine class:>
I have made so many changes in the code that it's gonna take very long to post all them, so what I'm going to to is to make a list with updated things:
<Engine class:>
- I have added 3 fonts to the game, they only change in size so they can used for main tittles or the plain text in the game.
- TextOut function to draw text.
- IntOut function to draw numbers
- FillRect to fill a rectangle with a color
- Window function to switch between windowed / full screen mode
- Accel, Speed, Angle variables added
- Now the player's point of view is defined by an angle, an the movement is based in that angle, when you press <forward> player speed will increase by it's accel value (to a limit) and move accordingly to that.
- Needed two timers in the game so I found the easiest way to use them was to encapsulate into a class, now I have a timer for FPS calculation and another to regulate framerate.
- A new class used to grab input from keyboard and add to a string (Used to write player's name)
- DrawMap: In that function I have made a small but very important optimization: it drawed all the tiles in the three layers in the map but that was a mistake because not all the three layers were filled, only the first one, so what I did was to check in 2nd an 3rd layer if the tile was empty and then if it isn't, draw it, a simple change that made the processor use change from 99% to 30%, not too bad!
- ShowStats: a function to draw player stats (name, attibutes, skilss..)
- DrawGUI:To draw player's life and magic points
- DrawDir: To draw a single dot in player's point of view
Subscribe to:
Posts (Atom)







