Jump to content




CraftOS 2.0 - Dan's Secret Project

computer help

798 replies to this topic

#741 Lego Stax

  • Members
  • 136 posts
  • LocationThe dark depths of the web

Posted 13 October 2016 - 01:46 PM

How many people think CraftOS 2.0 will get released on December 24?

#742 Anavrins

  • Members
  • 775 posts

Posted 25 October 2016 - 06:03 AM

 dan200, on 09 July 2015 - 01:32 PM, said:

Status update on this thing: With ComputerCraftEdu out of the way, my current focus is on finishing the Steam release of Redirection. When that is done, this new project gets 100% of my attention :)/>/>
Redirection has been released, and another grain of sand fell.
The hype is real!

Edited by Anavrins, 25 October 2016 - 06:03 AM.


#743 dan200

  • Administrators
  • 542 posts
  • LocationCambridge, England

Posted 27 October 2016 - 11:50 PM

Hey all,

I've just finished documenting the Robot Arcade part of Redirection, which as you probably know my now, serves as a preview of the CraftOS 2.0 project:
http://steamcommunit...s/?id=788101089

There have already been several Arcade games posted to the workshop, on top of the 3 built into the game:
http://steamcommunit...5D=Arcade+Games

If you want to get in on the action, Redirection is currently 15% off on Steam :)
http://store.steampo....com/app/305760

On top of the CraftOS 2.0 preview, you also get a great puzzle game with 100% positive Steam reviews, and help me to pay my rent :P

#744 oeed

    Oversimplifier

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

Posted 28 October 2016 - 04:20 AM

Awesome!

For things like Silica which will need to manually draw their pixels, rather than using the GPU, what is the fastest way to draw the entire screen?

Is using drawImage faster than repeatedly calling drawPixel, or does drawImage just call drawPixel itself (like paintuils)?

#745 dan200

  • Administrators
  • 542 posts
  • LocationCambridge, England

Posted 28 October 2016 - 08:09 AM

I can't think of any reason not to use the GPU for rendering, but yes: one gpu.drawImage call is much faster than hundreds of gpu.drawPixel calls. Calling image:write with a string argument is the faster way to upload pixels into an image en masse also.

#746 CoderPuppy

  • Members
  • 121 posts

Posted 28 October 2016 - 06:12 PM

Edit by Dan:
**snip**
Please don't reverse engineer or decompile my code. Redirection is a commercial game, and the code is copyrighted. I don't mind you documenting the undocumented Lua APIs, but recompiling my code or creating other code that links to it crosses a line. I put a lot of trust in the community by deciding not to obfuscate the code, please don't make me regret this.

Technical Details

 oeed, on 28 October 2016 - 04:20 AM, said:

Awesome!
For things like Silica which will need to manually draw their pixels, rather than using the GPU, what is the fastest way to draw the entire screen?
Is using drawImage faster than repeatedly calling drawPixel, or does drawImage just call drawPixel itself (like paintuils)?
Canvas/Image/Mask should probably be reimplemented using images, from a quick look through master I can think of ways of implementing everything efficiently.

 dan200, on 27 October 2016 - 11:50 PM, said:

Hey all,
I've just finished documenting the Robot Arcade part of Redirection, which as you probably know my now, serves as a preview of the CraftOS 2.0 project:
http://steamcommunit...s/?id=788101089
There have already been several Arcade games posted to the workshop, on top of the 3 built into the game:
http://steamcommunit...5D=Arcade+Games
If you want to get in on the action, Redirection is currently 15% off on Steam :)/>/>/>
http://store.steampo....com/app/305760
On top of the CraftOS 2.0 preview, you also get a great puzzle game with 100% positive Steam reviews, and help me to pay my rent :P/>/>/>
There are quite a few methods missing from the guide, is that intentional?
I can't really see any benefit to the UTF-8 file modes, they just parse as UTF-8 then convert back to an array of bytes which just corrupts non-UTF-8 data.
I also found at least one bug I can remember right now: in `Image.Fill` `x + height` is compared to `Height`, that should be `y + height`.

Edited by dan200, 29 October 2016 - 07:53 AM.


#747 oeed

    Oversimplifier

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

Posted 28 October 2016 - 08:42 PM

Quote

Memory limit, set at 1MB (not 1MiB) in the arcade

I take it that's memory, not storage. Could be a fun challenge, the Luo compiler is definitely surpassing 2MB at the moment...

Quote

Now using Lua 5.3.

rip jit

Quote

getModifiedTime, getNameWithoutExtension, mount
Awwww yeahhhhhhh!

Quote

getPowerStatus() : string, int - `powerStatus, chargeLevel`, `powerStatus` is either `'unpowered'`, `'charged'`, `'charging'`, `'discharging'` or `'fixed'`

Interesting... seems to hint that Dan has some cool plans for the future!

Quote

getTime() : float - time as seconds since 12:00:00 January 1 0001 (0001-01-01T12:00:00.00)
resetTime() - reset the time to UTC

Glad to see we have access to the real world time now, can you explain what is meant by resetTime though? There doesn't seem to be anything to set it. Can you change the timezone?

Interested to see what's possible with the speaker. I haven't done much stuff with sound, but I take it that it's fairly basic?

#748 CoderPuppy

  • Members
  • 121 posts

Posted 28 October 2016 - 08:50 PM

 oeed, on 28 October 2016 - 08:42 PM, said:

Quote

getTime() : float - time as seconds since 12:00:00 January 1 0001 (0001-01-01T12:00:00.00)
resetTime() - reset the time to UTC
Glad to see we have access to the real world time now, can you explain what is meant by resetTime though? There doesn't seem to be anything to set it. Can you change the timezone?
Right below `resetTime` is `setTime`.

 oeed, on 28 October 2016 - 08:42 PM, said:

