[INSANE CODING] iios - Desktop Environment using RenPy

Post demo and beta versions of your game here for testing.
Post Reply
Message
Author
iichan_lolbot
Veteran
Posts: 204
Joined: Tue Dec 30, 2008 9:18 am
Projects: iichan erogame
Contact:

[INSANE CODING] iios - Desktop Environment using RenPy

#1 Post by iichan_lolbot » Sat May 23, 2015 8:35 pm

Hi, all. I have done my best on using RenPy in unsupported and unrecommended ways (I'm really sorry, PyTom..) and created something really strange.
It's a renpy-based windowed desktop environment capable of running dozens of "programs" by dynamicly loading them from python files.
There are such applications as picture viewer, movie player, IRC client, minesweeper game and prototypes of renpy subset interpreter and a web browser.
I even wrote a clone of WinAmp program, which plays music, handles playlist and supports winamp 2.x skin files.
SusanTheCat's Renpystein is also ported as an app for this platform.

Most of the code is under CC-BY-NC-SA 4.0, i will put it on GitHub later.
You can download a build and try it out: https://mega.co.nz/#!vdYzAQjA!YphmyQ2Cs ... upkOe8cs_Q
iios_4.jpg
iios_3.jpg
iios_2.jpg
iios_1.jpg
It is still far from finished, just showing what I have right now.
Still, I'm curious, what do you think about it? Please, let me know.

HiddenCreature
Regular
Posts: 178
Joined: Sat May 16, 2015 8:00 pm
Projects: Vampire: The New Birth
Contact:

Re: [INSANE CODING] iios - Desktop Environment using RenPy

#2 Post by HiddenCreature » Sat May 23, 2015 8:48 pm

If I understand correctly, is this your attempt at making Ren'Py more user-friendly?

User avatar
PyTom
Ren'Py Creator
Posts: 15120
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: [INSANE CODING] iios - Desktop Environment using RenPy

#3 Post by PyTom » Sat May 23, 2015 10:03 pm

My initial reaction is that is 1 month, 23 days late.

(I mean, I'm both flabbergasted by both the "how?" and the "why?".)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

iichan_lolbot
Veteran
Posts: 204
Joined: Tue Dec 30, 2008 9:18 am
Projects: iichan erogame
Contact:

Re: [INSANE CODING] iios - Desktop Environment using RenPy

#4 Post by iichan_lolbot » Sun May 24, 2015 7:32 am

PyTom wrote:My initial reaction is that is 1 month, 23 days late.
Ahahaha, it took me some time to calculate what exactly was on that day. ^_^
PyTom wrote:I mean, I'm both flabbergasted by both the "how?" and the "why?".
Ok, I'll try to answer.

"Why": RenPy allows programming on pure python, providing a kind of good UI library. Using it in nonintended ways is fun, because it's both exciting (with python programming is fun again) and challenging (some details of how RenPy works are too VN-specific). Several days before New Year party I found out that RenPy supports Drag&Drop, at this moment I reinvented it with awful shit-code for Travnica game (stay tuned, english version is coming soon). When celebration was over, we had a long Russian State Winter Holiday weeks. During this period I've tried Drag and thought "hmmm, one can use them to make something windows-like". This idea was so strong I couldn't help but to code this down.

"How": basicly, to make something like this you need to store a DragGroup in a variable and to manage Drags inside it when a window needs to be added/closed/updated. As for applications, I've agressively used non-public API. And yes, this was not too easy. There are lot's of places where I feel that I'm reaching current RenPy's limits.

Some most interesting limits worked around:
* if Drag has a scrollable ViewPort inside, it is still dragged, not scrolled. Kind of solved this in SnaplessDrag class.
* Button reacts only to left and right mouse keys. Screw this, my MultiClickedButton class reacts to middle click and mouse scroll too! (That was actually needed for MicroAmp and Minesweeper game)
* Text does not have properties to disable tag support. Created TaglessText class for this.
* Grid uses the same widths&heights for all the columns&rows. UnevenGrid class solves this.
* Adding & removing sound channels is not allowed when the game have started. Using non-public API to do this.
* I was not sure if new Styles can be generated after init phase, but I needed this. So all styles are handled by directly passing ui properties.

Behaviour and performance issues:
* RenPy works extremely slower if DynamicDisplayable contains a clickable Button (FPS 60 instantly drops to FPS <20)
* RenPy slows down if a hundred(s) of focusable objects are displayed.
* RenPy consumes hundreds more of memory Mb when a very long Label is displayed inside ViewPort. It is hundreds Mbs less if one Label is replaced with a Vbox with lots of Labels.

Unsolved limits:
* RenPy core code uses "renpy.something" calls and "import renpy.something" imports in lots of places, which makes it uneasy to run multiple instances of RenPy. Still, I have successfully runned "The question", which is kind of success.
* Maximum Unicode code is 65536 on some platforms
* HTTPS is not supported (which means that english Wikipedia is accessable and russian is not, lol)
* Only one video stream can play at a time
* Video stream can't be paused
* Audio&video stream can't be rewinded
* Audio&video stream total length is avaliable with any APIs (for MP3 I have parsed some headers to extract this)
* Equalizer can't be implemented with any current APIs
* I don't know a way to drop a given set of images from image cache without purging everything
* If an exception is thrown from audio subsystem or during render, my code does not catch it and does not show a beautiful application window with a traceback without ruining the whole system.
* Many more...

User avatar
Sorakun
Regular
Posts: 103
Joined: Sun Oct 20, 2013 10:02 pm
Completed: Techno Titans, Blood Metal Exorcism, Tom Cruiser, Mechadin, UPlay
IRC Nick: Sorakun
Skype: sora.ch4n
Contact:

Re: [INSANE CODING] iios - Desktop Environment using RenPy

#5 Post by Sorakun » Tue May 26, 2015 2:05 pm

It sounds like you have basically tried to create a virtual desktop run on Ren'Py, if that is the case, my question is, why not just use C# or some other easly adaptable language?
Seems kind of like trying to use a spoon to dig to china, it can be done but don't see why you wouldn't just use a shovel.

iichan_lolbot
Veteran
Posts: 204
Joined: Tue Dec 30, 2008 9:18 am
Projects: iichan erogame
Contact:

Re: [INSANE CODING] iios - Desktop Environment using RenPy

#6 Post by iichan_lolbot » Mon Jun 01, 2015 1:06 am

Sorakun wrote: It sounds like you have basically tried to create a virtual desktop run on Ren'Py
Yes, that's right. Plus, write some apps to make this demo functional.
Sorakun wrote: why not just use C# or some other easly adaptable language?
Python is easily adaptable in many ways.
Sorakun wrote:Seems kind of like trying to use a spoon to dig to china
YES!
Sorakun wrote:but don't see why you wouldn't just use a shovel.
1.Some not much into shovels.
2.You don't need to look for a spoon once you get to China, it is already with you.
3.This expedition helps you learn much more about spoons.
4.Digging is fun and enjoyful even if the earth is flat and there is no China.

User avatar
Karl_C
Regular
Posts: 187
Joined: Sun Mar 31, 2013 6:18 am
Contact:

Re: [INSANE CODING] iios - Desktop Environment using RenPy

#7 Post by Karl_C » Tue Jul 28, 2015 2:16 pm

It's surprisingly fast, even on my old machine.

Can possibly used for games that emulate a desktop environment?

Good job, iichan!

iichan_lolbot
Veteran
Posts: 204
Joined: Tue Dec 30, 2008 9:18 am
Projects: iichan erogame
Contact:

Re: [INSANE CODING] iios - Desktop Environment using RenPy

#8 Post by iichan_lolbot » Fri Jul 08, 2016 1:26 pm

Karl_C wrote:Can possibly used for games that emulate a desktop environment?
Not sure if it is safe with renpy's save and rollback. Until you don't use them, this should be fine to integrate this desktop environment as a part of a bigger game.

User avatar
Morhighan
Miko-Class Veteran
Posts: 904
Joined: Sun Jun 27, 2010 12:54 pm
itch: MysteryCorgi
Location: Illinois
Contact:

Re: [INSANE CODING] iios - Desktop Environment using RenPy

#9 Post by Morhighan » Sun Sep 04, 2016 5:11 am

iichan_lolbot wrote:
Karl_C wrote:Can possibly used for games that emulate a desktop environment?
Not sure if it is safe with renpy's save and rollback. Until you don't use them, this should be fine to integrate this desktop environment as a part of a bigger game.
I'm not too interested in having rollback in my game, but I do think I need a save function. Any way to remedy this?

iichan_lolbot
Veteran
Posts: 204
Joined: Tue Dec 30, 2008 9:18 am
Projects: iichan erogame
Contact:

Re: [INSANE CODING] iios - Desktop Environment using RenPy

#10 Post by iichan_lolbot » Sun Sep 04, 2016 6:42 pm

Currently there is no "hibernate" function for this runtime, so after you close the game all the unsaved stuff like list of open windows and their positions are lost. Only things that are actually saved are those things that are forced to be saved by apps themself (like, selected skin of iiAmp, highscore table for iiMines, etc). If your game is all about user's desktop, then maybe you don't even need any save function.

If you are planning to use desktop only in a few moments within a VN scenario, then I'm not sure what actually would happen. I never tested saving with RenPy's built-in save mechanism, but I suppose there may be issues like exceptions about unsavable lambda or something like this.

User avatar
Morhighan
Miko-Class Veteran
Posts: 904
Joined: Sun Jun 27, 2010 12:54 pm
itch: MysteryCorgi
Location: Illinois
Contact:

Re: [INSANE CODING] iios - Desktop Environment using RenPy

#11 Post by Morhighan » Sun Sep 04, 2016 10:40 pm

iichan_lolbot wrote:Currently there is no "hibernate" function for this runtime, so after you close the game all the unsaved stuff like list of open windows and their positions are lost. Only things that are actually saved are those things that are forced to be saved by apps themself (like, selected skin of iiAmp, highscore table for iiMines, etc). If your game is all about user's desktop, then maybe you don't even need any save function.

If you are planning to use desktop only in a few moments within a VN scenario, then I'm not sure what actually would happen. I never tested saving with RenPy's built-in save mechanism, but I suppose there may be issues like exceptions about unsavable lambda or something like this.
Oh, I see! I think I get that a bit better now.

Also... I ran into an error while trying to open the web browser:

Image

User avatar
Karl_C
Regular
Posts: 187
Joined: Sun Mar 31, 2013 6:18 am
Contact:

Re: [INSANE CODING] iios - Desktop Environment using RenPy

#12 Post by Karl_C » Mon Sep 05, 2016 12:00 am

Morhighan wrote:Also... I ran into an error while trying to open the web browser:

Image
iichan_lolbot wrote: Unsolved limits:
...
* HTTPS is not supported (which means that english Wikipedia is accessable and russian is not, lol)
...

User avatar
Morhighan
Miko-Class Veteran
Posts: 904
Joined: Sun Jun 27, 2010 12:54 pm
itch: MysteryCorgi
Location: Illinois
Contact:

Re: [INSANE CODING] iios - Desktop Environment using RenPy

#13 Post by Morhighan » Mon Sep 05, 2016 1:40 pm

Karl_C wrote:
Morhighan wrote:Also... I ran into an error while trying to open the web browser:

Image
iichan_lolbot wrote: Unsolved limits:
...
* HTTPS is not supported (which means that english Wikipedia is accessable and russian is not, lol)
...
Okay, thought so!
Is there any way to set it to the English Wikipedia just for testing purposes?

Post Reply

Who is online

Users browsing this forum: No registered users