Age Prototype of "Tahwah"

Show us what you can do! Let us know how you did it!

Re: Age Prototype of "Tahwah"

Postby DatokerJ » Wed Mar 31, 2010 5:06 am

That's just amazing guys, Word just can't express how stunned I am. Very impressive indeed.
DatokerJ
 
Posts: 22
Joined: Thu Jun 26, 2008 5:59 am

Re: Age Prototype of "Tahwah"

Postby kahinj » Wed Mar 31, 2010 5:13 am

I have got to say this is cool. I look forward to it's further development.
Life is a book.
kahinj
 
Posts: 62
Joined: Sun Dec 06, 2009 3:26 am

Re: Age Prototype of "Tahwah"

Postby Robert The Rebuilder » Wed Mar 31, 2010 5:22 am

This is fantastic, TMOD! I'm eager to find out how you accomplished this.

A while ago I had an idea for in-game age creation that provided the user with a blank book and a pen. You would generate symbols on different pages that affected different properties of the age (e.g. climate, degree of foliage, soil consistency, etc). Through an external linking panel (like the one Catherine made in Riven), you could see the effects of the changes in real time; and when you're ready, you can use the panel to link to the age. However, I could not think of a way to manipulate geometry via Plasma Python.

I'm glad to see that you've found some means to do this!
Can we rebuild it? Yes, we can - here's how.

MOULagain KI# 1299

Myst Movie coming soon - spread the word!
User avatar
Robert The Rebuilder
 
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
Location: Virginia, US

Re: Age Prototype of "Tahwah"

Postby The.Modificator » Wed Mar 31, 2010 8:11 am

Thanks for the great feedback! :D

First of all, some answers to questions:

Justintime9 wrote:Wow. I had no idea anything like this was even possible. Beyond the basic terrain modification would it also be possible eventually to texture it etc. ingame?


Yes, that's what I'm planning to do with the other two screens. The middle one should be used for drawing different materials (i.e. different textures) onto the landscape. I even played with the thought to use the right one to place simple small geometry like grass or small rocks onto the ground.


Trylon wrote:Am I right in assuming you glued bits of pyprp to the age's python script?


As Diafero said: It's far worse than that. As promised, here's some more insight into the technical background of how things are done in Tahwah... (btw: Tahwah = tawa [the age file name] = Test Age Writing Age ;) )



Client Setup
The client is a standard Uru:TPotS or Uru:CC installation with the Offline KI installed. Aditionally it uses the UruSetup.exe from Untìl Uru and a serverconfig.ini pointing to my own data server.


Game Server Setup
The game server is a standard Alcugs installation. It has the tawa.age, generatedage.age and an additional SDL file added to its basic data set.


Data Server Setup
The data server is the one that does most of the work. Since the "old" Uru client versions simply use HTTP for their data server, my server is a standard Apache 2 installation. However, the machine also has the X desktop installed and can therefore run Blender.

For the communication between the Uru client and the data server I created a very simple "protocol" that allows the commands "Get", "Send", "Bake Book" and "Is Done?" both to transfer the landscape information (which is basically just a simple JPEG file) and to initialize the age creation process. The command Get simply returns the currently stored image, whereas the Send command stores a new image on the server. The "Is Done?" command will be called periodically by the client to check if the age creation process is already complete. Once this is the case, the red box will be made invisible again and the book animation is started.

The big worker command is the "Bake Book" command. Originally this command simply started up Blender with an autostart Python script which directly exported the generated age, always with the current height profile. However, as I started to also use Blender's unwrap function to make the texture look a bit better (which you can not call through the Blender Python API), I had to do a step backwards. If you saw the current "Bake Book" code, you'd directly send it to The Daily WTF... The current implementation starts up Blender and then emulates a series of key strokes and mouse move and click operations. Yes. Awesome, I know. ;)

As the machine where all that stuff is running on can barely run just the X server this also explains the long waiting time at the moment. For future versions I'm planning to create a tool on the basis of libHSPlasma to replace Blender completely (and therefore make the X server unnecessary).

Anyway... Once Blender successfully exported the age, it calls a script written by Diafero which then automatically generates the new data server manifest files and also gzips the new data files. Once this process is complete, a flag on the data server will be set so that the "Is Done?" command will return "yes" from that point on.


(Technical) Age Design
The age "Tahwah" itself uses a lot of Python code that is closely tied with the PRP files. I used a custom PyPRP version (the 1.6 release with some modified code) and PrpShop to compile the age. It makes a lot of use of GUI dialog elements (like the GUI Clickable Map) and Dynamic Maps. Since I didn't find a good way to paint stuff on the image at the beginning of my development, an earlier version introduced an additional executable called "consolepaint.exe". Originally this small program was used to do the following:

Code: Select all
1. Wait for user console input.
2. Check the command. If it starts with "DRW" (for draw) interpret the remaining part of the line as a coordinate.
   a) Open the file "./tawa/age.jpg".
   b) Put a pre-loaded image at the specified coordinate onto the age.jpg.
   c) Save the age.jpg again.
   d) Send the string "OK\n" to stdout.
3. Goto 1.


I used pipes that are opened in another Uru Python thread to communicate with this application. Whenever the mouse cursor was moved, consolepaint received the "DRW" command and did the steps mentioned above. Whenever my thread received the line "OK\n", it called a Plasma function which re-loaded the age.jpg and drew it onto the Dynamic Map. Later on also the transfer commands were added to consolepaint. This first implementation was completely laggy as you might have already guessed.

