Jump to content




Anyone Interested In A Javascript (Web/html5) Version Of A Cc Emulator?


39 replies to this topic

#21 AfterLifeLochie

    Wiki Oracle

  • Moderators
  • 480 posts
  • LocationAfterLifeLochie's "Dungeon", Australia

Posted 18 August 2013 - 02:30 AM

View PostElvishJerricco, on 18 August 2013 - 02:09 AM, said:

Again, I point to WebWorkers. And still, I'm sure there's a way to make a non-blocking VM. No concrete evidence on this because that would take much more research than I'm willing to put into a project I'm not building, but the emscripten VM is capable of using setTimeout and other call-back based JS functions.
WebWorkers are a solution, but they're not exactly supported widely (browsers which support HTML5, IE10+, none on Android afaik). While it's a solution, it's probably equally as tricky as others.

View PostElvishJerricco, on 18 August 2013 - 02:21 AM, said:

View PostGravityScore, on 17 August 2013 - 01:05 PM, said:

CCDesk is quite an engineering feat, but quitting it causes a kernel panic (yes, it shuts down and shows this screen) on my retina display mac, so I can't use it (I've not bothered to report this because I seem to be the only one with the problem, and didn't think it would be worth Lochie's time just for one potential user. My mac seems to hate all things Java, apart from Minecraft).

I have the same problems. CCDesk is not mac compatible. Maybe it's just 10.8 and up or something but I've never been able to get it to work properly.
The kernel-panic is a driver-related issue with LWJGL - and it's totally out of my control. I've been given a few dumps and I'm waiting for another semi-stable update to the LWJGL libraries to (hopefully) fix this totally. Mac support was okay for a while, and things just slid downhill due to a series of other UI bugs. They're being beaten out next weekend.

#22 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 18 August 2013 - 05:34 AM

+1 I like the idea very much since you could use you iOS/Android device to test a program etc.

#23 oeed

    Oversimplifier

  • Members
  • 2,095 posts
  • LocationAuckland, New Zealand

Posted 18 August 2013 - 07:00 AM

Yes! Ever since I installed Mavericks (the beta OS X, which probably brought a new version of Java with it) I've been unable to use either CCDesk or CCEmu.

Is it possible to send me the C++ version? I'm running OS X, so if it's an app it shouldn't be hard, unless there are legal or similar issues of course. I'm interested in helping out either way, don't expect my offer to be taken, but it's on the table.

#24 Sorroko

  • Members
  • 87 posts

Posted 18 August 2013 - 08:36 AM

Writing the entire emulator in c and then porting to javascript with emscripten might be more viable. OpenTTD was ported to javascript in the same way: http://play-ttd.com

#25 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 18 August 2013 - 10:39 AM

View Postoeed, on 18 August 2013 - 07:00 AM, said:

Yes! Ever since I installed Mavericks (the beta OS X, which probably brought a new version of Java with it) I've been unable to use either CCDesk or CCEmu.

Is it possible to send me the C++ version? I'm running OS X, so if it's an app it shouldn't be hard, unless there are legal or similar issues of course. I'm interested in helping out either way, don't expect my offer to be taken, but it's on the table.

I could send the C++ version to you easily :) but it needs to be distributed with a computercraft.jar file. I'm pretty sure I can distribute it privately to just one person, but it would be nice to have clarification for that. Or I can just say you're beta testing it for me :P It requires you to install a few dependencies currently, and its a bit buggy (top row can't receive mouse clicks, a bit flickery at times, no crash protection) but it has modems :D I'll PM you the details tomorrow when I'm not on my phone :P

#26 Graypup

  • Members
  • 90 posts

Posted 18 August 2013 - 01:44 PM

That idea is insane. You're running 1 programming language that isn't very fast on another not-very-fast programming language. Someone has done this, though I think they're crazy. https://github.com/kripken/lua.vm.js

#27 M4sh3dP0t4t03

  • Members
  • 255 posts
  • LocationGermany

Posted 18 August 2013 - 03:44 PM

View PostGraypup, on 18 August 2013 - 01:44 PM, said:

That idea is insane. You're running 1 programming language that isn't very fast on another not-very-fast programming language. Someone has done this, though I think they're crazy. https://github.com/kripken/lua.vm.js
It isn't insane. There is even a gameboy emulator that is working perfectly with no lag written in HTML5 and JavaScript( https://github.com/g.../GameBoy-Online )

#28 Sxw

  • Members
  • 306 posts
  • LocationWhenever, Wherever!

Posted 18 August 2013 - 04:12 PM

Abstract it! http://haxe.org/
That would work if you want to have many platforms.
You could code the core emulator in haxe then a UI in whatever. ;P

#29 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 18 August 2013 - 06:45 PM

View PostSxw, on 18 August 2013 - 04:12 PM, said:

Abstract it! http://haxe.org/
That would work if you want to have many platforms.
You could code the core emulator in haxe then a UI in whatever. ;P

I've done some games using NME and Haxe before. I don't think it's possible to run either java or Lua from it at all. Is this the case, or did I miss something when googling?

#30 1lann

  • Members
  • 516 posts
  • LocationSeattle

Posted 19 August 2013 - 05:12 AM

View PostGraypup, on 18 August 2013 - 01:44 PM, said:

That idea is insane. You're running 1 programming language that isn't very fast on another not-very-fast programming language. Someone has done this, though I think they're crazy. https://github.com/kripken/lua.vm.js
Lua's pretty fast... And yes we are going to use a lua vm for this, specifically this one (because it uses lua 5.1): https://github.com/humbletim/ljs
Nevermind this one doesn't have 5.1 features... We'll be looking into doing something....

Although I'm aware running lua within javascript can become quite slow, but we'll see how it goes. I'll see if I can implement some functions and actually get it somewhat working. The main goal currently is to implement coroutines, since the one I'm using doesn't support coroutines.

#31 Mitchfizz05

  • Members
  • 125 posts
  • LocationAdelaide, Australia

Posted 19 August 2013 - 05:17 AM

This sounds like a brilliant idea!

#32 1lann

  • Members
  • 516 posts
  • LocationSeattle

Posted 20 August 2013 - 04:59 AM

Just a heads up, I'm quite busy, and not only that but I might not be capable of implementing all the features required, and figure everything out. It could take a longggg time and the project might be ditched (I'll try not to). Just a heads up.