Interested to see what's possible with the speaker. I haven't done much stuff with sound, but I take it that it's fairly basic?
I've no idea.

#749 oeed

    Oversimplifier

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

Posted 28 October 2016 - 09:03 PM

 CoderPuppy, on 28 October 2016 - 08:50 PM, said:

Right below `resetTime` is `setTime`.

Facepalm.

#750 cyanisaac

  • Members
  • 369 posts
  • LocationSan Diego, CA

Posted 30 October 2016 - 12:41 AM

So with this Arcade mode, are there any restrictions with it as opposed to standard ComputerCraft, or can you make anything with it? (ie missing features, such as maybe certain inputs)

If this is basically CraftOS 2.0 unrestricted within Redirection I'm definitely interested in it.

#751 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 30 October 2016 - 01:30 AM

This is merely a preview of CraftOS2.0, intended for the creation of minigames. The display is 64x64 and monochrome (text characters take 4x6px each, including padding). Keyboard input seems to be limited to arrows + Z + X. I don't believe mouse input is accepted. io.open() throws access denied errors when attempting to use write mode, though there's a scoreboard API (that Dan hasn't documented for whatever reason) which can be used to retain a high score between loads.

It isn't event-driven in the manner ComputerCraft is. I'm quite tempted to create a compatibility layer to replicate that old behaviour.

It offers sound (nothing too complex), and a few nifty drawing functions. You can load a picture file and render it where ever you like for eg. Another undocumented function, gpu.setTransparentColor(), is handy for this.

I was able to port across a stripped-down version of my old Tetris script with minimal effort. Debugging can be a little tricky at times, though, given that it often omits line numbers from its errors - though manually adding breakpoints into a script isn't "hard", per se, simply annoying.

ALREADY someone has posted an "OS" for it. It has four menu options - half of them are redundant and the other half non-functional.

#752 CoderPuppy

  • Members
  • 121 posts

Posted 30 October 2016 - 01:48 AM

 Bomb Bloke, on 30 October 2016 - 01:30 AM, said:

It isn't event-driven in the manner ComputerCraft is. I'm quite tempted to create a compatibility layer to replicate that old behaviour.

It is, `system.sleep` is implemented as:
function system.sleep( nSeconds )
	expect( nSeconds, "number", 1 )
	local clock = system_getDevice( "clock" )
	if not clock then
		error( "No clock present" )
	end
	local nTimer = clock.startTimer( nSeconds )
	while true do
		local sEvent, p1 = system_pullEvent( "timer" )
		if p1 == nTimer then
			break
		end
	end
end


#753 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 30 October 2016 - 02:16 AM

Ah, that's handy then! :)

#754 Emma

  • Members
  • 216 posts
  • Locationtmpim

Posted 25 November 2016 - 02:52 AM

I broke it
Spoiler


#755 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 25 November 2016 - 03:15 AM

Yeah they're a few bugs in there (at least, last I checked). Some of them are caused by incorrect calls on your part and really just need a better error message attached to them, others are a bit more dubious. Having some of the drawing functions attempt to plot stuff outside of the visible area can sometimes crash Redirection completely for eg.

#756 Emma

  • Members
  • 216 posts
  • Locationtmpim

Posted 25 November 2016 - 04:05 AM

 Bomb Bloke, on 25 November 2016 - 03:15 AM, said:

--snip--

Yeah, this one in particular was me trying to load a file at the wrong path, really should have a better error ;P

#757 dan200

  • Administrators
  • 542 posts
  • LocationCambridge, England

Posted 25 November 2016 - 11:04 AM

 Bomb Bloke, on 25 November 2016 - 03:15 AM, said:

Yeah they're a few bugs in there (at least, last I checked). Some of them are caused by incorrect calls on your part and really just need a better error message attached to them, others are a bit more dubious. Having some of the drawing functions attempt to plot stuff outside of the visible area can sometimes crash Redirection completely for eg.

Hey all! Can you report all instances of calls which crash Redirection, causes a C# stacktrace to be printed, or otherwise error when they shouldn't here please: https://github.com/d...irection/issues
As always, minimal reproduction code is best!

#758 Elttob

  • Members
  • 22 posts
  • LocationLondon, UK

Posted 27 December 2016 - 02:14 AM

Yay features!

(furiously figuring out ways to exploit the speaker api to produce cool sounds)

EDIT: All done! Using FamiTracker with the current limitations of the speaker api in mind, voila: https://dl.dropboxus.../CraftOS%21.wav

I made the kick drum with some fancy pitch sliding on a triangle channel.

Edited by Elttob, 27 December 2016 - 02:42 AM.


#759 Elttob

  • Members
  • 22 posts
  • LocationLondon, UK

Posted 27 December 2016 - 04:21 AM

(not an edit of previous post, since they aren't related)

I redesigned Vertex's interface to work better on the COS2.0 CGA display. Here's a snap:

Posted Image

Same palette as before, but with a much cleaner look. I like the antialiasing effects too; they were largely accidental but worked well in the end :P

(except maybe the search icon, I'm not fond of that one)

Edited by Elttob, 27 December 2016 - 05:11 AM.


#760 ScoutCD10

  • Members
  • 18 posts

Posted 04 January 2017 - 09:30 PM

Dan promised that after Redirection release,he will start working again on CC2.0 but dan gave no news about CC2.0 so i think CC2.0 is dead for good.
Its been almost 3 months since redirection and we hadnt any news about CC2.0 Progresa

Edited by ScoutCD10, 04 January 2017 - 09:33 PM.






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users