The International Simutrans Forum

 

Author Topic: Browser game version  (Read 4254 times)

0 Members and 1 Guest are viewing this topic.

ernobius

  • Guest
Browser game version
« on: May 07, 2009, 07:51:34 PM »
I've been wondering about how would it be to make a browser game which would have some similarities with Simutrans (but, as browser games have to be, may be simpler), but I don't want to make a copy.
Although I mentioned only Simutrans, I'm open to other ideas too (for example Lincity, but original ideas are even better). If anyone is interested, please write to me at ernobius @ yahoo. com (don't write the spaces...)
or I've just created a forum at http://alterea.forumotion.net/ (that could be the game's name, but that's not a must either). feel free to post your ideas, concerns, anything you've got.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Browser game version
« Reply #1 on: May 07, 2009, 08:08:15 PM »
Well, as I have no clue whatsoever... how would you do it? Simulations of worlds are quite resource hungry, so you would probably have to shy away from the original paradigm somewhat.

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: Browser game version
« Reply #2 on: May 07, 2009, 10:09:53 PM »
This is actually something I've given some thought to recently. With the advances in Javascript engines which have been made recently and the addition of things like the new HTML 5 Canvas element it's starting to become a possibility to write these kind of sprite based games in the web browser. Javascript is actually a surprisingly capable language if you have a fast enough interpreter.

One idea I played with was creating a clone of Command and Conquer, or a transport sim game. Sadly the sheer magnitude of a project like this tends to put me off. It's definitely possible though and I'd be interested in discussing your ideas further with you.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9595
  • Languages: De,EN,JP
Re: Browser game version
« Reply #3 on: May 08, 2009, 09:36:40 AM »
I am not sure that some structures like ordered heaps or binary trees and so on could be efficently implemented in Javascript without pointers. Even more, simutrans uses its own memory allocations for almost every structure. Think of it: A 256*256 map has already 65536 tiles and easily 200000 objects. I am not sure how well javascript handles that.

For that the OpenTTD approach with a fixed structure per tile (like 12 Byte which are interpreted differently for different types) and less OOP would be probably helpful to avoid too much action of the garbage collector.

Offline Spike

  • *
  • Posts: 1361
  • First Simutrans Developer and Graphics Artist
Re: Browser game version
« Reply #4 on: May 08, 2009, 01:28:42 PM »
Flash is the hype lately for browser based games. Javascript is not suitable for bigger projects, but there are quite a lot Flash based games out there, so it seems to work.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Browser game version
« Reply #5 on: May 08, 2009, 02:39:45 PM »
Of course it depends on actual implementation, but Flash has the same language inside... I've read it compiles it for target cpu though.

ernobius

  • Guest
Re: Browser game version
« Reply #6 on: May 10, 2009, 12:54:11 PM »
Well, I know that it's not exactly the easiest thing to make a game, so I think it should be started as simple as possible (but still being a game), and it would be developed on the way. But I can't decide how an open source browser game could work... it seems to me as strange as open source antivirus software. But as there are open source antivirus softwares, a game shouldn't be impossible either.
So as a beginning, I wouldn't expect Simutrans being completely rewritten in Flash, for example, but something simpler.
And what do you think about PHP? I know a game, Pardus, which works even on my mobile's Opera, because uses PHP, and it's graphics aren't bad.
By the way, let's clear what type of online game are we talking about? Something "long-term", like Ogame, or Pardus, Travian, whatever, or something like those Flash games, that last a couple of minutes?
I'm glad you're interested :)

P.S.: Are there any open source online games? Or anything like that? I don't mean MMORPG, where you have to fight with pigs, of course  :) You know what I mean.
« Last Edit: May 10, 2009, 12:58:35 PM by ernobius »

Offline Spike

  • *
  • Posts: 1361
  • First Simutrans Developer and Graphics Artist
Re: Browser game version
« Reply #7 on: May 10, 2009, 07:01:23 PM »
And what do you think about PHP?

I think it can work if there isn't so much communcation going on between client and server and/or the communcation is only needed infrequently. You won't get a shooter or so done this way I think, but overall PHP can and will work for some sorts of games.

Board games, card games, slow paced adventure/role playing and simulation games all should work.

I've been pondering the use of PHP for collaborative games a while, but I was too lazy to actually do more than dreaming  ;D

ernobius

  • Guest
Re: Browser game version
« Reply #8 on: May 12, 2009, 07:58:10 AM »
It seems that many of us were thinking about creating a game :)
« Last Edit: May 12, 2009, 07:10:08 PM by ernobius »

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: Browser game version
« Reply #9 on: May 18, 2009, 02:15:27 PM »
It seems that many of us were thinking about creating a game :)

Sadly thinking about it isn't enough :)

ernobius

  • Guest
Re: Browser game version
« Reply #10 on: May 28, 2009, 02:12:25 PM »
Absolutely true :) Thinking about something is not enough
Lately and for a week or two I simply haven't got time to think at other things, but I'll soon do something :)

Offline Spike

  • *
  • Posts: 1361
  • First Simutrans Developer and Graphics Artist
Re: Browser game version
« Reply #11 on: May 28, 2009, 02:17:14 PM »
What kind of game do you have in mind?

ernobius

  • Guest
