Page 1 of 2

Online games yet?

Posted: Mon Oct 20, 2008 2:14 pm
by bartbes
Anyone creating online games yet? As we should have one epic Löve game and spread it over the entire world, creating Löve domination! :twisted:

Seriously though, we should create one game to let people know there is something like Löve. And online games tend to bring the world together...

Re: Online games yet?

Posted: Mon Oct 20, 2008 4:39 pm
by TsT
Yes :D

I use love as network client (client only, not listening part) for our futur MMO game (nothing officially released yet, will be under free licence).
It will be played by turn (1 turn will equal between 1 and 10 minutes) then our game don't need hight network rate.
I'm interesting to share network experience with love, because we don't have tutorial about network support.
I will release my network code soon (i'm using luasocket as told here).

Regards,

Re: Online games yet?

Posted: Mon Oct 20, 2008 4:50 pm
by bartbes
Can't wait to play it :D

Anyway, I was thinking about creating a library myself (as I'm just too lazy to create a game myself :D), however I think I'll wait to see what your code is going to look like (I could already implement a host though).

Löve is really growing up!

Re: Online games yet?

Posted: Mon Oct 20, 2008 5:12 pm
by TsT
You must... because my game is currently not playable at all !
I can provide a alpha screenshot previous if you want :D
But I'm currently working about rewriting lot of technical part (nothing visible on a screenshot)


About my network part ... For now,
I'm using only one socket always keep opened, open at start, close before quit.
I'm checking if new data was available on the socket every 5 seconds.
I was setup the socket timeout to 0.1s.

Re: Online games yet?

Posted: Tue Oct 21, 2008 11:52 am
by bartbes
I'd like to know what the users expect from the lib, and especially what approach (e.g. send tables) and how to implement them (encode them to strings?). So if you (the reader) know something, just post, I'll try to use the best ideas.
I'm trying to create a Löve/lua only, and maybe implement things (like threading) in c++ in some later state, but only if that is really needed.


BTW My computer is needing serious repairs at the moment, I can access only half of my partitions, so I won't have full capabilities (Löve is on one of the readable partitions, don't worry).

EDIT: Fixed that

Re: Online games yet?

Posted: Tue Oct 21, 2008 8:09 pm
by TsT
At first a screenshot of actual client :
Image

At second, my begin of network "lib" (built yesterday) :
network.lua
j2h network lib v0.1.0 (r240)
(3.79 KiB) Downloaded 258 times
EDIT: newer version here

At third, a small smaple of code to illustrate how I use it

Code: Select all

function load()
	love.filesystem.require( "lib/network.lua" );
	config.host = "myhost.domain.com";
	config.port = 1234;

	socket = require("socket");
	network = Network:new("j2h-network");
	network:setup(config.host, config.port);
	network:enable()
	network:send();
end

function j2h_quit()
	network:disable();
	love.system.exit()
end


function update(dt)
	network:update(dt);
end


Re: Online games yet?

Posted: Wed Oct 22, 2008 8:39 am
by bartbes
I've been looking through your code and saw that you're using TCP, though it's easy, games normally use UDP, for the lack of having to be connected.
This makes coding the server (a tiny bit) harder, but greatly simplifies the server, as all it has to do is create a table, and loop through it, using just 1 connection.

And what about the tick? Is it a keep-alive, or a request for data?

However, it's still a great start!

I'll start working on my lib now, I'll post soon.

Please post suggestions!

EDIT:
Made this so far (~30 mins ;))
Client.lua
(2.34 KiB) Downloaded 244 times
Feedback!

Re: Online games yet?

Posted: Thu Oct 23, 2008 10:15 am
by bartbes
I'll start a new topic in Projects.

Re: Online games yet?

Posted: Thu Oct 23, 2008 10:24 am
by TsT
Good idea, I will do too at first official release.

Re: Online games yet?

Posted: Thu Oct 23, 2008 1:27 pm
by Nexion
TsT, does your game support true server-client games, or is it only LAN?

(--Sidenote: 1000th post on the general forum!!!!)