The International Simutrans Forum

Community => Community Discussion => Topic started by: Dwachs on July 03, 2012, 07:55:25 PM

Title: Play transport tycoon in browser
Post by: Dwachs on July 03, 2012, 07:55:25 PM
Check it out:

http://play-ttd.com/
Title: Re: Play transport tycoon in browser
Post by: eipi on July 03, 2012, 08:07:13 PM
Cool! The thing with me is, in fullscreen mode the screen is somehow stretched horizontally since I'm using a widescreen monitor.

I like Simutrans more, though 8)
Title: Re: Play transport tycoon in browser
Post by: Dwachs on July 03, 2012, 08:18:46 PM
In principle the same can be done for simutrans, too! They used a C++ to Bitcode to Javascript compiler.
Title: Re: Play transport tycoon in browser
Post by: VS on July 03, 2012, 08:50:33 PM
Downloading our graphics will be a bit harder, though ;-) The original (open)ttd uses 8-bit palette, so that probably cuts down the size considerably.
Title: Online (Javascript) Simutrans
Post by: prissi on July 07, 2012, 08:33:02 PM
There is a tool, you can use to compile C++ code to Javascript using LLVM. People did an OpenTTD emulation. http://play-ttd.com/ It is slow, but what is most amazing is that is runs nearly decent at all!

However, thinking of the default CPU of simutrans, I fear it will be still too slow.
Title: Re: Online (Javascript) Simutrans
Post by: Ters on July 07, 2012, 09:24:12 PM
What do you mean regarding Simutrans and CPU?

For me, Simutrans only uses 10 % of one 1.73GHz core. And the game I had opened wasn't exactly small, though I'm sure there are more complex maps out there. However, the other 80 % might be spent waiting on I/O, so there might not be room for 20 % active CPU.
Title: Re: Online (Javascript) Simutrans
Post by: prissi on July 08, 2012, 07:31:54 PM
OpenTTD runs on a 486 with 8 MB ram smoothly. Simutrans never did; mostly since it generates even passengers without stops and a typical pakset has way more objects than OpenTTD default. Not to mention the 8 vs 16 bit (although the latter may be even advantegeous on modern OS). But it would "just" require a translation via LLVM and the tool mentioned on the site to check for sure ...
Title: Re: Online (Javascript) Simutrans
Post by: Yona-TYT on July 08, 2012, 08:48:24 PM
worth a try
Title: Re: Play transport tycoon in browser
Post by: Yona-TYT on February 11, 2013, 11:17:40 AM
Simutrans in HTML5/JavaScript, Possible?
http://forum.simutrans.com/index.php?topic=11433.0
Title: Re: Play transport tycoon in browser
Post by: An_dz on February 11, 2013, 01:54:41 PM
Maybe, but it's really hard.
Javascript is an interpreted language, as it's not compiled it's way slower.

Plus javascript is single thread, it can not run multiple codes togheter.

And if there's any error, even if the error is intside an 'if' argument that won't be called the whole code crash.

Convert a C++ software to HTML5+Javascript is as hard as code the software on its own language.

Anyway we won't mind if someone with enough knowledge do so.
Title: Re: Play transport tycoon in browser
Post by: Yona-TYT on February 12, 2013, 03:03:25 AM
if "openttd" it  profit,   why "Simutrans" not? ???
Title: Re: Play transport tycoon in browser
Post by: An_dz on February 12, 2013, 03:21:31 AM
I'm not saying not to do so, just saying that it's not always that easy.

If anyone do so, it will be awesome.
Title: Re: Play transport tycoon in browser
Post by: jamespetts on March 04, 2013, 01:12:50 AM
Hmm, playing this very briefly reminded me how good that Simutrans really is...
Title: Re: Play transport tycoon in browser
Post by: An_dz on March 04, 2013, 06:16:50 AM
Quote from: jamespetts on March 04, 2013, 01:12:50 AM
Hmm, playing this very briefly reminded me how good that Simutrans really is...
Same here. I started playing it and was like: where are the stuff? why this is in another button? I gave up after 5 minutes. :)