Re: Browser game version
« Reply #12 on: May 29, 2009, 03:20:15 PM »
What kind of game do you have in mind?

Well, as the title suggests, I myself want to stick with the browser's limits. I love open source too, so my plan would be to start with something simple, but open source, and evolve in time. I think PHP would be good. And this game would last longer, like other browser games, like Ogame or Pardus. Of course, shorter versions and other extras could be created, but I know you can't start with everything, so I'll stay with the simple start.
This would be my idea in a couple of lines :)

Offline Matthi205

  • *
  • Posts: 107
  • Elvish Marshal of the human Wesnothian Army
Re: Browser game version
« Reply #13 on: June 22, 2009, 02:34:54 AM »
Why don't you make a game with a randomly generated 20x20 map,with 2 cities and some industry,with the same goal as simutrans?Maybe written in java?PHP?Html?

Offline Isaac.Eiland-Hall us

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3666
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Browser game version
« Reply #14 on: June 22, 2009, 04:34:17 AM »
Sounds difficult to write in HTML. ;-)

ernobius

  • Guest
Re: Browser game version
« Reply #15 on: June 22, 2009, 05:54:45 AM »
Not a bad idea either. Lately I didn't have too much time, but problems are going to be solved, so I will have time.

Offline Matthi205

  • *
  • Posts: 107
  • Elvish Marshal of the human Wesnothian Army
Re: Browser game version
« Reply #16 on: July 06, 2009, 02:20:47 PM »
Write it in java,please...My brother's got a new "Mini iPhone"(illegal duplicate,made in china,only accepts java programs).
I don't want to give him my new computer just because my parents **** me to hell because I'm playing computer games and am interested in programming...They call it "hacking"(maybe thats because I like Linux)... ;)

Offline Nathan Samson

  • *
  • Posts: 89
Re: Browser game version
« Reply #17 on: July 06, 2009, 04:21:08 PM »
Sounds difficult to write in HTML. ;-)

With HTML + javascript (mainly to communicate with the server) + canvas tag (only supported in latest browsers, but not in IE8) you could probably achieve nice things

Ofcourse some sort of server application (written in any language) should be running

Actually I was thinking/dreaming something like this a while ago

ernobius

  • Guest
Re: Browser game version
« Reply #18 on: July 30, 2009, 08:35:01 PM »
OK, I've been only talking for a while, but slowly things will change :)
And an other question from you? What do you think, would Python be useful here too? I like it's clean, visible style.

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: Browser game version
« Reply #19 on: July 30, 2009, 09:26:48 PM »
Python is a very nice language, you could use it for the server-side components. Look into the Twisted library, as well as web frameworks like Django.

Offline Michael 'Cruzer'

  • Devotee
  • *
  • Posts: 196
  • Founder of pak192.comic
    • Marktplatz für Parkplätze
  • Languages: DE, EN
Re: Browser game version
« Reply #20 on: July 31, 2009, 09:04:02 AM »
OK, I've been only talking for a while, but slowly things will change :)
And an other question from you? What do you think, would Python be useful here too? I like it's clean, visible style.

Python isn't only a server-side language. With Python you could write server applications, but at client-side you had to use HTML or something else.

On client side you could only use:
- HTML - Only text and small graphic stuff, but the basic of everything!
- Javascript - Is for make HTML-Code more dynamical
- Java - Is for writting Applets, with it you could wirte small client side application
- Flash - Same as Java
- Silverlight - Same as Java

And for server-side componets:
- Perl - Very Old
- PHP - Widespread (but also very old)
- Python - Modern and very clean (not well known)


If you don't know what server-side and client-side means, forgot it to make a browser game.

Offline Spike

  • *
  • Posts: 1361
  • First Simutrans Developer and Graphics Artist
Re: Browser game version
« Reply #21 on: July 31, 2009, 09:09:48 AM »
- Perl - Very Old

Old should not be a problem. There are very powerful and well maintained libraries available for Perl. Lots, because Perl is old and there was much time to develop them  ;)

But Perl syntax can be obscure. This does not mean you will have a problem, it just means if you are not careful with your programming, it is easy to write code that is very hard to read later.

Offline vilvoh

  • One of the good guys
  • Administrator (Inactive)
  • *
  • Posts: 4504
  • I'm the constructor, the architect
    • Escala real
Re: Browser game version
« Reply #22 on: July 31, 2009, 09:31:32 AM »
IMHO, all depends on the load of the different parts of the system. I think it's clear that it needs a client-server approach, but exactly what kind? thin client? Multi-thread server? Will the server bear all the processing or will it be merely an intermediary that distributes the info between clients? You need to answer this questions before choosing the programming languages you're going to use.

Offline Spike

  • *
  • Posts: 1361
  • First Simutrans Developer and Graphics Artist
Re: Browser game version
« Reply #23 on: August 04, 2009, 09:57:34 AM »
Multi-thread server?

Almost all new PCs have dual cores or multi cores. So some degree of multithreading is almost a must have to make good use of such hardware.

Most languages allow this, though. I think the architecture questions can be solved independently from the language - tackling such a big project mostly means to use tools that one is good at working with, so it should be a language that one already has used in projects before and that one knows pretty well.

if someone has ideas for a peer-to-peer multiplayer architecture I'd be much interested :)