In the newest version the "DRW" command could theoretically still be called... but fortunately we found a way to create some sort of paint application by just using Plasma functions. The classes used for this are ptImage and ptDynamicMap. If you want to do something similar, you should take a look at the methods those classes offer. Also the function PtLoadJPEGFromDisk() might be interesting for you.

In a future version I plan to completely remove consolepaint.exe (at the moment it's only used to transfer the files anyway) and replace it by an implementation which uses the _socket.pyd.



Thanks/Credits
Since the short "thanks" section in my video isn't very precise, I'll try to create a bit more thorough credits list here.

Thanks to:
  • Diafero
    for
    • a lot of Linux help (I'm not a Linux person at all)
    • suggestions for Python code
    • the manifest file generation and gzipping script
    • setting up the game server for this project
  • Mucol and Mr. Clock
    for
    • ideas for the story
    • ideas for the preliminary level design
    • creating textures
  • Old Wolle
    for
    • letting the game server run on one of his machines
I'd also like to thank all these persons on this list for helping me test the age and the code.


Texture Sources
To give credit to the people who created the textures (or the photographs of which I then created seamless textures), here is a list of texture sources:
  • Rust
  • Metal
  • Paper
  • The stars are from the NASA (therefore Public Domain)
  • The wall texture was created by Mr. Clock
  • The console texture was created by Mucol


If you have any remaining questions concerning this project, feel free to ask.


Cheers,

The.Modificator
The.Modificator
 
Posts: 14
Joined: Wed Mar 10, 2010 8:40 am

Re: Age Prototype of "Tahwah"

Postby diafero » Wed Mar 31, 2010 9:21 am

Let me just repeat in public what I already said several times: I absolutely love the awesomely terrible ideas you have. It happened more than a single time that I thought "hm, how is he going to do THAT?", and the other day, you told me. You really are an artist, creatively (mis)using the available technology. And I have a liking for this kind of programming "around the corner" ("um die Ecke" in German, not sure if this translates).
So, it's been a pleasure, and I look forward to support more of your ideas :)
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2803
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Age Prototype of "Tahwah"

Postby Aloys » Wed Mar 31, 2010 9:25 am

That's some seriously impressive (and unexpected) work.
How long did all of that took you to create? (roughly)
I find the whole painting system inside Plasma especially nifty; it opens up interesting new interraction possibilities. The server side work looks like a tangled mess; but the result is really cool. :)
Congrats to you and Diafero for creating this.
User avatar
Aloys
 
Posts: 1824
Joined: Sun Oct 21, 2007 7:57 pm
Location: France (GMT +1)

Re: Age Prototype of "Tahwah"

Postby diafero » Wed Mar 31, 2010 9:36 am

I joined around March 17th, 18th.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.

"Many people's horizon is a circle with a radius of zero. They call it their point of view."

Deep Island Shard | Offline KI
diafero
Deep Island Admin
 
Posts: 2803
Joined: Mon May 05, 2008 5:50 am
Location: Germany

Re: Age Prototype of "Tahwah"

Postby The.Modificator » Wed Mar 31, 2010 9:39 am

Aloys wrote:How long did all of that took you to create? (roughly)

The first date in my IC-style development diary roughly tells you the point where I started my first experiments with age creation. (Actually Tahwah is just the second age I've created [after the usual "avatar on untextured plane" test age].)
I had the idea for this one or two weeks earlier though. (And I worked a bit with Blender before.)


Aloys wrote:The server side work looks like a tangled mess; but the result is really cool. :)

Thanks!
Yes, the server side is really messy at the moment. But I knew basically right from the beginning that having to start up Blender to perform the necessary tasks is not the right solution for this project. Therefore I didn't spent a lot of time optimizing this part yet - I just threw something together to check if my theory actually works. ;)
The.Modificator
 
Posts: 14
Joined: Wed Mar 10, 2010 8:40 am

Re: Age Prototype of "Tahwah"

Postby Erik » Wed Mar 31, 2010 10:16 am

Wow! Incredible!
User avatar
Erik
 
Posts: 124
Joined: Wed Oct 03, 2007 7:49 am
Location: the Netherlands

Re: Age Prototype of "Tahwah"

Postby Robert The Rebuilder » Wed Mar 31, 2010 10:26 am

Yes, thank for sharing the details! Amazing how it all works. Rube Goldberg would be quite proud. :)

Here's a crazy idea. Blender (or something like it) could also be used as a 3-D renderer that would provide a view of the scene from some arbitrary viewpoint. The render could be placed in a JPEG that is textured somewhere in TAHWAH. Initially, this image could be shown in the book-making room (as a sort of linking panel image); later on, it would be cool to see a preview in the age-making room on one of the screens. The turnaround period for making a render wouldn't be as slow as 'bake book", since you wouldn't need to export the age. But it wouldn't be very fast, either. Ideally, the Blender/renderer process would stay running, and some other process listening over the socket connection to the client would feed commands to the renderer - to eliminate the application startup-shutdown delay.

diafero: The English phrase "behind the scenes" may be what you're looking for.
Can we rebuild it? Yes, we can - here's how.

MOULagain KI# 1299

Myst Movie coming soon - spread the word!
User avatar
Robert The Rebuilder
 
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
Location: Virginia, US

PreviousNext

Return to Tips and Showcase

Who is online

Users browsing this forum: No registered users and 2 guests

cron