Tag Archives: game

Download

Hi guys
Anyway … let’s test the teaser 0.0.2. Download from:
linu.com.br/vectortowns.zip

The test will start today at 4 pm (Eastern: UTC -5 / -4 UTC05: 00) or 6 pm (Brasília, UTC03: 00) and will be active for some time
If you can follow me here Then I recreate this blog on facebook and commenting with you

bye

Version 0.0.2 in October!

Hi guys!
Next month I will release a teaser of the game. In this version players can chat and battle on a small map called “Dungeon Safeguard“. For now the player will have only a single spell (like a Fire” in the style of FF games). The RPG system is not yet implemented! That means no mana and all have only 1 HP. Received a damage spell, died!

With this version I can test whether various online players cause slowness on the server. Well, this will be an alpha, alpha, alpha version with few resources and no details worked out, but playable.

Those interested, comment here, I send executable.

Then I’ll post the video here

Client-server communication: solved!

After some searching (http://www.gamedev.net/topic/659071-sending-and-receiving-udp-packets-to-character-status-need-be-encrypted/, and other) testing I got a good architecture for client-server communication. It’s something very close to the exposed solution in post Adversities in client-server communication (https://vectortowns.wordpress.com/2014/07/31/adversities-in-client-server-communication/). I will comment on the details here.

First I should clarify that this communication will only work if met with premises security and login (ie, a handshake). See the following:

1- At first, the player will send a TCP packet over SSL with your username and password. In the authentication process, a certification authority (CA) will be consulted to ensure the authenticity of the game server;
2- After confirmed the authenticity of the server, the client obtains a public key server;
3- The client generates a secret key (AES 128) and a sessionId and sends to the server by encrypting the packet with the server’s public key;
4- Thereafter all packets exchanged between them (either TCP or UDP) will be encrypted and decrypted with the secret key (AES 128).

After this handshake, the communication will be as shown in the following image:

Architecture

Below are the details of communication:

– The client application is built in Java; the recipient of requests (which I call SuperServer) is built on NodeJS; the application of business rules (manage an NPC, for example) will be built (not yet exist) in Lua (http://www.lua.org/about.html) and is called ManagerServer; only SuperServer and ManagerServer applications communicate with the MySQL database;
– Every event (WALKING, CASTING, TALKING …) sent by a player occurs by a UDP datagram encrypted with AES 128 and 32 CRC checksum;
– For events that require confirmation, the response will occur via a UDP datagram checked with CRC 32 unencrypted. Note: An event like WALKING, for example, needs a server validation; one as LOGOFF, is sent only and has no return;
– All events logged by other players are obtained for the TCP socket without encryption;
– Sending events from Java client to NodeJS SuperServer occur by 9731 port; Java client application get events from other players by SuperServer 9732 port; Communication between the SuperServer NodeJS and ManagerServer Lua will occur by 9730 port.

With this architecture I’m getting a good performance. Sending events from Java application client to NodeJS server and your confirmation is performed in the range of 130-155ms. Obtaining the events of the other players is occurring in the range 180-200 ms. As there is an intentional delay of 200 ms for the game to run the events controlled by the player (same happens in the game Age of Empires 2) the sending and receiving of data occur at the expected time – without causing lag in game.

In the near future I will post here a video of the game with some online testers!

lol
bye

My first steps

Hi. I’m creating a 2d game in Java. I will post my progress here. In future I’ll create a oficial website. For now, I have an isometric map. I drew the tiles (floors, stairs and walls) and downloaded sprites of the Scias, a Breath of Fire IV (a ps1 game) character.

The project is organized into three sub projects: base, client and server. The dependence between them and the management of package dependencies being managed by Maven. The basic project contains database entities, rich model entities, utilities (eg, bundle resources, i18n, static classes), classes for artificial intelligence and classes for pathfinding. It is used as a library for the other two.

I’m currently still using the hibernate entities, but in the future I intend to replace the database access by simple jdbc (‘m still thinking about it later). Why? The client project do not access the database directly. Only the server project will have access to the database (directly) and perhaps better access via jdbc (because of performance).

The project client will access data from database through a statefull connection (and encrypted) with a script running on Node.js. These script (affectionately called SuperServer) will not have business rules and only provide a means for requests to the database.

What am I working on now? Like I already said, my map is isometric. Therefore pattern pathfinding algorithm can not be fully utilized. The first adaptation is to change the weights of the horizontal/vertical and diagonal movements. Usually a diagonal move has a higher cost compared to the horizontal/verticias, respectively have 14, and 10. In my case, the horizontal/vertical movement should have a higher cost. Why? See the representation of an isometric tile below:

Isometric Tile

See it to walk north from an isometric tile you need to hold a diagonal movement. Therefore, diagonal directions are more expensive than orthogonal directions.

Another adjustment was needed in Manhattan algorithm. In matrix map, Manhattan calculates exactly the orthogonal distance between the current node and the destination node. In an isometric map, this calculation is not always correct. Luckily, another game developer had already found a solution for this (http://www.quartertothree.com/game-talk/archive/index.php/t-69406.html).

package br.com.linu.vectortown.base.pathfinding;
import java.io.Serializable;
import br.com.linu.vectortown.base.modelo.auxiliar.Posicao;
public class ManhattanIsometrico implements Serializable {
   private static final long serialVersionUID = -2242005057055685258L;
   private static int intValue(Double d) { return d.intValue(); }
   /* http://www.quartertothree.com/game-talk/archive/index.php/t-69406.html */
   public static int calcular(No origem, No destino) {
      int cx = origem.x() - intValue(origem.y() * 0.5);
      int cy = origem.y() + cx;
      int gx = destino.x() -intValue(destino.y() * 0.5);
      int gy = destino.y() + gx;
      int diagonal = Math.min( Math.abs(cx-gx) , Math.abs(cy-gy) );
      int straight = (Math.abs(cx-gx) + Math.abs(cy-gy));
      return 12 * diagonal + 10 * (straight - 2 * diagonal);
   }
}

I copied your solution and it’s served me well 🙂

For now, however, I’m still having a few problems finding the best path when the source tile and destination tile are on different floors (the game will have at most three different floors per screen). Sometimes pathfinding goes to a far corner of the stairs that would take him to the different floors, and consequently for the destination tile. Soon I will post here the solution to this…