#33 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 20 August 2013 - 05:51 AM

View Post1lann, on 20 August 2013 - 04:59 AM, said:

Just a heads up, I'm quite busy, and not only that but I might not be capable of implementing all the features required, and figure everything out. It could take a longggg time and the project might be ditched (I'll try not to). Just a heads up.

On the up side, I'm most of the way through a nice implementation of a lightweight, cross-platformed emulator written in Python (but still using Java to run all the computercraft related stuff, making it easy to update :)). I'm fed up with C++ and its annoyingness (not because of the language itself, but because of my inexperience).

#34 Zudo

  • Members
  • 800 posts
  • LocationUK

Posted 20 August 2013 - 03:14 PM

You will be using the HTML5 <canvas> tag if it goes ahead, I assume?

#35 1lann

  • Members
  • 516 posts
  • LocationSeattle

Posted 20 August 2013 - 10:22 PM

View PostZudoHackz, on 20 August 2013 - 03:14 PM, said:

You will be using the HTML5 <canvas> tag if it goes ahead, I assume?
Yes of course.

#36 nutcase84

  • Members
  • 711 posts
  • LocationIn My Lonely Little Computer Corner

Posted 22 August 2013 - 10:20 AM

I see an error thing at the top of the page.
Spoiler


#37 GravityScore

  • Members
  • 796 posts
  • LocationLand of Meh

Posted 22 August 2013 - 11:15 AM

View Postnutcase84, on 22 August 2013 - 10:20 AM, said:

I see an error thing at the top of the page.
Spoiler

So do I :/

#38 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 25 August 2013 - 08:31 AM

View PostGravityScore, on 22 August 2013 - 11:15 AM, said:

View Postnutcase84, on 22 August 2013 - 10:20 AM, said:

I see an error thing at the top of the page.
Spoiler

So do I :/
My assumption would be that those forums are not compatible with out modern browsers which supports html 5. I have it too, bit there is nothing we can do nor the admins. That is because the stuff with licenses and blabla.. in short, we will have to wait :P

but to be back on topic, maybe the idea of a web client is not in the right spot. Since you are currently coding in python, which is compatible with almost every platform to nu knowledge, you could possibly make it a standalone, lightweight emulator.
The idea of not having java installed but running such an emulator is awesome. But without knowing any python, I don't know if it is really possible and doable

#39 nutcase84

  • Members
  • 711 posts
  • LocationIn My Lonely Little Computer Corner

Posted 25 August 2013 - 06:14 PM

I have programed in python, but how would you put it on Android/IOS/Others? I found few python apps for android, but it can't do GUIs.

#40 oeed

    Oversimplifier

  • Members
  • 2,095 posts
  • LocationAuckland, New Zealand

Posted 25 August 2013 - 09:14 PM

View Postnutcase84, on 25 August 2013 - 06:14 PM, said:

I have programed in python, but how would you put it on Android/IOS/Others? I found few python apps for android, but it can't do GUIs.

While it is possible to use Python on iOS I wouldn't advise it. There is a Lua interpreter for Lua, but your main problem is the absolute zero support for Java. So you'd have to write the whole thing yourself essentially. Your other problem is keyboard input. How do you know when to show they keyboard? What about arrow keys. Granted, you could make a keyboard interface, but it won't fit on a phone. Finally, who would actually use a CC emulator on their phone? Apart from the novelty value I can't really see a use.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users